Index: head/lib/libc/i386/SYS.h =================================================================== --- head/lib/libc/i386/SYS.h (revision 240151) +++ head/lib/libc/i386/SYS.h (revision 240152) @@ -1,59 +1,59 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. * * @(#)SYS.h 5.5 (Berkeley) 5/7/91 * $FreeBSD$ */ #include #include -#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ +#define SYSCALL(x) 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),%eax; KERNCALL; \ + jb HIDENAME(cerror) #define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) -#define PSEUDO(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ +#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; jb 2b; ret; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__CONCAT(__sys_,x)) /* 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 Index: head/lib/libc/i386/Symbol.map =================================================================== --- head/lib/libc/i386/Symbol.map (revision 240151) +++ head/lib/libc/i386/Symbol.map (revision 240152) @@ -1,70 +1,69 @@ /* * $FreeBSD$ */ /* * This only needs to contain symbols that are not listed in * symbol maps from other parts of libc (i.e., not found in * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). */ FBSD_1.0 { /* PSEUDO syscalls */ _exit; .mcount; _setjmp; _longjmp; alloca; fabs; __flt_rounds; __nan; __infinity; makecontext; rfork_thread; setjmp; longjmp; sigsetjmp; siglongjmp; htonl; htons; ntohl; ntohs; vfork; brk; exect; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; i386_get_ioperm; i386_get_ldt; i386_set_fsbase; i386_set_gsbase; i386_set_ioperm; i386_set_ldt; i386_set_watch; i386_vm86; sbrk; ___tls_get_addr; }; FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; _getlogin; __sys_exit; _set_tp; ___longjmp; __makecontext; __longjmp; __signalcontext; signalcontext; __siglongjmp; __sys_vfork; _vfork; _end; - .cerror; _brk; .curbrk; .minbrk; }; Index: head/lib/libc/i386/gen/rfork_thread.S =================================================================== --- head/lib/libc/i386/gen/rfork_thread.S (revision 240151) +++ head/lib/libc/i386/gen/rfork_thread.S (revision 240152) @@ -1,120 +1,119 @@ /*- * Copyright (c) 2000 Peter Wemm * All rights reserved. * * 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 AUTHOR 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 AUTHOR 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. */ #include __FBSDID("$FreeBSD$"); /* * With thanks to John Dyson for the original version of this. */ #include /* * 8 12 16 20 * rfork_thread(flags, stack_addr, start_fnc, start_arg); * * flags: Flags to rfork system call. See rfork(2). * stack_addr: Top of stack for thread. * start_fnc: Address of thread function to call in child. * start_arg: Argument to pass to the thread function in child. */ ENTRY(rfork_thread) pushl %ebp movl %esp, %ebp pushl %esi /* * Push thread info onto the new thread's stack */ movl 12(%ebp), %esi # get stack addr subl $4, %esi movl 20(%ebp), %eax # get start argument movl %eax, (%esi) subl $4, %esi movl 16(%ebp), %eax # get start thread address movl %eax, (%esi) /* * Prepare and execute the thread creation syscall */ pushl 8(%ebp) pushl $0 movl $SYS_rfork, %eax KERNCALL jb 2f /* * Check to see if we are in the parent or child */ cmpl $0, %edx jnz 1f addl $8, %esp popl %esi movl %ebp, %esp popl %ebp ret .p2align 2 /* * If we are in the child (new thread), then * set-up the call to the internal subroutine. If it * returns, then call __exit. */ 1: movl %esi,%esp popl %eax call *%eax addl $4, %esp /* * Exit system call */ pushl %eax pushl $0 #ifdef SYS_exit movl $SYS_exit, %eax #else movl $SYS_sys_exit, %eax #endif KERNCALL /* * Branch here if the thread creation fails: */ 2: addl $8, %esp popl %esi movl %ebp, %esp popl %ebp - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) + jmp HIDENAME(cerror) END(rfork_thread) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/Ovfork.S =================================================================== --- head/lib/libc/i386/sys/Ovfork.S (revision 240151) +++ head/lib/libc/i386/sys/Ovfork.S (revision 240152) @@ -1,57 +1,56 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)Ovfork.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .weak _vfork .set _vfork,__sys_vfork .weak vfork .set vfork,__sys_vfork ENTRY(__sys_vfork) popl %ecx /* my rta into ecx */ mov $SYS_vfork,%eax KERNCALL jb 1f jmp *%ecx 1: pushl %ecx - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) + jmp HIDENAME(cerror) END(__sys_vfork) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/brk.S =================================================================== --- head/lib/libc/i386/sys/brk.S (revision 240151) +++ head/lib/libc/i386/sys/brk.S (revision 240152) @@ -1,90 +1,85 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)brk.s 5.2 (Berkeley) 12/17/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(curbrk) .globl HIDENAME(minbrk) ENTRY(_brk) jmp ok END(_brk) ENTRY(brk) #ifdef PIC movl 4(%esp),%eax PIC_PROLOGUE movl PIC_GOT(HIDENAME(curbrk)),%edx # set up GOT addressing movl PIC_GOT(HIDENAME(minbrk)),%ecx # PIC_EPILOGUE cmpl %eax,(%ecx) jbe ok movl (%ecx),%eax movl %eax,4(%esp) ok: mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl 4(%esp),%eax movl %eax,(%edx) movl $0,%eax ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) #else movl 4(%esp),%eax cmpl %eax,HIDENAME(minbrk) jbe ok movl HIDENAME(minbrk),%eax movl %eax,4(%esp) ok: mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl 4(%esp),%eax movl %eax,HIDENAME(curbrk) movl $0,%eax ret -err: - jmp HIDENAME(cerror) #endif END(brk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/cerror.S =================================================================== --- head/lib/libc/i386/sys/cerror.S (revision 240151) +++ head/lib/libc/i386/sys/cerror.S (revision 240152) @@ -1,66 +1,67 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)cerror.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl HIDENAME(cerror) /* * The __error() function is thread aware. For non-threaded * programs and the initial threaded in threaded programs, * it returns a pointer to the global errno variable. */ .globl CNAME(__error) .type CNAME(__error),@function HIDENAME(cerror): - pushl %eax #ifdef PIC - /* The caller must execute the PIC prologue before jumping to cerror. */ + PIC_PROLOGUE + pushl %eax call PIC_PLT(CNAME(__error)) popl %ecx PIC_EPILOGUE #else + pushl %eax call CNAME(__error) popl %ecx #endif movl %ecx,(%eax) movl $-1,%eax movl $-1,%edx ret .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/exect.S =================================================================== --- head/lib/libc/i386/sys/exect.S (revision 240151) +++ head/lib/libc/i386/sys/exect.S (revision 240152) @@ -1,54 +1,53 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)exect.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" #include ENTRY(exect) mov $SYS_execve,%eax pushf popl %edx orl $ PSL_T,%edx pushl %edx popf KERNCALL - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */ + jmp HIDENAME(cerror) /* exect(file, argv, env); */ END(exect) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/getcontext.S =================================================================== --- head/lib/libc/i386/sys/getcontext.S (revision 240151) +++ head/lib/libc/i386/sys/getcontext.S (revision 240152) @@ -1,53 +1,50 @@ /*- * Copyright (c) 2003 Peter Wemm * All rights reserved. * * 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 AUTHOR 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 AUTHOR 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. */ #include __FBSDID("$FreeBSD$"); #include /* * This has to be magic to handle the multiple returns. * Otherwise, the setcontext() syscall will return here and we'll * pop off the return address and go to the *setcontext* call. */ .weak _getcontext .set _getcontext,__sys_getcontext .weak getcontext .set getcontext,__sys_getcontext ENTRY(__sys_getcontext) movl (%esp),%ecx /* save getcontext return address */ mov $SYS_getcontext,%eax KERNCALL - jb 1f + jb HIDENAME(cerror) addl $4,%esp /* remove stale (setcontext) return address */ jmp *%ecx /* restore return address */ -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(__sys_getcontext) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/ptrace.S =================================================================== --- head/lib/libc/i386/sys/ptrace.S (revision 240151) +++ head/lib/libc/i386/sys/ptrace.S (revision 240152) @@ -1,60 +1,57 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)ptrace.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(ptrace) xorl %eax,%eax #ifdef PIC PIC_PROLOGUE movl PIC_GOT(CNAME(errno)),%edx movl %eax,(%edx) PIC_EPILOGUE #else movl %eax,CNAME(errno) #endif mov $SYS_ptrace,%eax KERNCALL - jb err + jb HIDENAME(cerror) ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(ptrace) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/sbrk.S =================================================================== --- head/lib/libc/i386/sys/sbrk.S (revision 240151) +++ head/lib/libc/i386/sys/sbrk.S (revision 240152) @@ -1,93 +1,88 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)sbrk.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl CNAME(_end) .globl HIDENAME(minbrk) .globl HIDENAME(curbrk) .data HIDENAME(minbrk): .long CNAME(_end) HIDENAME(curbrk): .long CNAME(_end) .text ENTRY(sbrk) #ifdef PIC movl 4(%esp),%ecx PIC_PROLOGUE movl PIC_GOT(HIDENAME(curbrk)),%edx movl (%edx),%eax PIC_EPILOGUE testl %ecx,%ecx jz back addl %eax,4(%esp) mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) PIC_PROLOGUE movl PIC_GOT(HIDENAME(curbrk)),%edx movl (%edx),%eax addl %ecx,(%edx) PIC_EPILOGUE back: ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) #else /* !PIC */ movl 4(%esp),%ecx movl HIDENAME(curbrk),%eax testl %ecx,%ecx jz back addl %eax,4(%esp) mov $SYS_break,%eax KERNCALL - jb err + jb HIDENAME(cerror) movl HIDENAME(curbrk),%eax addl %ecx,HIDENAME(curbrk) back: ret -err: - jmp HIDENAME(cerror) #endif /* PIC */ END(sbrk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/i386/sys/syscall.S =================================================================== --- head/lib/libc/i386/sys/syscall.S (revision 240151) +++ head/lib/libc/i386/sys/syscall.S (revision 240152) @@ -1,55 +1,52 @@ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * * This code is derived from software contributed to Berkeley by * William Jolitz. * * 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. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #if defined(SYSLIBC_SCCS) && !defined(lint) .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" ENTRY(syscall) pop %ecx /* rta */ pop %eax /* syscall number */ push %ecx KERNCALL push %ecx /* need to push a word to keep stack frame intact upon return; the word must be the return address. */ - jb 1f + jb HIDENAME(cerror) ret -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) END(syscall) .section .note.GNU-stack,"",%progbits