diff options
author | Peter Galbavy <peter@cvs.openbsd.org> | 1998-07-21 13:20:29 +0000 |
---|---|---|
committer | Peter Galbavy <peter@cvs.openbsd.org> | 1998-07-21 13:20:29 +0000 |
commit | 43b686d61558c0957f1779c747214ddef20a2252 (patch) | |
tree | 99fb41dbccee40683a84fe98aa3c6a9784911bf2 /lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S | |
parent | ea12e8eb2f8d4c89e854d9381f85ce8fb4688ad0 (diff) |
Complete initial import from mySQL 3.22.4 (mit-pthreads/).
Lots of dross to move and remove yet.
At minimum:
o remove GNU config and GNU Makefiles
o build arch directory and migrate away machdep/
o rebuild BSD Makefiles
o move notes etc. into doc/
Diffstat (limited to 'lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S')
-rw-r--r-- | lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S b/lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S new file mode 100644 index 00000000000..753475b5c3d --- /dev/null +++ b/lib/libpthread/machdep/syscall-template-i386-sco-3.2v5.S @@ -0,0 +1,67 @@ +#include <sys/errno.h> +#include <sys/syscall.h> + +#ifdef _SCO_ELF + +#define NAME(X) machdep_sys_##X +#define END(X) 1: ; .type NAME(X),@function ; .size NAME(X),1b - NAME(X) +#define GETBX(X) \ + push %ebx; \ + call 1f; \ +1: \ + popl %ebx; +#else + +#define NAME(X) _machdep_sys_##X +#define END(X) + +#endif + +#ifdef __STDC__ + +#define SYSCALL(x) \ + .globl NAME(x); \ + \ +NAME(x):; \ + movl $(SYS_##x##), %eax; \ + .byte 0x9a; .long 0; .word 7; \ + jae 1f; \ + cmp $(ERESTART), %eax; \ + je NAME(x); \ + neg %eax; \ +1: \ + ret; \ + END(x) + +#else + +#define SYSCALL(x) \ + .globl _machdep_sys_/**/x; \ + \ +machdep_sys_/**/x:; \ + \ + movl $(SYS_/**/x), %eax; \ + .byte 0x9a; .long 0; .word 7; \ + jae 1f; \ + neg %eax; +1: \ + ret; + +#endif + + +/* + * Initial asm stuff for all functions. + */ + .text + .align 2 + + +/* ========================================================================== + * error code for all syscalls. The error value is returned as the negative + * of the errno value. + */ + +#define XSYSCALL(NAME) SYSCALL(NAME) + +XSYSCALL(SYSCALL_NAME) |