summaryrefslogtreecommitdiffstats
path: root/lib/libc/arm/SYS.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2007-07-04 23:18:38 +0000
committerpeter <peter@FreeBSD.org>2007-07-04 23:18:38 +0000
commit1b55a32fbf471df5850c6998ad88edb70b2b1bc6 (patch)
tree974e0aa76f3ee9dad506c3e179d7fc5cb80d58e7 /lib/libc/arm/SYS.h
parent6d9e6c677c1a7ef838878317c645098d31f598ff (diff)
downloadFreeBSD-src-1b55a32fbf471df5850c6998ad88edb70b2b1bc6.zip
FreeBSD-src-1b55a32fbf471df5850c6998ad88edb70b2b1bc6.tar.gz
Adjust the syscall stub macros to be consistent in their meaning. In
particular: SYSCALL() makes a syscall, with errno handling, and continues execution directly after the macro in the non-error case. RSYSCALL() is just like SYSCALL(), but returns after success. Both SYSCALL(name) and RSYSCALL(name) export "__sys_name" as a strong symbol, with "_name" and "name" as weak aliases. PSEUDO() is just like RSYSCALL(), but skipping the "name" weak alias. It still does "__sys_name" and "_name". Change i386 to add errno handling to PSEUDO. The same for amd64 and sparc64, with appear to have copied the behavior. ia64 was correct (as was alpha). Just remove some apparently unused variants of the macros. (untested!) I believe powerpc is correct. Fix arm to not export "name" from the PSEUDO case. Remove apparently extra unused variants. (untested!) The errno problem manifested on i386/amd64/sparc64 by having "PSEUDO" classified syscalls return without setting errno. eg: "addr = mmap()" could return with "addr" = 22 instead of setting errno to 22 and returning -1. Approved by: re (kensmith)
Diffstat (limited to 'lib/libc/arm/SYS.h')
-rw-r--r--lib/libc/arm/SYS.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h
index 4710876..223c26b 100644
--- a/lib/libc/arm/SYS.h
+++ b/lib/libc/arm/SYS.h
@@ -56,26 +56,19 @@
_SYSCALL_NOERROR(x); \
bcs PIC_SYM(CERROR, PLT)
-#define SYSCALL_NOERROR(x) \
- _SYSCALL_NOERROR(x)
-
#define SYSCALL(x) \
_SYSCALL(x)
-
-#define PSEUDO_NOERROR(x) \
- _SYSCALL_NOERROR(x); \
- RET
-
#define PSEUDO(x) \
- _SYSCALL(x); \
+ ENTRY(__CONCAT(__sys_, x)); \
+ .weak _C_LABEL(__CONCAT(_,x)); \
+ .set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \
+ SYSTRAP(x)
+ bcs PIC_SYM(CERROR, PLT)
RET
-
-#define RSYSCALL_NOERROR(x) \
- PSEUDO_NOERROR(x)
-
#define RSYSCALL(x) \
- PSEUDO(x)
+ _SYSCALL(x); \
+ RET
.globl CERROR
OpenPOWER on IntegriCloud