Changeset 368 for soft/giet_vm/giet_libs/spin_lock.h
- Timestamp:
- Jul 31, 2014, 8:47:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/spin_lock.h
r258 r368 4 4 // Author : alain greiner 5 5 // Copyright (c) UPMC-LIP6 6 /////////////////////////////////////////////////////////////////////////////////// 7 // The spin_lock.c and spin_lock.h files are part of the GIET-VM nano-kernel. 8 // This library implements a user-level lock. 9 // It is a simple binary lock, without waiting queue. 10 // The lock_acquire() and lock_release() functions do not require a system call. 11 // If the platform does not provide hardware cache coherence, the lock must be 12 // declared in a non cacheable segment, 13 // 14 // When a lock is defined in the mapping, it has not to be declared in the 15 // application code: it will be initialised in the boot phase, 16 // and the vobj_get_vbase() system call (defined in stdio.c and stdio.h files) 17 // can be used to get the virtual base address of the lock from it's name. 6 18 /////////////////////////////////////////////////////////////////////////////////// 7 19 … … 11 23 /////////////////////////////////////////////////////////////////////////////////// 12 24 // lock structure 13 // This is a simple binary lock (without waiting queue).14 25 /////////////////////////////////////////////////////////////////////////////////// 15 26 16 typedef struct giet_lock_s { 17 char name[32]; // lock name 27 typedef struct giet_lock_s 28 { 29 char name[60]; // lock name 18 30 unsigned int value; // taken if value != 0 19 31 } giet_lock_t; … … 23 35 ////////////////////////////////////////////////////////////////////////////// 24 36 25 void lock_acquire(giet_lock_t * lock);26 void lock_release(giet_lock_t * lock);37 extern void lock_acquire(giet_lock_t * lock); 38 extern void lock_release(giet_lock_t * lock); 27 39 28 40 #endif
Note: See TracChangeset
for help on using the changeset viewer.