From f8695751205b22a466e3886c58acc2be75882d30 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Mon, 22 Jun 2015 04:41:21 +0200 Subject: [PATCH] i386 removal, part 4/x: Remove i386 specific code from libc. --- lib/libc/gdtoa/_hldtoa.c | 19 --- lib/libc/gen/sysctl.3 | 4 +- lib/libc/gen/tls.c | 18 --- lib/libc/i386/DEFS.h | 42 ------- lib/libc/i386/Makefile.inc | 7 -- lib/libc/i386/SYS.h | 60 ---------- lib/libc/i386/Symbol.map | 44 ------- lib/libc/i386/_fpmath.h | 54 --------- lib/libc/i386/arith.h | 15 --- lib/libc/i386/gd_qnan.h | 21 ---- lib/libc/i386/gen/Makefile.inc | 8 -- lib/libc/i386/gen/_ctx_start.S | 70 ----------- lib/libc/i386/gen/_setjmp.S | 82 ------------- lib/libc/i386/gen/alloca.S | 56 --------- lib/libc/i386/gen/fabs.S | 44 ------- lib/libc/i386/gen/flt_rounds.c | 24 ---- lib/libc/i386/gen/infinity.c | 12 -- lib/libc/i386/gen/makecontext.c | 175 ---------------------------- lib/libc/i386/gen/mcontext.S | 152 ------------------------ lib/libc/i386/gen/rfork_thread.S | 117 ------------------- lib/libc/i386/gen/setjmp.S | 101 ---------------- lib/libc/i386/gen/sigsetjmp.S | 109 ----------------- lib/libc/i386/stdlib/Makefile.inc | 5 - lib/libc/i386/stdlib/abs.S | 47 -------- lib/libc/i386/stdlib/div.S | 43 ------- lib/libc/i386/stdlib/labs.S | 47 -------- lib/libc/i386/stdlib/ldiv.S | 43 ------- lib/libc/i386/string/Makefile.inc | 6 - lib/libc/i386/string/bcmp.S | 66 ----------- lib/libc/i386/string/bcopy.S | 103 ---------------- lib/libc/i386/string/bzero.S | 83 ------------- lib/libc/i386/string/ffs.S | 59 ---------- lib/libc/i386/string/ffsl.S | 2 - lib/libc/i386/string/fls.S | 46 -------- lib/libc/i386/string/flsl.S | 2 - lib/libc/i386/string/index.S | 65 ----------- lib/libc/i386/string/memchr.S | 60 ---------- lib/libc/i386/string/memcmp.S | 77 ------------ lib/libc/i386/string/memcpy.S | 2 - lib/libc/i386/string/memmove.S | 2 - lib/libc/i386/string/memset.S | 91 --------------- lib/libc/i386/string/rindex.S | 66 ----------- lib/libc/i386/string/strcat.S | 102 ---------------- lib/libc/i386/string/strchr.S | 65 ----------- lib/libc/i386/string/strcmp.S | 121 ------------------- lib/libc/i386/string/strcpy.S | 91 --------------- lib/libc/i386/string/strncmp.S | 168 -------------------------- lib/libc/i386/string/strrchr.S | 66 ----------- lib/libc/i386/string/swab.S | 101 ---------------- lib/libc/i386/sys/Makefile.inc | 34 ------ lib/libc/i386/sys/Ovfork.S | 68 ----------- lib/libc/i386/sys/asmcontext.c | 14 --- lib/libc/i386/sys/brk.S | 88 -------------- lib/libc/i386/sys/cerror.S | 120 ------------------- lib/libc/i386/sys/exect.S | 52 --------- lib/libc/i386/sys/fork.S | 47 -------- lib/libc/i386/sys/getcontext.S | 92 --------------- lib/libc/i386/sys/i386_clr_watch.c | 51 -------- lib/libc/i386/sys/i386_get_ioperm.2 | 82 ------------- lib/libc/i386/sys/i386_get_ioperm.c | 48 -------- lib/libc/i386/sys/i386_get_ldt.2 | 97 --------------- lib/libc/i386/sys/i386_get_ldt.c | 44 ------- lib/libc/i386/sys/i386_set_ioperm.c | 42 ------- lib/libc/i386/sys/i386_set_ldt.c | 44 ------- lib/libc/i386/sys/i386_set_watch.3 | 103 ---------------- lib/libc/i386/sys/i386_set_watch.c | 89 -------------- lib/libc/i386/sys/i386_vm86.2 | 93 --------------- lib/libc/i386/sys/i386_vm86.c | 41 ------- lib/libc/i386/sys/pipe.S | 47 -------- lib/libc/i386/sys/ptrace.S | 71 ----------- lib/libc/i386/sys/reboot.S | 43 ------- lib/libc/i386/sys/rfork.S | 47 -------- lib/libc/i386/sys/sbrk.S | 87 -------------- lib/libc/i386/sys/setlogin.S | 55 --------- lib/libc/i386/sys/sigreturn.S | 47 -------- lib/libc/i386/sys/syscall.S | 53 --------- lib/libc/quad/Makefile.inc | 8 -- lib/libc/sys/ptrace.2 | 11 +- lib/libc/sys/sysarch.2 | 15 ++- 79 files changed, 15 insertions(+), 4581 deletions(-) delete mode 100644 lib/libc/i386/DEFS.h delete mode 100644 lib/libc/i386/Makefile.inc delete mode 100644 lib/libc/i386/SYS.h delete mode 100644 lib/libc/i386/Symbol.map delete mode 100644 lib/libc/i386/_fpmath.h delete mode 100644 lib/libc/i386/arith.h delete mode 100644 lib/libc/i386/gd_qnan.h delete mode 100644 lib/libc/i386/gen/Makefile.inc delete mode 100644 lib/libc/i386/gen/_ctx_start.S delete mode 100644 lib/libc/i386/gen/_setjmp.S delete mode 100644 lib/libc/i386/gen/alloca.S delete mode 100644 lib/libc/i386/gen/fabs.S delete mode 100644 lib/libc/i386/gen/flt_rounds.c delete mode 100644 lib/libc/i386/gen/infinity.c delete mode 100644 lib/libc/i386/gen/makecontext.c delete mode 100644 lib/libc/i386/gen/mcontext.S delete mode 100644 lib/libc/i386/gen/rfork_thread.S delete mode 100644 lib/libc/i386/gen/setjmp.S delete mode 100644 lib/libc/i386/gen/sigsetjmp.S delete mode 100644 lib/libc/i386/stdlib/Makefile.inc delete mode 100644 lib/libc/i386/stdlib/abs.S delete mode 100644 lib/libc/i386/stdlib/div.S delete mode 100644 lib/libc/i386/stdlib/labs.S delete mode 100644 lib/libc/i386/stdlib/ldiv.S delete mode 100644 lib/libc/i386/string/Makefile.inc delete mode 100644 lib/libc/i386/string/bcmp.S delete mode 100644 lib/libc/i386/string/bcopy.S delete mode 100644 lib/libc/i386/string/bzero.S delete mode 100644 lib/libc/i386/string/ffs.S delete mode 100644 lib/libc/i386/string/ffsl.S delete mode 100644 lib/libc/i386/string/fls.S delete mode 100644 lib/libc/i386/string/flsl.S delete mode 100644 lib/libc/i386/string/index.S delete mode 100644 lib/libc/i386/string/memchr.S delete mode 100644 lib/libc/i386/string/memcmp.S delete mode 100644 lib/libc/i386/string/memcpy.S delete mode 100644 lib/libc/i386/string/memmove.S delete mode 100644 lib/libc/i386/string/memset.S delete mode 100644 lib/libc/i386/string/rindex.S delete mode 100644 lib/libc/i386/string/strcat.S delete mode 100644 lib/libc/i386/string/strchr.S delete mode 100644 lib/libc/i386/string/strcmp.S delete mode 100644 lib/libc/i386/string/strcpy.S delete mode 100644 lib/libc/i386/string/strncmp.S delete mode 100644 lib/libc/i386/string/strrchr.S delete mode 100644 lib/libc/i386/string/swab.S delete mode 100644 lib/libc/i386/sys/Makefile.inc delete mode 100644 lib/libc/i386/sys/Ovfork.S delete mode 100644 lib/libc/i386/sys/asmcontext.c delete mode 100644 lib/libc/i386/sys/brk.S delete mode 100644 lib/libc/i386/sys/cerror.S delete mode 100644 lib/libc/i386/sys/exect.S delete mode 100644 lib/libc/i386/sys/fork.S delete mode 100644 lib/libc/i386/sys/getcontext.S delete mode 100644 lib/libc/i386/sys/i386_clr_watch.c delete mode 100644 lib/libc/i386/sys/i386_get_ioperm.2 delete mode 100644 lib/libc/i386/sys/i386_get_ioperm.c delete mode 100644 lib/libc/i386/sys/i386_get_ldt.2 delete mode 100644 lib/libc/i386/sys/i386_get_ldt.c delete mode 100644 lib/libc/i386/sys/i386_set_ioperm.c delete mode 100644 lib/libc/i386/sys/i386_set_ldt.c delete mode 100644 lib/libc/i386/sys/i386_set_watch.3 delete mode 100644 lib/libc/i386/sys/i386_set_watch.c delete mode 100644 lib/libc/i386/sys/i386_vm86.2 delete mode 100644 lib/libc/i386/sys/i386_vm86.c delete mode 100644 lib/libc/i386/sys/pipe.S delete mode 100644 lib/libc/i386/sys/ptrace.S delete mode 100644 lib/libc/i386/sys/reboot.S delete mode 100644 lib/libc/i386/sys/rfork.S delete mode 100644 lib/libc/i386/sys/sbrk.S delete mode 100644 lib/libc/i386/sys/setlogin.S delete mode 100644 lib/libc/i386/sys/sigreturn.S delete mode 100644 lib/libc/i386/sys/syscall.S diff --git a/lib/libc/gdtoa/_hldtoa.c b/lib/libc/gdtoa/_hldtoa.c index 5efd007425..e0c8ab26bf 100644 --- a/lib/libc/gdtoa/_hldtoa.c +++ b/lib/libc/gdtoa/_hldtoa.c @@ -31,10 +31,6 @@ #include #include -#ifdef __i386__ -#include -#endif - #include "../stdio/floatio.h" #include "fpmath.h" #include "gdtoaimp.h" @@ -80,9 +76,6 @@ __hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, manh_t manh; manl_t manl; int bufsize; -#ifdef __i386__ - fp_prec_t oldprec; -#endif u.e = e; *sign = u.bits.sign; @@ -95,14 +88,8 @@ __hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, *decpt = 1; return (nrv_alloc("0", rve, 1)); case FP_SUBNORMAL: -#ifdef __i386__ - oldprec = fpsetprec(FP_PE); -#endif u.e *= 0x1p514L; *decpt = u.bits.exp - (514 + LDBL_ADJ); -#ifdef __i386__ - fpsetprec(oldprec); -#endif break; case FP_INFINITE: *decpt = INT_MAX; @@ -128,16 +115,10 @@ __hldtoa(long double e, const char *xdigs, int ndigits, int *decpt, int *sign, if (SIGFIGS > ndigits && ndigits > 0) { float redux = one[u.bits.sign]; int offset = 4 * ndigits + LDBL_MAX_EXP - 4 - LDBL_MANT_DIG; -#ifdef __i386__ - oldprec = fpsetprec(FP_PE); -#endif u.bits.exp = offset; u.e += redux; u.e -= redux; *decpt += u.bits.exp - offset; -#ifdef __i386__ - fpsetprec(oldprec); -#endif } mask_nbit_l(u); diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index ea1747c8ca..2b4ed1c652 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD: src/lib/libc/gen/sysctl.3,v 1.33.2.13 2002/04/07 04:57:14 dd Exp $ .\" -.Dd January 18, 2015 +.Dd June 22, 2015 .Dt SYSCTL 3 .Os .Sh NAME @@ -553,7 +553,7 @@ followed by the vnode itself .El .Ss CTL_MACHDEP The set of variables defined is architecture dependent. -The following variables are defined for the i386 architecture. +The following variables are defined for the x86_64 architecture. .Bl -column "CONSOLE_DEVICEXXX" "struct bootinfoXXX" -offset indent .It Sy "Second level name" Ta Sy "Type" Ta Sy "Changeable" .It Dv CPU_CONSDEV Ta "dev_t" Ta "no" diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 1a88a4591e..7e187d87e6 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -48,9 +48,6 @@ __weak_reference(__libc_allocate_tls, _rtld_allocate_tls); __weak_reference(__libc_free_tls, _rtld_free_tls); __weak_reference(__libc_call_init, _rtld_call_init); -#ifdef __i386__ -__weak_reference(___libc_tls_get_addr, ___tls_get_addr); -#endif __weak_reference(__libc_tls_get_addr, __tls_get_addr); __weak_reference(__libc_tls_get_addr_tcb, __tls_get_addr_tcb); __weak_reference(_libc_init_tls, _init_tls); @@ -73,21 +70,6 @@ static void *tls_init; static struct tls_tcb *initial_tcb; #endif -#ifdef __i386__ - -/* GNU ABI */ - -void *___libc_tls_get_addr(void *ti) __attribute__((__regparm__(1))); - -__attribute__((__regparm__(1))) -void * -___libc_tls_get_addr(void *ti __unused) -{ - return (0); -} - -#endif - void *__libc_tls_get_addr(void *ti); void *__libc_tls_get_addr_tcb(struct tls_tcb *, void *); diff --git a/lib/libc/i386/DEFS.h b/lib/libc/i386/DEFS.h deleted file mode 100644 index 876f6c77e2..0000000000 --- a/lib/libc/i386/DEFS.h +++ /dev/null @@ -1,42 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90 - * - * $FreeBSD: src/lib/libc/i386/DEFS.h,v 1.10 2000/01/20 03:15:00 jasone Exp $ - * $DragonFly: src/lib/libc/i386/DEFS.h,v 1.2 2003/06/17 04:26:42 dillon Exp $ - */ - -#include diff --git a/lib/libc/i386/Makefile.inc b/lib/libc/i386/Makefile.inc deleted file mode 100644 index 175fb70dbf..0000000000 --- a/lib/libc/i386/Makefile.inc +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD: src/lib/libc/i386/Makefile.inc,v 1.3 2007/12/03 07:17:32 das Exp $ - -CMAPS+= ${.CURDIR}/i386/Symbol.map - -# Long double is 80 bits -GDTOASRCS+=strtorx.c -MDSRCS+=machdep_ldisx.c diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h deleted file mode 100644 index 75cdc4523d..0000000000 --- a/lib/libc/i386/SYS.h +++ /dev/null @@ -1,60 +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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)SYS.h 5.5 (Berkeley) 5/7/91 - * $FreeBSD: src/lib/libc/i386/SYS.h,v 1.27 2008/11/02 01:28:47 peter Exp $ - * $DragonFly: src/lib/libc/i386/SYS.h,v 1.7 2006/07/27 00:43:42 corecode Exp $ - */ - -#include -#include - -#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b - -#define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) - -#define PSEUDO(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret; \ - END(__CONCAT(__sys_,x)) - -/* gas messes up offset -- although we don't currently need it, do for BCS */ -#define LCALL(x,y) .byte 0x9a ; .long y; .word x - -#define KERNCALL int $0x80 diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map deleted file mode 100644 index 3f5dba7a78..0000000000 --- a/lib/libc/i386/Symbol.map +++ /dev/null @@ -1,44 +0,0 @@ -DF402.0 { - /* PSEUDO syscalls */ - _exit; - - .mcount; - _setjmp; - _longjmp; - alloca; - fabs; - __flt_rounds; - __infinity; - makecontext; - rfork_thread; - setjmp; - longjmp; - sigsetjmp; - siglongjmp; - htonl; - htons; - ntohl; - ntohs; - exect; - i386_clr_watch; - i386_get_ioperm; - i386_get_ldt; - i386_set_ioperm; - i386_set_ldt; - i386_set_watch; - i386_vm86; - sbrk; - ___tls_get_addr; -}; - -DFprivate_1.0 { - __sys_exit; - ___longjmp; - __longjmp; - __siglongjmp; - _end; - _brk; - .cerror; - .curbrk; - .minbrk; -}; diff --git a/lib/libc/i386/_fpmath.h b/lib/libc/i386/_fpmath.h deleted file mode 100644 index 455631ca00..0000000000 --- a/lib/libc/i386/_fpmath.h +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 2002, 2003 David Schultz - * 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. - * - * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.6 2008/01/17 16:39:06 bde Exp $ - */ - -union IEEEl2bits { - long double e; - struct { - unsigned int manl :32; - unsigned int manh :32; - unsigned int exp :15; - unsigned int sign :1; - unsigned int junk :16; - } bits; - struct { - unsigned long long man :64; - unsigned int expsign :16; - unsigned int junk :16; - } xbits; -}; - -#define LDBL_NBIT 0x80000000 -#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT) - -#define LDBL_MANH_SIZE 32 -#define LDBL_MANL_SIZE 32 - -#define LDBL_TO_ARRAY32(u, a) do { \ - (a)[0] = (uint32_t)(u).bits.manl; \ - (a)[1] = (uint32_t)(u).bits.manh; \ -} while (0) diff --git a/lib/libc/i386/arith.h b/lib/libc/i386/arith.h deleted file mode 100644 index c55a4df3ab..0000000000 --- a/lib/libc/i386/arith.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * MD header for contrib/gdtoa - * - * $FreeBSD: src/lib/libc/i386/arith.h,v 1.2 2003/05/08 13:50:43 das Exp $ - */ - -/* - * NOTE: The definitions in this file must be correct or strtod(3) and - * floating point formats in printf(3) will break! The file can be - * generated by running contrib/gdtoa/arithchk.c on the target - * architecture. See contrib/gdtoa/gdtoaimp.h for details. - */ - -#define IEEE_8087 -#define Arith_Kind_ASL 1 diff --git a/lib/libc/i386/gd_qnan.h b/lib/libc/i386/gd_qnan.h deleted file mode 100644 index 827301460b..0000000000 --- a/lib/libc/i386/gd_qnan.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * MD header for contrib/gdtoa - * - * This file can be generated by compiling and running contrib/gdtoa/qnan.c - * on the target architecture after arith.h has been generated. - * - * $FreeBSD: src/lib/libc/i386/gd_qnan.h,v 1.2 2007/12/16 21:15:08 das Exp $ - */ - -#define f_QNAN 0x7fc00000 -#define d_QNAN0 0x0 -#define d_QNAN1 0x7ff80000 -#define ld_QNAN0 0x0 -#define ld_QNAN1 0xc0000000 -#define ld_QNAN2 0x7fff -#define ld_QNAN3 0x0 -#define ldus_QNAN0 0x0 -#define ldus_QNAN1 0x0 -#define ldus_QNAN2 0x0 -#define ldus_QNAN3 0xc000 -#define ldus_QNAN4 0x7fff diff --git a/lib/libc/i386/gen/Makefile.inc b/lib/libc/i386/gen/Makefile.inc deleted file mode 100644 index 3c29621964..0000000000 --- a/lib/libc/i386/gen/Makefile.inc +++ /dev/null @@ -1,8 +0,0 @@ -# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/i386/gen/Makefile.inc,v 1.10.2.1 2001/02/07 00:12:45 peter Exp $ - -SRCS+= fabs.S flt_rounds.c infinity.c \ - makecontext.c \ - _ctx_start.S _setjmp.S alloca.S \ - mcontext.S \ - rfork_thread.S setjmp.S sigsetjmp.S diff --git a/lib/libc/i386/gen/_ctx_start.S b/lib/libc/i386/gen/_ctx_start.S deleted file mode 100644 index 714b23e47b..0000000000 --- a/lib/libc/i386/gen/_ctx_start.S +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2001 Daniel Eischen - * 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. Neither the name of the author 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 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. - * - * $FreeBSD: src/lib/libc/i386/gen/_ctx_start.S,v 1.3.8.1 2006/07/05 12:43:13 kib Exp $ - * $DragonFly: src/lib/libc/i386/gen/_ctx_start.S,v 1.1 2007/01/16 07:16:23 dillon Exp $ - */ - -#include -#include - -/* - * _ctx_start((void *func)(int arg1, ..., argn), - * int arg1, ..., argn, ucontext_t *ucp) - * - * 0(%esp) - func - * 4(%esp) - arg1 - * 8(%esp) - arg2 - * ... - * (4*n)(%esp) - argn - * (4*(n + 1))(%esp) - ucp, %ebp setup to point here (base of stack) - */ -ENTRY(_ctx_start) - /* - * setcontext() blocks all signals, restore the signal mask for - * the new context. - * - * Call sigsetmask(SIG_SETMASK, &uc->uc_sigmask, NULL). - */ - movl (%esi),%eax /* 0(%esi) has pointer to ucontext_t */ - addl $UC_SIGMASK,%eax - PIC_PROLOGUE - pushl $0 - pushl %eax - pushl $SIG_SETMASK - call PIC_PLT(_sigprocmask) - addl $12,%esp - PIC_EPILOGUE - - popl %eax /* get start function */ - call *%eax /* call start function with args */ - PIC_PROLOGUE - movl %esi, %esp /* - * setup stack for completion routine; - * ucp is now at top of stack - */ - call PIC_PLT(_ctx_done) /* should never return */ - call PIC_PLT(abort) /* fubar */ - ret diff --git a/lib/libc/i386/gen/_setjmp.S b/lib/libc/i386/gen/_setjmp.S deleted file mode 100644 index 2fa70c396c..0000000000 --- a/lib/libc/i386/gen/_setjmp.S +++ /dev/null @@ -1,82 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/gen/_setjmp.S,v 1.12 2000/01/20 21:58:26 jasone Exp $ - * $DragonFly: src/lib/libc/i386/gen/_setjmp.S,v 1.4 2005/01/31 22:29:24 dillon Exp $ - */ - -/* - * C library -- _setjmp, _longjmp - * - * _longjmp(a,v) - * will generate a "return(v)" from the last call to - * _setjmp(a) - * by restoring registers from the environment 'a'. - * The previous signal state is NOT restored. - */ - -#include "DEFS.h" - -ENTRY(_setjmp) - movl 4(%esp),%eax - movl 0(%esp),%edx - movl %edx, 0(%eax) /* rta */ - movl %ebx, 4(%eax) - movl %esp, 8(%eax) - movl %ebp,12(%eax) - movl %esi,16(%eax) - movl %edi,20(%eax) - fnstcw 24(%eax) - xorl %eax,%eax - ret - - .weak CNAME(_longjmp) - .set CNAME(_longjmp),CNAME(___longjmp) -ENTRY(___longjmp) - movl 4(%esp),%edx - movl 8(%esp),%eax - movl 0(%edx),%ecx - movl 4(%edx),%ebx - movl 8(%edx),%esp - movl 12(%edx),%ebp - movl 16(%edx),%esi - movl 20(%edx),%edi - fninit - fldcw 24(%edx) - testl %eax,%eax - jnz 1f - incl %eax -1: movl %ecx,0(%esp) - ret diff --git a/lib/libc/i386/gen/alloca.S b/lib/libc/i386/gen/alloca.S deleted file mode 100644 index 6b7bf27284..0000000000 --- a/lib/libc/i386/gen/alloca.S +++ /dev/null @@ -1,56 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/gen/alloca.S,v 1.5.2.1 2001/03/05 09:58:04 obrien Exp $ - * $DragonFly: src/lib/libc/i386/gen/alloca.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -/* like alloc, but automatic automatic free in return */ - -#include "DEFS.h" - -ENTRY(alloca) - popl %edx /* pop return addr */ - popl %eax /* pop amount to allocate */ - movl %esp,%ecx - addl $3,%eax /* round up to next word */ - andl $0xfffffffc,%eax - subl %eax,%esp - movl %esp,%eax /* base of newly allocated space */ - pushl 8(%ecx) /* copy possible saved registers */ - pushl 4(%ecx) - pushl 0(%ecx) - pushl %eax /* dummy to pop at callsite */ - jmp *%edx /* "return" */ diff --git a/lib/libc/i386/gen/fabs.S b/lib/libc/i386/gen/fabs.S deleted file mode 100644 index a91d9767a4..0000000000 --- a/lib/libc/i386/gen/fabs.S +++ /dev/null @@ -1,44 +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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)fabs.s 5.2 (Berkeley) 12/17/90 - * $FreeBSD: head/lib/libc/i386/gen/fabs.S 217106 2011-01-07 16:08:40Z kib $ - */ - -#include - -ENTRY(fabs) - fldl 4(%esp) - fabs - ret -END(fabs) - - .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/gen/flt_rounds.c b/lib/libc/i386/gen/flt_rounds.c deleted file mode 100644 index b965e5d507..0000000000 --- a/lib/libc/i386/gen/flt_rounds.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Written by J.T. Conklin, Apr 10, 1995 - * Public domain. - * - * $FreeBSD: head/lib/libc/i386/gen/flt_rounds.c 132383 2004-07-19 08:17:25Z das $ - */ - -#include - -static const int map[] = { - 1, /* round to nearest */ - 3, /* round to zero */ - 2, /* round to negative infinity */ - 0 /* round to positive infinity */ -}; - -int -__flt_rounds(void) -{ - int x; - - __asm("fnstcw %0" : "=m" (x)); - return (map[(x >> 10) & 0x03]); -} diff --git a/lib/libc/i386/gen/infinity.c b/lib/libc/i386/gen/infinity.c deleted file mode 100644 index cd765b9d0b..0000000000 --- a/lib/libc/i386/gen/infinity.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * infinity.c - * $FreeBSD: head/lib/libc/i386/gen/infinity.c 110566 2003-02-08 20:37:55Z mike $ - */ - -#include - -/* bytes for +Infinity on a 387 */ -const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } }; - -/* bytes for NaN */ -const union __nan_un __nan = { { 0, 0, 0xc0, 0xff } }; diff --git a/lib/libc/i386/gen/makecontext.c b/lib/libc/i386/gen/makecontext.c deleted file mode 100644 index 98752e3d7b..0000000000 --- a/lib/libc/i386/gen/makecontext.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2001 Daniel M. Eischen - * All rights reserved. - * Copyright (c) 2007 Matthew Dillon - * 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. Neither the name of the author 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 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. - * - * $FreeBSD: src/lib/libc/i386/gen/makecontext.c,v 1.5 2004/12/05 21:22:08 deischen Exp $ - */ - -#include -#include -#include - -#include -#include -#include -#include - -/* Prototypes */ -extern void _ctx_start(ucontext_t *, int argc, ...); - -__weak_reference(_makecontext, makecontext); - -/* - * _ctx_done - terminate a context - * - * The function specified by makecontext() is called by _ctx_start, - * returns, and then _ctx_start calls _ctx_done to terminate the context. - */ -void -_ctx_done (ucontext_t *ucp) -{ - if (ucp->uc_link == NULL) { - exit(0); - } else { - /* - * Since this context has finished, don't allow it - * to be restarted without being reinitialized (via - * setcontext or swapcontext). - */ - ucp->uc_mcontext.mc_len = 0; - - /* Set context to next one in link */ - /* XXX - what to do for error, abort? */ - setcontext((const ucontext_t *)ucp->uc_link); - abort(); /* should never get here */ - } -} - -/* - * makecontext() associates a stack with a user thread context and sets - * up to call the start function when switched to. The start function - * returns to _ctx_start which then calls _ctx_done to terminate the - * context. - */ -void -_makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...) -{ - va_list ap; - char *stack_top; - intptr_t *argp; - int i; - - if (ucp == NULL) - return; - - /* - * Invalidate a context which did not have a stack associated with - * it or for which the stack was too small. The stack check is - * kinda silly, though, since we have no control over the stack - * usage of the code being set up to run. - */ - if ((ucp->uc_stack.ss_sp == NULL) || - (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { - ucp->uc_mcontext.mc_len = 0; - } - if (argc < 0 || argc > NCARGS) - ucp->uc_mcontext.mc_len = 0; - - if (ucp->uc_mcontext.mc_len == sizeof(mcontext_t)) { - /* - * Arrange the stack as follows: - * - * _ctx_start - dummy return frame for stack trace - * start_ptr - user start routine <<<< ESP PTR - * arg1 - first argument, aligned(16) - * ... - * argn - * ucp - this context, %ebp points here - * - * When the context is started, control will return to - * the context start wrapper _ctx_start which will pop the - * user start routine from the top of the stack. After that, - * the top of the stack will be setup with all arguments - * necessary for calling the start routine. When the - * start routine returns, the context wrapper then sets - * the stack pointer to %ebp which was setup to point to - * the base of the stack (and where ucp is stored). It - * will then call _ctx_done() to swap in the next context - * (uc_link != 0) or exit the program (uc_link == 0). - */ - stack_top = (char *)(ucp->uc_stack.ss_sp + - ucp->uc_stack.ss_size - sizeof(intptr_t)); - - /* - * Adjust top of stack to allow for 3 pointers (return - * address, _ctx_start, and ucp) and argc arguments. - * We allow the arguments to be pointers also. The first - * argument to the user function must be properly aligned. - */ - stack_top = stack_top - (sizeof(intptr_t) * (1 + argc)); - stack_top = (char *)((unsigned)stack_top & ~15); - stack_top = stack_top - (2 * sizeof(intptr_t)); - argp = (intptr_t *)stack_top; - - /* - * Setup the top of the stack with the user start routine - * followed by all of its aguments and the pointer to the - * ucontext. We need to leave a spare spot at the top of - * the stack because setcontext will move eip to the top - * of the stack before returning. - */ - *argp = (intptr_t)_ctx_start; /* overwritten with same value */ - argp++; - *argp = (intptr_t)start; - argp++; - - /* Add all the arguments: */ - va_start(ap, argc); - for (i = 0; i < argc; i++) { - *argp = va_arg(ap, intptr_t); - argp++; - } - va_end(ap); - - /* The ucontext is placed at the bottom of the stack. */ - *argp = (intptr_t)ucp; - - /* - * Set the machine context to point to the top of the - * stack and the program counter to the context start - * wrapper. Note that setcontext() pushes the return - * address onto the top of the stack, so allow for this - * by adjusting the stack downward 1 slot. Also set - * %esi to point to the base of the stack where ucp - * is stored. - */ - ucp->uc_mcontext.mc_esi = (int)argp; - ucp->uc_mcontext.mc_ebp = 0; - ucp->uc_mcontext.mc_esp = (int)stack_top + sizeof(caddr_t); - ucp->uc_mcontext.mc_eip = (int)_ctx_start; - } -} - diff --git a/lib/libc/i386/gen/mcontext.S b/lib/libc/i386/gen/mcontext.S deleted file mode 100644 index ee3500e741..0000000000 --- a/lib/libc/i386/gen/mcontext.S +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2007 Matthew T. Emmerton - * All rights reserved. - * Copyright (c) 2007 Matthew Dillon - * 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. Neither the name of the author 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 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. - * - * $DragonFly: src/lib/libc/i386/gen/mcontext.S,v 1.2 2007/04/13 12:12:27 corecode Exp $ - */ - -#include -#include - - /* - * int get_mcontext(mcontext_t *mcp) - * - * Copy the caller's context into the mcontext, %eax excepted. - */ - .weak get_mcontext - .set get_mcontext,_get_mcontext -ENTRY(_get_mcontext) - movl 4(%esp),%eax - /* mc_onstack,0*4(%eax) */ - movw %gs,1*4(%eax) - movw %fs,2*4(%eax) - movw %es,3*4(%eax) - /* %ds,4*4(%eax) */ - movl %edi,5*4(%eax) - movl %esi,6*4(%eax) - movl %ebp,7*4(%eax) - /* %isp,8*4(%eax) */ - movl %ebx,9*4(%eax) - movl %edx,10*4(%eax) - movl %ecx,11*4(%eax) - /* mc_eax: 12*4(%eax) */ - /* mc_xflags: 13*4(%eax) */ - /* mc_trapno: 14*4(%eax) */ - /* mc_err: 15*4(%eax) */ - /* mc_eip: 16*4(%eax) */ - /* mc_cs: 17*4(%eax) */ - /* mc_eflags: 18*4(%eax) */ - /* mc_esp: 19*4(%eax) */ - - /* - * Saved stack pointer as if we had returned from this - * procedure. - */ - movl %esp,19*4(%eax) - addl $4,19*4(%eax) - - /* - * Save eflags - */ - pushfl - popl 18*4(%eax) - - /* - * Saved instruction pointer as if we had returned from - * this procedure. - */ - movl (%esp),%edx - movl %edx,16*4(%eax) - - /* - * On restore as if procedure returned the value 1 - */ - movl $1,12*4(%eax) - - /* - * Set MC_LEN - */ - movl $SIZEOF_MCONTEXT_T,MC_LEN(%eax) - - /* - * Return 0 - */ - xorl %eax,%eax - ret - - - /* - * int set_mcontext(mcontext_t *mcp) - * - * Load the register context, effectively switching to the - * new context. - */ - .weak set_mcontext - .set set_mcontext,_set_mcontext -ENTRY(_set_mcontext) - movl 4(%esp),%eax - /* 0*4(%eax),mc_onstack */ - movw 1*4(%eax),%gs - movw 2*4(%eax),%fs - movw 3*4(%eax),%es - /* 4*4(%eax),%ds */ - movl 5*4(%eax),%edi - movl 6*4(%eax),%esi - movl 7*4(%eax),%ebp - /* 8*4(%eax),%isp */ - movl 9*4(%eax),%ebx - movl 10*4(%eax),%edx - movl 11*4(%eax),%ecx - /* mc_eax: 12*4(%eax) */ - /* mc_xflags: 13*4(%eax) */ - /* mc_trapno: 14*4(%eax) */ - /* mc_err: 15*4(%eax) */ - /* mc_eip: 16*4(%eax) */ - /* mc_cs: 17*4(%eax) */ - /* mc_eflags: 18*4(%eax) */ - /* mc_esp: 19*4(%eax) */ - - /* - * Load the new stack pointer - */ - movl 19*4(%eax),%esp - - /* - * Restore the flags - */ - pushl 18*4(%eax) - popfl - - /* - * Push the return pc so we can 'ret' to it. - */ - pushl 16*4(%eax) - - /* - * Load %eax last, and return. - */ - movl 12*4(%eax),%eax - ret diff --git a/lib/libc/i386/gen/rfork_thread.S b/lib/libc/i386/gen/rfork_thread.S deleted file mode 100644 index f694ee01cc..0000000000 --- a/lib/libc/i386/gen/rfork_thread.S +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * Copyright (c) 2000 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/gen/rfork_thread.S,v 1.2.2.1 2001/02/07 00:12:45 peter Exp $ - * $DragonFly: src/lib/libc/i386/gen/rfork_thread.S,v 1.3 2004/04/05 05:31:58 dillon Exp $ - */ - -/* - * With thanks to John Dyson for the original version of this. - */ - -#include - -/* - * 8 12 16 20 - * rfork_thread(flags, stack_addr, start_fnc, start_arg); - * - * flags: Flags to rfork system call. See rfork(2). - * stack_addr: Top of stack for thread. - * start_fnc: Address of thread function to call in child. - * start_arg: Argument to pass to the thread function in child. - */ - -ENTRY(rfork_thread) - pushl %ebp - movl %esp, %ebp - pushl %esi - - /* - * Push thread info onto the new thread's stack - */ - movl 12(%ebp), %esi # get stack addr - - subl $4, %esi - movl 20(%ebp), %eax # get start argument - movl %eax, (%esi) - - subl $4, %esi - movl 16(%ebp), %eax # get start thread address - movl %eax, (%esi) - - /* - * Prepare and execute the thread creation syscall - */ - pushl 8(%ebp) - pushl $0 - leal SYS_rfork, %eax - KERNCALL - jb 2f - - /* - * Check to see if we are in the parent or child - */ - cmpl $0, %edx - jnz 1f - addl $8, %esp - popl %esi - movl %ebp, %esp - popl %ebp - ret - .p2align 2 - - /* - * If we are in the child (new thread), then - * set-up the call to the internal subroutine. If it - * returns, then call __exit. - */ -1: - movl %esi,%esp - popl %eax - call *%eax - addl $4, %esp - - /* - * Exit system call - */ - pushl %eax - pushl $0 -#ifdef SYS_exit - leal SYS_exit, %eax -#else - leal SYS_sys_exit, %eax -#endif - KERNCALL - - /* - * Branch here if the thread creation fails: - */ -2: - addl $8,%esp - popl %esi - movl %ebp,%esp - popl %ebp - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) diff --git a/lib/libc/i386/gen/setjmp.S b/lib/libc/i386/gen/setjmp.S deleted file mode 100644 index e3dcc489b0..0000000000 --- a/lib/libc/i386/gen/setjmp.S +++ /dev/null @@ -1,101 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/gen/setjmp.S,v 1.17.2.2 2001/07/06 12:41:44 deischen Exp $ - * $DragonFly: src/lib/libc/i386/gen/setjmp.S,v 1.4 2005/01/31 22:29:24 dillon Exp $ - */ - -/* - * C library -- _setjmp, _longjmp - * - * longjmp(a,v) - * will generate a "return(v)" from the last call to - * setjmp(a) - * by restoring registers from the environment 'a'. - * The previous signal state is restored. - */ - -#include "DEFS.h" -#include "SYS.h" - -ENTRY(setjmp) - movl 4(%esp),%ecx - PIC_PROLOGUE - leal 28(%ecx), %eax - pushl %eax /* (sigset_t*)oset */ - pushl $0 /* (sigset_t*)set */ - pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp - PIC_EPILOGUE - movl 4(%esp),%ecx - movl 0(%esp),%edx - movl %edx, 0(%ecx) - movl %ebx, 4(%ecx) - movl %esp, 8(%ecx) - movl %ebp,12(%ecx) - movl %esi,16(%ecx) - movl %edi,20(%ecx) - fnstcw 24(%ecx) - xorl %eax,%eax - ret - - .weak CNAME(longjmp); - .set CNAME(longjmp),CNAME(__longjmp); -ENTRY(__longjmp) - movl 4(%esp),%edx - PIC_PROLOGUE - pushl $0 /* (sigset_t*)oset */ - leal 28(%edx), %eax - pushl %eax /* (sigset_t*)set */ - pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp - PIC_EPILOGUE - movl 4(%esp),%edx - movl 8(%esp),%eax - movl 0(%edx),%ecx - movl 4(%edx),%ebx - movl 8(%edx),%esp - movl 12(%edx),%ebp - movl 16(%edx),%esi - movl 20(%edx),%edi - fninit - fldcw 24(%edx) - testl %eax,%eax - jnz 1f - incl %eax -1: movl %ecx,0(%esp) - ret diff --git a/lib/libc/i386/gen/sigsetjmp.S b/lib/libc/i386/gen/sigsetjmp.S deleted file mode 100644 index 919f4242dc..0000000000 --- a/lib/libc/i386/gen/sigsetjmp.S +++ /dev/null @@ -1,109 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/gen/sigsetjmp.S,v 1.19.2.2 2001/07/06 12:41:44 deischen Exp $ - * $DragonFly: src/lib/libc/i386/gen/sigsetjmp.S,v 1.4 2005/01/31 22:29:24 dillon Exp $ - */ - -#include "DEFS.h" -#include "SYS.h" - -/*- - * TODO: - * Rename sigsetjmp to __sigsetjmp and siglongjmp to __siglongjmp, - * remove the other *jmp functions and define everything in terms - * of the renamed functions. This requires compiler support for - * the renamed functions (introduced in gcc-2.5.3; previous versions - * only supported *jmp with 0 or 1 leading underscores). - * - * Restore _all_ the registers and the signal mask atomically. Can - * use sigreturn() if sigreturn() works. - */ - -ENTRY(sigsetjmp) - movl 8(%esp),%eax - movl 4(%esp),%ecx - movl %eax,44(%ecx) - testl %eax,%eax - jz 2f - PIC_PROLOGUE - leal 28(%ecx), %eax - pushl %eax /* (sigset_t*)oset */ - pushl $0 /* (sigset_t*)set */ - pushl $1 /* SIG_BLOCK */ - call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp - PIC_EPILOGUE - movl 4(%esp),%ecx -2: movl 0(%esp),%edx - movl %edx, 0(%ecx) - movl %ebx, 4(%ecx) - movl %esp, 8(%ecx) - movl %ebp,12(%ecx) - movl %esi,16(%ecx) - movl %edi,20(%ecx) - fnstcw 24(%ecx) - xorl %eax,%eax - ret - - .weak CNAME(siglongjmp); - .set CNAME(siglongjmp),CNAME(__siglongjmp); -ENTRY(__siglongjmp); - movl 4(%esp),%edx - cmpl $0,44(%edx) - jz 2f - PIC_PROLOGUE - pushl $0 /* (sigset_t*)oset */ - leal 28(%edx), %eax - pushl %eax /* (sigset_t*)set */ - pushl $3 /* SIG_SETMASK */ - call PIC_PLT(CNAME(_sigprocmask)) - addl $12,%esp - PIC_EPILOGUE - movl 4(%esp),%edx -2: movl 8(%esp),%eax - movl 0(%edx),%ecx - movl 4(%edx),%ebx - movl 8(%edx),%esp - movl 12(%edx),%ebp - movl 16(%edx),%esi - movl 20(%edx),%edi - fninit - fldcw 24(%edx) - testl %eax,%eax - jnz 1f - incl %eax -1: movl %ecx,0(%esp) - ret diff --git a/lib/libc/i386/stdlib/Makefile.inc b/lib/libc/i386/stdlib/Makefile.inc deleted file mode 100644 index 4672d10010..0000000000 --- a/lib/libc/i386/stdlib/Makefile.inc +++ /dev/null @@ -1,5 +0,0 @@ -# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/i386/stdlib/Makefile.inc,v 1.7 1999/08/27 23:59:26 peter Exp $ -# $DragonFly: src/lib/libc/i386/stdlib/Makefile.inc,v 1.2 2003/06/17 04:26:43 dillon Exp $ - -MDSRCS+=abs.S div.S labs.S ldiv.S diff --git a/lib/libc/i386/stdlib/abs.S b/lib/libc/i386/stdlib/abs.S deleted file mode 100644 index 9afe563c9d..0000000000 --- a/lib/libc/i386/stdlib/abs.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/stdlib/abs.S,v 1.6 1999/08/27 23:59:27 peter Exp $ - * $DragonFly: src/lib/libc/i386/stdlib/abs.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -ENTRY(abs) - movl 4(%esp),%eax - testl %eax,%eax - jns 1f - negl %eax -1: ret diff --git a/lib/libc/i386/stdlib/div.S b/lib/libc/i386/stdlib/div.S deleted file mode 100644 index d3f1cd9b7b..0000000000 --- a/lib/libc/i386/stdlib/div.S +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/stdlib/div.S,v 1.4 1999/08/27 23:59:27 peter Exp $ - * $DragonFly: src/lib/libc/i386/stdlib/div.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -ENTRY(div) - movl 4(%esp),%eax - movl 8(%esp),%ecx - cdq - idiv %ecx - movl %eax,4(%esp) - movl %edx,8(%esp) - ret diff --git a/lib/libc/i386/stdlib/labs.S b/lib/libc/i386/stdlib/labs.S deleted file mode 100644 index ae8938cd69..0000000000 --- a/lib/libc/i386/stdlib/labs.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/stdlib/labs.S,v 1.6 1999/08/27 23:59:27 peter Exp $ - * $DragonFly: src/lib/libc/i386/stdlib/labs.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -ENTRY(labs) - movl 4(%esp),%eax - testl %eax,%eax - jns 1f - negl %eax -1: ret diff --git a/lib/libc/i386/stdlib/ldiv.S b/lib/libc/i386/stdlib/ldiv.S deleted file mode 100644 index 53b2c47a53..0000000000 --- a/lib/libc/i386/stdlib/ldiv.S +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/stdlib/ldiv.S,v 1.4 1999/08/27 23:59:28 peter Exp $ - * $DragonFly: src/lib/libc/i386/stdlib/ldiv.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -ENTRY(ldiv) - movl 4(%esp),%eax - movl 8(%esp),%ecx - cdq - idiv %ecx - movl %eax,4(%esp) - movl %edx,8(%esp) - ret diff --git a/lib/libc/i386/string/Makefile.inc b/lib/libc/i386/string/Makefile.inc deleted file mode 100644 index 1f2ed530d8..0000000000 --- a/lib/libc/i386/string/Makefile.inc +++ /dev/null @@ -1,6 +0,0 @@ -# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 -# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.9 1999/08/27 23:59:29 peter Exp $ - -MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S ffsl.S fls.S flsl.S index.S memchr.S \ - memcmp.S memcpy.S memmove.S memset.S rindex.S strcat.S strchr.S \ - strcmp.S strcpy.S strncmp.S strrchr.S swab.S diff --git a/lib/libc/i386/string/bcmp.S b/lib/libc/i386/string/bcmp.S deleted file mode 100644 index 766503f49b..0000000000 --- a/lib/libc/i386/string/bcmp.S +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/bcmp.S,v 1.5 1999/08/27 23:59:29 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/bcmp.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * bcmp (void *b1, void *b2, size_t len) - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(bcmp) - pushl %edi - pushl %esi - movl 12(%esp),%edi - movl 16(%esp),%esi - xorl %eax,%eax /* clear return value */ - cld /* set compare direction forward */ - - movl 20(%esp),%ecx /* compare by words */ - shrl $2,%ecx - repe - cmpsl - jne L1 - - movl 20(%esp),%ecx /* compare remainder by bytes */ - andl $3,%ecx - repe - cmpsb - je L2 - -L1: incl %eax -L2: popl %esi - popl %edi - ret diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S deleted file mode 100644 index 4edb48063f..0000000000 --- a/lib/libc/i386/string/bcopy.S +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from locore.s. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* $FreeBSD: src/lib/libc/i386/string/bcopy.S,v 1.6.6.2 2002/11/07 19:35:25 sobomax Exp $ */ -/* $DragonFly: src/lib/libc/i386/string/bcopy.S,v 1.2 2003/06/17 04:26:43 dillon Exp $ */ - -#include - - RCSID("$NetBSD: bcopy.S,v 1.6 1996/11/12 00:50:06 jtc Exp $") - - /* - * (ov)bcopy (src,dst,cnt) - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 - */ - -#ifdef MEMCOPY -ENTRY(memcpy) -#else -#ifdef MEMMOVE -ENTRY(memmove) -#else -ENTRY(bcopy) -#endif -#endif - pushl %esi - pushl %edi -#if defined(MEMCOPY) || defined(MEMMOVE) - movl 12(%esp),%edi - movl 16(%esp),%esi - movl %edi,%eax -#else - movl 12(%esp),%esi - movl 16(%esp),%edi -#endif - movl 20(%esp),%ecx - movl %edi,%edx - subl %esi,%edx - cmpl %ecx,%edx /* overlapping? */ - jb 1f - cld /* nope, copy forwards. */ - movl %ecx,%edx - shrl $2,%ecx /* copy by words */ - rep - movsl - movl %edx,%ecx - andl $3,%ecx /* any bytes left? */ - rep - movsb - popl %edi - popl %esi - ret -1: - addl %ecx,%edi /* copy backwards. */ - addl %ecx,%esi - std - movl %ecx,%edx - andl $3,%ecx /* any fractional bytes? */ - decl %edi - decl %esi - rep - movsb - movl %edx,%ecx /* copy remainder by words */ - shrl $2,%ecx - subl $3,%esi - subl $3,%edi - rep - movsl - popl %edi - popl %esi - cld - ret diff --git a/lib/libc/i386/string/bzero.S b/lib/libc/i386/string/bzero.S deleted file mode 100644 index 671cab3e79..0000000000 --- a/lib/libc/i386/string/bzero.S +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/bzero.S,v 1.5 1999/08/27 23:59:30 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/bzero.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * bzero (void *b, size_t len) - * write len zero bytes to the string b. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(bzero) - pushl %edi - pushl %ebx - movl 12(%esp),%edi - movl 16(%esp),%ecx - - cld /* set fill direction forward */ - xorl %eax,%eax /* set fill data to 0 */ - - /* - * if the string is too short, it's really not worth the overhead - * of aligning to word boundries, etc. So we jump to a plain - * unaligned set. - */ - cmpl $0x0f,%ecx - jle L1 - - movl %edi,%edx /* compute misalignment */ - negl %edx - andl $3,%edx - movl %ecx,%ebx - subl %edx,%ebx - - movl %edx,%ecx /* zero until word aligned */ - rep - stosb - - movl %ebx,%ecx /* zero by words */ - shrl $2,%ecx - rep - stosl - - movl %ebx,%ecx - andl $3,%ecx /* zero remainder by bytes */ -L1: rep - stosb - - popl %ebx - popl %edi - ret diff --git a/lib/libc/i386/string/ffs.S b/lib/libc/i386/string/ffs.S deleted file mode 100644 index 2a7e72ae9b..0000000000 --- a/lib/libc/i386/string/ffs.S +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/ffs.S,v 1.5 1999/08/27 23:59:30 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/ffs.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * ffs(value) - * finds the first bit set in value and returns the index of - * that bit. Bits are numbered starting from 1, starting at the - * rightmost bit. A return value of 0 means that the argument - * was zero. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -#ifdef FFSL -ENTRY(ffsl) -#else -ENTRY(ffs) -#endif - bsfl 4(%esp),%eax - jz L1 /* ZF is set if all bits are 0 */ - incl %eax /* bits numbered from 1, not 0 */ - ret - - .align 2 -L1: xorl %eax,%eax /* clear result */ - ret diff --git a/lib/libc/i386/string/ffsl.S b/lib/libc/i386/string/ffsl.S deleted file mode 100644 index afa375b3c7..0000000000 --- a/lib/libc/i386/string/ffsl.S +++ /dev/null @@ -1,2 +0,0 @@ -#define FFSL -#include "ffs.S" diff --git a/lib/libc/i386/string/fls.S b/lib/libc/i386/string/fls.S deleted file mode 100644 index 8c02c9f54c..0000000000 --- a/lib/libc/i386/string/fls.S +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2010 The DragonFly Project - * 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 "DEFS.h" - -/* - * fls(value) - * Finds the highest set bit in a word. Bits are numbered from 1; - * a return of 0 indicates that the word was 0. - */ -#ifdef FLSL -ENTRY(flsl) -#else -ENTRY(fls) -#endif - bsrl 4(%esp),%eax - jz L1 - addl $1,%eax - ret - -L1: xorl %eax, %eax - ret diff --git a/lib/libc/i386/string/flsl.S b/lib/libc/i386/string/flsl.S deleted file mode 100644 index c06c4851f0..0000000000 --- a/lib/libc/i386/string/flsl.S +++ /dev/null @@ -1,2 +0,0 @@ -#define FLSL -#include "fls.S" diff --git a/lib/libc/i386/string/index.S b/lib/libc/i386/string/index.S deleted file mode 100644 index 95a920ede5..0000000000 --- a/lib/libc/i386/string/index.S +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/index.S,v 1.5 1999/08/27 23:59:30 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/index.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * index(s, c) - * return a pointer to the first occurance of the character c in - * string s, or NULL if c does not occur in the string. - * - * %edx - pointer iterating through string - * %eax - pointer to first occurance of 'c' - * %cl - character we're comparing against - * %bl - character at %edx - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(index) - pushl %ebx - movl 8(%esp),%eax - movb 12(%esp),%cl - .align 2,0x90 -L1: - movb (%eax),%bl - cmpb %bl,%cl /* found char??? */ - je L2 - incl %eax - testb %bl,%bl /* null terminator??? */ - jne L1 - xorl %eax,%eax -L2: - popl %ebx - ret diff --git a/lib/libc/i386/string/memchr.S b/lib/libc/i386/string/memchr.S deleted file mode 100644 index 70c0816a7a..0000000000 --- a/lib/libc/i386/string/memchr.S +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/memchr.S,v 1.8 1999/08/27 23:59:31 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/memchr.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * memchr (b, c, len) - * locates the first occurance of c in string b. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(memchr) - pushl %edi - movl 8(%esp),%edi /* string address */ - movl 12(%esp),%eax /* set character to search for */ - movl 16(%esp),%ecx /* set length of search */ - testl %esp,%esp /* clear Z flag, for len == 0 */ - cld /* set search forward */ - repne /* search! */ - scasb - jnz L1 /* scan failed, return null */ - leal -1(%edi),%eax /* adjust result of scan */ - popl %edi - ret - .align 2,0x90 -L1: xorl %eax,%eax - popl %edi - ret diff --git a/lib/libc/i386/string/memcmp.S b/lib/libc/i386/string/memcmp.S deleted file mode 100644 index 5e44322372..0000000000 --- a/lib/libc/i386/string/memcmp.S +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/memcmp.S,v 1.5 1999/08/27 23:59:32 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/memcmp.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * memcmp (void *b1, void *b2, size_t len) - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(memcmp) - pushl %edi - pushl %esi - movl 12(%esp),%edi - movl 16(%esp),%esi - cld /* set compare direction forward */ - - movl 20(%esp),%ecx /* compare by words */ - shrl $2,%ecx - repe - cmpsl - jne L5 /* do we match so far? */ - - movl 20(%esp),%ecx /* compare remainder by bytes */ - andl $3,%ecx - repe - cmpsb - jne L6 /* do we match? */ - - xorl %eax,%eax /* we match, return zero */ - popl %esi - popl %edi - ret - -L5: movl $4,%ecx /* We know that one of the next */ - subl %ecx,%edi /* four pairs of bytes do not */ - subl %ecx,%esi /* match. */ - repe - cmpsb -L6: movzbl -1(%edi),%eax /* Perform unsigned comparison */ - movzbl -1(%esi),%edx - subl %edx,%eax - popl %esi - popl %edi - ret diff --git a/lib/libc/i386/string/memcpy.S b/lib/libc/i386/string/memcpy.S deleted file mode 100644 index 1617c7153a..0000000000 --- a/lib/libc/i386/string/memcpy.S +++ /dev/null @@ -1,2 +0,0 @@ -#define MEMCOPY -#include "bcopy.S" diff --git a/lib/libc/i386/string/memmove.S b/lib/libc/i386/string/memmove.S deleted file mode 100644 index f5a94ed493..0000000000 --- a/lib/libc/i386/string/memmove.S +++ /dev/null @@ -1,2 +0,0 @@ -#define MEMMOVE -#include "bcopy.S" diff --git a/lib/libc/i386/string/memset.S b/lib/libc/i386/string/memset.S deleted file mode 100644 index 156a6847e9..0000000000 --- a/lib/libc/i386/string/memset.S +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/memset.S,v 1.5 1999/08/27 23:59:32 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/memset.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * memset(void *b, int c, size_t len) - * write len bytes of value c (converted to an unsigned char) to - * the string b. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(memset) - pushl %edi - pushl %ebx - movl 12(%esp),%edi - movzbl 16(%esp),%eax /* unsigned char, zero extend */ - movl 20(%esp),%ecx - pushl %edi /* push address of buffer */ - - cld /* set fill direction forward */ - - /* - * if the string is too short, it's really not worth the overhead - * of aligning to word boundries, etc. So we jump to a plain - * unaligned set. - */ - cmpl $0x0f,%ecx - jle L1 - - movb %al,%ah /* copy char to all bytes in word */ - movl %eax,%edx - sall $16,%eax - orl %edx,%eax - - movl %edi,%edx /* compute misalignment */ - negl %edx - andl $3,%edx - movl %ecx,%ebx - subl %edx,%ebx - - movl %edx,%ecx /* set until word aligned */ - rep - stosb - - movl %ebx,%ecx - shrl $2,%ecx /* set by words */ - rep - stosl - - movl %ebx,%ecx /* set remainder by bytes */ - andl $3,%ecx -L1: rep - stosb - - popl %eax /* pop address of buffer */ - popl %ebx - popl %edi - ret diff --git a/lib/libc/i386/string/rindex.S b/lib/libc/i386/string/rindex.S deleted file mode 100644 index 0b3b2f5a13..0000000000 --- a/lib/libc/i386/string/rindex.S +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/rindex.S,v 1.5 1999/08/27 23:59:32 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/rindex.S,v 1.3 2003/12/06 03:11:35 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * rindex(s, c) - * return a pointer to the last occurance of the character c in - * string s, or NULL if c does not occur in the string. - * - * %edx - pointer iterating through string - * %eax - pointer to last occurance of 'c' - * %cl - character we're comparing against - * %bl - character at %edx - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(rindex) - pushl %ebx - movl 8(%esp),%edx - movb 12(%esp),%cl - xorl %eax,%eax /* init pointer to null */ - .align 2,0x90 -L1: - movb (%edx),%bl - cmpb %bl,%cl - jne L2 - movl %edx,%eax -L2: - incl %edx - testb %bl,%bl /* null terminator??? */ - jne L1 - popl %ebx - ret diff --git a/lib/libc/i386/string/strcat.S b/lib/libc/i386/string/strcat.S deleted file mode 100644 index f6fe95371e..0000000000 --- a/lib/libc/i386/string/strcat.S +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strcat.S,v 1.5 1999/08/27 23:59:33 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strcat.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strcat(s, append) - * append a copy of the null-terminated string "append" to the end - * of the null-terminated string s, then add a terminating `\0'. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -/* - * I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcat) - pushl %edi /* save edi */ - movl 8(%esp),%edi /* dst address */ - movl 12(%esp),%edx /* src address */ - pushl %edi /* push destination address */ - - cld /* set search forward */ - xorl %eax,%eax /* set search for null terminator */ - movl $-1,%ecx /* set search for lots of characters */ - repne /* search! */ - scasb - - leal -1(%edi),%ecx /* correct dst address */ - - .align 2,0x90 -L1: movb (%edx),%al /* unroll loop, but not too much */ - movb %al,(%ecx) - testb %al,%al - je L2 - movb 1(%edx),%al - movb %al,1(%ecx) - testb %al,%al - je L2 - movb 2(%edx),%al - movb %al,2(%ecx) - testb %al,%al - je L2 - movb 3(%edx),%al - movb %al,3(%ecx) - testb %al,%al - je L2 - movb 4(%edx),%al - movb %al,4(%ecx) - testb %al,%al - je L2 - movb 5(%edx),%al - movb %al,5(%ecx) - testb %al,%al - je L2 - movb 6(%edx),%al - movb %al,6(%ecx) - testb %al,%al - je L2 - movb 7(%edx),%al - movb %al,7(%ecx) - addl $8,%edx - addl $8,%ecx - testb %al,%al - jne L1 -L2: popl %eax /* pop destination address */ - popl %edi /* restore edi */ - ret diff --git a/lib/libc/i386/string/strchr.S b/lib/libc/i386/string/strchr.S deleted file mode 100644 index 1b81e0e67e..0000000000 --- a/lib/libc/i386/string/strchr.S +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strchr.S,v 1.5 1999/08/27 23:59:33 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strchr.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strchr(s, c) - * return a pointer to the first occurance of the character c in - * string s, or NULL if c does not occur in the string. - * - * %edx - pointer iterating through string - * %eax - pointer to first occurance of 'c' - * %cl - character we're comparing against - * %bl - character at %edx - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(strchr) - pushl %ebx - movl 8(%esp),%eax - movb 12(%esp),%cl - .align 2,0x90 -L1: - movb (%eax),%bl - cmpb %bl,%cl /* found char??? */ - je L2 - incl %eax - testb %bl,%bl /* null terminator??? */ - jne L1 - xorl %eax,%eax -L2: - popl %ebx - ret diff --git a/lib/libc/i386/string/strcmp.S b/lib/libc/i386/string/strcmp.S deleted file mode 100644 index 6c89fe688e..0000000000 --- a/lib/libc/i386/string/strcmp.S +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strcmp.S,v 1.5 1999/08/27 23:59:33 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strcmp.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strcmp(s1, s2) - * return an integer greater than, equal to, or less than 0, - * according as string s1 is greater than, equal to, or less - * than the string s2. - * - * %eax - pointer to s1 - * %edx - pointer to s2 - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -/* - * I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcmp) - movl 0x04(%esp),%eax - movl 0x08(%esp),%edx - jmp L2 /* Jump into the loop! */ - - .align 2,0x90 -L1: incl %eax - incl %edx -L2: movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - jne L3 - incl %eax - incl %edx - movb (%eax),%cl - testb %cl,%cl - je L3 - cmpb %cl,(%edx) - je L1 - .align 2, 0x90 -L3: movzbl (%eax),%eax /* unsigned comparison */ - movzbl (%edx),%edx - subl %edx,%eax - ret diff --git a/lib/libc/i386/string/strcpy.S b/lib/libc/i386/string/strcpy.S deleted file mode 100644 index 63e68e1f34..0000000000 --- a/lib/libc/i386/string/strcpy.S +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strcpy.S,v 1.5 1999/08/27 23:59:34 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strcpy.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strcpy (dst, src) - * copy the string src to dst. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -/* - * I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - */ - -ENTRY(strcpy) - movl 4(%esp),%ecx /* dst address */ - movl 8(%esp),%edx /* src address */ - pushl %ecx /* push dst address */ - - .align 2,0x90 -L1: movb (%edx),%al /* unroll loop, but not too much */ - movb %al,(%ecx) - testb %al,%al - je L2 - movb 1(%edx),%al - movb %al,1(%ecx) - testb %al,%al - je L2 - movb 2(%edx),%al - movb %al,2(%ecx) - testb %al,%al - je L2 - movb 3(%edx),%al - movb %al,3(%ecx) - testb %al,%al - je L2 - movb 4(%edx),%al - movb %al,4(%ecx) - testb %al,%al - je L2 - movb 5(%edx),%al - movb %al,5(%ecx) - testb %al,%al - je L2 - movb 6(%edx),%al - movb %al,6(%ecx) - testb %al,%al - je L2 - movb 7(%edx),%al - movb %al,7(%ecx) - addl $8,%edx - addl $8,%ecx - testb %al,%al - jne L1 -L2: popl %eax /* pop dst address */ - ret diff --git a/lib/libc/i386/string/strncmp.S b/lib/libc/i386/string/strncmp.S deleted file mode 100644 index f2d858c906..0000000000 --- a/lib/libc/i386/string/strncmp.S +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 1993,94 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strncmp.S,v 1.6 1999/08/27 23:59:35 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strncmp.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strncmp(s1, s2, n) - * return an integer greater than, equal to, or less than 0, - * according as the first n characters of string s1 is greater - * than, equal to, or less than the string s2. - * - * %eax - pointer to s1 - * %ecx - pointer to s2 - * %edx - length - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -/* - * I've unrolled the loop eight times: large enough to make a - * significant difference, and small enough not to totally trash the - * cache. - * - * TODO: change all the jz's back to je for consistency. - */ - -ENTRY(strncmp) - pushl %ebx - movl 8(%esp),%eax - movl 12(%esp),%ecx - movl 16(%esp),%edx - testl %edx,%edx - jmp L2 /* Jump into the loop! */ - - .align 2,0x90 -L1: incl %eax - incl %ecx - decl %edx -L2: jz L4 /* strings are equal */ - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - -/* - * XXX it might be best to move the next 4 instructions to the end of the - * unrolled part of the loop. The unrolled part would then be - * movb n(%eax),%bl; testb %bl, %bl; je L3; cmpb n(%ecx); jne L3 - * or maybe better - * movb n(%eax),%bl; cmpb n(%ecx); jne L3; testb %bl,%bl; je return_0 - * for n = 0, 1, ..., 8. The end of the loop would be - * L1: addl $8,%eax; addl $8,%ecx; subl $8,%edx; cmpl $8,%edx; jae Lx - * where residual counts of 0 to 7 are handled at Lx. However, this would - * be slower for short strings. Cache effects are probably not so - * important because we are only handling a byte at a time. - */ - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - jne L3 - - incl %eax - incl %ecx - decl %edx - jz L4 - movb (%eax),%bl - testb %bl,%bl - jz L3 - cmpb %bl,(%ecx) - je L1 - - .align 2,0x90 -L3: movzbl (%eax),%eax /* unsigned comparison */ - movzbl (%ecx),%ecx - subl %ecx,%eax - popl %ebx - ret - .align 2,0x90 -L4: xorl %eax,%eax - popl %ebx - ret diff --git a/lib/libc/i386/string/strrchr.S b/lib/libc/i386/string/strrchr.S deleted file mode 100644 index e8b3cf1fa1..0000000000 --- a/lib/libc/i386/string/strrchr.S +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/strrchr.S,v 1.5 1999/08/27 23:59:35 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/strrchr.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * strrchr(s, c) - * return a pointer to the last occurance of the character c in - * string s, or NULL if c does not occur in the string. - * - * %edx - pointer iterating through string - * %eax - pointer to last occurance of 'c' - * %cl - character we're comparing against - * %bl - character at %edx - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(strrchr) - pushl %ebx - movl 8(%esp),%edx - movb 12(%esp),%cl - xorl %eax,%eax /* init pointer to null */ - .align 2,0x90 -L1: - movb (%edx),%bl - cmpb %bl,%cl - jne L2 - movl %edx,%eax -L2: - incl %edx - testb %bl,%bl /* null terminator??? */ - jne L1 - popl %ebx - ret diff --git a/lib/libc/i386/string/swab.S b/lib/libc/i386/string/swab.S deleted file mode 100644 index 6c80339f4e..0000000000 --- a/lib/libc/i386/string/swab.S +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1993,94 Winning Strategies, Inc. - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. 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. - * - * $FreeBSD: src/lib/libc/i386/string/swab.S,v 1.5 1999/08/27 23:59:35 peter Exp $ - * $DragonFly: src/lib/libc/i386/string/swab.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" - -/* - * void - * swab (const void *src, void *dst, size_t len) - * copy len bytes from src to dst, swapping adjacent bytes - * - * On the i486, this code is negligibly faster than the code generated - * by gcc at about half the size. If my i386 databook is correct, it - * should be considerably faster than the gcc code on a i386. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(swab) - pushl %esi - pushl %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx - - cld # set direction forward - - shrl $1,%ecx - testl $7,%ecx # copy first group of 1 to 7 words - jz L2 # while swaping alternate bytes. - .align 2,0x90 -L1: lodsw - rorw $8,%ax - stosw - decl %ecx - testl $7,%ecx - jnz L1 - -L2: shrl $3,%ecx # copy remainder 8 words at a time - jz L4 # while swapping alternate bytes. - .align 2,0x90 -L3: lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - lodsw - rorw $8,%ax - stosw - decl %ecx - jnz L3 - -L4: popl %edi - popl %esi - ret diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc deleted file mode 100644 index fd0a0bb27b..0000000000 --- a/lib/libc/i386/sys/Makefile.inc +++ /dev/null @@ -1,34 +0,0 @@ -# from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp -# $FreeBSD: src/lib/libc/i386/sys/Makefile.inc,v 1.17.2.3 2002/10/15 19:46:46 fjoe Exp $ - -SRCS+= i386_clr_watch.c i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c \ - i386_set_ldt.c i386_set_watch.c i386_vm86.c - -MDASM= Ovfork.S brk.S cerror.S exect.S fork.S getcontext.S pipe.S ptrace.S \ - reboot.S rfork.S sbrk.S setlogin.S sigreturn.S syscall.S - -# Don't generate default code for these syscalls: -NOASM= break.o exit.o ftruncate.o getdomainname.o getlogin.o \ - lseek.o mmap.o openbsd_poll.o setdomainname.o sstk.o \ - truncate.o uname.o vfork.o yield.o fork.o - -PSEUDO= _getlogin.o _exit.o - -# getcontext.S needs certain offsets -# -# XXX this should be moved to a non-arch directory -SRCS+= asmcontext.h -CLEANFILES+= asmcontext.h asmcontext.o - -GENASSYM= NM=nm sh ${.CURDIR}/../../sys/kern/genassym.sh -asmcontext.h: asmcontext.o - ${GENASSYM} ${.ALLSRC} > ${.TARGET} - -.if ${LIB} == "c" -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 -.endif diff --git a/lib/libc/i386/sys/Ovfork.S b/lib/libc/i386/sys/Ovfork.S deleted file mode 100644 index 2619fa1692..0000000000 --- a/lib/libc/i386/sys/Ovfork.S +++ /dev/null @@ -1,68 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/Ovfork.S,v 1.11.2.1 2002/10/15 19:46:46 fjoe Exp $ - * $DragonFly: src/lib/libc/i386/sys/Ovfork.S,v 1.4 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "DEFS.h" -#include "SYS.h" - -/* - * pid = vfork(); - * - * %edx == 0 in parent process, %edx == 1 in child process. - * %eax == pid of child in parent, %eax == pid of parent in child. - * - */ - -#ifdef _THREAD_SAFE -ENTRY(__sys_vfork) -#else -ENTRY(vfork) -#endif - popl %ecx /* my rta into ecx */ - lea SYS_vfork,%eax - KERNCALL - jb 2f - cmpl $0,%edx /* parent process? */ - je 1f /* yes */ - movl $0,%eax -1: - jmp *%ecx -2: - pushl %ecx - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) diff --git a/lib/libc/i386/sys/asmcontext.c b/lib/libc/i386/sys/asmcontext.c deleted file mode 100644 index 689076f8a1..0000000000 --- a/lib/libc/i386/sys/asmcontext.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $DragonFly: src/lib/libc/i386/sys/asmcontext.c,v 1.1 2007/01/17 02:17:36 corecode Exp $ */ - -#define _KERNEL_STRUCTURES -#include -#include -#include -#include - -ASSYM(UC_SIGMASK, offsetof(ucontext_t, uc_sigmask)); -ASSYM(UC_MCONTEXT, offsetof(ucontext_t, uc_mcontext)); -ASSYM(SIG_BLOCK, SIG_BLOCK); -ASSYM(SIG_SETMASK, SIG_SETMASK); -ASSYM(MC_LEN, offsetof(mcontext_t, mc_len)); -ASSYM(SIZEOF_MCONTEXT_T, sizeof(mcontext_t)); diff --git a/lib/libc/i386/sys/brk.S b/lib/libc/i386/sys/brk.S deleted file mode 100644 index e7113b8208..0000000000 --- a/lib/libc/i386/sys/brk.S +++ /dev/null @@ -1,88 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/brk.S,v 1.7 1999/08/27 23:59:38 peter Exp $ - */ - -#include "SYS.h" - - .globl HIDENAME(curbrk) - .globl HIDENAME(minbrk) -ENTRY(_brk) - jmp ok -END(_brk) - -ENTRY(brk) -#ifdef PIC - movl 4(%esp),%eax - PIC_PROLOGUE - movl PIC_GOT(HIDENAME(curbrk)),%edx # set up GOT addressing - movl PIC_GOT(HIDENAME(minbrk)),%ecx # - PIC_EPILOGUE - cmpl %eax,(%ecx) - jbe ok - movl (%ecx),%eax - movl %eax,4(%esp) -ok: - lea SYS_break,%eax - KERNCALL - jb err - movl 4(%esp),%eax - movl %eax,(%edx) - movl $0,%eax - ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) - -#else - - movl 4(%esp),%eax - cmpl %eax,HIDENAME(minbrk) - jbe ok - movl HIDENAME(minbrk),%eax - movl %eax,4(%esp) -ok: - lea SYS_break,%eax - KERNCALL - jb err - movl 4(%esp),%eax - movl %eax,HIDENAME(curbrk) - movl $0,%eax - ret -err: - jmp HIDENAME(cerror) -#endif -END(brk) diff --git a/lib/libc/i386/sys/cerror.S b/lib/libc/i386/sys/cerror.S deleted file mode 100644 index ec892bdf49..0000000000 --- a/lib/libc/i386/sys/cerror.S +++ /dev/null @@ -1,120 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/cerror.S,v 1.10 1999/08/27 23:59:38 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/cerror.S,v 1.6 2008/01/19 13:30:51 corecode Exp $ - */ - -#include "SYS.h" - - .globl HIDENAME(cerror) - -#if 0 /* POSSIBLE FUTURE */ - -HIDENAME(cerror): -#ifdef PIC - /* The caller must execute the PIC prologue before jumping to cerror. */ -#ifdef __thread - movl PIC_GOT(CNAME(errno)),%edx -#else - movl %gs:12,%edx -#endif - movl %eax,(%edx) - PIC_EPILOGUE -#else - -#ifdef __thread - movl %eax, errno -#else - movl %gs:12, %edx - movl %eax,(%edx) -#endif - -#endif - movl $-1,%eax - movl $-1,%edx - ret - -#endif /* #if 0 */ - -HIDENAME(cerror): -#ifdef PIC - /* The caller must execute the PIC prologue before jumping to cerror. */ -#ifdef __thread - movl PIC_GOT(CNAME(errno)),%ecx - movl %eax,(%ecx) -#else - pushl %eax - leal errno@TLSGD(,%ebx,1), %eax - call ___tls_get_addr@PLT - popl %ecx - movl %ecx, (%eax) -#endif - PIC_EPILOGUE -#else -#ifdef __thread - movl %eax, errno -#else - movl %gs:0,%ecx - movl %eax,errno@NTPOFF(%ecx) -#endif -#endif - movl $-1,%eax - movl $-1,%edx - ret - -#if !defined(PIC) && !defined(__thread) - /* - * Return the direct TLS offset for errno. TLS non-PIC version - * of libc only (i.e. statically linked programs). - */ - .globl __get_errno_GS_offset -__get_errno_GS_offset: - movl errno@INDNTPOFF,%eax - ret -#endif - -#if defined(PIC) && !defined(__thread) - /* - * Return a pointer to the GOT table entry for errno. TLS PIC version - * of libc only (i.e. the dynamic libc). - */ - .globl __get_errno_GOT_ptr -__get_errno_GOT_ptr: - PIC_PROLOGUE - leal errno@TLSGD(,%ebx,1),%eax - PIC_EPILOGUE - ret -#endif diff --git a/lib/libc/i386/sys/exect.S b/lib/libc/i386/sys/exect.S deleted file mode 100644 index 3674ce6283..0000000000 --- a/lib/libc/i386/sys/exect.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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/exect.S,v 1.6 1999/08/27 23:59:38 peter Exp $ - */ - -#include "SYS.h" -#include - -ENTRY(exect) - lea SYS_execve,%eax - pushf - popl %edx - orl $ PSL_T,%edx - pushl %edx - popf - KERNCALL - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) /* exect(file, argv, env); */ -END(exect) diff --git a/lib/libc/i386/sys/fork.S b/lib/libc/i386/sys/fork.S deleted file mode 100644 index 9ac2eefad8..0000000000 --- a/lib/libc/i386/sys/fork.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/fork.S,v 1.8 1999/08/27 23:59:39 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/fork.S,v 1.4 2006/07/27 00:43:42 corecode Exp $ - */ - -#include "SYS.h" - -SYSCALL(fork) - cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */ - je 1f - movl $0,%eax -1: - ret /* pid = fork(); */ diff --git a/lib/libc/i386/sys/getcontext.S b/lib/libc/i386/sys/getcontext.S deleted file mode 100644 index 6b56160f5e..0000000000 --- a/lib/libc/i386/sys/getcontext.S +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2006 The DragonFly Project. All rights reserved. - * - * This code is derived from software contributed to The DragonFly Project - * by Matthew Dillon - * - * 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 DragonFly Project 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 COPYRIGHT HOLDERS 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 - * COPYRIGHT HOLDERS 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. - * - * $DragonFly: src/lib/libc/i386/sys/getcontext.S,v 1.2 2007/02/04 20:28:21 corecode Exp $ - */ - -#include -#include - - /* - * This function is special-cased because the context it saves - * includes a stale stack context (because it returns before the - * caller presumably makes the call to setcontext()). - */ - .weak getcontext - .set getcontext,_getcontext -ENTRY(_getcontext) - /* - * Retrieve the current signal mask and save it in &ucp->uc_sigmask. - */ - movl 4(%esp),%eax /* ucontext_t pointer */ - addl $UC_SIGMASK,%eax /* pointer to signal mask */ - PIC_PROLOGUE - pushl %eax - pushl $0 - pushl $SIG_BLOCK - call PIC_PLT(_sigprocmask) /* retrieve & save signal mask */ - addl $12,%esp - PIC_EPILOGUE - - /* - * Save what we need because our stack context is going stale. - */ - movl 4(%esp),%eax - movl %eax,%ecx /* save ucontext_t in %ecx */ - movl (%esp),%edx /* save return PC in %edx */ - addl $UC_MCONTEXT,%eax - pushl %eax - call get_mcontext /* returns non-zero on resume */ - addl $4,%esp - cmpl $0,%eax - je 2f - /* - * On resume, resave the stale return pc and restore the signal - * mask (signals are blocked right now from the setcontext call). - */ - movl %edx,(%esp) /* re-save the return PC */ - addl $UC_SIGMASK,%ecx - PIC_PROLOGUE - pushl $0 - pushl %ecx - pushl $SIG_SETMASK - call PIC_PLT(_sigprocmask) /* retrieve & save signal mask */ - addl $12,%esp - PIC_EPILOGUE -2: - movl $0,%eax /* return success */ - ret - -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) 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 cea34e412d..0000000000 --- a/lib/libc/i386/sys/i386_clr_watch.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2000 Brian S. Dean - * 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. - * - */ - -/* - * $FreeBSD: src/lib/libc/i386/sys/i386_clr_watch.c,v 1.1.2.1 2000/10/21 01:33:34 bsd Exp $ - * $DragonFly: src/lib/libc/i386/sys/i386_clr_watch.c,v 1.2 2003/06/17 04:26:43 dillon Exp $ - */ - - -#include -#include - - -int -i386_clr_watch(int watchnum, struct dbreg * d) -{ - - if (watchnum < 0 || watchnum >= 4) - return -1; - - d->dr7 = d->dr7 & ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); - DBREG_DRX(d,watchnum) = 0; - - return 0; -} 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 6024688fda..0000000000 --- a/lib/libc/i386/sys/i386_get_ioperm.2 +++ /dev/null @@ -1,82 +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. -.\" -.\" $FreeBSD: src/lib/libc/i386/sys/i386_get_ioperm.2,v 1.3.2.6 2001/12/14 18:33:54 ru Exp $ -.\" -.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 -.Fn i386_get_ioperm -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 -.Fn i386_set_ioperm -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 -.Fn i386_get_ioperm -and -.Fn i386_set_ioperm -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 -.Fn 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 52f4f2f77c..0000000000 --- a/lib/libc/i386/sys/i386_get_ioperm.c +++ /dev/null @@ -1,48 +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. - * - * $FreeBSD: src/lib/libc/i386/sys/i386_get_ioperm.c,v 1.4 1999/09/02 21:03:31 luoqi Exp $ - * $DragonFly: src/lib/libc/i386/sys/i386_get_ioperm.c,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include - -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, (char *)&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 82b0968724..0000000000 --- a/lib/libc/i386/sys/i386_get_ldt.2 +++ /dev/null @@ -1,97 +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 -.\" $FreeBSD: src/lib/libc/i386/sys/i386_get_ldt.2,v 1.6.2.7 2001/12/14 18:33:54 ru Exp $ -.\" $DragonFly: src/lib/libc/i386/sys/i386_get_ldt.2,v 1.5 2006/05/26 19:39:37 swildner Exp $ -.\" -.Dd September 20, 1993 -.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 -.Fn i386_get_ldt -will return the list of i386 descriptors that the process has in its -LDT. -.Fn i386_set_ldt -will set a list of i386 descriptors for the current process in its -LDT. -Both routines accept a starting selector number -.Fa start_sel , -an array of memory that -will contain the descriptors to be set or returned -.Fa descs , -and the number of entries to set or return -.Fa num_sels . -.Pp -The argument -.Fa descs -can be either segment_descriptor or gate_descriptor and are defined in -.In machine/segments.h . -These structures are defined by the architecture -as disjoint bit-fields, so care must be taken in constructing them. -.Sh RETURN VALUES -Upon successful completion, -.Fn i386_get_ldt -returns the number of descriptors currently in the LDT. -.Fn i386_set_ldt -returns the first selector set. -Otherwise, a value of -1 is returned and the global -variable -.Va errno -is set to indicate the error. -.Sh ERRORS -.Fn i386_get_ldt -and -.Fn i386_set_ldt -will fail if: -.Bl -tag -width Er -.It Bq Er EINVAL -An inappropriate parameter 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 6acd5de9b9..0000000000 --- a/lib/libc/i386/sys/i386_get_ldt.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - * - * $FreeBSD: src/lib/libc/i386/sys/i386_get_ldt.c,v 1.7 1999/09/02 21:03:31 luoqi Exp $ - */ - -#include -#include - -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, (char *)&p); -} 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 30d11bea1c..0000000000 --- a/lib/libc/i386/sys/i386_set_ioperm.c +++ /dev/null @@ -1,42 +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. - * - * $FreeBSD: src/lib/libc/i386/sys/i386_set_ioperm.c,v 1.4 1999/09/02 21:03:32 luoqi Exp $ - * $DragonFly: src/lib/libc/i386/sys/i386_set_ioperm.c,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include - -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, (char *)&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 acd3c241e0..0000000000 --- a/lib/libc/i386/sys/i386_set_ldt.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - * - * $FreeBSD: src/lib/libc/i386/sys/i386_set_ldt.c,v 1.7 1999/09/02 21:03:32 luoqi Exp $ - */ - -#include -#include - -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, (char *)&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 961050d295..0000000000 --- a/lib/libc/i386/sys/i386_set_watch.3 +++ /dev/null @@ -1,103 +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. -.\" -.\" $FreeBSD: src/lib/libc/i386/sys/i386_set_watch.3,v 1.1.2.4 2002/12/29 16:35:34 schweikh Exp $ -.\" -.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 -.Fn i386_clr_watch -will disable the indicated watch point within the specified debug -register set. -.Pp -.Fn i386_set_watch -will set up the specified debug registers as indicated by the -parameters. 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. -.Fa Watchaddr -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 -.Fn i386_clr_watch -returns 0 on success, or -1 if -.Fa watchnum -is invalid (not in the range of 0-3). -.Pp -.Fn i386_set_watch -will return the -.Fa watchnum -argument, or the watchnum actually used in the case that -.Fa watchnum -is -1 on success. On error, -.Fn i386_set_watch -will return -1 indicating that the watchpoint could not be set up -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 3ffbee5c1a..0000000000 --- a/lib/libc/i386/sys/i386_set_watch.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2000 Brian S. Dean - * 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. - * - */ - -/* - * $FreeBSD: src/lib/libc/i386/sys/i386_set_watch.c,v 1.1.2.1 2000/10/21 01:33:34 bsd Exp $ - * $DragonFly: src/lib/libc/i386/sys/i386_set_watch.c,v 1.2 2003/06/17 04:26:43 dillon Exp $ - */ - - -#include -#include - - -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 ((d->dr7 & 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 */ - d->dr7 &= ~((0x3 << (watchnum*2)) | (0x0f << (watchnum*4+16))); - - /* set drN register to the address, N=watchnum */ - DBREG_DRX(d,watchnum) = watchaddr; - - /* enable the watchpoint */ - d->dr7 |= (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 391de0b583..0000000000 --- a/lib/libc/i386/sys/i386_vm86.2 +++ /dev/null @@ -1,93 +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. -.\" -.\" $FreeBSD: src/lib/libc/i386/sys/i386_vm86.2,v 1.3.2.6 2001/12/14 18:33:54 ru Exp $ -.\" -.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 -.Fn i386_vm86 -is used to call various vm86 related functions. -.Fa function -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. -.Fa data -points to the following structure: -.Bd -literal -struct vm86_init_args { - int debug; - int cpu_type; - u_char int_map[32]; -}; -.Ed -.Pp -.Fa debug -is used to turn on debugging code. -.Fa cpu_type -controls the type of CPU being emulated, and is currently unimplemented. -.Fa int_map -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_SET_VME -.\" .It Dv VM86_GET_VME -.\" .It Dv VM86_INTCALL -.El -.Pp -vm86 mode is entered by calling -.Xr sigreturn 2 -with the correct machine context for vm86, and with the -.Em PSL_VM -bit set. Control returns to the process upon delivery of a signal. -.Sh RETURN VALUES -.Rv -std i386_vm86 -.Sh ERRORS -.Fn i386_vm86 -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 -This man page was written by -.An Jonathan Lemon . diff --git a/lib/libc/i386/sys/i386_vm86.c b/lib/libc/i386/sys/i386_vm86.c deleted file mode 100644 index 48725e7126..0000000000 --- a/lib/libc/i386/sys/i386_vm86.c +++ /dev/null @@ -1,41 +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. - * - * $FreeBSD: src/lib/libc/i386/sys/i386_vm86.c,v 1.3 1999/09/02 21:03:32 luoqi Exp $ - * $DragonFly: src/lib/libc/i386/sys/i386_vm86.c,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include - -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, (void *)&p)); -} diff --git a/lib/libc/i386/sys/pipe.S b/lib/libc/i386/sys/pipe.S deleted file mode 100644 index 5acc566703..0000000000 --- a/lib/libc/i386/sys/pipe.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/pipe.S,v 1.8 1999/08/27 23:59:42 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/pipe.S,v 1.4 2006/07/27 00:43:42 corecode Exp $ - */ - -#include "SYS.h" - -SYSCALL(pipe) - movl 4(%esp),%ecx - movl %eax,(%ecx) - movl %edx,4(%ecx) - movl $0,%eax - ret diff --git a/lib/libc/i386/sys/ptrace.S b/lib/libc/i386/sys/ptrace.S deleted file mode 100644 index 214a348f52..0000000000 --- a/lib/libc/i386/sys/ptrace.S +++ /dev/null @@ -1,71 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/ptrace.S,v 1.6 1999/08/27 23:59:43 peter Exp $ - */ - -#include "SYS.h" - -ENTRY(ptrace) - xorl %eax,%eax -#ifdef PIC - PIC_PROLOGUE -# ifdef __thread - movl PIC_GOT(CNAME(errno)), %ecx -# else - pushl %eax - leal errno@TLSGD(,%ebx,1), %eax - call ___tls_get_addr@PLT - movl %eax, %ecx - popl %eax -# endif - movl %eax, (%ecx) - PIC_EPILOGUE -#else -# ifdef __thread - movl %eax, errno -# else - movl %gs:0, %ecx - movl %eax, errno@NTPOFF(%ecx) -# endif -#endif - lea SYS_ptrace,%eax - KERNCALL - jb err - ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) -END(ptrace) diff --git a/lib/libc/i386/sys/reboot.S b/lib/libc/i386/sys/reboot.S deleted file mode 100644 index 9c0d766d13..0000000000 --- a/lib/libc/i386/sys/reboot.S +++ /dev/null @@ -1,43 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/reboot.S,v 1.5 1999/08/27 23:59:43 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/reboot.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "SYS.h" - -SYSCALL(reboot) - iret diff --git a/lib/libc/i386/sys/rfork.S b/lib/libc/i386/sys/rfork.S deleted file mode 100644 index 26a400ea12..0000000000 --- a/lib/libc/i386/sys/rfork.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/rfork.S,v 1.6 1999/08/27 23:59:43 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/rfork.S,v 1.4 2006/07/27 00:43:42 corecode Exp $ - */ - -#include "SYS.h" - -SYSCALL(rfork) - cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */ - je 1f - movl $0,%eax -1: - ret /* pid = rfork(); */ diff --git a/lib/libc/i386/sys/sbrk.S b/lib/libc/i386/sys/sbrk.S deleted file mode 100644 index 0382172e1b..0000000000 --- a/lib/libc/i386/sys/sbrk.S +++ /dev/null @@ -1,87 +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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/sbrk.S,v 1.7.2.2 2002/08/22 20:21:17 kan Exp $ - */ - -#include "SYS.h" - - .globl CNAME(_end) - .globl HIDENAME(minbrk) - .globl HIDENAME(curbrk) - - .data -HIDENAME(minbrk): .long CNAME(_end) -HIDENAME(curbrk): .long CNAME(_end) - .text - -ENTRY(sbrk) -#ifdef PIC - movl 4(%esp),%ecx - PIC_PROLOGUE - movl PIC_GOT(HIDENAME(curbrk)),%edx - movl (%edx),%eax - PIC_EPILOGUE - testl %ecx,%ecx - jz back - addl %eax,4(%esp) - lea SYS_break,%eax - KERNCALL - jb err - PIC_PROLOGUE - movl PIC_GOT(HIDENAME(curbrk)),%edx - movl (%edx),%eax - addl %ecx,(%edx) - PIC_EPILOGUE -back: - ret -err: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) - -#else /* !PIC */ - - movl 4(%esp),%ecx - movl HIDENAME(curbrk),%eax - testl %ecx,%ecx - jz back - addl %eax,4(%esp) - lea SYS_break,%eax - KERNCALL - jb err - movl HIDENAME(curbrk),%eax - addl %ecx,HIDENAME(curbrk) -back: - ret -err: - jmp HIDENAME(cerror) -#endif /* PIC */ -END(sbrk) diff --git a/lib/libc/i386/sys/setlogin.S b/lib/libc/i386/sys/setlogin.S deleted file mode 100644 index 3c520f9e65..0000000000 --- a/lib/libc/i386/sys/setlogin.S +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * Copyright (c) 1991 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/setlogin.S,v 1.6 1999/08/27 23:59:44 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/setlogin.S,v 1.4 2005/01/31 22:29:27 dillon Exp $ - */ - -#include "SYS.h" - -.globl CNAME(_logname_valid) /* in _getlogin() */ - -SYSCALL(setlogin) -#ifdef PIC - PIC_PROLOGUE - pushl %eax - movl PIC_GOT(CNAME(_logname_valid)),%eax - movl $0,(%eax) - popl %eax - PIC_EPILOGUE -#else - movl $0,CNAME(_logname_valid) -#endif - ret /* setlogin(name) */ diff --git a/lib/libc/i386/sys/sigreturn.S b/lib/libc/i386/sys/sigreturn.S deleted file mode 100644 index 70dbbe5340..0000000000 --- a/lib/libc/i386/sys/sigreturn.S +++ /dev/null @@ -1,47 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/sigreturn.S,v 1.8.2.1 2001/10/19 18:23:33 ru Exp $ - * $DragonFly: src/lib/libc/i386/sys/sigreturn.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "SYS.h" - -/* - * NOTE: If the profiling ENTRY() code ever changes any registers, they - * must be saved. On FreeBSD, this is not the case. - */ - -RSYSCALL(sigreturn) diff --git a/lib/libc/i386/sys/syscall.S b/lib/libc/i386/sys/syscall.S deleted file mode 100644 index 3f983bc1aa..0000000000 --- a/lib/libc/i386/sys/syscall.S +++ /dev/null @@ -1,53 +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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/i386/sys/syscall.S,v 1.6 1999/08/27 23:59:46 peter Exp $ - * $DragonFly: src/lib/libc/i386/sys/syscall.S,v 1.3 2003/12/06 03:11:36 drhodus Exp $ - */ - -#include "SYS.h" - -ENTRY(syscall) - pop %ecx /* rta */ - pop %eax /* syscall number */ - push %ecx - KERNCALL - push %ecx /* need to push a word to keep stack frame intact - upon return; the word must be the return address. */ - jb 1f - ret -1: - PIC_PROLOGUE - jmp PIC_PLT(HIDENAME(cerror)) diff --git a/lib/libc/quad/Makefile.inc b/lib/libc/quad/Makefile.inc index f3463fe0ee..4eb7ff730a 100644 --- a/lib/libc/quad/Makefile.inc +++ b/lib/libc/quad/Makefile.inc @@ -6,16 +6,8 @@ CMAPS+= ${.CURDIR}/quad/Symbol.map # Quad support, if needed .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/quad ${.CURDIR}/../libc/quad -.if ${MACHINE_ARCH} == "i386" - -SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c - -.else - SRCS+= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c fixdfdi.c \ fixsfdi.c fixunsdfdi.c fixunssfdi.c floatdidf.c floatdisf.c \ floatunsdidf.c iordi3.c lshldi3.c lshrdi3.c moddi3.c muldi3.c \ negdi2.c notdi2.c qdivrem.c subdi3.c ucmpdi2.c udivdi3.c umoddi3.c \ xordi3.c - -.endif diff --git a/lib/libc/sys/ptrace.2 b/lib/libc/sys/ptrace.2 index b240bcc1f3..e53d0f491e 100644 --- a/lib/libc/sys/ptrace.2 +++ b/lib/libc/sys/ptrace.2 @@ -1,9 +1,8 @@ .\" $FreeBSD: src/lib/libc/sys/ptrace.2,v 1.12.2.12 2001/12/14 18:34:01 ru Exp $ -.\" $DragonFly: src/lib/libc/sys/ptrace.2,v 1.4 2006/05/26 19:39:37 swildner Exp $ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd January 18, 2015 +.Dd June 22, 2015 .Dt PTRACE 2 .Os .Sh NAME @@ -165,8 +164,8 @@ succeeds, the traced process is no longer traced and continues execution normally. .El .Pp -Additionally, machine-specific requests can exist. On the i386, these -are: +Additionally, machine-specific requests can exist. +On x86_64, these are: .Bl -tag -width 12n .It Dv PT_GETREGS This request reads the traced process' machine registers into the @@ -311,9 +310,7 @@ above. .Xr execve 2 , .Xr sigaction 2 , .Xr wait 2 , -.Xr execv 3 , -.Xr i386_clr_watch 3 , -.Xr i386_set_watch 3 +.Xr execv 3 .Sh HISTORY A .Fn ptrace diff --git a/lib/libc/sys/sysarch.2 b/lib/libc/sys/sysarch.2 index 95f0371a49..e5e26294b5 100644 --- a/lib/libc/sys/sysarch.2 +++ b/lib/libc/sys/sysarch.2 @@ -1,6 +1,5 @@ .\" $NetBSD: sysarch.2,v 1.6 1998/02/25 21:24:57 perry Exp $ .\" $FreeBSD: src/lib/libc/sys/sysarch.2,v 1.2.2.3 2001/12/14 18:34:01 ru Exp $ -.\" $DragonFly: src/lib/libc/sys/sysarch.2,v 1.3 2006/05/26 19:39:37 swildner Exp $ .\" .\" Copyright (c) 1980, 1991 Regents of the University of California. .\" All rights reserved. @@ -31,7 +30,7 @@ .\" .\" from: @(#)syscall.2 6.3 (Berkeley) 3/10/91 .\" -.Dd October 11, 1993 +.Dd June 22, 2015 .Dt SYSARCH 2 .Os .Sh NAME @@ -65,13 +64,17 @@ system call should never be called directly by user programs. Instead, they should access its functions using the architecture-dependent library. +.Sh IMPLEMENTATION NOTES +For the +.Va x86_64 +architecture, no architecture-dependent functions are defined. .Sh RETURN VALUES See the manual pages for specific architecture-dependent function calls for information about their return values. -.Sh SEE ALSO -.Xr i386_get_ioperm 2 , -.Xr i386_get_ldt 2 , -.Xr i386_vm86 2 +.\".Sh SEE ALSO +.\".Xr i386_get_ioperm 2 , +.\".Xr i386_get_ldt 2 , +.\".Xr i386_vm86 2 .Sh HISTORY This manual page was taken from .Nx . -- 2.41.0