From owner-p4-projects Mon Sep 23 0:30: 6 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BAB837B407; Mon, 23 Sep 2002 00:29:58 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB56237B404 for ; Mon, 23 Sep 2002 00:29:57 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FA5443E42 for ; Mon, 23 Sep 2002 00:29:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8N7TvCo081206 for ; Mon, 23 Sep 2002 00:29:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8N7TvaS081203 for perforce@freebsd.org; Mon, 23 Sep 2002 00:29:57 -0700 (PDT) Date: Mon, 23 Sep 2002 00:29:57 -0700 (PDT) Message-Id: <200209230729.g8N7TvaS081203@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17978 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 #include -#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 #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