Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2012 15:30:00 +0100
From:      Andreas Tobler <andreast@fgznet.ch>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andreas Tobler <andreast@FreeBSD.org>
Subject:   Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64
Message-ID:  <4F1ACBE8.2000404@fgznet.ch>
In-Reply-To: <20120121224511.R3269@besplex.bde.org>
References:  <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> <4F1A72DC.7020107@fgznet.ch> <20120121224511.R3269@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090503000802090601060501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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



--------------090503000802090601060501
Content-Type: text/plain;
 name="weak_ref-20120121-1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="weak_ref-20120121-1.diff"

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)

--------------090503000802090601060501--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F1ACBE8.2000404>