Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2002 00:29:57 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17978 for review
Message-ID:  <200209230729.g8N7TvaS081203@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17978

Change 17978 by peter@peter_overcee on 2002/09/23 00:29:09

	update for hammer.  Ahh, the joy of having real PC relative
	modes.  DOWN WITH PIC_PROLOGUE etc!

Affected files ...

.. //depot/projects/hammer/lib/libc/x86_64/SYS.h#2 edit
.. //depot/projects/hammer/sys/x86_64/include/asm.h#2 edit

Differences ...

==== //depot/projects/hammer/lib/libc/x86_64/SYS.h#2 (text+ko) ====

@@ -40,22 +40,19 @@
 #include <sys/syscall.h>
 #include <machine/asm.h>
 
-#define	SYSCALL(x)	2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror));	\
+#define	SYSCALL(x)	2: jmp PIC_PLT(HIDENAME(cerror));	\
 			ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(x);					\
 			.set CNAME(x),CNAME(__CONCAT(__sys_,x));	\
 			.weak CNAME(__CONCAT(_,x));			\
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
-			mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b
+			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2b
 
 #define	RSYSCALL(x)	SYSCALL(x); ret
 
 #define	PSEUDO(x)	ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(__CONCAT(_,x));			\
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
-			mov __CONCAT($SYS_,x),%eax; KERNCALL; ret
+			mov __CONCAT($SYS_,x),%rax; KERNCALL; ret
 
-/* gas messes up offset -- although we don't currently need it, do for BCS */
-#define	LCALL(x,y)	.byte 0x9a ; .long y; .word x
-
-#define KERNCALL	int $0x80
+#define KERNCALL	syscall

==== //depot/projects/hammer/sys/x86_64/include/asm.h#2 (text+ko) ====

@@ -43,23 +43,11 @@
 #include <sys/cdefs.h>
 
 #ifdef PIC
-#define	PIC_PROLOGUE	\
-	pushl	%ebx;	\
-	call	1f;	\
-1:			\
-	popl	%ebx;	\
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b],%ebx
-#define	PIC_EPILOGUE	\
-	popl	%ebx
 #define	PIC_PLT(x)	x@PLT
-#define	PIC_GOT(x)	x@GOT(%ebx)
-#define	PIC_GOTOFF(x)	x@GOTOFF(%ebx)
+#define	PIC_GOT(x)	x@GOTPCREL(%rip)
 #else
-#define	PIC_PROLOGUE
-#define	PIC_EPILOGUE
 #define	PIC_PLT(x)	x
 #define	PIC_GOT(x)	x
-#define	PIC_GOTOFF(x)	x
 #endif
 
 /*
@@ -80,14 +68,14 @@
 
 #ifdef PROF
 #define	ALTENTRY(x)	_ENTRY(x); \
-			pushl %ebp; movl %esp,%ebp; \
+			pushl %rbp; movl %rsp,%rbp; \
 			call PIC_PLT(HIDENAME(mcount)); \
-			popl %ebp; \
+			popl %rbp; \
 			jmp 9f
 #define	ENTRY(x)	_ENTRY(x); \
-			pushl %ebp; movl %esp,%ebp; \
+			pushl %rbp; movl %rsp,%rbp; \
 			call PIC_PLT(HIDENAME(mcount)); \
-			popl %ebp; \
+			popl %rbp; \
 			9:
 #else
 #define	ALTENTRY(x)	_ENTRY(x)
@@ -119,25 +107,21 @@
 #define	ARCH_DISPATCH(x) \
 			_START_ENTRY; \
 			.globl CNAME(x); .type CNAME(x),@function; CNAME(x): ; \
-			PIC_PROLOGUE; \
-			movl PIC_GOT(AVECNAME(x)),%eax; \
-			PIC_EPILOGUE; \
-			jmpl *(%eax)
+			movl PIC_GOT(AVECNAME(x)),%rax; \
+			jmpl *(%rax)
 
 #define	ARCH_SELECT(x)	_START_ENTRY; \
 			.type ASELNAME(x),@function; \
 			ASELNAME(x): \
-			PIC_PROLOGUE; \
 			call PIC_PLT(CNAME(__get_hw_float)); \
-			testl %eax,%eax; \
-			movl PIC_GOT(ANAME(x)),%eax; \
+			testl %rax,%rax; \
+			movl PIC_GOT(ANAME(x)),%rax; \
 			jne 8f; \
-			movl PIC_GOT(GNAME(x)),%eax; \
+			movl PIC_GOT(GNAME(x)),%rax; \
 			8: \
-			movl PIC_GOT(AVECNAME(x)),%edx; \
-			movl %eax,(%edx); \
-			PIC_EPILOGUE; \
-			jmpl *%eax
+			movl PIC_GOT(AVECNAME(x)),%rdx; \
+			movl %rax,(%rdx); \
+			jmpl *%rax
 #else /* !PIC */
 #define	ARCH_DISPATCH(x) \
 			_START_ENTRY; \
@@ -148,13 +132,13 @@
 			.type ASELNAME(x),@function; \
 			ASELNAME(x): \
 			call CNAME(__get_hw_float); \
-			testl %eax,%eax; \
-			movl $ANAME(x),%eax; \
+			testl %rax,%rax; \
+			movl $ANAME(x),%rax; \
 			jne 8f; \
-			movl $GNAME(x),%eax; \
+			movl $GNAME(x),%rax; \
 			8: \
-			movl %eax,AVECNAME(x); \
-			jmpl *%eax
+			movl %rax,AVECNAME(x); \
+			jmpl *%rax
 #endif /* PIC */
 
 #define	ARCH_VECTOR(x)	.data; .p2align 2; \

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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