Changeset 495 for soft/giet_vm/giet_common/kernel_locks.h
- Timestamp:
- Feb 8, 2015, 12:55:35 PM (9 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/kernel_locks.h
r466 r495 1 1 /////////////////////////////////////////////////////////////////////////////////// 2 // File : locks.h2 // File : kernel_locks.h 3 3 // Date : 01/12/2014 4 4 // Author : alain greiner … … 34 34 typedef struct spin_lock_s 35 35 { 36 unsigned int current; // current slot index 36 unsigned int current; // current slot index: 37 37 unsigned int free; // next free tiket index 38 38 unsigned int padding[14]; // for 64 bytes alignment … … 40 40 41 41 extern unsigned int _atomic_increment( unsigned int* ptr, 42 unsignedint increment );42 int increment ); 43 43 44 44 extern void _spin_lock_init( spin_lock_t* lock ); … … 48 48 extern void _spin_lock_release( spin_lock_t* lock ); 49 49 50 50 51 ////////////////////////////////////////////////////////////////////////////////// 51 // S BT lock structures and access functions52 // SQT lock structures and access functions 52 53 ////////////////////////////////////////////////////////////////////////////////// 53 54 54 typedef struct lock_node_s55 typedef struct sqt_lock_node_s 55 56 { 56 unsigned int taken; // lock taken if non zero 57 unsigned int current; // current ticket index 58 unsigned int free; // next free ticket index 57 59 unsigned int level; // hierarchical level (0 is bottom) 58 struct lock_node_s* parent; // pointer on parent node (NULL for root) 59 struct lock_node_s* child0; // pointer on children node 60 struct lock_node_s* child1; // pointer on children node 61 unsigned int x; // cluster x coordinate 62 unsigned int y; // cluster y coordinate 63 unsigned int padding[9]; // for 64 bytes alignment 64 } lock_node_t; 60 struct sqt_lock_node_s* parent; // parent node (NULL for root) 61 struct sqt_lock_node_s* child[4]; // children node 62 unsigned int padding[8]; // for 64 bytes alignment 63 } sqt_lock_node_t; 65 64 66 typedef struct s bt_lock_s65 typedef struct sqt_lock_s 67 66 { 68 unsigned int ntasks; // total number of expected tasks 69 lock_node_t* node[X_SIZE][Y_SIZE][9]; // array of pointers on SBT nodes 70 } sbt_lock_t; 67 sqt_lock_node_t* node[X_SIZE][Y_SIZE][5]; // array of pointers on SBT nodes 68 } sqt_lock_t; 71 69 72 extern void _s bt_lock_init( sbt_lock_t* lock );70 extern void _sqt_lock_init( sqt_lock_t* lock ); 73 71 74 extern void _s bt_lock_acquire( sbt_lock_t* lock );72 extern void _sqt_lock_acquire( sqt_lock_t* lock ); 75 73 76 extern void _sbt_lock_release( sbt_lock_t* lock ); 74 extern void _sqt_lock_release( sqt_lock_t* lock ); 75 77 76 78 77 #endif
Note: See TracChangeset
for help on using the changeset viewer.