From 5e0b8d508ed51004bd836384293be00950ee62c9 Mon Sep 17 00:00:00 2001 From: Pasha Date: Tue, 20 Feb 2024 18:49:50 +0000 Subject: init gnumach copy --- linux/src/arch/i386/lib/semaphore.S | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 linux/src/arch/i386/lib/semaphore.S (limited to 'linux/src/arch/i386/lib/semaphore.S') 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 + +/* + * "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 + -- cgit v1.2.1