summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64/SYS.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/amd64/SYS.h')
-rw-r--r--lib/libc/amd64/SYS.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h
index 20811a0..ef75377 100644
--- a/lib/libc/amd64/SYS.h
+++ b/lib/libc/amd64/SYS.h
@@ -44,6 +44,12 @@
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
+
+#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
+ .weak CNAME(__CONCAT(_,x)); \
+ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
+ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \
+ 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
#else
#define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \
.weak CNAME(x); \
@@ -52,11 +58,12 @@
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
2: jmp HIDENAME(cerror)
-#endif
#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
.weak CNAME(__CONCAT(_,x)); \
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
- mov __CONCAT($SYS_,x),%rax; KERNCALL; ret
+ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
+ 2: jmp HIDENAME(cerror)
+#endif
#define KERNCALL movq %rcx, %r10; syscall
OpenPOWER on IntegriCloud