2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2012, NWU EECS 441 Transactional Memory Team
11 * Copyright (c) 2012, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Maciek Swiech <dotpyfe@u.northwestern.edu>
15 * Marcel Flores <marcel-flores@u.northwestern.edu>
16 * Zachary Bischof <zbischof@u.northwestern.edu>
17 * Kyle C. Hale <kh@u.northwestern.edu>
19 * This is free software. You are permitted to use,
20 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 // new printing macros
27 // used like TM_ERR(core, ABORT, "couldnt wangle the dangle");
29 #define TM_ERR(core, label, msg, ...) \
31 typeof (core) _core = (core); \
32 PrintError(_core->vm_info, _core, "TM %10s | " msg , #label, ##__VA_ARGS__); \
35 #ifdef V3_CONFIG_DEBUG_TM_FUNC
36 #define TM_DBG(core, label, msg, ...) \
38 typeof (core) _core = (core); \
39 PrintDebug(_core->vm_info, _core, "TM %10s | " msg , #label, ##__VA_ARGS__); \
42 #define TM_DBG(cor, label, msg, ...)
50 struct list_head op_node;
53 void v3_clear_tm_lists(struct v3_trans_mem * tm);
55 // note memory location touched in the list, avoids duplicate creation
56 int add_mem_op_to_list(struct list_head * list, addr_t guest_addr);
58 // searches for address in the list, returns pointer to elt if found, null
59 struct mem_op * list_contains_guest_addr(struct list_head * list, addr_t guest_addr);
61 // checks for current = 0 in list, updates to new value from staging page
62 int update_list(struct v3_trans_mem * tm, struct list_head * list);
64 // writes value to staging page, sets current = 0
65 int stage_entry(struct v3_trans_mem * tm, struct list_head * list, addr_t guest_addr);
67 // adds entry to list if it doesnt exist, used in copying
68 int copy_add_entry(struct list_head * list, addr_t guest_addr, uint64_t data);
70 // if TM block succesfully finishes, commits the list
71 int commit_list(struct guest_info * core, struct v3_trans_mem * tm);
73 // copy other lists to core's global lists
74 int v3_copy_lists(struct guest_info *core);
76 // set TM_MODE to TM_ON
77 int v3_set_tm(struct v3_trans_mem * tm);
79 // set TM_MODE to TM_OFF, clear data structures
80 int v3_clr_tm(struct v3_trans_mem * tm);
82 // clear the vtlb on a core
83 int v3_clr_vtlb(struct guest_info *core);
85 // set TM_STATE to TM_ABORT
86 int v3_tm_set_abrt(struct v3_trans_mem * tm);
88 // free the staging page of the core
89 int v3_free_staging_page(struct v3_trans_mem * tm);