diff options
Diffstat (limited to 'linux/src/arch/i386/lib')
-rw-r--r-- | linux/src/arch/i386/lib/delay.S | 18 | ||||
-rw-r--r-- | linux/src/arch/i386/lib/semaphore.S | 35 |
2 files changed, 53 insertions, 0 deletions
diff --git a/linux/src/arch/i386/lib/delay.S b/linux/src/arch/i386/lib/delay.S new file mode 100644 index 0000000..9d36420 --- /dev/null +++ b/linux/src/arch/i386/lib/delay.S @@ -0,0 +1,18 @@ +#include <linux/linkage.h> + +/* + * BogoMips loop. Non-inlined because various x86's have so wildly + * varying results depending on the exact alignment. + */ + +ENTRY(__do_delay) + jmp 1f +.align 16 +1: jmp 2f +.align 16 +2: decl %eax + jns 2b + ret + + + diff --git a/linux/src/arch/i386/lib/semaphore.S b/linux/src/arch/i386/lib/semaphore.S new file mode 100644 index 0000000..e09655c --- /dev/null +++ b/linux/src/arch/i386/lib/semaphore.S @@ -0,0 +1,35 @@ +/* + * linux/arch/i386/lib/semaphore.S + * + * Copyright (C) 1996 Linus Torvalds + */ + +#include <linux/linkage.h> + +/* + * "down_failed" is called with the eventual return address + * in %eax, and the address of the semaphore in %ecx. We need + * to increment the number of waiters on the semaphore, + * call "__down()", and then eventually return to try again. + */ +ENTRY(down_failed) + pushl %eax + pushl %ecx + call SYMBOL_NAME(__down) + popl %ecx + ret + +ENTRY(up_wakeup) + pushl %eax + pushl %ecx + call SYMBOL_NAME(__up) + popl %ecx + ret + +ENTRY(down_failed_interruptible) + pushl %eax + pushl %ecx + call SYMBOL_NAME(__down_interruptible) + popl %ecx + ret + |