Changeset 188 for sbliveos2/trunk/lib32/spinlock.c
- Timestamp:
- Sep 9, 2001, 5:31:35 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sbliveos2/trunk/lib32/spinlock.c
r142 r188 28 28 #include <asm/hardirq.h> 29 29 30 31 unsigned long __lock(void); 32 #pragma aux __lock = \ 33 "pushfd" \ 34 "cli" \ 35 "pop eax" \ 36 modify exact [eax] \ 37 value [eax]; 38 39 40 void __unlock(unsigned long cpuflags); 41 #pragma aux __unlock = \ 42 "push eax" \ 43 "popfd" \ 44 modify exact [] \ 45 parm [eax]; 46 47 48 30 49 void spin_lock_init(spinlock_t *lock) 31 50 { … … 35 54 void spin_lock(spinlock_t *lock) 36 55 { 37 unsigned long cpuflags; 38 39 _asm { 40 pushfd 41 pop eax 42 mov [cpuflags], eax 43 cli 44 } 45 *lock = cpuflags; 56 *lock = __lock(); 46 57 } 47 58 48 59 void spin_lock_flag(spinlock_t *lock, unsigned long *flag) 49 60 { 50 spin_lock(lock);61 *lock = __lock(); 51 62 } 52 63 … … 65 76 void spin_unlock(spinlock_t *lock) 66 77 { 67 unsigned long cpuflags = *lock; 78 __unlock(*lock); 79 } 68 80 69 _asm { 70 mov eax, [cpuflags] 71 push eax 72 popfd 73 } 74 } 81
Note:
See TracChangeset
for help on using the changeset viewer.