From owner-p4-projects@FreeBSD.ORG Wed Apr 23 16:28:31 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B64C437B404; Wed, 23 Apr 2003 16:28:30 -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 6C68E37B401 for ; Wed, 23 Apr 2003 16:28:30 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE4E043FA3 for ; Wed, 23 Apr 2003 16:28:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3NNST0U073690 for ; Wed, 23 Apr 2003 16:28:29 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3NNSTHi073685 for perforce@freebsd.org; Wed, 23 Apr 2003 16:28:29 -0700 (PDT) Date: Wed, 23 Apr 2003 16:28:29 -0700 (PDT) Message-Id: <200304232328.h3NNSTHi073685@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 29563 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2003 23:28:31 -0000 http://perforce.freebsd.org/chv.cgi?CH=29563 Change 29563 by peter@peter_daintree on 2003/04/23 16:27:33 initial shot at setjmp/longjmp Affected files ... .. //depot/projects/hammer/lib/libc/x86_64/gen/Makefile.inc#3 edit .. //depot/projects/hammer/lib/libc/x86_64/gen/setjmp.S#2 edit Differences ... ==== //depot/projects/hammer/lib/libc/x86_64/gen/Makefile.inc#3 (text+ko) ==== @@ -1,4 +1,4 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/lib/libc/i386/gen/Makefile.inc,v 1.18 2002/11/16 06:39:11 deischen Exp $ -SRCS+= frexp.c infinity.c isinf.c +SRCS+= setjmp.S frexp.c infinity.c isinf.c ==== //depot/projects/hammer/lib/libc/x86_64/gen/setjmp.S#2 (text+ko) ==== @@ -53,51 +53,57 @@ #include "SYS.h" ENTRY(setjmp) - movl 4(%esp),%ecx + pushq %rdi + movq %rdi,%rcx PIC_PROLOGUE - leal 28(%ecx), %eax - pushl %eax /* (sigset_t*)oset */ - pushl $0 /* (sigset_t*)set */ - pushl $1 /* SIG_BLOCK */ + leaq 72(%rcx),%rdi /* (sigset_t*)oset */ + movq $0,%rsi /* (sigset_t*)set */ + movq $1,%rdx /* SIG_BLOCK */ call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp PIC_EPILOGUE - movl 4(%esp),%ecx - movl 0(%esp),%edx - movl %edx, 0(%ecx) - movl %ebx, 4(%ecx) - movl %esp, 8(%ecx) - movl %ebp,12(%ecx) - movl %esi,16(%ecx) - movl %edi,20(%ecx) - fnstcw 24(%ecx) - xorl %eax,%eax + popq %rdi + movq %rdi,%rcx + movq 0(%rsp),%rdx /* retval */ + movq %rdx, 0(%rcx) /* retval */ + movq %rbx, 8(%rcx) + movq %rsp,16(%rcx) + movq %rbp,24(%rcx) + movq %r12,32(%rcx) + movq %r13,40(%rcx) + movq %r14,48(%rcx) + movq %r15,56(%rcx) + fnstcw 64(%rcx) + xorq %rax,%rax ret .weak CNAME(longjmp) .set CNAME(longjmp),CNAME(__longjmp) ENTRY(__longjmp) - movl 4(%esp),%edx + pushq %rdi + pushq %rsi + movq %rdi,%rdx PIC_PROLOGUE - pushl $0 /* (sigset_t*)oset */ - leal 28(%edx), %eax - pushl %eax /* (sigset_t*)set */ - pushl $3 /* SIG_SETMASK */ + movq $0,%rdi /* (sigset_t*)oset */ + leaq 72(%rdx),%rsi /* (sigset_t*)set */ + movq $3,%rdx /* SIG_SETMASK */ call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp PIC_EPILOGUE - movl 4(%esp),%edx - movl 8(%esp),%eax - movl 0(%edx),%ecx - movl 4(%edx),%ebx - movl 8(%edx),%esp - movl 12(%edx),%ebp - movl 16(%edx),%esi - movl 20(%edx),%edi + popq %rsi + popq %rdi /* jmpbuf */ + movq %rdi,%rdx + movq %rsi,%rax /* retval */ + movq 0(%rdx),%rcx + movq 8(%rdx),%rbx + movq 16(%rdx),%rsp + movq 24(%rdx),%rbp + movq 32(%rdx),%r12 + movq 40(%rdx),%r13 + movq 48(%rdx),%r14 + movq 56(%rdx),%r15 fninit - fldcw 24(%edx) - testl %eax,%eax + fldcw 64(%rdx) + testq %rax,%rax jnz 1f - incl %eax -1: movl %ecx,0(%esp) + incq %rax +1: movq %rcx,0(%rsp) ret