diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
commit | d8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch) | |
tree | 3067bc130b80d52808e6390c9fc7fc087ec1e33c /arch/i386/lib | |
parent | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff) |
Initial revision
Diffstat (limited to 'arch/i386/lib')
-rw-r--r-- | arch/i386/lib/locks.S | 5 | ||||
-rw-r--r-- | arch/i386/lib/semaphore.S | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/arch/i386/lib/locks.S b/arch/i386/lib/locks.S index b9d8b0a9c..30a5bc432 100644 --- a/arch/i386/lib/locks.S +++ b/arch/i386/lib/locks.S @@ -10,22 +10,25 @@ * %eax contains callers PC and %edx holds this cpu ID. */ ENTRY(__lock_kernel) - pushl %eax ! return address 1: lock btsl $0, SYMBOL_NAME(kernel_flag) jnc 3f + sti 2: btl %dl, SYMBOL_NAME(smp_invalidate_needed) jnc 0f lock btrl %dl, SYMBOL_NAME(smp_invalidate_needed) jnc 0f + pushl %eax movl %cr3, %eax movl %eax, %cr3 + popl %eax 0: btl $0, SYMBOL_NAME(kernel_flag) jc 2b + cli jmp 1b 3: diff --git a/arch/i386/lib/semaphore.S b/arch/i386/lib/semaphore.S index ff2443c40..faddbf4ec 100644 --- a/arch/i386/lib/semaphore.S +++ b/arch/i386/lib/semaphore.S @@ -13,16 +13,17 @@ * there is contention on the semaphore. */ ENTRY(__down_failed) - pushl %eax /* return address */ + pushl %eax /* save %eax */ pushl %edx /* save %edx */ pushl %ecx /* save %ecx (and argument) */ call SYMBOL_NAME(__down) popl %ecx /* restore %ecx (count on __down not changing it) */ popl %edx /* restore %edx */ + popl %eax /* restore %eax */ ret +/* Don't save/restore %eax, because that will be our return value */ ENTRY(__down_failed_interruptible) - pushl %eax /* return address */ pushl %edx /* save %edx */ pushl %ecx /* save %ecx (and argument) */ call SYMBOL_NAME(__down_interruptible) @@ -31,10 +32,11 @@ ENTRY(__down_failed_interruptible) ret ENTRY(__up_wakeup) - pushl %eax /* return address */ + pushl %eax /* save %eax */ pushl %edx /* save %edx */ pushl %ecx /* save %ecx (and argument) */ call SYMBOL_NAME(__up) popl %ecx /* restore %ecx (count on __up not changing it) */ popl %edx /* restore %edx */ + popl %eax /* restore %eax */ ret |