CVS commit: src/lib/libc/arch/i386/sys
Module Name:src Committed By: kamil Date: Mon Oct 19 11:31:02 UTC 2020 Modified Files: src/lib/libc/arch/i386/sys: __sigtramp2.S Log Message: Restore ESP from mcontext Improves unwinding of multiple frames without base pointer. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/sys/__sigtramp2.S diff -u src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6 src/lib/libc/arch/i386/sys/__sigtramp2.S:1.7 --- src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6 Mon Oct 12 23:56:08 2020 +++ src/lib/libc/arch/i386/sys/__sigtramp2.S Mon Oct 19 11:31:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.6 2020/10/12 23:56:08 kamil Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.7 2020/10/19 11:31:01 kamil Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ .cfi_offset ecx, UC_GREGS_ECX .cfi_offset edx, UC_GREGS_EDX .cfi_offset ebx, UC_GREGS_EBX - /* The unwinder will use the CFA to restore ESP. */ + .cfi_offset esp, UC_GREGS_ESP .cfi_offset ebp, UC_GREGS_EBP .cfi_offset esi, UC_GREGS_ESI .cfi_offset edi, UC_GREGS_EDI
CVS commit: src/lib/libc/arch/i386
Module Name:src Committed By: kamil Date: Mon Oct 12 23:58:14 UTC 2020 Modified Files: src/lib/libc/arch/i386: genassym.cf Log Message: Fix typo To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/i386/genassym.cf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/genassym.cf diff -u src/lib/libc/arch/i386/genassym.cf:1.1 src/lib/libc/arch/i386/genassym.cf:1.2 --- src/lib/libc/arch/i386/genassym.cf:1.1 Mon Oct 12 23:56:08 2020 +++ src/lib/libc/arch/i386/genassym.cf Mon Oct 12 23:58:14 2020 @@ -1,10 +1,10 @@ -# $NetBSD: genassym.cf,v 1.1 2020/10/12 23:56:08 kamil Exp $ +# $NetBSD: genassym.cf,v 1.2 2020/10/12 23:58:14 kamil Exp $ # # Copyright (c) 2020 The NetBSD Foundation, Inc. # All rights reserved. # # This code is derived from software contributed to The NetBSD Foundation -# by Kamil Rytarowski or Moritz Systems Technology Company Sp. z o.o. +# by Kamil Rytarowski for Moritz Systems Technology Company Sp. z o.o. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions
CVS commit: src/lib/libc/arch/i386
Module Name:src Committed By: kamil Date: Mon Oct 12 23:56:08 UTC 2020 Modified Files: src/lib/libc/arch/i386: Makefile.inc src/lib/libc/arch/i386/sys: __sigtramp2.S Added Files: src/lib/libc/arch/i386: genassym.cf Log Message: Decorate the i386 signal trampoline with CFI attributes easing unwinding Now, the unwinders (in backtrace(3) and similar) can unwind properly the stack from a signal handler. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libc/arch/i386/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/i386/genassym.cf cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/Makefile.inc diff -u src/lib/libc/arch/i386/Makefile.inc:1.21 src/lib/libc/arch/i386/Makefile.inc:1.22 --- src/lib/libc/arch/i386/Makefile.inc:1.21 Wed Jul 15 14:27:49 2015 +++ src/lib/libc/arch/i386/Makefile.inc Mon Oct 12 23:56:08 2020 @@ -1,5 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.21 2015/07/15 14:27:49 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.22 2020/10/12 23:56:08 kamil Exp $ .if ${RUMPRUN} != "yes" SRCS+= __sigaction14_sigtramp.c __sigtramp2.S .endif + +CPPFLAGS+= -I. Index: src/lib/libc/arch/i386/sys/__sigtramp2.S diff -u src/lib/libc/arch/i386/sys/__sigtramp2.S:1.5 src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6 --- src/lib/libc/arch/i386/sys/__sigtramp2.S:1.5 Fri May 23 02:34:19 2014 +++ src/lib/libc/arch/i386/sys/__sigtramp2.S Mon Oct 12 23:56:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.5 2014/05/23 02:34:19 uebayasi Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.6 2020/10/12 23:56:08 kamil Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -30,6 +30,7 @@ */ #include "SYS.h" +#include "assym.h" /* * The i386 signal trampoline is invoked only to return from @@ -42,7 +43,26 @@ * pointer to ucontext structure [8] * pointer to siginfo structure [4] * sp-> signal number[0] + * + * The unwind entry includes the one byte prior to the trampoline + * because the unwinder will look up (return PC - 1) while unwinding. + * Normally (return PC - 1) computes an address inside the call + * instruction that created the child frame, but here there is no call + * instruction so we have to manually add padding. */ + .cfi_startproc simple + .cfi_signal_frame + .cfi_def_cfa esp, 140 + .cfi_offset eax, UC_GREGS_EAX + .cfi_offset ecx, UC_GREGS_ECX + .cfi_offset edx, UC_GREGS_EDX + .cfi_offset ebx, UC_GREGS_EBX + /* The unwinder will use the CFA to restore ESP. */ + .cfi_offset ebp, UC_GREGS_EBP + .cfi_offset esi, UC_GREGS_ESI + .cfi_offset edi, UC_GREGS_EDI + .cfi_offset eip, UC_GREGS_EIP + nop NENTRY(__sigtramp_siginfo_2) leal 12+128(%esp),%eax /* get address of ucontext */ movl %eax,4(%esp) /* put it in the argument slot */ @@ -50,4 +70,5 @@ NENTRY(__sigtramp_siginfo_2) SYSTRAP(setcontext) /* do setcontext */ movl $-1,4(%esp) /* if we return here, something is wrong */ SYSTRAP(exit) /* exit */ + .cfi_endproc END(__sigtramp_siginfo_2) Added files: Index: src/lib/libc/arch/i386/genassym.cf diff -u /dev/null src/lib/libc/arch/i386/genassym.cf:1.1 --- /dev/null Mon Oct 12 23:56:08 2020 +++ src/lib/libc/arch/i386/genassym.cf Mon Oct 12 23:56:08 2020 @@ -0,0 +1,41 @@ +# $NetBSD: genassym.cf,v 1.1 2020/10/12 23:56:08 kamil Exp $ +# +# Copyright (c) 2020 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Kamil Rytarowski or Moritz Systems Technology Company Sp. z o.o. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +
CVS commit: src/lib/libc/arch/i386
Module Name:src Committed By: uebayasi Date: Fri May 23 02:17:43 UTC 2014 Modified Files: src/lib/libc/arch/i386: SYS.h Log Message: Put missing END() markers to set ELF symbol size. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/lib/libc/arch/i386/SYS.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/SYS.h diff -u src/lib/libc/arch/i386/SYS.h:1.24 src/lib/libc/arch/i386/SYS.h:1.25 --- src/lib/libc/arch/i386/SYS.h:1.24 Thu Sep 12 15:36:15 2013 +++ src/lib/libc/arch/i386/SYS.h Fri May 23 02:17:43 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: SYS.h,v 1.24 2013/09/12 15:36:15 joerg Exp $ */ +/* $NetBSD: SYS.h,v 1.25 2014/05/23 02:17:43 uebayasi Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -126,13 +126,15 @@ #define PSEUDO_NOERROR(x,y) \ _SYSCALL_NOERROR(x,y); \ - ret + ret;\ + END(x) #define PSEUDO(x,y) \ _SYSCALL_NOERROR(x,y); \ jc 2f;\ ret;\ - 2: _SYSCALL_ERR + 2: _SYSCALL_ERR; \ + END(x) #define RSYSCALL_NOERROR(x) \ PSEUDO_NOERROR(x,x)
CVS commit: src/lib/libc/arch/i386
Module Name:src Committed By: uebayasi Date: Fri May 23 02:34:19 UTC 2014 Modified Files: src/lib/libc/arch/i386/gen: _setjmp.S alloca.S divsi3.S fabs.S fixdfsi.S fixunsdfsi.S flt_rounds.S fpgetmask.S fpgetprec.S fpgetround.S fpgetsticky.S fpsetmask.S fpsetprec.S fpsetround.S fpsetsticky.S resumecontext.S setjmp.S sigsetjmp.S swapcontext.S udivsi3.S src/lib/libc/arch/i386/stdlib: abs.S div.S labs.S ldiv.S llabs.S src/lib/libc/arch/i386/string: bcmp.S strncmp.S swab.S src/lib/libc/arch/i386/sys: __clone.S __sigtramp2.S __syscall.S __vfork14.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S sbrk.S syscall.S Log Message: Put missing END() markers to set ELF symbol size. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/gen/_setjmp.S \ src/lib/libc/arch/i386/gen/alloca.S cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/gen/divsi3.S \ src/lib/libc/arch/i386/gen/fixdfsi.S \ src/lib/libc/arch/i386/gen/fpgetround.S \ src/lib/libc/arch/i386/gen/fpgetsticky.S \ src/lib/libc/arch/i386/gen/fpsetsticky.S \ src/lib/libc/arch/i386/gen/udivsi3.S cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/gen/fabs.S \ src/lib/libc/arch/i386/gen/fpsetround.S cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/gen/fixunsdfsi.S cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/i386/gen/flt_rounds.S cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/i386/gen/fpgetmask.S \ src/lib/libc/arch/i386/gen/fpsetmask.S cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/i386/gen/fpgetprec.S \ src/lib/libc/arch/i386/gen/fpsetprec.S cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/i386/gen/resumecontext.S \ src/lib/libc/arch/i386/gen/swapcontext.S cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/i386/gen/setjmp.S cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/i386/gen/sigsetjmp.S cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/i386/stdlib/abs.S \ src/lib/libc/arch/i386/stdlib/labs.S cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/i386/stdlib/div.S \ src/lib/libc/arch/i386/stdlib/ldiv.S cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/stdlib/llabs.S cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/i386/string/bcmp.S cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/i386/string/strncmp.S cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/string/swab.S cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/sys/__clone.S cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/i386/sys/__sigtramp2.S \ src/lib/libc/arch/i386/sys/__syscall.S cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/i386/sys/__vfork14.S \ src/lib/libc/arch/i386/sys/fork.S cvs rdiff -u -r1.23 -r1.24 src/lib/libc/arch/i386/sys/brk.S cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/i386/sys/cerror.S cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/i386/sys/exect.S cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/i386/sys/getcontext.S cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/sys/pipe.S cvs rdiff -u -r1.18 -r1.19 src/lib/libc/arch/i386/sys/ptrace.S cvs rdiff -u -r1.21 -r1.22 src/lib/libc/arch/i386/sys/sbrk.S cvs rdiff -u -r1.12 -r1.13 src/lib/libc/arch/i386/sys/syscall.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/_setjmp.S diff -u src/lib/libc/arch/i386/gen/_setjmp.S:1.8 src/lib/libc/arch/i386/gen/_setjmp.S:1.9 --- src/lib/libc/arch/i386/gen/_setjmp.S:1.8 Wed Oct 5 20:18:12 2005 +++ src/lib/libc/arch/i386/gen/_setjmp.S Fri May 23 02:34:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: _setjmp.S,v 1.8 2005/10/05 20:18:12 christos Exp $ */ +/* $NetBSD: _setjmp.S,v 1.9 2014/05/23 02:34:19 uebayasi Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) - RCSID($NetBSD: _setjmp.S,v 1.8 2005/10/05 20:18:12 christos Exp $) + RCSID($NetBSD: _setjmp.S,v 1.9 2014/05/23 02:34:19 uebayasi Exp $) #endif /* @@ -60,6 +60,7 @@ ENTRY(_setjmp) movl %edi,20(%eax) xorl %eax,%eax ret +END(_setjmp) ENTRY(_longjmp) movl 4(%esp),%edx @@ -75,3 +76,4 @@ ENTRY(_longjmp) incl %eax 1: movl %ecx,0(%esp) ret +END(_longjmp) Index: src/lib/libc/arch/i386/gen/alloca.S diff -u src/lib/libc/arch/i386/gen/alloca.S:1.8 src/lib/libc/arch/i386/gen/alloca.S:1.9 --- src/lib/libc/arch/i386/gen/alloca.S:1.8 Thu Aug 7 16:42:06 2003 +++ src/lib/libc/arch/i386/gen/alloca.S Fri May 23 02:34:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: alloca.S,v 1.8 2003/08/07 16:42:06 agc Exp $ */ +/* $NetBSD: alloca.S,v 1.9 2014/05/23 02:34:19 uebayasi Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) - RCSID($NetBSD: alloca.S,v 1.8 2003/08/07 16:42:06 agc Exp $) + RCSID($NetBSD: alloca.S,v 1.9 2014/05/23 02:34:19 uebayasi Exp $) #endif /* like alloc, but automatic free in return */ @@ -54,3 +54,4
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: uebayasi Date: Fri May 23 03:05:56 UTC 2014 Modified Files: src/lib/libc/arch/i386/gen: setjmp.S Log Message: Fix previous. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/lib/libc/arch/i386/gen/setjmp.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/setjmp.S diff -u src/lib/libc/arch/i386/gen/setjmp.S:1.16 src/lib/libc/arch/i386/gen/setjmp.S:1.17 --- src/lib/libc/arch/i386/gen/setjmp.S:1.16 Fri May 23 02:34:19 2014 +++ src/lib/libc/arch/i386/gen/setjmp.S Fri May 23 03:05:56 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: setjmp.S,v 1.16 2014/05/23 02:34:19 uebayasi Exp $ */ +/* $NetBSD: setjmp.S,v 1.17 2014/05/23 03:05:56 uebayasi Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) - RCSID($NetBSD: setjmp.S,v 1.16 2014/05/23 02:34:19 uebayasi Exp $) + RCSID($NetBSD: setjmp.S,v 1.17 2014/05/23 03:05:56 uebayasi Exp $) #endif /* @@ -76,6 +76,7 @@ ENTRY(__setjmp14) xorl %eax,%eax ret +END(__setjmp14) ENTRY(__longjmp14) /* Restore the signal mask. */ @@ -107,4 +108,4 @@ ENTRY(__longjmp14) incl %eax 1: movl %ecx,0(%esp) ret -END(__setjmp14) +END(__longjmp14)
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: drochner Date: Fri Aug 31 20:57:24 UTC 2012 Modified Files: src/lib/libc/arch/i386/gen: _lwp.c Log Message: Align the stack to a 16-byte boundary on LWP creation. This is more than required by the ABI, but it makes programs using SSE in a thread work without extra compiler flags or performance hit. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/i386/gen/_lwp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/_lwp.c diff -u src/lib/libc/arch/i386/gen/_lwp.c:1.7 src/lib/libc/arch/i386/gen/_lwp.c:1.8 --- src/lib/libc/arch/i386/gen/_lwp.c:1.7 Thu Feb 24 04:28:42 2011 +++ src/lib/libc/arch/i386/gen/_lwp.c Fri Aug 31 20:57:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: _lwp.c,v 1.7 2011/02/24 04:28:42 joerg Exp $ */ +/* $NetBSD: _lwp.c,v 1.8 2012/08/31 20:57:24 drochner Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: _lwp.c,v 1.7 2011/02/24 04:28:42 joerg Exp $); +__RCSID($NetBSD: _lwp.c,v 1.8 2012/08/31 20:57:24 drochner Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -56,9 +56,9 @@ _lwp_makecontext(ucontext_t *u, void (*s /* LINTED uintptr_t is safe */ u-uc_mcontext.__gregs[_REG_EIP] = (uintptr_t)start; - /* Align to a word */ + /* Align to a 16-byte boundary for SSE */ /* LINTED uintptr_t is safe */ - sp = (void **) ((uintptr_t)(stack_base + stack_size) ~0x3); + sp = (void **) (((uintptr_t)(stack_base + stack_size - 4) ~0xf) + 4); *--sp = arg; *--sp = (void *) _lwp_exit;
CVS commit: src/lib/libc/arch/i386/sys
Module Name:src Committed By: joerg Date: Fri Nov 18 20:21:41 UTC 2011 Modified Files: src/lib/libc/arch/i386/sys: __clone.S __syscall.S __vfork14.S brk.S cerror.S exect.S ptrace.S sbrk.S syscall.S Log Message: Mark __cerror as hidden and exploit that to simplify assembler. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/i386/sys/__clone.S \ src/lib/libc/arch/i386/sys/__syscall.S cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/sys/__vfork14.S cvs rdiff -u -r1.21 -r1.22 src/lib/libc/arch/i386/sys/brk.S cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/i386/sys/cerror.S cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/sys/exect.S cvs rdiff -u -r1.16 -r1.17 src/lib/libc/arch/i386/sys/ptrace.S cvs rdiff -u -r1.19 -r1.20 src/lib/libc/arch/i386/sys/sbrk.S cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/i386/sys/syscall.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/sys/__clone.S diff -u src/lib/libc/arch/i386/sys/__clone.S:1.3 src/lib/libc/arch/i386/sys/__clone.S:1.4 --- src/lib/libc/arch/i386/sys/__clone.S:1.3 Wed Jul 18 12:24:53 2001 +++ src/lib/libc/arch/i386/sys/__clone.S Fri Nov 18 20:21:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: __clone.S,v 1.3 2001/07/18 12:24:53 fvdl Exp $ */ +/* $NetBSD: __clone.S,v 1.4 2011/11/18 20:21:41 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -100,11 +100,4 @@ ENTRY(__clone) addl $12,%esp 5: popl %ebp -#ifdef PIC - PIC_PROLOGUE - movl PIC_GOT(CERROR),%edx - PIC_EPILOGUE - jmp *%edx -#else jmp CERROR -#endif Index: src/lib/libc/arch/i386/sys/__syscall.S diff -u src/lib/libc/arch/i386/sys/__syscall.S:1.3 src/lib/libc/arch/i386/sys/__syscall.S:1.4 --- src/lib/libc/arch/i386/sys/__syscall.S:1.3 Thu Aug 7 16:42:08 2003 +++ src/lib/libc/arch/i386/sys/__syscall.S Fri Nov 18 20:21:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc Exp $ */ +/* $NetBSD: __syscall.S,v 1.4 2011/11/18 20:21:41 joerg Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(SYSLIBC_SCCS) !defined(lint) - RCSID($NetBSD: __syscall.S,v 1.3 2003/08/07 16:42:08 agc Exp $) + RCSID($NetBSD: __syscall.S,v 1.4 2011/11/18 20:21:41 joerg Exp $) #endif /* SYSLIBC_SCCS and not lint */ #include SYS.h @@ -52,11 +52,4 @@ ENTRY(__syscall) jc err ret err: -#ifdef PIC - PIC_PROLOGUE - mov PIC_GOT(CERROR), %ecx - PIC_EPILOGUE - jmp *%ecx -#else jmp CERROR -#endif Index: src/lib/libc/arch/i386/sys/__vfork14.S diff -u src/lib/libc/arch/i386/sys/__vfork14.S:1.8 src/lib/libc/arch/i386/sys/__vfork14.S:1.9 --- src/lib/libc/arch/i386/sys/__vfork14.S:1.8 Fri Mar 9 14:30:48 2007 +++ src/lib/libc/arch/i386/sys/__vfork14.S Fri Nov 18 20:21:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad Exp $ */ +/* $NetBSD: __vfork14.S,v 1.9 2011/11/18 20:21:41 joerg Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(SYSLIBC_SCCS) !defined(lint) - RCSID($NetBSD: __vfork14.S,v 1.8 2007/03/09 14:30:48 ad Exp $) + RCSID($NetBSD: __vfork14.S,v 1.9 2011/11/18 20:21:41 joerg Exp $) #endif /* SYSLIBC_SCCS and not lint */ #include SYS.h @@ -57,11 +57,4 @@ ENTRY(__vfork14) jmp *%ecx err: pushl %ecx -#ifdef PIC - PIC_PROLOGUE - mov PIC_GOT(CERROR), %ecx - PIC_EPILOGUE - jmp *%ecx -#else jmp CERROR -#endif Index: src/lib/libc/arch/i386/sys/brk.S diff -u src/lib/libc/arch/i386/sys/brk.S:1.21 src/lib/libc/arch/i386/sys/brk.S:1.22 --- src/lib/libc/arch/i386/sys/brk.S:1.21 Fri Mar 9 14:30:56 2007 +++ src/lib/libc/arch/i386/sys/brk.S Fri Nov 18 20:21:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad Exp $ */ +/* $NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(SYSLIBC_SCCS) !defined(lint) - RCSID($NetBSD: brk.S,v 1.21 2007/03/09 14:30:56 ad Exp $) + RCSID($NetBSD: brk.S,v 1.22 2011/11/18 20:21:41 joerg Exp $) #endif /* SYSLIBC_SCCS and not lint */ #include SYS.h @@ -74,10 +74,7 @@ ENTRY(_brk) xorl %eax,%eax ret err: - PIC_PROLOGUE - mov PIC_GOT(CERROR),%edx - PIC_EPILOGUE - jmp *%edx + jmp CERROR #else movl 4(%esp),%ecx cmpl %ecx,_C_LABEL(__minbrk) Index: src/lib/libc/arch/i386/sys/cerror.S diff -u src/lib/libc/arch/i386/sys/cerror.S:1.14 src/lib/libc/arch/i386/sys/cerror.S:1.15 --- src/lib/libc/arch/i386/sys/cerror.S:1.14 Thu Aug 7 16:42:08 2003 +++ src/lib/libc/arch/i386/sys/cerror.S Fri Nov 18 20:21:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cerror.S,v 1.14 2003/08/07 16:42:08 agc Exp $ */ +/* $NetBSD: cerror.S,v 1.15 2011/11/18 20:21:41 joerg Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,12
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: christos Date: Fri Sep 30 23:42:01 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: flt_rounds.S fpgetround.S fpsetround.S Log Message: make rounding work To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/gen/flt_rounds.S cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/gen/fpgetround.S cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/i386/gen/fpsetround.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/flt_rounds.S diff -u src/lib/libc/arch/i386/gen/flt_rounds.S:1.8 src/lib/libc/arch/i386/gen/flt_rounds.S:1.9 --- src/lib/libc/arch/i386/gen/flt_rounds.S:1.8 Thu Sep 29 18:53:13 2011 +++ src/lib/libc/arch/i386/gen/flt_rounds.S Fri Sep 30 19:42:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds.S,v 1.8 2011/09/29 22:53:13 christos Exp $ */ +/* $NetBSD: flt_rounds.S,v 1.9 2011/09/30 23:42:00 christos Exp $ */ #include machine/asm.h @@ -12,8 +12,10 @@ _ALIGN_TEXT ENTRY(__flt_rounds) fnstcw -4(%esp) - movl -4(%esp), %eax - shrl $10, %eax + movl -4(%esp), %ecx + shrl $9, %ecx + andl $6, %ecx + movl $0x2d, %eax /* 0x2d = 00.10.11.01 */ + sarl %cl, %eax /* 0,1,2,3 - 1,3,2,0 */ andl $3, %eax - xorl $1, %eax /* map 0,1,2,3 - 1,0,3,2 */ ret Index: src/lib/libc/arch/i386/gen/fpgetround.S diff -u src/lib/libc/arch/i386/gen/fpgetround.S:1.5 src/lib/libc/arch/i386/gen/fpgetround.S:1.6 --- src/lib/libc/arch/i386/gen/fpgetround.S:1.5 Sun Jan 13 16:45:43 2002 +++ src/lib/libc/arch/i386/gen/fpgetround.S Fri Sep 30 19:42:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fpgetround.S,v 1.5 2002/01/13 21:45:43 thorpej Exp $ */ +/* $NetBSD: fpgetround.S,v 1.6 2011/09/30 23:42:00 christos Exp $ */ /* * Written by J.T. Conklin, Apr 4, 1995 @@ -7,16 +7,17 @@ #include machine/asm.h +/* + * XXX load only x87 state. + */ + #ifdef WEAK_ALIAS WEAK_ALIAS(fpgetround, _fpgetround) ENTRY(_fpgetround) #else ENTRY(fpgetround) #endif - subl $4,%esp - fnstcw (%esp) - movl (%esp),%eax - rorl $10,%eax - andl $3,%eax - addl $4,%esp + fnstcw -4(%esp) + movl -4(%esp), %eax + andl $0x0c00, %eax ret Index: src/lib/libc/arch/i386/gen/fpsetround.S diff -u src/lib/libc/arch/i386/gen/fpsetround.S:1.3 src/lib/libc/arch/i386/gen/fpsetround.S:1.4 --- src/lib/libc/arch/i386/gen/fpsetround.S:1.3 Sun Jan 13 16:45:43 2002 +++ src/lib/libc/arch/i386/gen/fpsetround.S Fri Sep 30 19:42:00 2011 @@ -1,34 +1,33 @@ -/* $NetBSD: fpsetround.S,v 1.3 2002/01/13 21:45:43 thorpej Exp $ */ +/* $NetBSD: fpsetround.S,v 1.4 2011/09/30 23:42:00 christos Exp $ */ /* - * Written by Charles M. Hannum, Apr 9, 1995 + * Written by Frank van der Linden at Wasabi Systems for NetBSD. * Public domain. */ #include machine/asm.h +/* + * XXX set both the x87 control word + * Applications should only set exception and round flags + */ + + #ifdef WEAK_ALIAS WEAK_ALIAS(fpsetround, _fpsetround) ENTRY(_fpsetround) #else ENTRY(fpsetround) #endif - subl $4,%esp - - fnstcw (%esp) - movl (%esp),%eax - rorl $10,%eax - movl %eax,%edx - andl $3,%eax - - subl %eax,%edx - movl 8(%esp),%ecx - andl $3,%ecx - orl %ecx,%edx - roll $10,%edx - movl %edx,(%esp) - fldcw (%esp) + fnstcw -4(%esp) + movl -4(%esp), %edx + movl %edx, %eax + andl $0x0c00, %eax + andl $0xf3ff, %edx + movl 4(%esp), %edi + orl %edi, %edx + movl %edx, -4(%esp) + fldcw -4(%esp) - addl $4,%esp ret
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: christos Date: Fri Sep 30 23:45:41 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: fpsetround.S Log Message: don't use %edi! To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/i386/gen/fpsetround.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/fpsetround.S diff -u src/lib/libc/arch/i386/gen/fpsetround.S:1.4 src/lib/libc/arch/i386/gen/fpsetround.S:1.5 --- src/lib/libc/arch/i386/gen/fpsetround.S:1.4 Fri Sep 30 19:42:00 2011 +++ src/lib/libc/arch/i386/gen/fpsetround.S Fri Sep 30 19:45:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fpsetround.S,v 1.4 2011/09/30 23:42:00 christos Exp $ */ +/* $NetBSD: fpsetround.S,v 1.5 2011/09/30 23:45:41 christos Exp $ */ /* * Written by Frank van der Linden at Wasabi Systems for NetBSD. @@ -25,8 +25,8 @@ ENTRY(fpsetround) movl %edx, %eax andl $0x0c00, %eax andl $0xf3ff, %edx - movl 4(%esp), %edi - orl %edi, %edx + movl 4(%esp), %ecx + orl %ecx, %edx movl %edx, -4(%esp) fldcw -4(%esp)
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: christos Date: Thu Sep 29 22:46:00 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: flt_rounds.S Log Message: add a simpler version To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/gen/flt_rounds.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/flt_rounds.S diff -u src/lib/libc/arch/i386/gen/flt_rounds.S:1.6 src/lib/libc/arch/i386/gen/flt_rounds.S:1.7 --- src/lib/libc/arch/i386/gen/flt_rounds.S:1.6 Mon Aug 23 04:45:09 1999 +++ src/lib/libc/arch/i386/gen/flt_rounds.S Thu Sep 29 18:46:00 2011 @@ -1,33 +1,20 @@ -/* $NetBSD: flt_rounds.S,v 1.6 1999/08/23 08:45:09 kleink Exp $ */ - -/* - * Written by J.T. Conklin, Apr 4, 1995 - * Public domain. - */ +/* $NetBSD: flt_rounds.S,v 1.7 2011/09/29 22:46:00 christos Exp $ */ #include machine/asm.h +/* + * 00 0 round to zero + * 01 1 round to nearest + * 10 2 round to positive infinity + * 11 3 round to negative infinity + */ .text _ALIGN_TEXT -_map: - .byte 1 /* round to nearest */ - .byte 3 /* round to negative infinity */ - .byte 2 /* round to positive infinity */ - .byte 0 /* round to zero */ - ENTRY(__flt_rounds) - subl $4,%esp - fnstcw (%esp) - movl (%esp),%eax - shrl $10,%eax - andl $3,%eax -#ifdef PIC - PIC_PROLOGUE - leal PIC_GOTOFF(_map),%ecx - PIC_EPILOGUE - movb (%ecx,%eax,1),%al -#else - movb _map(,%eax,1),%al -#endif - addl $4,%esp + fnstcw -4(%esp) + movl -4(%esp), %ecx + shrl $9, %ecx + andl $6, %ecx + xorl $1, %eax /* map 0,1,2,3 - 1,0,3,2 */ + andl $3, %eax ret
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: christos Date: Thu Sep 29 22:53:13 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: flt_rounds.S Log Message: even shorter To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/i386/gen/flt_rounds.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/flt_rounds.S diff -u src/lib/libc/arch/i386/gen/flt_rounds.S:1.7 src/lib/libc/arch/i386/gen/flt_rounds.S:1.8 --- src/lib/libc/arch/i386/gen/flt_rounds.S:1.7 Thu Sep 29 18:46:00 2011 +++ src/lib/libc/arch/i386/gen/flt_rounds.S Thu Sep 29 18:53:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds.S,v 1.7 2011/09/29 22:46:00 christos Exp $ */ +/* $NetBSD: flt_rounds.S,v 1.8 2011/09/29 22:53:13 christos Exp $ */ #include machine/asm.h @@ -12,9 +12,8 @@ _ALIGN_TEXT ENTRY(__flt_rounds) fnstcw -4(%esp) - movl -4(%esp), %ecx - shrl $9, %ecx - andl $6, %ecx - xorl $1, %eax /* map 0,1,2,3 - 1,0,3,2 */ + movl -4(%esp), %eax + shrl $10, %eax andl $3, %eax + xorl $1, %eax /* map 0,1,2,3 - 1,0,3,2 */ ret
CVS commit: src/lib/libc/arch/i386/stdlib
Module Name:src Committed By: plunky Date: Sun Jun 12 20:29:26 UTC 2011 Modified Files: src/lib/libc/arch/i386/stdlib: div.S ldiv.S Log Message: Functions that return a struct or union, must set %eax to the value of the original address of the callers area before it returns. (System V ABI, i386 supplement, fourth edition, page 3-14) To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/stdlib/div.S \ src/lib/libc/arch/i386/stdlib/ldiv.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/stdlib/div.S diff -u src/lib/libc/arch/i386/stdlib/div.S:1.8 src/lib/libc/arch/i386/stdlib/div.S:1.9 --- src/lib/libc/arch/i386/stdlib/div.S:1.8 Sat Jul 26 19:24:33 2003 +++ src/lib/libc/arch/i386/stdlib/div.S Sun Jun 12 20:29:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: div.S,v 1.8 2003/07/26 19:24:33 salo Exp $ */ +/* $NetBSD: div.S,v 1.9 2011/06/12 20:29:25 plunky Exp $ */ /* * Written by J.T. Conklin j...@netbsd.org. * Public domain. @@ -7,7 +7,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) -RCSID($NetBSD: div.S,v 1.8 2003/07/26 19:24:33 salo Exp $) +RCSID($NetBSD: div.S,v 1.9 2011/06/12 20:29:25 plunky Exp $) #endif ENTRY(div) @@ -19,5 +19,6 @@ idiv %ecx movl %eax,(%ebx) movl %edx,4(%ebx) + movl %ebx,%eax popl %ebx ret $4 Index: src/lib/libc/arch/i386/stdlib/ldiv.S diff -u src/lib/libc/arch/i386/stdlib/ldiv.S:1.8 src/lib/libc/arch/i386/stdlib/ldiv.S:1.9 --- src/lib/libc/arch/i386/stdlib/ldiv.S:1.8 Sat Jul 26 19:24:33 2003 +++ src/lib/libc/arch/i386/stdlib/ldiv.S Sun Jun 12 20:29:25 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ldiv.S,v 1.8 2003/07/26 19:24:33 salo Exp $ */ +/* $NetBSD: ldiv.S,v 1.9 2011/06/12 20:29:25 plunky Exp $ */ /* * Written by J.T. Conklin j...@netbsd.org. * Public domain. @@ -7,7 +7,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) -RCSID($NetBSD: ldiv.S,v 1.8 2003/07/26 19:24:33 salo Exp $) +RCSID($NetBSD: ldiv.S,v 1.9 2011/06/12 20:29:25 plunky Exp $) #endif ENTRY(ldiv) @@ -19,5 +19,6 @@ idiv %ecx movl %eax,(%ebx) movl %edx,4(%ebx) + movl %ebx,%eax popl %ebx ret $4
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: joerg Date: Sun May 22 20:11:47 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: fixunsdfsi.S Log Message: Use a plain float constant, no need to deal with messy 0r prefix To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/i386/gen/fixunsdfsi.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/fixunsdfsi.S diff -u src/lib/libc/arch/i386/gen/fixunsdfsi.S:1.11 src/lib/libc/arch/i386/gen/fixunsdfsi.S:1.12 --- src/lib/libc/arch/i386/gen/fixunsdfsi.S:1.11 Thu Aug 7 16:42:07 2003 +++ src/lib/libc/arch/i386/gen/fixunsdfsi.S Sun May 22 20:11:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fixunsdfsi.S,v 1.11 2003/08/07 16:42:07 agc Exp $ */ +/* $NetBSD: fixunsdfsi.S,v 1.12 2011/05/22 20:11:47 joerg Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -36,7 +36,7 @@ #include machine/asm.h #if defined(LIBC_SCCS) - RCSID($NetBSD: fixunsdfsi.S,v 1.11 2003/08/07 16:42:07 agc Exp $) + RCSID($NetBSD: fixunsdfsi.S,v 1.12 2011/05/22 20:11:47 joerg Exp $) #endif ENTRY(__fixunsdfsi) @@ -72,4 +72,4 @@ orl $0x8000,%eax /* restore bias */ ret -fbiggestsigned: .double 0r2147483648.0 +fbiggestsigned: .double 2147483648.0
CVS commit: src/lib/libc/arch/i386/gen
Module Name:src Committed By: christos Date: Wed Apr 6 21:55:36 UTC 2011 Modified Files: src/lib/libc/arch/i386/gen: infinityl.c Log Message: fix long double infinity. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/i386/gen/infinityl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/i386/gen/infinityl.c diff -u src/lib/libc/arch/i386/gen/infinityl.c:1.2 src/lib/libc/arch/i386/gen/infinityl.c:1.3 --- src/lib/libc/arch/i386/gen/infinityl.c:1.2 Sun Jun 12 01:21:26 2005 +++ src/lib/libc/arch/i386/gen/infinityl.c Wed Apr 6 17:55:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: infinityl.c,v 1.2 2005/06/12 05:21:26 lukem Exp $ */ +/* $NetBSD: infinityl.c,v 1.3 2011/04/06 21:55:36 christos Exp $ */ /* * IEEE-compatible infinityl.c for little-endian 80-bit format -- public domain. @@ -7,10 +7,10 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: infinityl.c,v 1.2 2005/06/12 05:21:26 lukem Exp $); +__RCSID($NetBSD: infinityl.c,v 1.3 2011/04/06 21:55:36 christos Exp $); #endif /* LIBC_SCCS and not lint */ #include math.h const union __long_double_u __infinityl = - { { 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 } }; + { { 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0x7f, 0, 0 } };