svn commit: r229693 - in head/lib/libc: powerpc powerpc64
Andreas Tobler
andreast at fgznet.ch
Sat Jan 21 08:32:49 UTC 2012
I write this reply from another machine...
Here is what I have tested so far.
Is this the right approach?
Thank you in advance,
Andreas
-------------- next part --------------
Index: lib/libc/powerpc/SYS.h
===================================================================
--- lib/libc/powerpc/SYS.h (revision 230383)
+++ lib/libc/powerpc/SYS.h (working copy)
@@ -33,38 +33,38 @@
#include <sys/syscall.h>
#include <machine/asm.h>
-#define _SYSCALL(x) \
- .text; \
- .align 2; \
- li 0,(__CONCAT(SYS_,x)); \
+#define _SYSCALL(name) \
+ .text; \
+ .align 2; \
+ li 0,(__CONCAT(SYS_, name)); \
sc
-#define SYSCALL(x) \
- .text; \
- .align 2; \
-2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
- _SYSCALL(x); \
+#define SYSCALL(name) \
+ .text; \
+ .align 2; \
+2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
bso 2b
-#define PSEUDO(x) \
- .text; \
- .align 2; \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
- _SYSCALL(x); \
- bnslr; \
+#define PSEUDO(name) \
+ .text; \
+ .align 2; \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
+ bnslr; \
b PIC_PLT(CNAME(HIDENAME(cerror)))
-#define RSYSCALL(x) \
- .text; \
- .align 2; \
-2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \
- _SYSCALL(x); \
- bnslr; \
+#define RSYSCALL(name) \
+ .text; \
+ .align 2; \
+2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
+ bnslr; \
b PIC_PLT(CNAME(HIDENAME(cerror)))
Index: lib/libc/powerpc/gen/setjmp.S
===================================================================
--- lib/libc/powerpc/gen/setjmp.S (revision 230383)
+++ lib/libc/powerpc/gen/setjmp.S (working copy)
@@ -69,7 +69,7 @@
li %r3,0 /* return (0) */
blr
- WEAK_ALIAS(longjmp, __longjmp)
+ WEAK_REFERENCE(CNAME(__longjmp), longjmp)
ENTRY(__longjmp)
lmw %r9,20(%r3) /* restore regs */
mr %r6,%r4 /* save val param */
Index: lib/libc/powerpc64/SYS.h
===================================================================
--- lib/libc/powerpc64/SYS.h (revision 230383)
+++ lib/libc/powerpc64/SYS.h (working copy)
@@ -33,62 +33,62 @@
#include <sys/syscall.h>
#include <machine/asm.h>
-#define _SYSCALL(x) \
- .text; \
- .align 2; \
- li 0,(__CONCAT(SYS_,x)); \
+#define _SYSCALL(name) \
+ .text; \
+ .align 2; \
+ li 0,(__CONCAT(SYS_, name)); \
sc
-#define SYSCALL(x) \
- .text; \
- .align 2; \
-2: mflr %r0; \
- std %r0,16(%r1); \
- stdu %r1,-48(%r1); \
- bl CNAME(HIDENAME(cerror)); \
- nop; \
- addi %r1,%r1,48; \
- ld %r0,16(%r1); \
- mtlr %r0; \
- blr; \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
- _SYSCALL(x); \
+#define SYSCALL(name) \
+ .text; \
+ .align 2; \
+2: mflr %r0; \
+ std %r0,16(%r1); \
+ stdu %r1,-48(%r1); \
+ bl CNAME(HIDENAME(cerror)); \
+ nop; \
+ addi %r1,%r1,48; \
+ ld %r0,16(%r1); \
+ mtlr %r0; \
+ blr; \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
bso 2b
-#define PSEUDO(x) \
- .text; \
- .align 2; \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
- _SYSCALL(x); \
- bnslr; \
- mflr %r0; \
- std %r0,16(%r1); \
- stdu %r1,-48(%r1); \
- bl CNAME(HIDENAME(cerror)); \
- nop; \
- addi %r1,%r1,48; \
- ld %r0,16(%r1); \
- mtlr %r0; \
+#define PSEUDO(name) \
+ .text; \
+ .align 2; \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
+ bnslr; \
+ mflr %r0; \
+ std %r0,16(%r1); \
+ stdu %r1,-48(%r1); \
+ bl CNAME(HIDENAME(cerror)); \
+ nop; \
+ addi %r1,%r1,48; \
+ ld %r0,16(%r1); \
+ mtlr %r0; \
blr;
-#define RSYSCALL(x) \
- .text; \
- .align 2; \
-ENTRY(__CONCAT(__sys_,x)); \
- WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
- WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \
- _SYSCALL(x); \
- bnslr; \
- \
- mflr %r0; \
- std %r0,16(%r1); \
- stdu %r1,-48(%r1); \
- bl CNAME(HIDENAME(cerror)); \
- nop; \
- addi %r1,%r1,48; \
- ld %r0,16(%r1); \
- mtlr %r0; \
+#define RSYSCALL(name) \
+ .text; \
+ .align 2; \
+ENTRY(__CONCAT(__sys_, name)); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
+ WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
+ _SYSCALL(name); \
+ bnslr; \
+ \
+ mflr %r0; \
+ std %r0,16(%r1); \
+ stdu %r1,-48(%r1); \
+ bl CNAME(HIDENAME(cerror)); \
+ nop; \
+ addi %r1,%r1,48; \
+ ld %r0,16(%r1); \
+ mtlr %r0; \
blr;
Index: lib/libc/powerpc64/gen/setjmp.S
===================================================================
--- lib/libc/powerpc64/gen/setjmp.S (revision 230396)
+++ lib/libc/powerpc64/gen/setjmp.S (working copy)
@@ -93,7 +93,7 @@
li %r3,0 /* return (0) */
blr
- WEAK_ALIAS(longjmp, __longjmp)
+ WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
ld %r9,40 + 0*8(%r3)
ld %r10,40 + 1*8(%r3)
Index: sys/powerpc/include/asm.h
===================================================================
--- sys/powerpc/include/asm.h (revision 230401)
+++ sys/powerpc/include/asm.h (working copy)
@@ -116,9 +116,9 @@
#define __FBSDID(s) /* nothing */
#endif /* not lint and not STRIP_FBSDID */
-#define WEAK_ALIAS(alias,sym) \
+#define WEAK_REFERENCE(sym, alias) \
.weak alias; \
- alias = sym
+ .equ alias, sym
#ifdef __STDC__
#define WARN_REFERENCES(_sym,_msg) \
More information about the svn-src-head
mailing list