diff options
Diffstat (limited to 'lib/libc/i386/sys')
-rw-r--r-- | lib/libc/i386/sys/Makefile.inc | 16 | ||||
-rw-r--r-- | lib/libc/i386/sys/Ovfork.S | 52 | ||||
-rw-r--r-- | lib/libc/i386/sys/cerror.S | 66 | ||||
-rw-r--r-- | lib/libc/i386/sys/getcontext.S | 46 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_clr_watch.c | 46 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_fsbase.c | 37 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_gsbase.c | 37 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_ioperm.2 | 85 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_ioperm.c | 48 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_ldt.2 | 138 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_get_ldt.c | 46 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_fsbase.c | 37 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_gsbase.c | 37 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_ioperm.c | 42 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_ldt.c | 46 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_watch.3 | 116 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_set_watch.c | 84 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_vm86.2 | 139 | ||||
-rw-r--r-- | lib/libc/i386/sys/i386_vm86.c | 41 | ||||
-rw-r--r-- | lib/libc/i386/sys/syscall.S | 50 |
20 files changed, 0 insertions, 1209 deletions
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 |