diff options
Diffstat (limited to 'lib/libc/i386')
36 files changed, 3 insertions, 1493 deletions
diff --git a/lib/libc/i386/Makefile.inc b/lib/libc/i386/Makefile.inc index 79ecb7597547..5268afe685f5 100644 --- a/lib/libc/i386/Makefile.inc +++ b/lib/libc/i386/Makefile.inc @@ -1,4 +1,3 @@ - # Long double is 80 bits GDTOASRCS+=strtorx.c SRCS+=machdep_ldisx.c diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h deleted file mode 100644 index f6966aacf237..000000000000 --- a/lib/libc/i386/SYS.h +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * 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. - * - * @(#)SYS.h 5.5 (Berkeley) 5/7/91 - */ - -#include <sys/syscall.h> -#include <machine/asm.h> - -#define SYSCALL(name) ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror) - -#define RSYSCALL(name) SYSCALL(name); ret; END(__sys_##name) - -#define PSEUDO(name) ENTRY(__sys_##name); \ - WEAK_REFERENCE(__sys_##name, _##name); \ - mov $SYS_##name,%eax; KERNCALL; \ - jb HIDENAME(cerror); ret; \ - END(__sys_##name) - -/* 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 diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index 9d6ea7fff9f3..d7961009417e 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -1,67 +1,21 @@ /* - */ - -/* * 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; - 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; + __flt_rounds; ___tls_get_addr; -}; - -FBSD_1.6 { - x86_pkru_get_perm; - x86_pkru_set_perm; - x86_pkru_protect_range; - x86_pkru_unprotect_range; + sbrk; }; FBSDprivate_1.0 { - /* PSEUDO syscalls */ - _getlogin; - ___longjmp; - __makecontext; __longjmp; __signalcontext; signalcontext; __siglongjmp; - _vfork; _brk; }; diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc index e89127bdae38..e3d36c0a1ade 100644 --- a/lib/libc/i386/gen/Makefile.inc +++ b/lib/libc/i386/gen/Makefile.inc @@ -1,5 +1,3 @@ -# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 - SRCS+= _ctx_start.S _setjmp.S fabs.S \ flt_rounds.c infinity.c ldexp.c makecontext.c \ - rfork_thread.S setjmp.S signalcontext.c sigsetjmp.S + setjmp.S signalcontext.c sigsetjmp.S diff --git a/lib/libc/i386/gen/_setjmp.S b/lib/libc/i386/gen/_setjmp.S index f61183dffbac..0d00bf7a998f 100644 --- a/lib/libc/i386/gen/_setjmp.S +++ b/lib/libc/i386/gen/_setjmp.S @@ -30,9 +30,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)_setjmp.s 5.1 (Berkeley) 4/23/90" -#endif /* LIBC_SCCS and not lint */ #include <machine/asm.h> /* * C library -- _setjmp, _longjmp diff --git a/lib/libc/i386/gen/fabs.S b/lib/libc/i386/gen/fabs.S index 15558a0ebede..d19cfd24ccc1 100644 --- a/lib/libc/i386/gen/fabs.S +++ b/lib/libc/i386/gen/fabs.S @@ -30,9 +30,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)fabs.s 5.2 (Berkeley) 12/17/90" -#endif /* LIBC_SCCS and not lint */ #include <machine/asm.h> ENTRY(fabs) fldl 4(%esp) diff --git a/lib/libc/i386/gen/flt_rounds.c b/lib/libc/i386/gen/flt_rounds.c index 6212dbf20918..cebd8e1eb098 100644 --- a/lib/libc/i386/gen/flt_rounds.c +++ b/lib/libc/i386/gen/flt_rounds.c @@ -3,7 +3,6 @@ * Public domain. */ -#include <sys/cdefs.h> #include <float.h> static const int map[] = { diff --git a/lib/libc/i386/gen/infinity.c b/lib/libc/i386/gen/infinity.c index b9db2fc84efa..bc05708abd2b 100644 --- a/lib/libc/i386/gen/infinity.c +++ b/lib/libc/i386/gen/infinity.c @@ -2,7 +2,6 @@ * infinity.c */ -#include <sys/cdefs.h> #include <math.h> /* bytes for +Infinity on a 387 */ diff --git a/lib/libc/i386/gen/makecontext.c b/lib/libc/i386/gen/makecontext.c index b710a7136788..7b4845ac6bee 100644 --- a/lib/libc/i386/gen/makecontext.c +++ b/lib/libc/i386/gen/makecontext.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> #include <sys/param.h> #include <sys/signal.h> #include <sys/ucontext.h> diff --git a/lib/libc/i386/gen/rfork_thread.S b/lib/libc/i386/gen/rfork_thread.S deleted file mode 100644 index e4d3b904d523..000000000000 --- a/lib/libc/i386/gen/rfork_thread.S +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org> - * 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 <machine/asm.h> -/* - * With thanks to John Dyson for the original version of this. - */ - -#include <SYS.h> - -/* - * 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 - movl $SYS_exit, %eax - KERNCALL - - /* - * 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/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S index 070bc7e88bcf..e16f01d02f20 100644 --- a/lib/libc/i386/gen/setjmp.S +++ b/lib/libc/i386/gen/setjmp.S @@ -30,9 +30,6 @@ * SUCH DAMAGE. */ -#if defined(LIBC_SCCS) && !defined(lint) - .asciz "@(#)setjmp.s 5.1 (Berkeley) 4/23/90" -#endif /* LIBC_SCCS and not lint */ #include <machine/asm.h> /* * C library -- _setjmp, _longjmp diff --git a/lib/libc/i386/gen/signalcontext.c b/lib/libc/i386/gen/signalcontext.c index 1e77ffe1a1a2..38b306501c3c 100644 --- a/lib/libc/i386/gen/signalcontext.c +++ b/lib/libc/i386/gen/signalcontext.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> #include <sys/param.h> #include <sys/ucontext.h> #include <machine/psl.h> diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S index 8aef3d1d90ee..588788f32e0a 100644 --- a/lib/libc/i386/gen/sigsetjmp.S +++ b/lib/libc/i386/gen/sigsetjmp.S @@ -28,8 +28,6 @@ * 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. - * - * @(#)setjmp.s 5.1 (Berkeley) 4/23/90" */ #if defined(LIBC_SCCS) && !defined(lint) diff --git a/lib/libc/i386/static_tls.h b/lib/libc/i386/static_tls.h deleted file mode 100644 index baf9dfc59a5a..000000000000 --- a/lib/libc/i386/static_tls.h +++ /dev/null @@ -1,44 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2019 The FreeBSD Foundation - * - * This software was developed by Konstantin Belousov <kib@FreeBSD.org> - * under sponsorship from the FreeBSD Foundation. - * - * 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. - */ - -#ifndef _LIBC_I386_STATIC_TLS_H -#define _LIBC_I386_STATIC_TLS_H - -static __inline uintptr_t -_libc_get_static_tls_base(size_t offset) -{ - uintptr_t tlsbase; - - __asm __volatile("movl %%gs:0, %0" : "=r" (tlsbase)); - tlsbase -= offset; - return (tlsbase); -} - -#endif diff --git a/lib/libc/i386/stdlib/Makefile.inc b/lib/libc/i386/stdlib/Makefile.inc index 959aedcf85ed..21e1af04fd8d 100644 --- a/lib/libc/i386/stdlib/Makefile.inc +++ b/lib/libc/i386/stdlib/Makefile.inc @@ -1,3 +1 @@ -# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 - MDSRCS+=div.S ldiv.S diff --git a/lib/libc/i386/string/Makefile.inc b/lib/libc/i386/string/Makefile.inc index 391b81be4d68..bbb4320a5b05 100644 --- a/lib/libc/i386/string/Makefile.inc +++ b/lib/libc/i386/string/Makefile.inc @@ -1,4 +1,3 @@ - MDSRCS+= \ bcmp.S \ bcopy.S \ diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc deleted file mode 100644 index f89099385dc9..000000000000 --- a/lib/libc/i386/sys/Makefile.inc +++ /dev/null @@ -1,16 +0,0 @@ -# from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp - -SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ - i386_clr_watch.c i386_set_watch.c i386_vm86.c - -MDASM= Ovfork.S cerror.S getcontext.S syscall.S - -NOASM+= sbrk.o vfork.o - -MAN+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2 -MAN+= i386_set_watch.3 - -MLINKS+=i386_get_ioperm.2 i386_set_ioperm.2 -MLINKS+=i386_get_ldt.2 i386_set_ldt.2 -MLINKS+=i386_set_watch.3 i386_clr_watch.3 diff --git a/lib/libc/i386/sys/Ovfork.S b/lib/libc/i386/sys/Ovfork.S deleted file mode 100644 index 96232222e121..000000000000 --- a/lib/libc/i386/sys/Ovfork.S +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * 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. - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)Ovfork.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include <machine/asm.h> -#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 - jb 1f - jmp *%ecx -1: - pushl %ecx - jmp HIDENAME(cerror) -END(__sys_vfork) - - .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S deleted file mode 100644 index 6570fb3c7c3f..000000000000 --- a/lib/libc/i386/sys/cerror.S +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * 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. - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)cerror.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include <machine/asm.h> -#include "SYS.h" - - .globl HIDENAME(cerror) - .hidden HIDENAME(cerror) - - /* - * The __error() function is thread aware. For non-threaded - * programs and the initial thread in threaded programs, - * it returns a pointer to the global errno variable. - */ - .globl CNAME(__error) - .type CNAME(__error),@function -HIDENAME(cerror): -#ifdef PIC - 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 diff --git a/lib/libc/i386/sys/getcontext.S b/lib/libc/i386/sys/getcontext.S deleted file mode 100644 index 8baf0caf18fd..000000000000 --- a/lib/libc/i386/sys/getcontext.S +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * Copyright (c) 2003 Peter Wemm <peter@FreeBSD.org> - * 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 <machine/asm.h> -#include <SYS.h> - -/* - * 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 - 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/i386_clr_watch.c b/lib/libc/i386/sys/i386_clr_watch.c deleted file mode 100644 index 07b85795fba4..000000000000 --- a/lib/libc/i386/sys/i386_clr_watch.c +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright 2000 Brian S. Dean <bsd@bsdhome.com> - * 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 BRIAN S. DEAN ``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 BRIAN S. DEAN 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 <sys/cdefs.h> -#include <machine/reg.h> -#include <machine/sysarch.h> - -int -i386_clr_watch(int watchnum, struct dbreg * d) -{ - - if (watchnum < 0 || watchnum >= 4) - return -1; - - DBREG_DRX(d,7) = DBREG_DRX(d,7) & ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); - DBREG_DRX(d,watchnum) = 0; - - return 0; -} diff --git a/lib/libc/i386/sys/i386_get_fsbase.c b/lib/libc/i386/sys/i386_get_fsbase.c deleted file mode 100644 index f12a2383cc3e..000000000000 --- a/lib/libc/i386/sys/i386_get_fsbase.c +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2005 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_get_fsbase(void **addr) -{ - - return (sysarch(I386_GET_FSBASE, addr)); -} diff --git a/lib/libc/i386/sys/i386_get_gsbase.c b/lib/libc/i386/sys/i386_get_gsbase.c deleted file mode 100644 index efe43d383b4f..000000000000 --- a/lib/libc/i386/sys/i386_get_gsbase.c +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2005 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_get_gsbase(void **addr) -{ - - return (sysarch(I386_GET_GSBASE, addr)); -} diff --git a/lib/libc/i386/sys/i386_get_ioperm.2 b/lib/libc/i386/sys/i386_get_ioperm.2 deleted file mode 100644 index decdf8379ac3..000000000000 --- a/lib/libc/i386/sys/i386_get_ioperm.2 +++ /dev/null @@ -1,85 +0,0 @@ -.\" Copyright (c) 1998 Jonathan Lemon -.\" 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. -.\" -.Dd July 27, 1998 -.Dt I386_GET_IOPERM 2 -.Os -.Sh NAME -.Nm i386_get_ioperm , -.Nm i386_set_ioperm -.Nd manage per-process access to the i386 I/O port space -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In machine/sysarch.h -.Ft int -.Fn i386_get_ioperm "unsigned int start" "unsigned int *length" "int *enable" -.Ft int -.Fn i386_set_ioperm "unsigned int start" "unsigned int length" "int enable" -.Sh DESCRIPTION -The -.Fn i386_get_ioperm -system call -will return the permission for the process' I/O port space in the -.Fa *enable -argument. -The port range starts at -.Fa start -and the number of contiguous entries will be returned in -.Fa *length . -.Pp -The -.Fn i386_set_ioperm -system call -will set access to a range of I/O ports described by the -.Fa start -and -.Fa length -arguments to the state specified by the -.Fa enable -argument. -.Sh RETURN VALUES -.Rv -std -.Sh ERRORS -The -.Fn i386_get_ioperm -and -.Fn i386_set_ioperm -system calls -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -An invalid range was specified by the -.Fa start -or -.Fa length -arguments. -.It Bq Er EPERM -The caller of i386_set_ioperm was not the superuser. -.El -.Sh SEE ALSO -.Xr io 4 -.Sh AUTHORS -This man page was written by -.An Jonathan Lemon . diff --git a/lib/libc/i386/sys/i386_get_ioperm.c b/lib/libc/i386/sys/i386_get_ioperm.c deleted file mode 100644 index 9d8e8d31862b..000000000000 --- a/lib/libc/i386/sys/i386_get_ioperm.c +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1998 Jonathan Lemon - * 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_get_ioperm(unsigned int start, unsigned int *length, int *enable) -{ - struct i386_ioperm_args p; - int error; - - p.start = start; - p.length = *length; - p.enable = *enable; - - error = sysarch(I386_GET_IOPERM, &p); - - *length = p.length; - *enable = p.enable; - - return (error); -} diff --git a/lib/libc/i386/sys/i386_get_ldt.2 b/lib/libc/i386/sys/i386_get_ldt.2 deleted file mode 100644 index c025aa684630..000000000000 --- a/lib/libc/i386/sys/i386_get_ldt.2 +++ /dev/null @@ -1,138 +0,0 @@ -.\" Copyright (c) 1980, 1991 Regents of the University of California. -.\" 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. -.\" 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. -.\" -.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91 -.\" -.Dd October 14, 2006 -.Dt I386_GET_LDT 2 -.Os -.Sh NAME -.Nm i386_get_ldt , -.Nm i386_set_ldt -.Nd manage i386 per-process Local Descriptor Table entries -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In machine/segments.h -.In machine/sysarch.h -.Ft int -.Fn i386_get_ldt "int start_sel" "union descriptor *descs" "int num_sels" -.Ft int -.Fn i386_set_ldt "int start_sel" "union descriptor *descs" "int num_sels" -.Sh DESCRIPTION -The -.Fn i386_get_ldt -system call -returns a list of the i386 descriptors in the current process' -LDT. -The -.Fn i386_set_ldt -system call -sets a list of i386 descriptors in the current process' -LDT. -For both routines, -.Fa start_sel -specifies the index of the selector in the LDT at which to begin and -.Fa descs -points to an array of -.Fa num_sels -descriptors to be set or returned. -.Pp -Each entry in the -.Fa descs -array can be either a segment_descriptor or gate_descriptor and are defined in -.In i386/segments.h . -These structures are defined by the architecture -as disjoint bit-fields, so care must be taken in constructing them. -.Pp -If -.Fa start_sel -is -.Em LDT_AUTO_ALLOC , -.Fa num_sels -is 1 and the descriptor pointed to by -.Fa descs -is legal, then -.Fn i386_set_ldt -will allocate a descriptor and return its -selector number. -.Pp -If -.Fa num_descs -is 1, -.Fa start_sels -is valid, and -.Fa descs -is NULL, then -.Fn i386_set_ldt -will free that descriptor -(making it available to be reallocated again later). -.Pp -If -.Fa num_descs -is 0, -.Fa start_sels -is 0 and -.Fa descs -is NULL then, as a special case, -.Fn i386_set_ldt -will free all descriptors. -.Sh RETURN VALUES -Upon successful completion, -.Fn i386_get_ldt -returns the number of descriptors currently in the LDT. -The -.Fn i386_set_ldt -system call -returns the first selector set on success. -If the kernel allocated a descriptor in the LDT, -the allocated index is returned. -Otherwise, a value of -1 is returned and the global -variable -.Va errno -is set to indicate the error. -.Sh ERRORS -The -.Fn i386_get_ldt -and -.Fn i386_set_ldt -system calls -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -An inappropriate value was used for -.Fa start_sel -or -.Fa num_sels . -.It Bq Er EACCES -The caller attempted to use a descriptor that would -circumvent protection or cause a failure. -.El -.Sh SEE ALSO -i386 Microprocessor Programmer's Reference Manual, Intel -.Sh WARNING -You can really hose your process using this. diff --git a/lib/libc/i386/sys/i386_get_ldt.c b/lib/libc/i386/sys/i386_get_ldt.c deleted file mode 100644 index 52daefd85de5..000000000000 --- a/lib/libc/i386/sys/i386_get_ldt.c +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1993 John Brezak - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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 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 <sys/cdefs.h> -#include <sys/cdefs.h> -#include <machine/segments.h> -#include <machine/sysarch.h> - -int -i386_get_ldt(int start, union descriptor *descs, int num) -{ - struct i386_ldt_args p; - - p.start = start; - p.descs = descs; - p.num = num; - - return sysarch(I386_GET_LDT, &p); -} diff --git a/lib/libc/i386/sys/i386_set_fsbase.c b/lib/libc/i386/sys/i386_set_fsbase.c deleted file mode 100644 index 81a4ed761a7e..000000000000 --- a/lib/libc/i386/sys/i386_set_fsbase.c +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2005 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_set_fsbase(void *addr) -{ - - return (sysarch(I386_SET_FSBASE, &addr)); -} diff --git a/lib/libc/i386/sys/i386_set_gsbase.c b/lib/libc/i386/sys/i386_set_gsbase.c deleted file mode 100644 index 8a584435e4c7..000000000000 --- a/lib/libc/i386/sys/i386_set_gsbase.c +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2005 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_set_gsbase(void *addr) -{ - - return (sysarch(I386_SET_GSBASE, &addr)); -} diff --git a/lib/libc/i386/sys/i386_set_ioperm.c b/lib/libc/i386/sys/i386_set_ioperm.c deleted file mode 100644 index dead1cae262a..000000000000 --- a/lib/libc/i386/sys/i386_set_ioperm.c +++ /dev/null @@ -1,42 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1998 Jonathan Lemon - * 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_set_ioperm(unsigned int start, unsigned int length, int enable) -{ - struct i386_ioperm_args p; - - p.start = start; - p.length = length; - p.enable = enable; - - return (sysarch(I386_SET_IOPERM, &p)); -} diff --git a/lib/libc/i386/sys/i386_set_ldt.c b/lib/libc/i386/sys/i386_set_ldt.c deleted file mode 100644 index 578b7f4d2f06..000000000000 --- a/lib/libc/i386/sys/i386_set_ldt.c +++ /dev/null @@ -1,46 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 1993 John Brezak - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `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 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 <sys/cdefs.h> -#include <sys/cdefs.h> -#include <machine/segments.h> -#include <machine/sysarch.h> - -int -i386_set_ldt(int start, union descriptor *descs, int num) -{ - struct i386_ldt_args p; - - p.start = start; - p.descs = descs; - p.num = num; - - return sysarch(I386_SET_LDT, &p); -} diff --git a/lib/libc/i386/sys/i386_set_watch.3 b/lib/libc/i386/sys/i386_set_watch.3 deleted file mode 100644 index 68c46e0ec081..000000000000 --- a/lib/libc/i386/sys/i386_set_watch.3 +++ /dev/null @@ -1,116 +0,0 @@ -.\" Copyright (c) 2000 Brian S. Dean -.\" All rights reserved. -.\" -.\" This man-page is based on a similar man-page by Jonathan Lemon -.\" which is copyrighted under the following conditions: -.\" -.\" 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. -.\" -.Dd August 24, 2000 -.Dt I386_SET_WATCH 3 -.Os -.Sh NAME -.Nm i386_clr_watch , -.Nm i386_set_watch -.Nd manage i386 debug register values -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In machine/reg.h -.In machine/sysarch.h -.Ft int -.Fn i386_clr_watch "int watchnum" "struct dbreg *d" -.Ft int -.Fn i386_set_watch "int watchnum" "unsigned int watchaddr" "int size" "int access" "struct dbreg *d" -.Sh DESCRIPTION -The -.Fn i386_clr_watch -function -will disable the indicated watch point within the specified debug -register set. -.Pp -The -.Fn i386_set_watch -function -will set up the specified debug registers as indicated by the -arguments. -The -.Fa watchnum -argument specifies which watch register is used, 0, 1, 2, 3, or \-1. -If -.Fa watchnum -is \-1, a free watch register is found and used. -If there are no free -watch registers, an error code of \-1 is returned. -The -.Fa watchaddr -argument -specifies the watch address, -.Fa size -specifies the size in bytes of the area to be watched (1, 2, or 4 bytes), -and -.Fa access -specifies the type of watch point: -.Pp -.Bd -literal -offset indent -compact -DBREG_DR7_EXEC An execution breakpoint. -DBREG_DR7_WRONLY Break only when the watch area is written to. -DBREG_DR7_RDWR Break when the watch area is read from or written - to. -.Ed -.Pp -Note that these functions do not actually set or clear breakpoints; -they manipulate the indicated debug register set. -You must use -.Xr ptrace 2 -to retrieve and install the debug register values for a process. -.Sh RETURN VALUES -On success, the -.Fn i386_clr_watch -function returns 0. -On error, \-1 returned which indicates that -.Fa watchnum -is invalid (not in the range of 0-3). -If the specified watchnum was already disabled, no error is returned. -.Pp -On success, the -.Fn i386_set_watch -function returns the -.Fa watchnum -argument, or the watchnum actually used in the case where the specified -.Fa watchnum -was \-1. -On error, the -.Fn i386_set_watch -function returns \-1 indicating that the watchpoint could not established -because either no more watchpoints are available, or -.Fa watchnum , -.Fa size , -or -.Fa access -is invalid. -.Sh SEE ALSO -.Xr ptrace 2 , -.Xr procfs 5 -.Sh AUTHORS -This man page was written by -.An Brian S. Dean . diff --git a/lib/libc/i386/sys/i386_set_watch.c b/lib/libc/i386/sys/i386_set_watch.c deleted file mode 100644 index 7b341e099c6b..000000000000 --- a/lib/libc/i386/sys/i386_set_watch.c +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright 2000 Brian S. Dean <bsd@bsdhome.com> - * 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 BRIAN S. DEAN ``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 BRIAN S. DEAN 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 <sys/cdefs.h> -#include <machine/reg.h> -#include <machine/sysarch.h> - -int -i386_set_watch(int watchnum, unsigned int watchaddr, int size, - int access, struct dbreg * d) -{ - int i; - unsigned int mask; - - if (watchnum == -1) { - for (i = 0, mask = 0x3; i < 4; i++, mask <<= 2) - if ((DBREG_DRX(d,7) & mask) == 0) - break; - if (i < 4) - watchnum = i; - else - return -1; - } - - switch (access) { - case DBREG_DR7_EXEC: - size = 1; /* size must be 1 for an execution breakpoint */ - /* fall through */ - case DBREG_DR7_WRONLY: - case DBREG_DR7_RDWR: - break; - default : return -1; break; - } - - /* - * we can watch a 1, 2, or 4 byte sized location - */ - switch (size) { - case 1 : mask = 0x00; break; - case 2 : mask = 0x01 << 2; break; - case 4 : mask = 0x03 << 2; break; - default : return -1; break; - } - - mask |= access; - - /* clear the bits we are about to affect */ - DBREG_DRX(d,7) &= ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); - - /* set drN register to the address, N=watchnum */ - DBREG_DRX(d,watchnum) = watchaddr; - - /* enable the watchpoint */ - DBREG_DRX(d,7) |= (0x2 << (watchnum*2)) | (mask << (watchnum*4+16)); - - return watchnum; -} diff --git a/lib/libc/i386/sys/i386_vm86.2 b/lib/libc/i386/sys/i386_vm86.2 deleted file mode 100644 index bbfb5a9b2ebc..000000000000 --- a/lib/libc/i386/sys/i386_vm86.2 +++ /dev/null @@ -1,139 +0,0 @@ -.\" Copyright (c) 1998 Jonathan Lemon -.\" 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. -.\" -.Dd July 27, 1998 -.Dt I386_VM86 2 -.Os -.Sh NAME -.Nm i386_vm86 -.Nd control vm86-related functions -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In machine/sysarch.h -.In machine/vm86.h -.Ft int -.Fn i386_vm86 "int function" "void *data" -.Sh DESCRIPTION -The -.Fn i386_vm86 -system call -is used to call various vm86 related functions. -The -.Fa function -argument -can be one of the following values: -.Bl -tag -offset indent -width VM86_SET_VME -.It Dv VM86_INIT -This will initialize the kernel's vm86 parameter area for the -process, and permit the process to make vm86 calls. -The -.Fa data -argument -points to the following structure: -.Bd -literal -struct vm86_init_args { - int debug; - int cpu_type; - u_char int_map[32]; -}; -.Ed -.Pp -The -.Fa debug -argument -is used to turn on debugging code. -The -.Fa cpu_type -argument -controls the type of CPU being emulated, and is currently unimplemented. -The -.Fa int_map -argument -is a bitmap which determines whether vm86 interrupts should be handled -in vm86 mode, or reflected back to the process. -If the -.Em Nth -bit is set, the interrupt will be reflected to the process, otherwise -it will be dispatched by the vm86 interrupt table. -.It Dv VM86_INTCALL -This allows calls to be made to vm86 interrupt handlers by the process. -It effectively simulates an INT instruction. -.Fa data -should point to the following structure: -.Bd -literal -struct vm86_intcall_args { - int intnum; - struct vm86frame vmf; -}; -.Ed -.Pp -.Fa intnum -specifies the operand of INT for the simulated call. -A value of 0x10, for example, would often be used to call into the VGA BIOS. -.Fa vmf -is used to initialize CPU registers according to the calling convention for -the interrupt handler. -.It Dv VM86_GET_VME -This is used to retrieve the current state of the Pentium(r) processor's -VME (Virtual-8086 Mode Extensions) flag, which is bit 0 of CR4. -.Fa data -should be initialized to point to the following: -.Bd -literal -struct vm86_vme_args { - int state; /* status */ -}; -.Ed -.Pp -.Fa state -will contain the state of the VME flag on return. -.\" .It Dv VM86_SET_VME -.El -.Pp -vm86 mode is entered by calling -.Xr sigreturn 2 -with the correct machine context for vm86, and with the -.Dv PSL_VM -bit set. -Control returns to the process upon delivery of a signal. -.Sh RETURN VALUES -.Rv -std i386_vm86 -.Sh ERRORS -The -.Fn i386_vm86 -system call -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -The kernel does not have vm86 support, or an invalid function was specified. -.It Bq Er ENOMEM -There is not enough memory to initialize the kernel data structures. -.El -.Sh AUTHORS -.An -nosplit -This man page was written by -.An Jonathan Lemon , -and updated by -.An Bruce M Simpson . diff --git a/lib/libc/i386/sys/i386_vm86.c b/lib/libc/i386/sys/i386_vm86.c deleted file mode 100644 index e5d942d37131..000000000000 --- a/lib/libc/i386/sys/i386_vm86.c +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 1998 Jonathan Lemon - * 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 <sys/cdefs.h> -#include <machine/sysarch.h> - -int -i386_vm86(int fcn, void *data) -{ - struct i386_vm86_args p; - - p.sub_op = fcn; - p.sub_args = (char *)data; - - return (sysarch(I386_VM86, &p)); -} diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S deleted file mode 100644 index c6b1d38960a8..000000000000 --- a/lib/libc/i386/sys/syscall.S +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * 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. - */ - -#if defined(SYSLIBC_SCCS) && !defined(lint) - .asciz "@(#)syscall.s 5.1 (Berkeley) 4/23/90" -#endif /* SYSLIBC_SCCS and not lint */ -#include <machine/asm.h> -#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 HIDENAME(cerror) - ret -END(syscall) - - .section .note.GNU-stack,"",%progbits |