Index: head/lib/libc/amd64/SYS.h =================================================================== --- head/lib/libc/amd64/SYS.h (revision 240177) +++ head/lib/libc/amd64/SYS.h (revision 240178) @@ -1,73 +1,55 @@ /*- * 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 -#ifdef PIC #define RSYSCALL(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),%rax; KERNCALL; jb 2f; ret; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__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),%rax; KERNCALL; jb 2f; ret ; \ - 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx; \ + mov __CONCAT($SYS_,x),%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ END(__CONCAT(__sys_,x)) -#else -#define RSYSCALL(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),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror); \ - END(__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),%rax; KERNCALL; jb 2f; ret; \ - 2: jmp HIDENAME(cerror); \ - END(__CONCAT(__sys_,x)) -#endif #define KERNCALL movq %rcx, %r10; syscall Index: head/lib/libc/amd64/Symbol.map =================================================================== --- head/lib/libc/amd64/Symbol.map (revision 240177) +++ head/lib/libc/amd64/Symbol.map (revision 240178) @@ -1,73 +1,72 @@ /* * $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; fabs; __flt_rounds; fpgetmask; fpgetprec; fpgetround; fpgetsticky; fpsetmask; fpsetprec; fpsetround; __infinity; __nan; makecontext; rfork_thread; setjmp; longjmp; sigsetjmp; siglongjmp; htonl; htons; ntohl; ntohs; amd64_get_fsbase; amd64_get_gsbase; amd64_set_fsbase; amd64_set_gsbase; brk; exect; sbrk; vfork; }; /* * * FreeBSD private ABI * */ FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; _getlogin; __sys_exit; _set_tp; ___longjmp; __makecontext; __longjmp; __signalcontext; signalcontext; __siglongjmp; .curbrk; .minbrk; _brk; - .cerror; _end; __sys_vfork; _vfork; }; Index: head/lib/libc/amd64/gen/rfork_thread.S =================================================================== --- head/lib/libc/amd64/gen/rfork_thread.S (revision 240177) +++ head/lib/libc/amd64/gen/rfork_thread.S (revision 240178) @@ -1,104 +1,99 @@ /*- * Copyright (c) 2000 Peter Wemm * Copyright (c) 2003 Alan L. Cox * 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 /* * %edi %rsi %rdx %rcx * 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) pushq %rbx pushq %r12 movq %rdx, %rbx movq %rcx, %r12 /* * Prepare and execute the thread creation syscall */ movq $SYS_rfork, %rax KERNCALL jb 2f /* * Check to see if we are in the parent or child */ cmpl $0, %edx jnz 1f popq %r12 popq %rbx ret /* * If we are in the child (new thread), then * set-up the call to the internal subroutine. If it * returns, then call __exit. */ 1: movq %rsi, %rsp movq %r12, %rdi call *%rbx movl %eax, %edi /* * Exit system call */ #ifdef SYS_exit movq $SYS_exit, %rax #else movq $SYS_sys_exit, %rax #endif KERNCALL /* * Branch here if the thread creation fails: */ 2: popq %r12 popq %rbx -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)), %rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(rfork_thread) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/brk.S =================================================================== --- head/lib/libc/amd64/sys/brk.S (revision 240177) +++ head/lib/libc/amd64/sys/brk.S (revision 240178) @@ -1,87 +1,82 @@ /*- * 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) pushq %rdi jmp ok END(_brk) ENTRY(brk) pushq %rdi movq %rdi,%rax #ifdef PIC movq PIC_GOT(HIDENAME(minbrk)),%rdx cmpq %rax,(%rdx) #else cmpq %rax,HIDENAME(minbrk)(%rip) #endif jbe ok #ifdef PIC movq (%rdx),%rdi #else movq HIDENAME(minbrk)(%rip),%rdi #endif ok: movq $SYS_break,%rax KERNCALL jb err movq 0(%rsp),%rax #ifdef PIC movq PIC_GOT(HIDENAME(curbrk)),%rdx movq %rax,(%rdx) #else movq %rax,HIDENAME(curbrk)(%rip) #endif movq $0,%rax popq %rdi ret err: addq $8, %rsp -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(brk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/exect.S =================================================================== --- head/lib/libc/amd64/sys/exect.S (revision 240177) +++ head/lib/libc/amd64/sys/exect.S (revision 240178) @@ -1,58 +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) movq $SYS_execve,%rax pushfq popq %r8 orq $PSL_T,%r8 pushq %r8 popfq KERNCALL -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(exect) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/getcontext.S =================================================================== --- head/lib/libc/amd64/sys/getcontext.S (revision 240177) +++ head/lib/libc/amd64/sys/getcontext.S (revision 240178) @@ -1,57 +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) movq (%rsp),%rsi /* save getcontext return address */ mov $SYS_getcontext,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) addq $8,%rsp /* remove stale (setcontext) return address */ jmp *%rsi /* restore return address */ -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_getcontext) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/pipe.S =================================================================== --- head/lib/libc/amd64/sys/pipe.S (revision 240177) +++ head/lib/libc/amd64/sys/pipe.S (revision 240178) @@ -1,62 +1,55 @@ /*- * 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 "@(#)pipe.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .weak _pipe .set _pipe,__sys_pipe .weak pipe .set pipe,__sys_pipe ENTRY(__sys_pipe) mov $SYS_pipe,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) movl %eax,(%rdi) /* %rdi is preserved by syscall */ movl %edx,4(%rdi) movq $0,%rax ret -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_pipe) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/ptrace.S =================================================================== --- head/lib/libc/amd64/sys/ptrace.S (revision 240177) +++ head/lib/libc/amd64/sys/ptrace.S (revision 240178) @@ -1,62 +1,55 @@ /*- * 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 movq PIC_GOT(CNAME(errno)),%r8 movl %eax,(%r8) #else movl %eax,CNAME(errno)(%rip) #endif mov $SYS_ptrace,%eax KERNCALL - jb err + jb HIDENAME(cerror) ret -err: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(ptrace) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/reboot.S =================================================================== --- head/lib/libc/amd64/sys/reboot.S (revision 240177) +++ head/lib/libc/amd64/sys/reboot.S (revision 240178) @@ -1,59 +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 "@(#)reboot.s 5.1 (Berkeley) 4/23/90" #endif /* SYSLIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .weak _reboot .set _reboot,__sys_reboot .weak reboot .set reboot,__sys_reboot ENTRY(__sys_reboot) mov $SYS_reboot,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) iretq -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_reboot) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/sbrk.S =================================================================== --- head/lib/libc/amd64/sys/sbrk.S (revision 240177) +++ head/lib/libc/amd64/sys/sbrk.S (revision 240178) @@ -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 "@(#)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): .quad CNAME(_end) HIDENAME(curbrk): .quad CNAME(_end) .text ENTRY(sbrk) pushq %rdi movq %rdi,%rcx #ifdef PIC movq PIC_GOT(HIDENAME(curbrk)),%rdx movq (%rdx),%rax #else movq HIDENAME(curbrk)(%rip),%rax #endif testq %rcx,%rcx jz back addq %rax,%rdi mov $SYS_break,%eax KERNCALL jb err #ifdef PIC movq PIC_GOT(HIDENAME(curbrk)),%rdx movq (%rdx),%rax #else movq HIDENAME(curbrk)(%rip),%rax #endif movq 0(%rsp), %rcx #ifdef PIC addq %rcx,(%rdx) #else addq %rcx,HIDENAME(curbrk)(%rip) #endif back: addq $8, %rsp ret err: addq $8, %rsp -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(sbrk) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/setlogin.S =================================================================== --- head/lib/libc/amd64/sys/setlogin.S (revision 240177) +++ head/lib/libc/amd64/sys/setlogin.S (revision 240178) @@ -1,67 +1,60 @@ /*- * Copyright (c) 1991 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(LIBC_SCCS) && !defined(lint) .asciz "@(#)setlogin.s 5.2 (Berkeley) 4/12/91" #endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); #include "SYS.h" .globl CNAME(_logname_valid) /* in _getlogin() */ .weak _setlogin .set _setlogin,__sys_setlogin .weak setlogin .set setlogin,__sys_setlogin ENTRY(__sys_setlogin) mov $SYS_setlogin,%rax KERNCALL - jb 1f + jb HIDENAME(cerror) #ifdef PIC movq PIC_GOT(CNAME(_logname_valid)),%rdx movl $0,(%rdx) #else movl $0,CNAME(_logname_valid)(%rip) #endif ret /* setlogin(name) */ -1: -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else - jmp HIDENAME(cerror) -#endif END(__sys_setlogin) .section .note.GNU-stack,"",%progbits Index: head/lib/libc/amd64/sys/vfork.S =================================================================== --- head/lib/libc/amd64/sys/vfork.S (revision 240177) +++ head/lib/libc/amd64/sys/vfork.S (revision 240178) @@ -1,61 +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) popq %rsi /* fetch return address (%rsi preserved) */ mov $SYS_vfork,%rax KERNCALL jb 1f jmp *%rsi 1: pushq %rsi -#ifdef PIC - movq PIC_GOT(HIDENAME(cerror)),%rdx - jmp *%rdx -#else jmp HIDENAME(cerror) -#endif END(__sys_vfork) .section .note.GNU-stack,"",%progbits