On 01/21/12 12:46, Bruce Evans wrote:
On Sat, 21 Jan 2012, Andreas Tobler wrote:

I write this reply from another machine...

Here is what I have tested so far.

Is this the right approach?

Seems mostly what I want. I wouldn't change the right-justification
of the backslashes, since most places don't need it and it gives
unreadable diffs. More later.

Ok, removed right-justification.

Would you like to see the ALIGN_TEXT in the same diff/commit or do you agree if I do two steps?

Thanks again for the review. I appreciate your input!

Andreas


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)                              \
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)                                            \
+#define        _SYSCALL(name)                                          \
        .text;                                                  \
        .align 2;                                               \
-       li      0,(__CONCAT(SYS_,x));                           \
+       li      0,(__CONCAT(SYS_, name));                       \
        sc
 
-#define        SYSCALL(x)                                              \
+#define        SYSCALL(name)                                           \
        .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);                                            \
+ENTRY(__CONCAT(__sys_, name));                         \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), name);           \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+       _SYSCALL(name);                                         \
        bso     2b
 
-#define        PSEUDO(x)                                               \
+#define        PSEUDO(name)                                            \
        .text;                                                  \
        .align 2;                                               \
-ENTRY(__CONCAT(__sys_,x));                                     \
-       WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x));           \
-       _SYSCALL(x);                                            \
+ENTRY(__CONCAT(__sys_, name));                         \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+       _SYSCALL(name);                                         \
        bnslr;                                                  \
        b       PIC_PLT(CNAME(HIDENAME(cerror)))
 
-#define        RSYSCALL(x)                                             \
+#define        RSYSCALL(name)                                          \
        .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);                                            \
+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,13 +33,13 @@
 #include <sys/syscall.h>
 #include <machine/asm.h>
 
-#define _SYSCALL(x)                                            \
+#define        _SYSCALL(name)                                          \
        .text;                                                  \
        .align 2;                                               \
-       li      0,(__CONCAT(SYS_,x));                           \
+       li      0,(__CONCAT(SYS_, name));                       \
        sc
 
-#define        SYSCALL(x)                                              \
+#define        SYSCALL(name)                                           \
        .text;                                                  \
        .align 2;                                               \
 2:     mflr    %r0;                                            \
@@ -51,18 +51,18 @@
        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);                                            \
+ENTRY(__CONCAT(__sys_, name));                                         \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), name);                   \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));      \
+       _SYSCALL(name);                                                 \
        bso     2b
 
-#define        PSEUDO(x)                                               \
+#define        PSEUDO(name)                                            \
        .text;                                                  \
        .align 2;                                               \
-ENTRY(__CONCAT(__sys_,x));                                     \
-       WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x));           \
-       _SYSCALL(x);                                            \
+ENTRY(__CONCAT(__sys_, name));                                 \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));   \
+       _SYSCALL(name);                                         \
        bnslr;                                                  \
        mflr    %r0;                                            \
        std     %r0,16(%r1);                                    \
@@ -74,13 +74,13 @@
        mtlr    %r0;                                            \
        blr;
 
-#define        RSYSCALL(x)                                             \
+#define        RSYSCALL(name)                                          \
        .text;                                                  \
        .align 2;                                               \
-ENTRY(__CONCAT(__sys_,x));                                     \
-       WEAK_ALIAS(x,__CONCAT(__sys_,x));                       \
-       WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x));          \
-       _SYSCALL(x);                                            \
+ENTRY(__CONCAT(__sys_, name));                                 \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), name);           \
+       WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
+       _SYSCALL(name);                                         \
        bnslr;                                                  \
                                                                \
        mflr    %r0;                                            \
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)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to