Changeset 709 for soft/giet_vm/giet_libs/user_lock.h
- Timestamp:
- Oct 1, 2015, 4:20:46 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/user_lock.h
r461 r709 8 8 /////////////////////////////////////////////////////////////////////////////////// 9 9 10 #ifndef _GIET_FILE_LOCK_H_ 11 #define _GIET_FILE_LOCK_H_ 10 #ifndef _USER_LOCK_H_ 11 #define _USER_LOCK_H_ 12 13 #include "hard_config.h" 12 14 13 15 /////////////////////////////////////////////////////////////////////////////////// 14 // lock structure16 // simple lock structure 15 17 /////////////////////////////////////////////////////////////////////////////////// 16 18 … … 23 25 24 26 /////////////////////////////////////////////////////////////////////////////////// 25 // access functions27 // simple lock access functions 26 28 /////////////////////////////////////////////////////////////////////////////////// 27 29 … … 35 37 extern void lock_init( user_lock_t * lock ); 36 38 39 /////////////////////////////////////////////////////////////////////////////////// 40 // SQT lock structures 41 /////////////////////////////////////////////////////////////////////////////////// 42 43 typedef struct sqt_lock_node_s 44 { 45 unsigned int current; // current ticket index 46 unsigned int free; // next free ticket index 47 unsigned int level; // hierarchical level (0 is bottom) 48 struct sqt_lock_node_s* parent; // parent node (NULL for root) 49 struct sqt_lock_node_s* child[4]; // children node 50 unsigned int padding[8]; // for 64 bytes alignment 51 } sqt_lock_node_t; 52 53 typedef struct sqt_lock_s 54 { 55 sqt_lock_node_t* node[X_SIZE][Y_SIZE][5]; // array of pointers on SBT nodes 56 } sqt_lock_t; 57 58 ////////////////////////////////////////////////////////////////////////////////// 59 // SQT lock access functions 60 ////////////////////////////////////////////////////////////////////////////////// 61 62 63 extern void sqt_lock_init( sqt_lock_t* lock, 64 unsigned int x_size, 65 unsigned int y_size, 66 unsigned int ntasks ); 67 68 extern void sqt_lock_acquire( sqt_lock_t* lock ); 69 70 extern void sqt_lock_release( sqt_lock_t* lock ); 71 37 72 #endif 38 73
Note: See TracChangeset
for help on using the changeset viewer.