svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include

Andreas Tobler andreast at FreeBSD.org
Sun Feb 5 20:04:44 UTC 2012


Author: andreast
Date: Sun Feb  5 20:04:43 2012
New Revision: 231044
URL: http://svn.freebsd.org/changeset/base/231044

Log:
  Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which
  has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful
  name.
  
  Tested on 32- and 64-bit PowerMac.
  
  Reviewed by:	bde

Modified:
  head/lib/libc/powerpc/SYS.h
  head/lib/libc/powerpc/gen/setjmp.S
  head/lib/libc/powerpc64/SYS.h
  head/lib/libc/powerpc64/gen/setjmp.S
  head/sys/powerpc/include/asm.h

Modified: head/lib/libc/powerpc/SYS.h
==============================================================================
--- head/lib/libc/powerpc/SYS.h	Sun Feb  5 20:04:21 2012	(r231043)
+++ head/lib/libc/powerpc/SYS.h	Sun Feb  5 20:04:43 2012	(r231044)
@@ -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)))

Modified: head/lib/libc/powerpc/gen/setjmp.S
==============================================================================
--- head/lib/libc/powerpc/gen/setjmp.S	Sun Feb  5 20:04:21 2012	(r231043)
+++ head/lib/libc/powerpc/gen/setjmp.S	Sun Feb  5 20:04:43 2012	(r231044)
@@ -69,7 +69,7 @@ ENTRY(setjmp)
 	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 */

Modified: head/lib/libc/powerpc64/SYS.h
==============================================================================
--- head/lib/libc/powerpc64/SYS.h	Sun Feb  5 20:04:21 2012	(r231043)
+++ head/lib/libc/powerpc64/SYS.h	Sun Feb  5 20:04:43 2012	(r231044)
@@ -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 @@ ENTRY(__CONCAT(__sys_,x));					\
 	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;						\

Modified: head/lib/libc/powerpc64/gen/setjmp.S
==============================================================================
--- head/lib/libc/powerpc64/gen/setjmp.S	Sun Feb  5 20:04:21 2012	(r231043)
+++ head/lib/libc/powerpc64/gen/setjmp.S	Sun Feb  5 20:04:43 2012	(r231044)
@@ -93,7 +93,7 @@ ENTRY(setjmp)
 	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)

Modified: head/sys/powerpc/include/asm.h
==============================================================================
--- head/sys/powerpc/include/asm.h	Sun Feb  5 20:04:21 2012	(r231043)
+++ head/sys/powerpc/include/asm.h	Sun Feb  5 20:04:43 2012	(r231044)
@@ -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