diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h index 23b4226d942f..2dfca1896fcd 100644 --- a/lib/libc/amd64/SYS.h +++ b/lib/libc/amd64/SYS.h @@ -1,51 +1,57 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * * 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. * 3. 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. */ #include #include +#define _SYSCALL(name) \ + mov $SYS_##name, %eax; \ + movq %rcx, %r10; \ + syscall + +#define _SYSCALL_BODY(name) \ + _SYSCALL(name); \ + jb HIDENAME(cerror); \ + ret + #define RSYSCALL(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) #define PSEUDO(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) - -#define KERNCALL movq %rcx, %r10; syscall diff --git a/lib/libc/amd64/gen/rfork_thread.S b/lib/libc/amd64/gen/rfork_thread.S index a3c64fad7994..a70551631f1b 100644 --- a/lib/libc/amd64/gen/rfork_thread.S +++ b/lib/libc/amd64/gen/rfork_thread.S @@ -1,93 +1,91 @@ /*- * 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 /* * 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 + _SYSCALL(rfork) 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 */ - movq $SYS_exit, %rax - KERNCALL + _SYSCALL(exit) /* * Branch here if the thread creation fails: */ 2: popq %r12 popq %rbx jmp HIDENAME(cerror) END(rfork_thread) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/getcontext.S b/lib/libc/amd64/sys/getcontext.S index 6860a3cf9bef..c3a856c879f8 100644 --- a/lib/libc/amd64/sys/getcontext.S +++ b/lib/libc/amd64/sys/getcontext.S @@ -1,46 +1,45 @@ /*- * 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 #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_REFERENCE(__sys_getcontext, _getcontext) WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movq (%rsp),%rsi /* save getcontext return address */ - mov $SYS_getcontext,%rax - KERNCALL + _SYSCALL(getcontext) jb HIDENAME(cerror) addq $8,%rsp /* remove stale (setcontext) return address */ jmp *%rsi /* restore return address */ END(__sys_getcontext) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/amd64/sys/vfork.S b/lib/libc/amd64/sys/vfork.S index 3714a742bc15..e3c5f701dcff 100644 --- a/lib/libc/amd64/sys/vfork.S +++ b/lib/libc/amd64/sys/vfork.S @@ -1,49 +1,48 @@ /*- * 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. * 3. 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. */ #include #include "SYS.h" WEAK_REFERENCE(__sys_vfork, _vfork) WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popq %rsi /* fetch return address (%rsi preserved) */ - mov $SYS_vfork,%rax - KERNCALL + _SYSCALL(vfork) jb 1f jmp *%rsi 1: pushq %rsi jmp HIDENAME(cerror) END(__sys_vfork) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h index 24b0060372f8..292b705f80f2 100644 --- a/lib/libc/i386/SYS.h +++ b/lib/libc/i386/SYS.h @@ -1,51 +1,56 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * * 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. * 3. 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. */ #include #include +#define _SYSCALL(name) \ + mov $SYS_##name, %eax; \ + int $0x80 + +#define _SYSCALL_BODY(name) \ + _SYSCALL(name); \ + jb HIDENAME(cerror); \ + ret + #define RSYSCALL(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); \ - ret; END(__sys_##name) + _SYSCALL_BODY(name); \ + END(__sys_##name) #define PSEUDO(name) ENTRY(__sys_##name); \ WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ + _SYSCALL_BODY(name); \ END(__sys_##name) - -#define KERNCALL int $0x80 diff --git a/lib/libc/i386/gen/rfork_thread.S b/lib/libc/i386/gen/rfork_thread.S index e4d3b904d523..b37f16c930e8 100644 --- a/lib/libc/i386/gen/rfork_thread.S +++ b/lib/libc/i386/gen/rfork_thread.S @@ -1,113 +1,111 @@ /*- * 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 /* * 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 + _SYSCALL(rfork) 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 - movl $SYS_exit, %eax - KERNCALL + _SYSCALL(exit) /* * Branch here if the thread creation fails: */ 2: addl $8, %esp popl %esi movl %ebp, %esp popl %ebp jmp HIDENAME(cerror) END(rfork_thread) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/getcontext.S b/lib/libc/i386/sys/getcontext.S index 8baf0caf18fd..d6b5dcd58669 100644 --- a/lib/libc/i386/sys/getcontext.S +++ b/lib/libc/i386/sys/getcontext.S @@ -1,46 +1,45 @@ /*- * 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 #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_REFERENCE(__sys_getcontext, _getcontext) WEAK_REFERENCE(__sys_getcontext, getcontext) ENTRY(__sys_getcontext) movl (%esp),%ecx /* save getcontext return address */ - mov $SYS_getcontext,%eax - KERNCALL + _SYSCALL(getcontext) jb HIDENAME(cerror) addl $4,%esp /* remove stale (setcontext) return address */ jmp *%ecx /* restore return address */ END(__sys_getcontext) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S index 6e9f8e587258..9eaf193c1d7a 100644 --- a/lib/libc/i386/sys/syscall.S +++ b/lib/libc/i386/sys/syscall.S @@ -1,47 +1,47 @@ /*- * 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. * 3. 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. */ #include #include "SYS.h" ENTRY(syscall) pop %ecx /* rta */ pop %eax /* syscall number */ push %ecx - KERNCALL + int $0x80 push %ecx /* need to push a word to keep stack frame intact upon return; the word must be the return address. */ jb HIDENAME(cerror) ret END(syscall) .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/vfork.S b/lib/libc/i386/sys/vfork.S index b96f3d18c950..3399b8b752de 100644 --- a/lib/libc/i386/sys/vfork.S +++ b/lib/libc/i386/sys/vfork.S @@ -1,49 +1,48 @@ /*- * 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. * 3. 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. */ #include #include "SYS.h" WEAK_REFERENCE(__sys_vfork, _vfork) WEAK_REFERENCE(__sys_vfork, vfork) ENTRY(__sys_vfork) popl %ecx /* my rta into ecx */ - mov $SYS_vfork,%eax - KERNCALL + _SYSCALL(vfork) jb 1f jmp *%ecx 1: pushl %ecx jmp HIDENAME(cerror) END(__sys_vfork) .section .note.GNU-stack,"",%progbits