11 #include <raw_compiler_defs.h>
13 #define BAMBOO_CACHE_LINE_SIZE (kCacheLineSize)
14 #define BAMBOO_CACHE_LINE_MASK (kCacheLineMask)
16 #define BAMBOO_TOTALCORE (raw_get_num_tiles()) // the total # of cores available in the processor
17 #define BAMBOO_NUM_OF_CORE corenum // the # of current residing core
18 #define BAMBOO_GET_NUM_OF_CORE() (raw_get_abs_pos_x() + raw_get_array_size_x() * raw_get_abs_pos_y()) // compute the # of current residing core
19 #define BAMBOO_DEBUGPRINT(x) (raw_test_pass((x)))
20 #define BAMBOO_DEBUGPRINT_REG(x) (raw_test_pass_reg((x)))
22 #define BAMBOO_SHARE_MEM_CALLOC(x, y) (calloc((x), (y))) // allocate an array of x elements each of whose size in bytes is y on shared memory
25 // locks for global data structures related to obj queue
26 #define BAMBOO_START_CRITICAL_SECTION_OBJ_QUEUE() raw_user_interrupts_off()
27 #define BAMBOO_CLOSE_CRITICAL_SECTION_OBJ_QUEUE() raw_user_interrupts_on()
28 // locks for global data structures related to status data
29 #define BAMBOO_START_CRITICAL_SECTION_STATUS() raw_user_interrupts_off()
30 #define BAMBOO_CLOSE_CRITICAL_SECTION_STATUS() raw_user_interrupts_on()
31 // locks for global data structures related to msg data
32 #define BAMBOO_START_CRITICAL_SECTION_MSG() raw_user_interrupts_off()
33 #define BAMBOO_CLOSE_CRITICAL_SECTION_MSG() raw_user_interrupts_on()
34 // locks for global data structures related to lock table
35 #define BAMBOO_START_CRITICAL_SECTION_LOCK() raw_user_interrupts_off()
36 #define BAMBOO_CLOSE_CRITICAL_SECTION_LOCK() raw_user_interrupts_on()
37 // locks for allocating memory
38 #define BAMBOO_START_CRITICAL_SECTION_MEM() raw_user_interrupts_off()
39 #define BAMBOO_CLOSE_CRITICAL_SECTION_MEM() raw_user_interrupts_on()
40 // locks for all global data structures
41 #define BAMBOO_START_CRITICAL_SECTION() raw_user_interrupts_off()
42 #define BAMBOO_CLOSE_CRITICAL_SECTION() raw_user_interrupts_on()
44 // locks for global data structures related to obj queue
45 #define BAMBOO_START_CRITICAL_SECTION_OBJ_QUEUE()
46 #define BAMBOO_CLOSE_CRITICAL_SECTION_OBJ_QUEUE()
47 // locks for global data structures related to status data
48 #define BAMBOO_START_CRITICAL_SECTION_STATUS()
49 #define BAMBOO_CLOSE_CRITICAL_SECTION_STATUS()
50 // locks for global data structures related to msg data
51 #define BAMBOO_START_CRITICAL_SECTION_MSG()
52 #define BAMBOO_CLOSE_CRITICAL_SECTION_MSG()
53 // locks for global data structures related to lock table
54 #define BAMBOO_START_CRITICAL_SECTION_LOCK()
55 #define BAMBOO_CLOSE_CRITICAL_SECTION_LOCK()
56 // locks for allocating memory
57 #define BAMBOO_START_CRITICAL_SECTION_MEM()
58 #define BAMBOO_CLOSE_CRITICAL_SECTION_MEM()
59 // locks for all global data structures
60 #define BAMBOO_START_CRITICAL_SECTION()
61 #define BAMBOO_CLOSE_CRITICAL_SECTION()
64 #define BAMBOO_WAITING_FOR_LOCK() (receiveObject())
65 #define BAMBOO_CACHE_FLUSH_RANGE(x, y) (raw_invalidate_cache_range((x), (y)))
66 #define BAMBOO_CACHE_FLUSH_ALL() (raw_flush_entire_cache())
67 #define BAMBOO_EXIT(x) (raw_test_done((x)))
68 #define BAMBOO_MSG_AVAIL() (gdn_input_avail())
69 #define BAMBOO_GET_EXE_TIME() (raw_get_cycle())
71 #endif // #ifndef RUNTIME_ARCH