summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/bits/syscalls.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/i386/bits/syscalls.h')
-rw-r--r--libc/sysdeps/linux/i386/bits/syscalls.h54
1 files changed, 9 insertions, 45 deletions
diff --git a/libc/sysdeps/linux/i386/bits/syscalls.h b/libc/sysdeps/linux/i386/bits/syscalls.h
index a6e26d7ec..09d48a2ff 100644
--- a/libc/sysdeps/linux/i386/bits/syscalls.h
+++ b/libc/sysdeps/linux/i386/bits/syscalls.h
@@ -21,8 +21,13 @@
#error LD debugging and DOMULTI are incompatible
#endif
-#ifdef __DOMULTI__
__asm__ (
+#ifdef __DOMULTI__
+ /* Protect against asm macro redefinition (happens in __DOMULTI__ mode).
+ * Unfortunately, it ends up visible in .o files. */
+ ".ifndef _BITS_SYSCALLS_ASM\n\t"
+ ".set _BITS_SYSCALLS_ASM,1\n\t"
+#endif
".L__X'%ebx = 1\n\t"
".L__X'%ecx = 2\n\t"
".L__X'%edx = 2\n\t"
@@ -32,9 +37,6 @@ __asm__ (
".L__X'%ebp = 3\n\t"
".L__X'%esp = 3\n\t"
- ".ifndef _BITS_SYSCALLS_ASM\n\t"
- ".set _BITS_SYSCALLS_ASM,1\n\t"
-
/* Loading param #1 (ebx) is done by loading it into
* another register, and then performing bpushl+bmovl,
* since we must preserve ebx */
@@ -57,8 +59,6 @@ __asm__ (
".endif\n\t"
".endm\n\t"
- ".endif\n\t" /* _BITS_SYSCALLS_ASM */
-
".macro bpopl name reg\n\t"
".if 1 - \\name\n\t"
".if 2 - \\name\n\t" /* if reg can't be clobbered... */
@@ -68,47 +68,11 @@ __asm__ (
".endif\n\t"
".endif\n\t"
".endm\n\t"
-);
-#else
-__asm__ (
- ".L__X'%ebx = 1\n\t"
- ".L__X'%ecx = 2\n\t"
- ".L__X'%edx = 2\n\t"
- ".L__X'%eax = 3\n\t"
- ".L__X'%esi = 3\n\t"
- ".L__X'%edi = 3\n\t"
- ".L__X'%ebp = 3\n\t"
- ".L__X'%esp = 3\n\t"
- ".macro bpushl name reg\n\t"
- ".if 1 - \\name\n\t"
- ".if 2 - \\name\n\t"
- "pushl %ebx\n\t"
- ".else\n\t"
- "xchgl \\reg, %ebx\n\t"
- ".endif\n\t"
- ".endif\n\t"
- ".endm\n\t"
-
- ".macro bmovl name reg\n\t"
- ".if 1 - \\name\n\t"
- ".if 2 - \\name\n\t"
- "movl \\reg, %ebx\n\t"
- ".endif\n\t"
- ".endif\n\t"
- ".endm\n\t"
-
- ".macro bpopl name reg\n\t"
- ".if 1 - \\name\n\t"
- ".if 2 - \\name\n\t"
- "popl %ebx\n\t"
- ".else\n\t"
- "xchgl \\reg, %ebx\n\t"
- ".endif\n\t"
- ".endif\n\t"
- ".endm\n\t"
-);
+#ifdef __DOMULTI__
+ ".endif\n\t" /* _BITS_SYSCALLS_ASM */
#endif
+);
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
({ \