diff options
author | peter <peter@FreeBSD.org> | 2003-08-23 00:04:53 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2003-08-23 00:04:53 +0000 |
commit | e95056563d2bcbc252ee29d8943f0ee4ec1bcb12 (patch) | |
tree | e282cb6144832deed8d7ba5ecda29428a66c4c97 /sys/amd64 | |
parent | e1826522f93a95e2a88e9477fa873a073d8168be (diff) | |
download | FreeBSD-src-e95056563d2bcbc252ee29d8943f0ee4ec1bcb12.zip FreeBSD-src-e95056563d2bcbc252ee29d8943f0ee4ec1bcb12.tar.gz |
Switch to using the emulator in the common compat area.
Still work-in-progress.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/ia32/Makefile | 16 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32.h | 103 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_genassym.c | 25 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_misc.c | 1437 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_proto.h | 302 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_signal.c | 26 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_signal.h | 164 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_syscall.c | 4 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_syscall.h | 298 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_syscalls.c | 447 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_sysent.c | 465 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_sysvec.c | 283 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_util.h | 89 | ||||
-rw-r--r-- | sys/amd64/ia32/syscalls.conf | 12 | ||||
-rw-r--r-- | sys/amd64/ia32/syscalls.master | 613 |
15 files changed, 15 insertions, 4269 deletions
diff --git a/sys/amd64/ia32/Makefile b/sys/amd64/ia32/Makefile deleted file mode 100644 index 22b5821..0000000 --- a/sys/amd64/ia32/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Makefile for syscall tables -# -# $FreeBSD$ - -all: - @echo "make sysent only" - -sysent: ia32_sysent.c ia32_syscall.h ia32_proto.h - -ia32_sysent.c ia32_syscalls.c ia32_syscall.h ia32_proto.h: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - -mv -f ia32_sysent.c ia32_sysent.c.bak - -mv -f ia32_syscalls.c ia32_syscalls.c.bak - -mv -f ia32_syscall.h ia32_syscall.h.bak - -mv -f ia32_proto.h ia32_proto.h.bak - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf diff --git a/sys/amd64/ia32/ia32.h b/sys/amd64/ia32/ia32.h deleted file mode 100644 index 943b24c..0000000 --- a/sys/amd64/ia32/ia32.h +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * Copyright (c) 2001 Doug Rabson - * 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$ - */ - -#ifndef _IA64_IA32_IA32_H_ -#define _IA64_IA32_IA32_H_ - -#define PTRIN(v) (void *)(uintptr_t) (v) -#define PTROUT(v) (u_int32_t)(uintptr_t) (v) - -#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) -#define PTRIN_CP(src,dst,fld) \ - do { (dst).fld = PTRIN((src).fld); } while (0) -#define PTROUT_CP(src,dst,fld) \ - do { (dst).fld = PTROUT((src).fld); } while (0) - -struct timeval32 { - int32_t tv_sec; - int32_t tv_usec; -}; -#define TV_CP(src,dst,fld) do { \ - CP((src).fld,(dst).fld,tv_sec); \ - CP((src).fld,(dst).fld,tv_usec); \ -} while (0); - -struct timespec32 { - u_int32_t tv_sec; - u_int32_t tv_nsec; -}; -#define TS_CP(src,dst,fld) do { \ - CP((src).fld,(dst).fld,tv_sec); \ - CP((src).fld,(dst).fld,tv_nsec); \ -} while (0); - -struct rusage32 { - struct timeval32 ru_utime; - struct timeval32 ru_stime; - int32_t ru_maxrss; - int32_t ru_ixrss; - int32_t ru_idrss; - int32_t ru_isrss; - int32_t ru_minflt; - int32_t ru_majflt; - int32_t ru_nswap; - int32_t ru_inblock; - int32_t ru_oublock; - int32_t ru_msgsnd; - int32_t ru_msgrcv; - int32_t ru_nsignals; - int32_t ru_nvcsw; - int32_t ru_nivcsw; -}; - -struct statfs32 { - int32_t f_spare2; - int32_t f_bsize; - int32_t f_iosize; - int32_t f_blocks; - int32_t f_bfree; - int32_t f_bavail; - int32_t f_files; - int32_t f_ffree; - fsid_t f_fsid; - uid_t f_owner; - int32_t f_type; - int32_t f_flags; - int32_t f_syncwrites; - int32_t f_asyncwrites; - char f_fstypename[MFSNAMELEN]; - char f_mntonname[MNAMELEN]; - int32_t f_syncreads; - int32_t f_asyncreads; - int16_t f_spares1; - char f_mntfromname[MNAMELEN]; - int16_t f_spares2; - int32_t f_spare[2]; -}; - -#endif /* !_IA64_IA32_IA32_H_ */ diff --git a/sys/amd64/ia32/ia32_genassym.c b/sys/amd64/ia32/ia32_genassym.c deleted file mode 100644 index d356714..0000000 --- a/sys/amd64/ia32/ia32_genassym.c +++ /dev/null @@ -1,25 +0,0 @@ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_compat.h" - -#include <sys/param.h> -#include <sys/assym.h> -#include <sys/systm.h> -#include <sys/signal.h> - -#include <amd64/ia32/ia32_signal.h> - -ASSYM(IA32_SIGF_HANDLER, offsetof(struct ia32_sigframe, sf_ah)); -ASSYM(IA32_SIGF_UC, offsetof(struct ia32_sigframe, sf_uc)); -ASSYM(IA32_UC_GS, offsetof(struct ia32_ucontext, uc_mcontext.mc_gs)); -ASSYM(IA32_UC_FS, offsetof(struct ia32_ucontext, uc_mcontext.mc_fs)); -ASSYM(IA32_UC_ES, offsetof(struct ia32_ucontext, uc_mcontext.mc_es)); -ASSYM(IA32_UC_DS, offsetof(struct ia32_ucontext, uc_mcontext.mc_ds)); -#ifdef COMPAT_FREEBSD4 -ASSYM(IA32_SIGF_UC4, offsetof(struct ia32_sigframe, sf_uc)); -ASSYM(IA32_UC4_GS, offsetof(struct ia32_ucontext4, uc_mcontext.mc_gs)); -ASSYM(IA32_UC4_FS, offsetof(struct ia32_ucontext4, uc_mcontext.mc_fs)); -ASSYM(IA32_UC4_ES, offsetof(struct ia32_ucontext4, uc_mcontext.mc_es)); -ASSYM(IA32_UC4_DS, offsetof(struct ia32_ucontext4, uc_mcontext.mc_ds)); -#endif diff --git a/sys/amd64/ia32/ia32_misc.c b/sys/amd64/ia32/ia32_misc.c deleted file mode 100644 index a38be87..0000000 --- a/sys/amd64/ia32/ia32_misc.c +++ /dev/null @@ -1,1437 +0,0 @@ -/*- - * Copyright (c) 2002 Doug Rabson - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_compat.h" - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/bus.h> -#include <sys/exec.h> -#include <sys/fcntl.h> -#include <sys/filedesc.h> -#include <sys/imgact.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/malloc.h> -#include <sys/file.h> /* Must come after sys/malloc.h */ -#include <sys/mman.h> -#include <sys/module.h> -#include <sys/mount.h> -#include <sys/mutex.h> -#include <sys/namei.h> -#include <sys/param.h> -#include <sys/proc.h> -#include <sys/reboot.h> -#include <sys/resource.h> -#include <sys/resourcevar.h> -#include <sys/selinfo.h> -#include <sys/pipe.h> /* Must come after sys/selinfo.h */ -#include <sys/signal.h> -#include <sys/signalvar.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/stat.h> -#include <sys/syscallsubr.h> -#include <sys/sysctl.h> -#include <sys/sysent.h> -#include <sys/sysproto.h> -#include <sys/systm.h> -#include <sys/unistd.h> -#include <sys/user.h> -#include <sys/utsname.h> -#include <sys/vnode.h> - -#include <vm/vm.h> -#include <vm/vm_kern.h> -#include <vm/vm_param.h> -#include <vm/pmap.h> -#include <vm/vm_map.h> -#include <vm/vm_object.h> -#include <vm/vm_extern.h> - -#include <amd64/ia32/ia32_util.h> -#include <amd64/ia32/ia32.h> -#include <amd64/ia32/ia32_proto.h> - -static const char ia32_emul_path[] = "/compat/ia32"; -/* - * [ taken from the linux emulator ] - * Search an alternate path before passing pathname arguments on - * to system calls. Useful for keeping a separate 'emulation tree'. - * - * If cflag is set, we check if an attempt can be made to create - * the named file, i.e. we check if the directory it should - * be in exists. - */ -int -ia32_emul_find(td, sgp, prefix, path, pbuf, cflag) - struct thread *td; - caddr_t *sgp; /* Pointer to stackgap memory */ - const char *prefix; - char *path; - char **pbuf; - int cflag; -{ - int error; - size_t len, sz; - char *buf, *cp, *ptr; - struct ucred *ucred; - struct nameidata nd; - struct nameidata ndroot; - struct vattr vat; - struct vattr vatroot; - - buf = (char *) malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - *pbuf = path; - - for (ptr = buf; (*ptr = *prefix) != '\0'; ptr++, prefix++) - continue; - - sz = MAXPATHLEN - (ptr - buf); - - /* - * If sgp is not given then the path is already in kernel space - */ - if (sgp == NULL) - error = copystr(path, ptr, sz, &len); - else - error = copyinstr(path, ptr, sz, &len); - - if (error) { - free(buf, M_TEMP); - return error; - } - - if (*ptr != '/') { - free(buf, M_TEMP); - return EINVAL; - } - - /* - * We know that there is a / somewhere in this pathname. - * Search backwards for it, to find the file's parent dir - * to see if it exists in the alternate tree. If it does, - * and we want to create a file (cflag is set). We don't - * need to worry about the root comparison in this case. - */ - - if (cflag) { - for (cp = &ptr[len] - 1; *cp != '/'; cp--) - ; - *cp = '\0'; - - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); - - if ((error = namei(&nd)) != 0) { - free(buf, M_TEMP); - return error; - } - - *cp = '/'; - } else { - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); - - if ((error = namei(&nd)) != 0) { - free(buf, M_TEMP); - return error; - } - - /* - * We now compare the vnode of the ia32_root to the one - * vnode asked. If they resolve to be the same, then we - * ignore the match so that the real root gets used. - * This avoids the problem of traversing "../.." to find the - * root directory and never finding it, because "/" resolves - * to the emulation root directory. This is expensive :-( - */ - NDINIT(&ndroot, LOOKUP, FOLLOW, UIO_SYSSPACE, ia32_emul_path, - td); - - if ((error = namei(&ndroot)) != 0) { - /* Cannot happen! */ - free(buf, M_TEMP); - vrele(nd.ni_vp); - return error; - } - - ucred = td->td_ucred; - if ((error = VOP_GETATTR(nd.ni_vp, &vat, ucred, td)) != 0) { - goto bad; - } - - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, ucred, - td)) != 0) { - goto bad; - } - - if (vat.va_fsid == vatroot.va_fsid && - vat.va_fileid == vatroot.va_fileid) { - error = ENOENT; - goto bad; - } - - } - if (sgp == NULL) - *pbuf = buf; - else { - sz = &ptr[len] - buf; - *pbuf = stackgap_alloc(sgp, sz + 1); - error = copyout(buf, *pbuf, sz); - free(buf, M_TEMP); - } - - vrele(nd.ni_vp); - if (!cflag) - vrele(ndroot.ni_vp); - - return error; - -bad: - vrele(ndroot.ni_vp); - vrele(nd.ni_vp); - free(buf, M_TEMP); - return error; -} - -int -ia32_open(struct thread *td, struct ia32_open_args *uap) -{ - caddr_t sg; - - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, uap->path); - - return open(td, (struct open_args *) uap); -} - -int -ia32_wait4(struct thread *td, struct ia32_wait4_args *uap) -{ - int error; - caddr_t sg; - struct rusage32 *rusage32, ru32; - struct rusage *rusage = NULL, ru; - - rusage32 = uap->rusage; - if (rusage32) { - sg = stackgap_init(); - rusage = stackgap_alloc(&sg, sizeof(struct rusage)); - uap->rusage = (struct rusage32 *)rusage; - } - error = wait4(td, (struct wait_args *)uap); - if (error) - return (error); - if (rusage32 && (error = copyin(rusage, &ru, sizeof(ru)) == 0)) { - TV_CP(ru, ru32, ru_utime); - TV_CP(ru, ru32, ru_stime); - CP(ru, ru32, ru_maxrss); - CP(ru, ru32, ru_ixrss); - CP(ru, ru32, ru_idrss); - CP(ru, ru32, ru_isrss); - CP(ru, ru32, ru_minflt); - CP(ru, ru32, ru_majflt); - CP(ru, ru32, ru_nswap); - CP(ru, ru32, ru_inblock); - CP(ru, ru32, ru_oublock); - CP(ru, ru32, ru_msgsnd); - CP(ru, ru32, ru_msgrcv); - CP(ru, ru32, ru_nsignals); - CP(ru, ru32, ru_nvcsw); - CP(ru, ru32, ru_nivcsw); - error = copyout(&ru32, rusage32, sizeof(ru32)); - } - return (error); -} - -static void -copy_statfs(struct statfs *in, struct statfs32 *out) -{ - CP(*in, *out, f_bsize); - CP(*in, *out, f_iosize); - CP(*in, *out, f_blocks); - CP(*in, *out, f_bfree); - CP(*in, *out, f_bavail); - CP(*in, *out, f_files); - CP(*in, *out, f_ffree); - CP(*in, *out, f_fsid); - CP(*in, *out, f_owner); - CP(*in, *out, f_type); - CP(*in, *out, f_flags); - CP(*in, *out, f_flags); - CP(*in, *out, f_syncwrites); - CP(*in, *out, f_asyncwrites); - bcopy(in->f_fstypename, - out->f_fstypename, MFSNAMELEN); - bcopy(in->f_mntonname, - out->f_mntonname, MNAMELEN); - CP(*in, *out, f_syncreads); - CP(*in, *out, f_asyncreads); - bcopy(in->f_mntfromname, - out->f_mntfromname, MNAMELEN); -} - -int -ia32_getfsstat(struct thread *td, struct ia32_getfsstat_args *uap) -{ - int error; - caddr_t sg; - struct statfs32 *sp32, stat32; - struct statfs *sp = NULL, stat; - int maxcount, count, i; - - sp32 = uap->buf; - maxcount = uap->bufsize / sizeof(struct statfs32); - - if (sp32) { - sg = stackgap_init(); - sp = stackgap_alloc(&sg, sizeof(struct statfs) * maxcount); - uap->buf = (struct statfs32 *)sp; - } - error = getfsstat(td, (struct getfsstat_args *) uap); - if (sp32 && !error) { - count = td->td_retval[0]; - for (i = 0; i < count; i++) { - error = copyin(&sp[i], &stat, sizeof(stat)); - if (error) - return (error); - copy_statfs(&stat, &stat32); - error = copyout(&stat32, &sp32[i], sizeof(stat32)); - if (error) - return (error); - } - } - return (error); -} - -int -ia32_access(struct thread *td, struct ia32_access_args *uap) -{ - caddr_t sg; - - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, uap->path); - - return access(td, (struct access_args *)uap); -} - -int -ia32_chflags(struct thread *td, struct ia32_chflags_args *uap) -{ - caddr_t sg; - - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, uap->path); - - return chflags(td, (struct chflags_args *)uap); -} - -struct sigaltstack32 { - u_int32_t ss_sp; - u_int32_t ss_size; - int ss_flags; -}; - -int -ia32_sigaltstack(struct thread *td, struct ia32_sigaltstack_args *uap) -{ - struct sigaltstack32 s32; - struct sigaltstack ss, oss, *ssp; - int error; - - if (uap->ss != NULL) { - error = copyin(uap->ss, &s32, sizeof(s32)); - if (error) - return (error); - PTRIN_CP(s32, ss, ss_sp); - CP(s32, ss, ss_size); - CP(s32, ss, ss_flags); - ssp = &ss; - } else - ssp = NULL; - error = kern_sigaltstack(td, ssp, &oss); - if (error == 0 && uap->oss != NULL) { - PTROUT_CP(oss, s32, ss_sp); - CP(oss, s32, ss_size); - CP(oss, s32, ss_flags); - error = copyout(&s32, uap->oss, sizeof(s32)); - } - return (error); -} - -int -ia32_execve(struct thread *td, struct ia32_execve_args *uap) -{ - int error; - caddr_t sg; - struct execve_args ap; - u_int32_t *p32, arg; - char **p; - int count; - - sg = stackgap_init(); - CHECKALTEXIST(td, &sg, uap->fname); - ap.fname = uap->fname; - - if (uap->argv) { - count = 0; - p32 = uap->argv; - do { - error = copyin(p32++, &arg, sizeof(arg)); - if (error) - return error; - count++; - } while (arg != 0); - p = stackgap_alloc(&sg, count * sizeof(char *)); - ap.argv = p; - p32 = uap->argv; - do { - error = copyin(p32++, &arg, sizeof(arg)); - if (error) - return error; - *p++ = PTRIN(arg); - } while (arg != 0); - } - if (uap->envv) { - count = 0; - p32 = uap->envv; - do { - error = copyin(p32++, &arg, sizeof(arg)); - if (error) - return error; - count++; - } while (arg != 0); - p = stackgap_alloc(&sg, count * sizeof(char *)); - ap.envv = p; - p32 = uap->envv; - do { - error = copyin(p32++, &arg, sizeof(arg)); - if (error) - return error; - *p++ = PTRIN(arg); - } while (arg != 0); - } - - return execve(td, &ap); -} - -#ifdef __ia64__ -static int -ia32_mmap_partial(struct thread *td, vm_offset_t start, vm_offset_t end, - int prot, int fd, off_t pos) -{ - vm_map_t map; - vm_map_entry_t entry; - int rv; - - map = &td->td_proc->p_vmspace->vm_map; - if (fd != -1) - prot |= VM_PROT_WRITE; - - if (vm_map_lookup_entry(map, start, &entry)) { - if ((entry->protection & prot) != prot) { - rv = vm_map_protect(map, - trunc_page(start), - round_page(end), - entry->protection | prot, - FALSE); - if (rv != KERN_SUCCESS) - return (EINVAL); - } - } else { - vm_offset_t addr = trunc_page(start); - rv = vm_map_find(map, 0, 0, - &addr, PAGE_SIZE, FALSE, prot, - VM_PROT_ALL, 0); - if (rv != KERN_SUCCESS) - return (EINVAL); - } - - if (fd != -1) { - struct pread_args r; - r.fd = fd; - r.buf = (void *) start; - r.nbyte = end - start; - r.offset = pos; - return (pread(td, &r)); - } else { - while (start < end) { - subyte((void *) start, 0); - start++; - } - return (0); - } -} -#endif - -int -ia32_mmap(struct thread *td, struct ia32_mmap_args *uap) -{ - struct mmap_args ap; - vm_offset_t addr = (vm_offset_t) uap->addr; - vm_size_t len = uap->len; - int prot = uap->prot; - int flags = uap->flags; - int fd = uap->fd; - off_t pos = (uap->poslo - | ((off_t)uap->poshi << 32)); -#ifdef __ia64__ - vm_size_t pageoff; - int error; - - /* - * Attempt to handle page size hassles. - */ - pageoff = (pos & PAGE_MASK); - if (flags & MAP_FIXED) { - vm_offset_t start, end; - start = addr; - end = addr + len; - - if (start != trunc_page(start)) { - error = ia32_mmap_partial(td, start, round_page(start), - prot, fd, pos); - if (fd != -1) - pos += round_page(start) - start; - start = round_page(start); - } - if (end != round_page(end)) { - vm_offset_t t = trunc_page(end); - error = ia32_mmap_partial(td, t, end, - prot, fd, - pos + t - start); - end = trunc_page(end); - } - if (end > start && fd != -1 && (pos & PAGE_MASK)) { - /* - * We can't map this region at all. The specified - * address doesn't have the same alignment as the file - * position. Fake the mapping by simply reading the - * entire region into memory. First we need to make - * sure the region exists. - */ - vm_map_t map; - struct pread_args r; - int rv; - - prot |= VM_PROT_WRITE; - map = &td->td_proc->p_vmspace->vm_map; - rv = vm_map_remove(map, start, end); - if (rv != KERN_SUCCESS) - return (EINVAL); - rv = vm_map_find(map, 0, 0, - &start, end - start, FALSE, - prot, VM_PROT_ALL, 0); - if (rv != KERN_SUCCESS) - return (EINVAL); - r.fd = fd; - r.buf = (void *) start; - r.nbyte = end - start; - r.offset = pos; - error = pread(td, &r); - if (error) - return (error); - - td->td_retval[0] = addr; - return (0); - } - if (end == start) { - /* - * After dealing with the ragged ends, there - * might be none left. - */ - td->td_retval[0] = addr; - return (0); - } - addr = start; - len = end - start; - } -#endif - - ap.addr = (void *) addr; - ap.len = len; - ap.prot = prot; - ap.flags = flags; - ap.fd = fd; - ap.pos = pos; - - return (mmap(td, &ap)); -} - -struct itimerval32 { - struct timeval32 it_interval; - struct timeval32 it_value; -}; - -int -ia32_setitimer(struct thread *td, struct ia32_setitimer_args *uap) -{ - int error; - caddr_t sg; - struct itimerval32 *p32, *op32, s32; - struct itimerval *p = NULL, *op = NULL, s; - - p32 = uap->itv; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct itimerval)); - uap->itv = (struct itimerval32 *)p; - error = copyin(p32, &s32, sizeof(s32)); - if (error) - return (error); - TV_CP(s32, s, it_interval); - TV_CP(s32, s, it_value); - error = copyout(&s, p, sizeof(s)); - if (error) - return (error); - } - op32 = uap->oitv; - if (op32) { - sg = stackgap_init(); - op = stackgap_alloc(&sg, sizeof(struct itimerval)); - uap->oitv = (struct itimerval32 *)op; - } - error = setitimer(td, (struct setitimer_args *) uap); - if (error) - return (error); - if (op32) { - error = copyin(op, &s, sizeof(s)); - if (error) - return (error); - TV_CP(s, s32, it_interval); - TV_CP(s, s32, it_value); - error = copyout(&s32, op32, sizeof(s32)); - } - return (error); -} - -int -ia32_select(struct thread *td, struct ia32_select_args *uap) -{ - int error; - caddr_t sg; - struct timeval32 *p32, s32; - struct timeval *p = NULL, s; - - p32 = uap->tv; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct timeval)); - uap->tv = (struct timeval32 *)p; - error = copyin(p32, &s32, sizeof(s32)); - if (error) - return (error); - CP(s32, s, tv_sec); - CP(s32, s, tv_usec); - error = copyout(&s, p, sizeof(s)); - if (error) - return (error); - } - /* - * XXX big-endian needs to convert the fd_sets too. - */ - return (select(td, (struct select_args *) uap)); -} - -struct kevent32 { - u_int32_t ident; /* identifier for this event */ - short filter; /* filter for event */ - u_short flags; - u_int fflags; - int32_t data; - u_int32_t udata; /* opaque user data identifier */ -}; - -int -ia32_kevent(struct thread *td, struct ia32_kevent_args *uap) -{ - int error; - caddr_t sg; - struct timespec32 ts32; - struct timespec ts; - struct kevent32 ks32; - struct kevent *ks; - struct kevent_args a; - int i; - - sg = stackgap_init(); - - a.fd = uap->fd; - a.changelist = uap->changelist; - a.nchanges = uap->nchanges; - a.eventlist = uap->eventlist; - a.nevents = uap->nevents; - a.timeout = NULL; - - if (uap->timeout) { - a.timeout = stackgap_alloc(&sg, sizeof(struct timespec)); - error = copyin(uap->timeout, &ts32, sizeof(ts32)); - if (error) - return (error); - CP(ts32, ts, tv_sec); - CP(ts32, ts, tv_nsec); - error = copyout(&ts, (void *)(uintptr_t)a.timeout, sizeof(ts)); - if (error) - return (error); - } - if (uap->changelist) { - a.changelist = (struct kevent *)stackgap_alloc(&sg, uap->nchanges * sizeof(struct kevent)); - for (i = 0; i < uap->nchanges; i++) { - error = copyin(&uap->changelist[i], &ks32, sizeof(ks32)); - if (error) - return (error); - ks = (struct kevent *)(uintptr_t)&a.changelist[i]; - CP(ks32, *ks, ident); - CP(ks32, *ks, filter); - CP(ks32, *ks, flags); - CP(ks32, *ks, fflags); - CP(ks32, *ks, data); - PTRIN_CP(ks32, *ks, udata); - } - } - if (uap->eventlist) { - a.eventlist = stackgap_alloc(&sg, uap->nevents * sizeof(struct kevent)); - } - error = kevent(td, &a); - if (uap->eventlist && error > 0) { - for (i = 0; i < error; i++) { - ks = &a.eventlist[i]; - CP(*ks, ks32, ident); - CP(*ks, ks32, filter); - CP(*ks, ks32, flags); - CP(*ks, ks32, fflags); - CP(*ks, ks32, data); - PTROUT_CP(*ks, ks32, udata); - error = copyout(&ks32, &uap->eventlist[i], sizeof(ks32)); - if (error) - return (error); - } - } - return error; -} - -int -ia32_gettimeofday(struct thread *td, struct ia32_gettimeofday_args *uap) -{ - int error; - caddr_t sg; - struct timeval32 *p32, s32; - struct timeval *p = NULL, s; - - p32 = uap->tp; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct timeval)); - uap->tp = (struct timeval32 *)p; - } - error = gettimeofday(td, (struct gettimeofday_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - CP(s, s32, tv_sec); - CP(s, s32, tv_usec); - error = copyout(&s32, p32, sizeof(s32)); - if (error) - return (error); - } - return (error); -} - -int -ia32_getrusage(struct thread *td, struct ia32_getrusage_args *uap) -{ - int error; - caddr_t sg; - struct rusage32 *p32, s32; - struct rusage *p = NULL, s; - - p32 = uap->rusage; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct rusage)); - uap->rusage = (struct rusage32 *)p; - } - error = getrusage(td, (struct getrusage_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - TV_CP(s, s32, ru_utime); - TV_CP(s, s32, ru_stime); - CP(s, s32, ru_maxrss); - CP(s, s32, ru_ixrss); - CP(s, s32, ru_idrss); - CP(s, s32, ru_isrss); - CP(s, s32, ru_minflt); - CP(s, s32, ru_majflt); - CP(s, s32, ru_nswap); - CP(s, s32, ru_inblock); - CP(s, s32, ru_oublock); - CP(s, s32, ru_msgsnd); - CP(s, s32, ru_msgrcv); - CP(s, s32, ru_nsignals); - CP(s, s32, ru_nvcsw); - CP(s, s32, ru_nivcsw); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -struct iovec32 { - u_int32_t iov_base; - int iov_len; -}; -#define STACKGAPLEN 400 - -int -ia32_readv(struct thread *td, struct ia32_readv_args *uap) -{ - int error, osize, nsize, i; - caddr_t sg; - struct readv_args /* { - syscallarg(int) fd; - syscallarg(struct iovec *) iovp; - syscallarg(u_int) iovcnt; - } */ a; - struct iovec32 *oio; - struct iovec *nio; - - sg = stackgap_init(); - - if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec))) - return (EINVAL); - - osize = uap->iovcnt * sizeof (struct iovec32); - nsize = uap->iovcnt * sizeof (struct iovec); - - oio = malloc(osize, M_TEMP, M_WAITOK); - nio = malloc(nsize, M_TEMP, M_WAITOK); - - error = 0; - if ((error = copyin(uap->iovp, oio, osize))) - goto punt; - for (i = 0; i < uap->iovcnt; i++) { - nio[i].iov_base = PTRIN(oio[i].iov_base); - nio[i].iov_len = oio[i].iov_len; - } - - a.fd = uap->fd; - a.iovp = stackgap_alloc(&sg, nsize); - a.iovcnt = uap->iovcnt; - - if ((error = copyout(nio, (caddr_t)a.iovp, nsize))) - goto punt; - error = readv(td, &a); - -punt: - free(oio, M_TEMP); - free(nio, M_TEMP); - return (error); -} - -int -ia32_writev(struct thread *td, struct ia32_writev_args *uap) -{ - int error, i, nsize, osize; - caddr_t sg; - struct writev_args /* { - syscallarg(int) fd; - syscallarg(struct iovec *) iovp; - syscallarg(u_int) iovcnt; - } */ a; - struct iovec32 *oio; - struct iovec *nio; - - sg = stackgap_init(); - - if (uap->iovcnt > (STACKGAPLEN / sizeof (struct iovec))) - return (EINVAL); - - osize = uap->iovcnt * sizeof (struct iovec32); - nsize = uap->iovcnt * sizeof (struct iovec); - - oio = malloc(osize, M_TEMP, M_WAITOK); - nio = malloc(nsize, M_TEMP, M_WAITOK); - - error = 0; - if ((error = copyin(uap->iovp, oio, osize))) - goto punt; - for (i = 0; i < uap->iovcnt; i++) { - nio[i].iov_base = PTRIN(oio[i].iov_base); - nio[i].iov_len = oio[i].iov_len; - } - - a.fd = uap->fd; - a.iovp = stackgap_alloc(&sg, nsize); - a.iovcnt = uap->iovcnt; - - if ((error = copyout(nio, (caddr_t)a.iovp, nsize))) - goto punt; - error = writev(td, &a); - -punt: - free(oio, M_TEMP); - free(nio, M_TEMP); - return (error); -} - -int -ia32_settimeofday(struct thread *td, struct ia32_settimeofday_args *uap) -{ - int error; - caddr_t sg; - struct timeval32 *p32, s32; - struct timeval *p = NULL, s; - - p32 = uap->tv; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct timeval)); - uap->tv = (struct timeval32 *)p; - error = copyin(p32, &s32, sizeof(s32)); - if (error) - return (error); - CP(s32, s, tv_sec); - CP(s32, s, tv_usec); - error = copyout(&s, p, sizeof(s)); - if (error) - return (error); - } - return (settimeofday(td, (struct settimeofday_args *) uap)); -} - -int -ia32_utimes(struct thread *td, struct ia32_utimes_args *uap) -{ - int error; - caddr_t sg; - struct timeval32 *p32, s32[2]; - struct timeval *p = NULL, s[2]; - - p32 = uap->tptr; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, 2*sizeof(struct timeval)); - uap->tptr = (struct timeval32 *)p; - error = copyin(p32, s32, sizeof(s32)); - if (error) - return (error); - CP(s32[0], s[0], tv_sec); - CP(s32[0], s[0], tv_usec); - CP(s32[1], s[1], tv_sec); - CP(s32[1], s[1], tv_usec); - error = copyout(s, p, sizeof(s)); - if (error) - return (error); - } - return (utimes(td, (struct utimes_args *) uap)); -} - -int -ia32_adjtime(struct thread *td, struct ia32_adjtime_args *uap) -{ - int error; - caddr_t sg; - struct timeval32 *p32, *op32, s32; - struct timeval *p = NULL, *op = NULL, s; - - p32 = uap->delta; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct timeval)); - uap->delta = (struct timeval32 *)p; - error = copyin(p32, &s32, sizeof(s32)); - if (error) - return (error); - CP(s32, s, tv_sec); - CP(s32, s, tv_usec); - error = copyout(&s, p, sizeof(s)); - if (error) - return (error); - } - op32 = uap->olddelta; - if (op32) { - sg = stackgap_init(); - op = stackgap_alloc(&sg, sizeof(struct timeval)); - uap->olddelta = (struct timeval32 *)op; - } - error = utimes(td, (struct utimes_args *) uap); - if (error) - return error; - if (op32) { - error = copyin(op, &s, sizeof(s)); - if (error) - return (error); - CP(s, s32, tv_sec); - CP(s, s32, tv_usec); - error = copyout(&s32, op32, sizeof(s32)); - } - return (error); -} - -int -ia32_statfs(struct thread *td, struct ia32_statfs_args *uap) -{ - int error; - caddr_t sg; - struct statfs32 *p32, s32; - struct statfs *p = NULL, s; - - p32 = uap->buf; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct statfs)); - uap->buf = (struct statfs32 *)p; - } - error = statfs(td, (struct statfs_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - copy_statfs(&s, &s32); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -int -ia32_fstatfs(struct thread *td, struct ia32_fstatfs_args *uap) -{ - int error; - caddr_t sg; - struct statfs32 *p32, s32; - struct statfs *p = NULL, s; - - p32 = uap->buf; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct statfs)); - uap->buf = (struct statfs32 *)p; - } - error = fstatfs(td, (struct fstatfs_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - copy_statfs(&s, &s32); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -int -ia32_semsys(struct thread *td, struct ia32_semsys_args *uap) -{ - /* - * Vector through to semsys if it is loaded. - */ - return sysent[169].sy_call(td, uap); -} - -int -ia32_msgsys(struct thread *td, struct ia32_msgsys_args *uap) -{ - /* - * Vector through to msgsys if it is loaded. - */ - return sysent[170].sy_call(td, uap); -} - -int -ia32_shmsys(struct thread *td, struct ia32_shmsys_args *uap) -{ - /* - * Vector through to shmsys if it is loaded. - */ - return sysent[171].sy_call(td, uap); -} - -int -ia32_pread(struct thread *td, struct ia32_pread_args *uap) -{ - struct pread_args ap; - - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = (uap->offsetlo - | ((off_t)uap->offsethi << 32)); - return (pread(td, &ap)); -} - -int -ia32_pwrite(struct thread *td, struct ia32_pwrite_args *uap) -{ - struct pwrite_args ap; - - ap.fd = uap->fd; - ap.buf = uap->buf; - ap.nbyte = uap->nbyte; - ap.offset = (uap->offsetlo - | ((off_t)uap->offsethi << 32)); - return (pwrite(td, &ap)); -} - -int -ia32_lseek(struct thread *td, struct ia32_lseek_args *uap) -{ - int error; - struct lseek_args ap; - off_t pos; - - ap.fd = uap->fd; - ap.offset = (uap->offsetlo - | ((off_t)uap->offsethi << 32)); - ap.whence = uap->whence; - error = lseek(td, &ap); - /* Expand the quad return into two parts for eax and edx */ - pos = *(off_t *)(td->td_retval); - td->td_retval[0] = pos & 0xffffffff; /* %eax */ - td->td_retval[1] = pos >> 32; /* %edx */ - return error; -} - -int -ia32_truncate(struct thread *td, struct ia32_truncate_args *uap) -{ - struct truncate_args ap; - - ap.path = uap->path; - ap.length = (uap->lengthlo - | ((off_t)uap->lengthhi << 32)); - return (truncate(td, &ap)); -} - -int -ia32_ftruncate(struct thread *td, struct ia32_ftruncate_args *uap) -{ - struct ftruncate_args ap; - - ap.fd = uap->fd; - ap.length = (uap->lengthlo - | ((off_t)uap->lengthhi << 32)); - return (ftruncate(td, &ap)); -} - -#ifdef COMPAT_FREEBSD4 -int -freebsd4_ia32_sendfile(struct thread *td, - struct freebsd4_ia32_sendfile_args *uap) -{ - struct freebsd4_sendfile_args ap; - - ap.fd = uap->fd; - ap.s = uap->s; - ap.offset = (uap->offsetlo - | ((off_t)uap->offsethi << 32)); - ap.nbytes = uap->nbytes; /* XXX check */ - ap.hdtr = uap->hdtr; /* XXX check */ - ap.sbytes = uap->sbytes; /* XXX FIXME!! */ - ap.flags = uap->flags; - return (freebsd4_sendfile(td, &ap)); -} -#endif - -int -ia32_sendfile(struct thread *td, struct ia32_sendfile_args *uap) -{ - struct sendfile_args ap; - - ap.fd = uap->fd; - ap.s = uap->s; - ap.offset = (uap->offsetlo - | ((off_t)uap->offsethi << 32)); - ap.nbytes = uap->nbytes; /* XXX check */ - ap.hdtr = uap->hdtr; /* XXX check */ - ap.sbytes = uap->sbytes; /* XXX FIXME!! */ - ap.flags = uap->flags; - return (sendfile(td, &ap)); -} - -struct stat32 { - udev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - udev_t st_rdev; - struct timespec32 st_atimespec; - struct timespec32 st_mtimespec; - struct timespec32 st_ctimespec; - off_t st_size; - int64_t st_blocks; - u_int32_t st_blksize; - u_int32_t st_flags; - u_int32_t st_gen; -}; - -static void -copy_stat( struct stat *in, struct stat32 *out) -{ - CP(*in, *out, st_dev); - CP(*in, *out, st_ino); - CP(*in, *out, st_mode); - CP(*in, *out, st_nlink); - CP(*in, *out, st_uid); - CP(*in, *out, st_gid); - CP(*in, *out, st_rdev); - TS_CP(*in, *out, st_atimespec); - TS_CP(*in, *out, st_mtimespec); - TS_CP(*in, *out, st_ctimespec); - CP(*in, *out, st_size); - CP(*in, *out, st_blocks); - CP(*in, *out, st_blksize); - CP(*in, *out, st_flags); - CP(*in, *out, st_gen); -} - -int -ia32_stat(struct thread *td, struct ia32_stat_args *uap) -{ - int error; - caddr_t sg; - struct stat32 *p32, s32; - struct stat *p = NULL, s; - - p32 = uap->ub; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct stat)); - uap->ub = (struct stat32 *)p; - } - error = stat(td, (struct stat_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - copy_stat(&s, &s32); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -int -ia32_fstat(struct thread *td, struct ia32_fstat_args *uap) -{ - int error; - caddr_t sg; - struct stat32 *p32, s32; - struct stat *p = NULL, s; - - p32 = uap->ub; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct stat)); - uap->ub = (struct stat32 *)p; - } - error = fstat(td, (struct fstat_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - copy_stat(&s, &s32); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -int -ia32_lstat(struct thread *td, struct ia32_lstat_args *uap) -{ - int error; - caddr_t sg; - struct stat32 *p32, s32; - struct stat *p = NULL, s; - - p32 = uap->ub; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct stat)); - uap->ub = (struct stat32 *)p; - } - error = lstat(td, (struct lstat_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - copy_stat(&s, &s32); - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -/* - * MPSAFE - */ -int -ia32_sysctl(struct thread *td, struct ia32_sysctl_args *uap) -{ - int error, name[CTL_MAXNAME]; - size_t j, oldlen; - - if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) - return (EINVAL); - - error = copyin(uap->name, &name, uap->namelen * sizeof(int)); - if (error) - return (error); - - mtx_lock(&Giant); - - if (uap->oldlenp) - oldlen = fuword32(uap->oldlenp); - else - oldlen = 0; - error = userland_sysctl(td, name, uap->namelen, - uap->old, &oldlen, 1, - uap->new, uap->newlen, &j); - if (error && error != ENOMEM) - goto done2; - if (uap->oldlenp) { - suword32(uap->oldlenp, j); - } -done2: - mtx_unlock(&Giant); - return (error); -} - -struct sigaction32 { - u_int32_t sa_u; - int sa_flags; - sigset_t sa_mask; -}; - -int -ia32_sigaction(struct thread *td, struct ia32_sigaction_args *uap) -{ - struct sigaction32 s32; - struct sigaction sa, osa, *sap; - int error; - - if (uap->act) { - error = copyin(uap->act, &s32, sizeof(s32)); - if (error) - return (error); - sa.sa_handler = PTRIN(s32.sa_u); - CP(s32, sa, sa_flags); - CP(s32, sa, sa_mask); - sap = &sa; - } else - sap = NULL; - error = kern_sigaction(td, uap->sig, sap, &osa, 0); - if (error != 0 && uap->oact != NULL) { - s32.sa_u = PTROUT(osa.sa_handler); - CP(osa, s32, sa_flags); - CP(osa, s32, sa_mask); - error = copyout(&s32, uap->oact, sizeof(s32)); - } - return (error); -} - -#ifdef COMPAT_FREEBSD4 -int -freebsd4_ia32_sigaction(struct thread *td, struct freebsd4_ia32_sigaction_args *uap) -{ - struct sigaction32 s32; - struct sigaction sa, osa, *sap; - int error; - - if (uap->act) { - error = copyin(uap->act, &s32, sizeof(s32)); - if (error) - return (error); - sa.sa_handler = PTRIN(s32.sa_u); - CP(s32, sa, sa_flags); - CP(s32, sa, sa_mask); - sap = &sa; - } else - sap = NULL; - error = kern_sigaction(td, uap->sig, sap, &osa, KSA_FREEBSD4); - if (error != 0 && uap->oact != NULL) { - s32.sa_u = PTROUT(osa.sa_handler); - CP(osa, s32, sa_flags); - CP(osa, s32, sa_mask); - error = copyout(&s32, uap->oact, sizeof(s32)); - } - return (error); -} -#endif - -#if 0 - -int -ia32_xxx(struct thread *td, struct ia32_xxx_args *uap) -{ - int error; - caddr_t sg; - struct yyy32 *p32, s32; - struct yyy *p = NULL, s; - - p32 = uap->zzz; - if (p32) { - sg = stackgap_init(); - p = stackgap_alloc(&sg, sizeof(struct yyy)); - uap->zzz = (struct yyy32 *)p; - error = copyin(p32, &s32, sizeof(s32)); - if (error) - return (error); - /* translate in */ - error = copyout(&s, p, sizeof(s)); - if (error) - return (error); - } - error = xxx(td, (struct xxx_args *) uap); - if (error) - return (error); - if (p32) { - error = copyin(p, &s, sizeof(s)); - if (error) - return (error); - /* translate out */ - error = copyout(&s32, p32, sizeof(s32)); - } - return (error); -} - -#endif diff --git a/sys/amd64/ia32/ia32_proto.h b/sys/amd64/ia32/ia32_proto.h deleted file mode 100644 index 3d28824..0000000 --- a/sys/amd64/ia32/ia32_proto.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * System call prototypes. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/ia32/syscalls.master,v 1.23 2003/08/21 03:48:05 peter Exp - */ - -#ifndef _IA32_SYSPROTO_H_ -#define _IA32_SYSPROTO_H_ - -#include <sys/signal.h> -#include <sys/acl.h> -#include <sys/thr.h> -#include <sys/umtx.h> -#include <posix4/_semaphore.h> - -#include <sys/ucontext.h> - -struct proc; - -struct thread; - -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) - -#if BYTE_ORDER == LITTLE_ENDIAN -#define PADL_(t) 0 -#define PADR_(t) PAD_(t) -#else -#define PADL_(t) PAD_(t) -#define PADR_(t) 0 -#endif - -struct ia32_open_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; -}; -struct ia32_wait4_args { - char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; - char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; - char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; - char rusage_l_[PADL_(struct rusage32 *)]; struct rusage32 * rusage; char rusage_r_[PADR_(struct rusage32 *)]; -}; -struct ia32_getfsstat_args { - char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)]; - char bufsize_l_[PADL_(long)]; long bufsize; char bufsize_r_[PADR_(long)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ia32_access_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ia32_chflags_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ia32_sigaltstack_args { - char ss_l_[PADL_(struct sigaltstack32 *)]; struct sigaltstack32 * ss; char ss_r_[PADR_(struct sigaltstack32 *)]; - char oss_l_[PADL_(struct sigaltstack32 *)]; struct sigaltstack32 * oss; char oss_r_[PADR_(struct sigaltstack32 *)]; -}; -struct ia32_execve_args { - char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; - char argv_l_[PADL_(u_int32_t *)]; u_int32_t * argv; char argv_r_[PADR_(u_int32_t *)]; - char envv_l_[PADL_(u_int32_t *)]; u_int32_t * envv; char envv_r_[PADR_(u_int32_t *)]; -}; -struct ia32_setitimer_args { - char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)]; - char itv_l_[PADL_(struct itimerval32 *)]; struct itimerval32 * itv; char itv_r_[PADR_(struct itimerval32 *)]; - char oitv_l_[PADL_(struct itimerval32 *)]; struct itimerval32 * oitv; char oitv_r_[PADR_(struct itimerval32 *)]; -}; -struct ia32_select_args { - char nd_l_[PADL_(int)]; int nd; char nd_r_[PADR_(int)]; - char in_l_[PADL_(fd_set *)]; fd_set * in; char in_r_[PADR_(fd_set *)]; - char ou_l_[PADL_(fd_set *)]; fd_set * ou; char ou_r_[PADR_(fd_set *)]; - char ex_l_[PADL_(fd_set *)]; fd_set * ex; char ex_r_[PADR_(fd_set *)]; - char tv_l_[PADL_(struct timeval32 *)]; struct timeval32 * tv; char tv_r_[PADR_(struct timeval32 *)]; -}; -struct ia32_gettimeofday_args { - char tp_l_[PADL_(struct timeval32 *)]; struct timeval32 * tp; char tp_r_[PADR_(struct timeval32 *)]; - char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; -}; -struct ia32_getrusage_args { - char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; - char rusage_l_[PADL_(struct rusage32 *)]; struct rusage32 * rusage; char rusage_r_[PADR_(struct rusage32 *)]; -}; -struct ia32_readv_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; - char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; -}; -struct ia32_writev_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char iovp_l_[PADL_(struct iovec32 *)]; struct iovec32 * iovp; char iovp_r_[PADR_(struct iovec32 *)]; - char iovcnt_l_[PADL_(u_int)]; u_int iovcnt; char iovcnt_r_[PADR_(u_int)]; -}; -struct ia32_settimeofday_args { - char tv_l_[PADL_(struct timeval32 *)]; struct timeval32 * tv; char tv_r_[PADR_(struct timeval32 *)]; - char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; -}; -struct ia32_utimes_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; -}; -struct ia32_adjtime_args { - char delta_l_[PADL_(struct timeval32 *)]; struct timeval32 * delta; char delta_r_[PADR_(struct timeval32 *)]; - char olddelta_l_[PADL_(struct timeval32 *)]; struct timeval32 * olddelta; char olddelta_r_[PADR_(struct timeval32 *)]; -}; -struct ia32_statfs_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)]; -}; -struct ia32_fstatfs_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(struct statfs32 *)]; struct statfs32 * buf; char buf_r_[PADR_(struct statfs32 *)]; -}; -struct ia32_semsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; -}; -struct ia32_msgsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; - char a5_l_[PADL_(int)]; int a5; char a5_r_[PADR_(int)]; - char a6_l_[PADL_(int)]; int a6; char a6_r_[PADR_(int)]; -}; -struct ia32_shmsys_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; - char a3_l_[PADL_(int)]; int a3; char a3_r_[PADR_(int)]; - char a4_l_[PADL_(int)]; int a4; char a4_r_[PADR_(int)]; -}; -struct ia32_pread_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)]; - char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; -}; -struct ia32_pwrite_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)]; - char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; -}; -struct ia32_stat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; -}; -struct ia32_fstat_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; -}; -struct ia32_lstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; -}; -struct ia32_mmap_args { - char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; - char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char poslo_l_[PADL_(u_int32_t)]; u_int32_t poslo; char poslo_r_[PADR_(u_int32_t)]; - char poshi_l_[PADL_(u_int32_t)]; u_int32_t poshi; char poshi_r_[PADR_(u_int32_t)]; -}; -struct ia32_lseek_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)]; - char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; - char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)]; -}; -struct ia32_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)]; - char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)]; -}; -struct ia32_ftruncate_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; - char lengthlo_l_[PADL_(u_int32_t)]; u_int32_t lengthlo; char lengthlo_r_[PADR_(u_int32_t)]; - char lengthhi_l_[PADL_(u_int32_t)]; u_int32_t lengthhi; char lengthhi_r_[PADR_(u_int32_t)]; -}; -struct ia32_sysctl_args { - char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; - char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; - char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; - char oldlenp_l_[PADL_(u_int32_t *)]; u_int32_t * oldlenp; char oldlenp_r_[PADR_(u_int32_t *)]; - char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; - char newlen_l_[PADL_(u_int32_t)]; u_int32_t newlen; char newlen_r_[PADR_(u_int32_t)]; -}; -struct ia32_kevent_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char changelist_l_[PADL_(const struct kevent *)]; const struct kevent * changelist; char changelist_r_[PADR_(const struct kevent *)]; - char nchanges_l_[PADL_(int)]; int nchanges; char nchanges_r_[PADR_(int)]; - char eventlist_l_[PADL_(struct kevent *)]; struct kevent * eventlist; char eventlist_r_[PADR_(struct kevent *)]; - char nevents_l_[PADL_(int)]; int nevents; char nevents_r_[PADR_(int)]; - char timeout_l_[PADL_(const struct timespec *)]; const struct timespec * timeout; char timeout_r_[PADR_(const struct timespec *)]; -}; -struct ia32_sendfile_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)]; - char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; - char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; - char hdtr_l_[PADL_(struct sf_hdtr *)]; struct sf_hdtr * hdtr; char hdtr_r_[PADR_(struct sf_hdtr *)]; - char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct ia32_sigaction_args { - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; - char act_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * act; char act_r_[PADR_(struct sigaction32 *)]; - char oact_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * oact; char oact_r_[PADR_(struct sigaction32 *)]; -}; -struct ia32_sigreturn_args { - char sigcntxp_l_[PADL_(const struct ia32_ucontext *)]; const struct ia32_ucontext * sigcntxp; char sigcntxp_r_[PADR_(const struct ia32_ucontext *)]; -}; -int ia32_open(struct thread *, struct ia32_open_args *); -int ia32_wait4(struct thread *, struct ia32_wait4_args *); -int ia32_getfsstat(struct thread *, struct ia32_getfsstat_args *); -int ia32_access(struct thread *, struct ia32_access_args *); -int ia32_chflags(struct thread *, struct ia32_chflags_args *); -int ia32_sigaltstack(struct thread *, struct ia32_sigaltstack_args *); -int ia32_execve(struct thread *, struct ia32_execve_args *); -int ia32_setitimer(struct thread *, struct ia32_setitimer_args *); -int ia32_select(struct thread *, struct ia32_select_args *); -int ia32_gettimeofday(struct thread *, struct ia32_gettimeofday_args *); -int ia32_getrusage(struct thread *, struct ia32_getrusage_args *); -int ia32_readv(struct thread *, struct ia32_readv_args *); -int ia32_writev(struct thread *, struct ia32_writev_args *); -int ia32_settimeofday(struct thread *, struct ia32_settimeofday_args *); -int ia32_utimes(struct thread *, struct ia32_utimes_args *); -int ia32_adjtime(struct thread *, struct ia32_adjtime_args *); -int ia32_statfs(struct thread *, struct ia32_statfs_args *); -int ia32_fstatfs(struct thread *, struct ia32_fstatfs_args *); -int ia32_semsys(struct thread *, struct ia32_semsys_args *); -int ia32_msgsys(struct thread *, struct ia32_msgsys_args *); -int ia32_shmsys(struct thread *, struct ia32_shmsys_args *); -int ia32_pread(struct thread *, struct ia32_pread_args *); -int ia32_pwrite(struct thread *, struct ia32_pwrite_args *); -int ia32_stat(struct thread *, struct ia32_stat_args *); -int ia32_fstat(struct thread *, struct ia32_fstat_args *); -int ia32_lstat(struct thread *, struct ia32_lstat_args *); -int ia32_mmap(struct thread *, struct ia32_mmap_args *); -int ia32_lseek(struct thread *, struct ia32_lseek_args *); -int ia32_truncate(struct thread *, struct ia32_truncate_args *); -int ia32_ftruncate(struct thread *, struct ia32_ftruncate_args *); -int ia32_sysctl(struct thread *, struct ia32_sysctl_args *); -int ia32_kevent(struct thread *, struct ia32_kevent_args *); -int ia32_sendfile(struct thread *, struct ia32_sendfile_args *); -int ia32_sigaction(struct thread *, struct ia32_sigaction_args *); -int ia32_sigreturn(struct thread *, struct ia32_sigreturn_args *); - -#ifdef COMPAT_43 - - -#endif /* COMPAT_43 */ - - -#ifdef COMPAT_FREEBSD4 - -struct freebsd4_ia32_sendfile_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char offsetlo_l_[PADL_(u_int32_t)]; u_int32_t offsetlo; char offsetlo_r_[PADR_(u_int32_t)]; - char offsethi_l_[PADL_(u_int32_t)]; u_int32_t offsethi; char offsethi_r_[PADR_(u_int32_t)]; - char nbytes_l_[PADL_(size_t)]; size_t nbytes; char nbytes_r_[PADR_(size_t)]; - char hdtr_l_[PADL_(struct sf_hdtr *)]; struct sf_hdtr * hdtr; char hdtr_r_[PADR_(struct sf_hdtr *)]; - char sbytes_l_[PADL_(off_t *)]; off_t * sbytes; char sbytes_r_[PADR_(off_t *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct freebsd4_ia32_sigaction_args { - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; - char act_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * act; char act_r_[PADR_(struct sigaction32 *)]; - char oact_l_[PADL_(struct sigaction32 *)]; struct sigaction32 * oact; char oact_r_[PADR_(struct sigaction32 *)]; -}; -struct freebsd4_ia32_sigreturn_args { - char sigcntxp_l_[PADL_(const struct __ucontext *)]; const struct __ucontext * sigcntxp; char sigcntxp_r_[PADR_(const struct __ucontext *)]; -}; -int freebsd4_ia32_sendfile(struct thread *, struct freebsd4_ia32_sendfile_args *); -int freebsd4_ia32_sigaction(struct thread *, struct freebsd4_ia32_sigaction_args *); -int freebsd4_ia32_sigreturn(struct thread *, struct freebsd4_ia32_sigreturn_args *); - -#endif /* COMPAT_FREEBSD4 */ - -#undef PAD_ -#undef PADL_ -#undef PADR_ - -#endif /* !_IA32_SYSPROTO_H_ */ diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index b57b21e..b38f565 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -71,9 +71,9 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_object.h> #include <vm/vm_extern.h> -#include <amd64/ia32/ia32_util.h> -#include <amd64/ia32/ia32_proto.h> -#include <amd64/ia32/ia32_signal.h> +#include <compat/freebsd32/freebsd32_util.h> +#include <compat/freebsd32/freebsd32_proto.h> +#include <compat/ia32/ia32_signal.h> #include <machine/psl.h> #include <machine/segments.h> #include <machine/specialreg.h> @@ -264,7 +264,7 @@ freebsd4_ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) } regs->tf_rsp = (uintptr_t)sfp; - regs->tf_rip = IA32_PS_STRINGS - sz_freebsd4_ia32_sigcode; + regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode; regs->tf_rflags &= ~PSL_T; regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -380,7 +380,7 @@ ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) } regs->tf_rsp = (uintptr_t)sfp; - regs->tf_rip = IA32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); regs->tf_rflags &= ~PSL_T; regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; @@ -406,10 +406,10 @@ ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) * MPSAFE */ int -freebsd4_ia32_sigreturn(td, uap) +freebsd4_freebsd32_sigreturn(td, uap) struct thread *td; - struct freebsd4_ia32_sigreturn_args /* { - const struct freebsd4_ucontext *sigcntxp; + struct freebsd4_freebsd32_sigreturn_args /* { + const struct freebsd4_freebsd32_ucontext *sigcntxp; } */ *uap; { struct ia32_ucontext4 uc; @@ -438,7 +438,7 @@ freebsd4_ia32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("freebsd4_ia32_sigreturn: eflags = 0x%x\n", eflags); + printf("freebsd4_freebsd32_sigreturn: eflags = 0x%x\n", eflags); return (EINVAL); } @@ -483,10 +483,10 @@ freebsd4_ia32_sigreturn(td, uap) * MPSAFE */ int -ia32_sigreturn(td, uap) +freebsd32_sigreturn(td, uap) struct thread *td; - struct ia32_sigreturn_args /* { - const struct ia32_ucontext *sigcntxp; + struct freebsd32_sigreturn_args /* { + const struct freebsd32_ucontext *sigcntxp; } */ *uap; { struct ia32_ucontext uc; @@ -515,7 +515,7 @@ ia32_sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("ia32_sigreturn: eflags = 0x%x\n", eflags); + printf("freebsd32_sigreturn: eflags = 0x%x\n", eflags); return (EINVAL); } diff --git a/sys/amd64/ia32/ia32_signal.h b/sys/amd64/ia32/ia32_signal.h deleted file mode 100644 index f251e72..0000000 --- a/sys/amd64/ia32/ia32_signal.h +++ /dev/null @@ -1,164 +0,0 @@ -/*- - * Copyright (c) 1999 Marcel Moolenaar - * Copyright (c) 2003 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 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$ - */ - -struct ia32_sigaltstack { - u_int32_t ss_sp; /* signal stack base */ - u_int32_t ss_size; /* signal stack length */ - int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ -}; - -/* XXX should be 640 bytes long; check and see if __packed is needed */ -struct ia32_mcontext { - int mc_onstack; /* XXX - sigcontext compat. */ - int mc_gs; /* machine state (struct trapframe) */ - int mc_fs; - int mc_es; - int mc_ds; - int mc_edi; - int mc_esi; - int mc_ebp; - int mc_isp; - int mc_ebx; - int mc_edx; - int mc_ecx; - int mc_eax; - int mc_trapno; - int mc_err; - int mc_eip; - int mc_cs; - int mc_eflags; - int mc_esp; - int mc_ss; - int mc_len; /* sizeof(struct ia32_mcontext) */ - /* We use the same values for fpformat and ownedfp */ - int mc_fpformat; - int mc_ownedfp; - int mc_spare1[1]; /* align next field to 16 bytes */ - /* - * See <machine/npx.h> for the internals of mc_fpstate[]. - */ - int mc_fpstate[128] __aligned(16); - int mc_spare2[8]; -}; - -/* XXX should be 704 bytes long; check and see if __packed is needed */ -struct ia32_ucontext { - sigset_t uc_sigmask; - struct ia32_mcontext uc_mcontext; - u_int32_t uc_link; - struct ia32_sigaltstack uc_stack; - int uc_flags; - int __spare__[4]; -}; - - -#if defined(COMPAT_FREEBSD4) -struct ia32_mcontext4 { - int mc_onstack; /* XXX - sigcontext compat. */ - int mc_gs; /* machine state (struct trapframe) */ - int mc_fs; - int mc_es; - int mc_ds; - int mc_edi; - int mc_esi; - int mc_ebp; - int mc_isp; - int mc_ebx; - int mc_edx; - int mc_ecx; - int mc_eax; - int mc_trapno; - int mc_err; - int mc_eip; - int mc_cs; - int mc_eflags; - int mc_esp; - int mc_ss; - int mc_fpregs[28]; - int __spare__[17]; -}; - -struct ia32_ucontext4 { - sigset_t uc_sigmask; - struct ia32_mcontext4 uc_mcontext; - u_int32_t uc_link; - struct ia32_sigaltstack uc_stack; - int __spare__[8]; -}; -#endif - -/* - * Signal frames, arguments passed to application signal handlers. - */ -union ia32_sigval { - int sigval_int; - u_int32_t sigval_ptr; -}; -struct ia32_siginfo { - int si_signo; /* signal number */ - int si_errno; /* errno association */ - int si_code; /* signal code */ - int32_t si_pid; /* sending process */ - u_int32_t si_uid; /* sender's ruid */ - int si_status; /* exit value */ - u_int32_t si_addr; /* faulting instruction */ - union ia32_sigval si_value; /* signal value */ - int32_t si_band; /* band event for SIGPOLL */ - int __spare__[7]; /* gimme some slack */ -}; - -#ifdef COMPAT_FREEBSD4 -struct ia32_sigframe4 { - u_int32_t sf_signum; - u_int32_t sf_siginfo; /* code or pointer to sf_si */ - u_int32_t sf_ucontext; /* points to sf_uc */ - u_int32_t sf_addr; /* undocumented 4th arg */ - u_int32_t sf_ah; /* action/handler pointer */ - struct ia32_ucontext4 sf_uc; /* = *sf_ucontext */ - struct ia32_siginfo sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ -}; -#endif - -struct ia32_sigframe { - u_int32_t sf_signum; - u_int32_t sf_siginfo; /* code or pointer to sf_si */ - u_int32_t sf_ucontext; /* points to sf_uc */ - u_int32_t sf_addr; /* undocumented 4th arg */ - u_int32_t sf_ah; /* action/handler pointer */ - struct ia32_ucontext sf_uc; /* = *sf_ucontext */ - struct ia32_siginfo sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ -}; - -extern char ia32_sigcode[]; -extern char freebsd4_ia32_sigcode[]; -extern int sz_ia32_sigcode; -extern int sz_freebsd4_ia32_sigcode; -extern void ia32_sendsig(sig_t, int, sigset_t *, u_long); diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c index 8675e17..915b0cb 100644 --- a/sys/amd64/ia32/ia32_syscall.c +++ b/sys/amd64/ia32/ia32_syscall.c @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define IDTVEC(name) __CONCAT(X,name) extern inthand_t IDTVEC(int0x80_syscall), IDTVEC(rsvd); -extern const char *ia32_syscallnames[]; +extern const char *freebsd32_syscallnames[]; void ia32_syscall(struct trapframe frame); /* Called from asm code */ @@ -253,7 +253,7 @@ ia32_syscall(struct trapframe frame) cred_free_thread(td); #endif WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - (code >= 0 && code < SYS_MAXSYSCALL) ? ia32_syscallnames[code] : "???"); + (code >= 0 && code < SYS_MAXSYSCALL) ? freebsd32_syscallnames[code] : "???"); mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } diff --git a/sys/amd64/ia32/ia32_syscall.h b/sys/amd64/ia32/ia32_syscall.h deleted file mode 100644 index 6920635..0000000 --- a/sys/amd64/ia32/ia32_syscall.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * System call numbers. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/ia32/syscalls.master,v 1.23 2003/08/21 03:48:05 peter Exp - */ - -#define IA32_SYS_syscall 0 -#define IA32_SYS_exit 1 -#define IA32_SYS_fork 2 -#define IA32_SYS_read 3 -#define IA32_SYS_write 4 -#define IA32_SYS_ia32_open 5 -#define IA32_SYS_close 6 -#define IA32_SYS_ia32_wait4 7 - /* 8 is obsolete old creat */ -#define IA32_SYS_link 9 -#define IA32_SYS_unlink 10 - /* 11 is obsolete execv */ -#define IA32_SYS_chdir 12 -#define IA32_SYS_fchdir 13 -#define IA32_SYS_mknod 14 -#define IA32_SYS_chmod 15 -#define IA32_SYS_chown 16 -#define IA32_SYS_break 17 -#define IA32_SYS_ia32_getfsstat 18 - /* 19 is obsolete olseek */ -#define IA32_SYS_getpid 20 -#define IA32_SYS_mount 21 -#define IA32_SYS_unmount 22 -#define IA32_SYS_setuid 23 -#define IA32_SYS_getuid 24 -#define IA32_SYS_geteuid 25 -#define IA32_SYS_ptrace 26 -#define IA32_SYS_sendmsg 28 -#define IA32_SYS_recvfrom 29 -#define IA32_SYS_accept 30 -#define IA32_SYS_getpeername 31 -#define IA32_SYS_getsockname 32 -#define IA32_SYS_ia32_access 33 -#define IA32_SYS_ia32_chflags 34 -#define IA32_SYS_fchflags 35 -#define IA32_SYS_sync 36 -#define IA32_SYS_kill 37 -#define IA32_SYS_getppid 39 -#define IA32_SYS_dup 41 -#define IA32_SYS_pipe 42 -#define IA32_SYS_getegid 43 -#define IA32_SYS_profil 44 -#define IA32_SYS_ktrace 45 -#define IA32_SYS_getgid 47 -#define IA32_SYS_getlogin 49 -#define IA32_SYS_setlogin 50 -#define IA32_SYS_acct 51 -#define IA32_SYS_sigpending 52 -#define IA32_SYS_ia32_sigaltstack 53 -#define IA32_SYS_ioctl 54 -#define IA32_SYS_reboot 55 -#define IA32_SYS_revoke 56 -#define IA32_SYS_symlink 57 -#define IA32_SYS_readlink 58 -#define IA32_SYS_ia32_execve 59 -#define IA32_SYS_umask 60 -#define IA32_SYS_chroot 61 - /* 62 is obsolete ofstat */ - /* 63 is obsolete ogetkerninfo */ - /* 64 is obsolete ogetpagesize */ - /* 65 is obsolete omsync */ - /* 66 is obsolete ovfork */ - /* 67 is obsolete vread */ - /* 68 is obsolete vwrite */ -#define IA32_SYS_sbrk 69 -#define IA32_SYS_sstk 70 - /* 71 is obsolete ommap */ -#define IA32_SYS_vadvise 72 -#define IA32_SYS_munmap 73 -#define IA32_SYS_mprotect 74 -#define IA32_SYS_madvise 75 - /* 76 is obsolete vhangup */ - /* 77 is obsolete vlimit */ -#define IA32_SYS_mincore 78 -#define IA32_SYS_getgroups 79 -#define IA32_SYS_setgroups 80 -#define IA32_SYS_getpgrp 81 -#define IA32_SYS_setpgid 82 -#define IA32_SYS_ia32_setitimer 83 - /* 84 is obsolete owait */ - /* 85 is obsolete oswapon */ - /* 86 is obsolete ogetitimer */ - /* 87 is obsolete ogethostname */ - /* 88 is obsolete osethostname */ -#define IA32_SYS_getdtablesize 89 -#define IA32_SYS_dup2 90 -#define IA32_SYS_fcntl 92 -#define IA32_SYS_ia32_select 93 -#define IA32_SYS_fsync 95 -#define IA32_SYS_setpriority 96 -#define IA32_SYS_socket 97 -#define IA32_SYS_connect 98 -#define IA32_SYS_accept 99 -#define IA32_SYS_getpriority 100 - /* 101 is obsolete osend */ - /* 102 is obsolete orecv */ - /* 103 is obsolete osigreturn */ -#define IA32_SYS_bind 104 -#define IA32_SYS_setsockopt 105 -#define IA32_SYS_listen 106 - /* 107 is obsolete vtimes */ - /* 108 is obsolete osigvec */ - /* 109 is obsolete osigblock */ - /* 110 is obsolete osigsetmask */ - /* 111 is obsolete osigsuspend */ - /* 112 is obsolete osigstack */ - /* 113 is obsolete orecvmsg */ - /* 114 is obsolete osendmsg */ - /* 115 is obsolete vtrace */ -#define IA32_SYS_ia32_gettimeofday 116 -#define IA32_SYS_ia32_getrusage 117 -#define IA32_SYS_getsockopt 118 -#define IA32_SYS_ia32_readv 120 -#define IA32_SYS_ia32_writev 121 -#define IA32_SYS_ia32_settimeofday 122 -#define IA32_SYS_fchown 123 -#define IA32_SYS_fchmod 124 -#define IA32_SYS_recvfrom 125 -#define IA32_SYS_setreuid 126 -#define IA32_SYS_setregid 127 -#define IA32_SYS_rename 128 - /* 129 is obsolete otruncate */ - /* 130 is obsolete ftruncate */ -#define IA32_SYS_flock 131 -#define IA32_SYS_mkfifo 132 -#define IA32_SYS_sendto 133 -#define IA32_SYS_shutdown 134 -#define IA32_SYS_socketpair 135 -#define IA32_SYS_mkdir 136 -#define IA32_SYS_rmdir 137 -#define IA32_SYS_ia32_utimes 138 - /* 139 is obsolete 4.2 sigreturn */ -#define IA32_SYS_ia32_adjtime 140 - /* 141 is obsolete ogetpeername */ - /* 142 is obsolete ogethostid */ - /* 143 is obsolete sethostid */ - /* 144 is obsolete getrlimit */ - /* 145 is obsolete setrlimit */ - /* 146 is obsolete killpg */ -#define IA32_SYS_setsid 147 -#define IA32_SYS_quotactl 148 - /* 149 is obsolete oquota */ - /* 150 is obsolete ogetsockname */ -#define IA32_SYS_getdirentries 156 -#define IA32_SYS_ia32_statfs 157 -#define IA32_SYS_ia32_fstatfs 158 -#define IA32_SYS_getfh 161 -#define IA32_SYS_getdomainname 162 -#define IA32_SYS_setdomainname 163 -#define IA32_SYS_uname 164 -#define IA32_SYS_sysarch 165 -#define IA32_SYS_rtprio 166 -#define IA32_SYS_ia32_semsys 169 -#define IA32_SYS_ia32_msgsys 170 -#define IA32_SYS_ia32_shmsys 171 -#define IA32_SYS_ia32_pread 173 -#define IA32_SYS_ia32_pwrite 174 -#define IA32_SYS_ntp_adjtime 176 -#define IA32_SYS_setgid 181 -#define IA32_SYS_setegid 182 -#define IA32_SYS_seteuid 183 -#define IA32_SYS_ia32_stat 188 -#define IA32_SYS_ia32_fstat 189 -#define IA32_SYS_ia32_lstat 190 -#define IA32_SYS_pathconf 191 -#define IA32_SYS_fpathconf 192 -#define IA32_SYS_getrlimit 194 -#define IA32_SYS_setrlimit 195 -#define IA32_SYS_getdirentries 196 -#define IA32_SYS_ia32_mmap 197 -#define IA32_SYS___syscall 198 -#define IA32_SYS_ia32_lseek 199 -#define IA32_SYS_ia32_truncate 200 -#define IA32_SYS_ia32_ftruncate 201 -#define IA32_SYS_ia32_sysctl 202 -#define IA32_SYS_mlock 203 -#define IA32_SYS_munlock 204 -#define IA32_SYS_undelete 205 -#define IA32_SYS_futimes 206 -#define IA32_SYS_getpgid 207 -#define IA32_SYS_poll 209 -#define IA32_SYS___semctl 220 -#define IA32_SYS_semget 221 -#define IA32_SYS_semop 222 -#define IA32_SYS_msgctl 224 -#define IA32_SYS_msgget 225 -#define IA32_SYS_msgsnd 226 -#define IA32_SYS_msgrcv 227 -#define IA32_SYS_shmat 228 -#define IA32_SYS_shmctl 229 -#define IA32_SYS_shmdt 230 -#define IA32_SYS_shmget 231 -#define IA32_SYS_clock_gettime 232 -#define IA32_SYS_clock_settime 233 -#define IA32_SYS_clock_getres 234 -#define IA32_SYS_nanosleep 240 -#define IA32_SYS_minherit 250 -#define IA32_SYS_rfork 251 -#define IA32_SYS_openbsd_poll 252 -#define IA32_SYS_issetugid 253 -#define IA32_SYS_lchown 254 -#define IA32_SYS_getdents 272 -#define IA32_SYS_lchmod 274 -#define IA32_SYS_netbsd_lchown 275 -#define IA32_SYS_lutimes 276 -#define IA32_SYS_netbsd_msync 277 -#define IA32_SYS_nstat 278 -#define IA32_SYS_nfstat 279 -#define IA32_SYS_nlstat 280 -#define IA32_SYS_fhstatfs 297 -#define IA32_SYS_fhopen 298 -#define IA32_SYS_fhstat 299 -#define IA32_SYS_modnext 300 -#define IA32_SYS_modstat 301 -#define IA32_SYS_modfnext 302 -#define IA32_SYS_modfind 303 -#define IA32_SYS_kldload 304 -#define IA32_SYS_kldunload 305 -#define IA32_SYS_kldfind 306 -#define IA32_SYS_kldnext 307 -#define IA32_SYS_kldstat 308 -#define IA32_SYS_kldfirstmod 309 -#define IA32_SYS_getsid 310 -#define IA32_SYS_setresuid 311 -#define IA32_SYS_setresgid 312 - /* 313 is obsolete signanosleep */ -#define IA32_SYS_yield 321 - /* 322 is obsolete thr_sleep */ - /* 323 is obsolete thr_wakeup */ -#define IA32_SYS_mlockall 324 -#define IA32_SYS_munlockall 325 -#define IA32_SYS___getcwd 326 -#define IA32_SYS_sched_setparam 327 -#define IA32_SYS_sched_getparam 328 -#define IA32_SYS_sched_setscheduler 329 -#define IA32_SYS_sched_getscheduler 330 -#define IA32_SYS_sched_yield 331 -#define IA32_SYS_sched_get_priority_max 332 -#define IA32_SYS_sched_get_priority_min 333 -#define IA32_SYS_sched_rr_get_interval 334 -#define IA32_SYS_utrace 335 - /* 336 is old ia32_sendfile */ -#define IA32_SYS_kldsym 337 -#define IA32_SYS_jail 338 -#define IA32_SYS_sigprocmask 340 -#define IA32_SYS_sigsuspend 341 - /* 342 is old ia32_sigaction */ -#define IA32_SYS_sigpending 343 - /* 344 is old ia32_sigreturn */ -#define IA32_SYS___acl_get_file 347 -#define IA32_SYS___acl_set_file 348 -#define IA32_SYS___acl_get_fd 349 -#define IA32_SYS___acl_set_fd 350 -#define IA32_SYS___acl_delete_file 351 -#define IA32_SYS___acl_delete_fd 352 -#define IA32_SYS___acl_aclcheck_file 353 -#define IA32_SYS___acl_aclcheck_fd 354 -#define IA32_SYS_extattrctl 355 -#define IA32_SYS_extattr_set_file 356 -#define IA32_SYS_extattr_get_file 357 -#define IA32_SYS_extattr_delete_file 358 -#define IA32_SYS_getresuid 360 -#define IA32_SYS_getresgid 361 -#define IA32_SYS_kqueue 362 -#define IA32_SYS_ia32_kevent 363 -#define IA32_SYS_extattr_set_fd 371 -#define IA32_SYS_extattr_get_fd 372 -#define IA32_SYS_extattr_delete_fd 373 -#define IA32_SYS___setugid 374 -#define IA32_SYS_eaccess 376 -#define IA32_SYS_nmount 378 -#define IA32_SYS_kse_exit 379 -#define IA32_SYS_kse_wakeup 380 -#define IA32_SYS_kse_create 381 -#define IA32_SYS_kse_thr_interrupt 382 -#define IA32_SYS_kse_release 383 -#define IA32_SYS_kenv 390 -#define IA32_SYS_lchflags 391 -#define IA32_SYS_uuidgen 392 -#define IA32_SYS_ia32_sendfile 393 -#define IA32_SYS_ia32_sigaction 416 -#define IA32_SYS_ia32_sigreturn 417 -#define IA32_SYS_thr_create 430 -#define IA32_SYS_thr_exit 431 -#define IA32_SYS_thr_self 432 -#define IA32_SYS_thr_kill 433 -#define IA32_SYS__umtx_lock 434 -#define IA32_SYS__umtx_unlock 435 -#define IA32_SYS_jail_attach 436 -#define IA32_SYS_MAXSYSCALL 437 diff --git a/sys/amd64/ia32/ia32_syscalls.c b/sys/amd64/ia32/ia32_syscalls.c deleted file mode 100644 index 3b399f9..0000000 --- a/sys/amd64/ia32/ia32_syscalls.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - * System call names. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/ia32/syscalls.master,v 1.23 2003/08/21 03:48:05 peter Exp - */ - -const char *ia32_syscallnames[] = { - "syscall", /* 0 = syscall */ - "exit", /* 1 = exit */ - "fork", /* 2 = fork */ - "read", /* 3 = read */ - "write", /* 4 = write */ - "ia32_open", /* 5 = ia32_open */ - "close", /* 6 = close */ - "ia32_wait4", /* 7 = ia32_wait4 */ - "obs_old", /* 8 = obsolete old creat */ - "link", /* 9 = link */ - "unlink", /* 10 = unlink */ - "obs_execv", /* 11 = obsolete execv */ - "chdir", /* 12 = chdir */ - "fchdir", /* 13 = fchdir */ - "mknod", /* 14 = mknod */ - "chmod", /* 15 = chmod */ - "chown", /* 16 = chown */ - "break", /* 17 = break */ - "ia32_getfsstat", /* 18 = ia32_getfsstat */ - "obs_olseek", /* 19 = obsolete olseek */ - "getpid", /* 20 = getpid */ - "mount", /* 21 = mount */ - "unmount", /* 22 = unmount */ - "setuid", /* 23 = setuid */ - "getuid", /* 24 = getuid */ - "geteuid", /* 25 = geteuid */ - "ptrace", /* 26 = ptrace */ - "#27", /* 27 = recvmsg */ - "sendmsg", /* 28 = sendmsg */ - "recvfrom", /* 29 = recvfrom */ - "accept", /* 30 = accept */ - "getpeername", /* 31 = getpeername */ - "getsockname", /* 32 = getsockname */ - "ia32_access", /* 33 = ia32_access */ - "ia32_chflags", /* 34 = ia32_chflags */ - "fchflags", /* 35 = fchflags */ - "sync", /* 36 = sync */ - "kill", /* 37 = kill */ - "#38", /* 38 = ostat */ - "getppid", /* 39 = getppid */ - "#40", /* 40 = olstat */ - "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ - "getegid", /* 43 = getegid */ - "profil", /* 44 = profil */ - "ktrace", /* 45 = ktrace */ - "#46", /* 46 = osigaction */ - "getgid", /* 47 = getgid */ - "#48", /* 48 = osigprocmask */ - "getlogin", /* 49 = getlogin */ - "setlogin", /* 50 = setlogin */ - "acct", /* 51 = acct */ - "sigpending", /* 52 = sigpending */ - "ia32_sigaltstack", /* 53 = ia32_sigaltstack */ - "ioctl", /* 54 = ioctl */ - "reboot", /* 55 = reboot */ - "revoke", /* 56 = revoke */ - "symlink", /* 57 = symlink */ - "readlink", /* 58 = readlink */ - "ia32_execve", /* 59 = ia32_execve */ - "umask", /* 60 = umask */ - "chroot", /* 61 = chroot */ - "obs_ofstat", /* 62 = obsolete ofstat */ - "obs_ogetkerninfo", /* 63 = obsolete ogetkerninfo */ - "obs_ogetpagesize", /* 64 = obsolete ogetpagesize */ - "obs_omsync", /* 65 = obsolete omsync */ - "obs_ovfork", /* 66 = obsolete ovfork */ - "obs_vread", /* 67 = obsolete vread */ - "obs_vwrite", /* 68 = obsolete vwrite */ - "sbrk", /* 69 = sbrk */ - "sstk", /* 70 = sstk */ - "obs_ommap", /* 71 = obsolete ommap */ - "vadvise", /* 72 = vadvise */ - "munmap", /* 73 = munmap */ - "mprotect", /* 74 = mprotect */ - "madvise", /* 75 = madvise */ - "obs_vhangup", /* 76 = obsolete vhangup */ - "obs_vlimit", /* 77 = obsolete vlimit */ - "mincore", /* 78 = mincore */ - "getgroups", /* 79 = getgroups */ - "setgroups", /* 80 = setgroups */ - "getpgrp", /* 81 = getpgrp */ - "setpgid", /* 82 = setpgid */ - "ia32_setitimer", /* 83 = ia32_setitimer */ - "obs_owait", /* 84 = obsolete owait */ - "obs_oswapon", /* 85 = obsolete oswapon */ - "obs_ogetitimer", /* 86 = obsolete ogetitimer */ - "obs_ogethostname", /* 87 = obsolete ogethostname */ - "obs_osethostname", /* 88 = obsolete osethostname */ - "getdtablesize", /* 89 = getdtablesize */ - "dup2", /* 90 = dup2 */ - "#91", /* 91 = getdopt */ - "fcntl", /* 92 = fcntl */ - "ia32_select", /* 93 = ia32_select */ - "#94", /* 94 = setdopt */ - "fsync", /* 95 = fsync */ - "setpriority", /* 96 = setpriority */ - "socket", /* 97 = socket */ - "connect", /* 98 = connect */ - "accept", /* 99 = accept */ - "getpriority", /* 100 = getpriority */ - "obs_osend", /* 101 = obsolete osend */ - "obs_orecv", /* 102 = obsolete orecv */ - "obs_osigreturn", /* 103 = obsolete osigreturn */ - "bind", /* 104 = bind */ - "setsockopt", /* 105 = setsockopt */ - "listen", /* 106 = listen */ - "obs_vtimes", /* 107 = obsolete vtimes */ - "obs_osigvec", /* 108 = obsolete osigvec */ - "obs_osigblock", /* 109 = obsolete osigblock */ - "obs_osigsetmask", /* 110 = obsolete osigsetmask */ - "obs_osigsuspend", /* 111 = obsolete osigsuspend */ - "obs_osigstack", /* 112 = obsolete osigstack */ - "obs_orecvmsg", /* 113 = obsolete orecvmsg */ - "obs_osendmsg", /* 114 = obsolete osendmsg */ - "obs_vtrace", /* 115 = obsolete vtrace */ - "ia32_gettimeofday", /* 116 = ia32_gettimeofday */ - "ia32_getrusage", /* 117 = ia32_getrusage */ - "getsockopt", /* 118 = getsockopt */ - "#119", /* 119 = resuba */ - "ia32_readv", /* 120 = ia32_readv */ - "ia32_writev", /* 121 = ia32_writev */ - "ia32_settimeofday", /* 122 = ia32_settimeofday */ - "fchown", /* 123 = fchown */ - "fchmod", /* 124 = fchmod */ - "recvfrom", /* 125 = recvfrom */ - "setreuid", /* 126 = setreuid */ - "setregid", /* 127 = setregid */ - "rename", /* 128 = rename */ - "obs_otruncate", /* 129 = obsolete otruncate */ - "obs_ftruncate", /* 130 = obsolete ftruncate */ - "flock", /* 131 = flock */ - "mkfifo", /* 132 = mkfifo */ - "sendto", /* 133 = sendto */ - "shutdown", /* 134 = shutdown */ - "socketpair", /* 135 = socketpair */ - "mkdir", /* 136 = mkdir */ - "rmdir", /* 137 = rmdir */ - "ia32_utimes", /* 138 = ia32_utimes */ - "obs_4.2", /* 139 = obsolete 4.2 sigreturn */ - "ia32_adjtime", /* 140 = ia32_adjtime */ - "obs_ogetpeername", /* 141 = obsolete ogetpeername */ - "obs_ogethostid", /* 142 = obsolete ogethostid */ - "obs_sethostid", /* 143 = obsolete sethostid */ - "obs_getrlimit", /* 144 = obsolete getrlimit */ - "obs_setrlimit", /* 145 = obsolete setrlimit */ - "obs_killpg", /* 146 = obsolete killpg */ - "setsid", /* 147 = setsid */ - "quotactl", /* 148 = quotactl */ - "obs_oquota", /* 149 = obsolete oquota */ - "obs_ogetsockname", /* 150 = obsolete ogetsockname */ - "#151", /* 151 = sem_lock */ - "#152", /* 152 = sem_wakeup */ - "#153", /* 153 = asyncdaemon */ - "#154", /* 154 = nosys */ - "#155", /* 155 = nfssvc */ - "getdirentries", /* 156 = getdirentries */ - "ia32_statfs", /* 157 = ia32_statfs */ - "ia32_fstatfs", /* 158 = ia32_fstatfs */ - "#159", /* 159 = nosys */ - "#160", /* 160 = nosys */ - "getfh", /* 161 = getfh */ - "getdomainname", /* 162 = getdomainname */ - "setdomainname", /* 163 = setdomainname */ - "uname", /* 164 = uname */ - "sysarch", /* 165 = sysarch */ - "rtprio", /* 166 = rtprio */ - "#167", /* 167 = nosys */ - "#168", /* 168 = nosys */ - "ia32_semsys", /* 169 = ia32_semsys */ - "ia32_msgsys", /* 170 = ia32_msgsys */ - "ia32_shmsys", /* 171 = ia32_shmsys */ - "#172", /* 172 = nosys */ - "ia32_pread", /* 173 = ia32_pread */ - "ia32_pwrite", /* 174 = ia32_pwrite */ - "#175", /* 175 = nosys */ - "ntp_adjtime", /* 176 = ntp_adjtime */ - "#177", /* 177 = sfork */ - "#178", /* 178 = getdescriptor */ - "#179", /* 179 = setdescriptor */ - "#180", /* 180 = nosys */ - "setgid", /* 181 = setgid */ - "setegid", /* 182 = setegid */ - "seteuid", /* 183 = seteuid */ - "#184", /* 184 = lfs_bmapv */ - "#185", /* 185 = lfs_markv */ - "#186", /* 186 = lfs_segclean */ - "#187", /* 187 = lfs_segwait */ - "ia32_stat", /* 188 = ia32_stat */ - "ia32_fstat", /* 189 = ia32_fstat */ - "ia32_lstat", /* 190 = ia32_lstat */ - "pathconf", /* 191 = pathconf */ - "fpathconf", /* 192 = fpathconf */ - "#193", /* 193 = nosys */ - "getrlimit", /* 194 = getrlimit */ - "setrlimit", /* 195 = setrlimit */ - "getdirentries", /* 196 = getdirentries */ - "ia32_mmap", /* 197 = ia32_mmap */ - "__syscall", /* 198 = __syscall */ - "ia32_lseek", /* 199 = ia32_lseek */ - "ia32_truncate", /* 200 = ia32_truncate */ - "ia32_ftruncate", /* 201 = ia32_ftruncate */ - "ia32_sysctl", /* 202 = ia32_sysctl */ - "mlock", /* 203 = mlock */ - "munlock", /* 204 = munlock */ - "undelete", /* 205 = undelete */ - "futimes", /* 206 = futimes */ - "getpgid", /* 207 = getpgid */ - "#208", /* 208 = newreboot */ - "poll", /* 209 = poll */ - "#210", /* 210 = */ - "#211", /* 211 = */ - "#212", /* 212 = */ - "#213", /* 213 = */ - "#214", /* 214 = */ - "#215", /* 215 = */ - "#216", /* 216 = */ - "#217", /* 217 = */ - "#218", /* 218 = */ - "#219", /* 219 = */ - "__semctl", /* 220 = __semctl */ - "semget", /* 221 = semget */ - "semop", /* 222 = semop */ - "#223", /* 223 = semconfig */ - "msgctl", /* 224 = msgctl */ - "msgget", /* 225 = msgget */ - "msgsnd", /* 226 = msgsnd */ - "msgrcv", /* 227 = msgrcv */ - "shmat", /* 228 = shmat */ - "shmctl", /* 229 = shmctl */ - "shmdt", /* 230 = shmdt */ - "shmget", /* 231 = shmget */ - "clock_gettime", /* 232 = clock_gettime */ - "clock_settime", /* 233 = clock_settime */ - "clock_getres", /* 234 = clock_getres */ - "#235", /* 235 = timer_create */ - "#236", /* 236 = timer_delete */ - "#237", /* 237 = timer_settime */ - "#238", /* 238 = timer_gettime */ - "#239", /* 239 = timer_getoverrun */ - "nanosleep", /* 240 = nanosleep */ - "#241", /* 241 = nosys */ - "#242", /* 242 = nosys */ - "#243", /* 243 = nosys */ - "#244", /* 244 = nosys */ - "#245", /* 245 = nosys */ - "#246", /* 246 = nosys */ - "#247", /* 247 = nosys */ - "#248", /* 248 = nosys */ - "#249", /* 249 = nosys */ - "minherit", /* 250 = minherit */ - "rfork", /* 251 = rfork */ - "openbsd_poll", /* 252 = openbsd_poll */ - "issetugid", /* 253 = issetugid */ - "lchown", /* 254 = lchown */ - "#255", /* 255 = nosys */ - "#256", /* 256 = nosys */ - "#257", /* 257 = nosys */ - "#258", /* 258 = nosys */ - "#259", /* 259 = nosys */ - "#260", /* 260 = nosys */ - "#261", /* 261 = nosys */ - "#262", /* 262 = nosys */ - "#263", /* 263 = nosys */ - "#264", /* 264 = nosys */ - "#265", /* 265 = nosys */ - "#266", /* 266 = nosys */ - "#267", /* 267 = nosys */ - "#268", /* 268 = nosys */ - "#269", /* 269 = nosys */ - "#270", /* 270 = nosys */ - "#271", /* 271 = nosys */ - "getdents", /* 272 = getdents */ - "#273", /* 273 = nosys */ - "lchmod", /* 274 = lchmod */ - "netbsd_lchown", /* 275 = netbsd_lchown */ - "lutimes", /* 276 = lutimes */ - "netbsd_msync", /* 277 = netbsd_msync */ - "nstat", /* 278 = nstat */ - "nfstat", /* 279 = nfstat */ - "nlstat", /* 280 = nlstat */ - "#281", /* 281 = nosys */ - "#282", /* 282 = nosys */ - "#283", /* 283 = nosys */ - "#284", /* 284 = nosys */ - "#285", /* 285 = nosys */ - "#286", /* 286 = nosys */ - "#287", /* 287 = nosys */ - "#288", /* 288 = nosys */ - "#289", /* 289 = nosys */ - "#290", /* 290 = nosys */ - "#291", /* 291 = nosys */ - "#292", /* 292 = nosys */ - "#293", /* 293 = nosys */ - "#294", /* 294 = nosys */ - "#295", /* 295 = nosys */ - "#296", /* 296 = nosys */ - "fhstatfs", /* 297 = fhstatfs */ - "fhopen", /* 298 = fhopen */ - "fhstat", /* 299 = fhstat */ - "modnext", /* 300 = modnext */ - "modstat", /* 301 = modstat */ - "modfnext", /* 302 = modfnext */ - "modfind", /* 303 = modfind */ - "kldload", /* 304 = kldload */ - "kldunload", /* 305 = kldunload */ - "kldfind", /* 306 = kldfind */ - "kldnext", /* 307 = kldnext */ - "kldstat", /* 308 = kldstat */ - "kldfirstmod", /* 309 = kldfirstmod */ - "getsid", /* 310 = getsid */ - "setresuid", /* 311 = setresuid */ - "setresgid", /* 312 = setresgid */ - "obs_signanosleep", /* 313 = obsolete signanosleep */ - "#314", /* 314 = aio_return */ - "#315", /* 315 = aio_suspend */ - "#316", /* 316 = aio_cancel */ - "#317", /* 317 = aio_error */ - "#318", /* 318 = aio_read */ - "#319", /* 319 = aio_write */ - "#320", /* 320 = lio_listio */ - "yield", /* 321 = yield */ - "obs_thr_sleep", /* 322 = obsolete thr_sleep */ - "obs_thr_wakeup", /* 323 = obsolete thr_wakeup */ - "mlockall", /* 324 = mlockall */ - "munlockall", /* 325 = munlockall */ - "__getcwd", /* 326 = __getcwd */ - "sched_setparam", /* 327 = sched_setparam */ - "sched_getparam", /* 328 = sched_getparam */ - "sched_setscheduler", /* 329 = sched_setscheduler */ - "sched_getscheduler", /* 330 = sched_getscheduler */ - "sched_yield", /* 331 = sched_yield */ - "sched_get_priority_max", /* 332 = sched_get_priority_max */ - "sched_get_priority_min", /* 333 = sched_get_priority_min */ - "sched_rr_get_interval", /* 334 = sched_rr_get_interval */ - "utrace", /* 335 = utrace */ - "old.ia32_sendfile", /* 336 = old ia32_sendfile */ - "kldsym", /* 337 = kldsym */ - "jail", /* 338 = jail */ - "#339", /* 339 = pioctl */ - "sigprocmask", /* 340 = sigprocmask */ - "sigsuspend", /* 341 = sigsuspend */ - "old.ia32_sigaction", /* 342 = old ia32_sigaction */ - "sigpending", /* 343 = sigpending */ - "old.ia32_sigreturn", /* 344 = old ia32_sigreturn */ - "#345", /* 345 = sigtimedwait */ - "#346", /* 346 = sigwaitinfo */ - "__acl_get_file", /* 347 = __acl_get_file */ - "__acl_set_file", /* 348 = __acl_set_file */ - "__acl_get_fd", /* 349 = __acl_get_fd */ - "__acl_set_fd", /* 350 = __acl_set_fd */ - "__acl_delete_file", /* 351 = __acl_delete_file */ - "__acl_delete_fd", /* 352 = __acl_delete_fd */ - "__acl_aclcheck_file", /* 353 = __acl_aclcheck_file */ - "__acl_aclcheck_fd", /* 354 = __acl_aclcheck_fd */ - "extattrctl", /* 355 = extattrctl */ - "extattr_set_file", /* 356 = extattr_set_file */ - "extattr_get_file", /* 357 = extattr_get_file */ - "extattr_delete_file", /* 358 = extattr_delete_file */ - "#359", /* 359 = aio_waitcomplete */ - "getresuid", /* 360 = getresuid */ - "getresgid", /* 361 = getresgid */ - "kqueue", /* 362 = kqueue */ - "ia32_kevent", /* 363 = ia32_kevent */ - "#364", /* 364 = __cap_get_proc */ - "#365", /* 365 = __cap_set_proc */ - "#366", /* 366 = __cap_get_fd */ - "#367", /* 367 = __cap_get_file */ - "#368", /* 368 = __cap_set_fd */ - "#369", /* 369 = __cap_set_file */ - "#370", /* 370 = lkmressys */ - "extattr_set_fd", /* 371 = extattr_set_fd */ - "extattr_get_fd", /* 372 = extattr_get_fd */ - "extattr_delete_fd", /* 373 = extattr_delete_fd */ - "__setugid", /* 374 = __setugid */ - "#375", /* 375 = nfsclnt */ - "eaccess", /* 376 = eaccess */ - "#377", /* 377 = afs_syscall */ - "nmount", /* 378 = nmount */ - "kse_exit", /* 379 = kse_exit */ - "kse_wakeup", /* 380 = kse_wakeup */ - "kse_create", /* 381 = kse_create */ - "kse_thr_interrupt", /* 382 = kse_thr_interrupt */ - "kse_release", /* 383 = kse_release */ - "#384", /* 384 = __mac_get_proc */ - "#385", /* 385 = __mac_set_proc */ - "#386", /* 386 = __mac_get_fd */ - "#387", /* 387 = __mac_get_file */ - "#388", /* 388 = __mac_set_fd */ - "#389", /* 389 = __mac_set_file */ - "kenv", /* 390 = kenv */ - "lchflags", /* 391 = lchflags */ - "uuidgen", /* 392 = uuidgen */ - "ia32_sendfile", /* 393 = ia32_sendfile */ - "#394", /* 394 = mac_syscall */ - "#395", /* 395 = nosys */ - "#396", /* 396 = nosys */ - "#397", /* 397 = nosys */ - "#398", /* 398 = nosys */ - "#399", /* 399 = nosys */ - "#400", /* 400 = ksem_close */ - "#401", /* 401 = ksem_post */ - "#402", /* 402 = ksem_wait */ - "#403", /* 403 = ksem_trywait */ - "#404", /* 404 = ksem_init */ - "#405", /* 405 = ksem_open */ - "#406", /* 406 = ksem_unlink */ - "#407", /* 407 = ksem_getvalue */ - "#408", /* 408 = ksem_destroy */ - "#409", /* 409 = __mac_get_pid */ - "#410", /* 410 = __mac_get_link */ - "#411", /* 411 = __mac_set_link */ - "#412", /* 412 = extattr_set_link */ - "#413", /* 413 = extattr_get_link */ - "#414", /* 414 = extattr_delete_link */ - "#415", /* 415 = __mac_execve */ - "ia32_sigaction", /* 416 = ia32_sigaction */ - "ia32_sigreturn", /* 417 = ia32_sigreturn */ - "#418", /* 418 = __xstat */ - "#419", /* 419 = __xfstat */ - "#420", /* 420 = __xlstat */ - "#421", /* 421 = getcontext */ - "#422", /* 422 = setcontext */ - "#423", /* 423 = swapcontext */ - "#424", /* 424 = swapoff */ - "#425", /* 425 = __acl_get_link */ - "#426", /* 426 = __acl_set_link */ - "#427", /* 427 = __acl_delete_link */ - "#428", /* 428 = __acl_aclcheck_link */ - "#429", /* 429 = sigwait */ - "thr_create", /* 430 = thr_create */ - "thr_exit", /* 431 = thr_exit */ - "thr_self", /* 432 = thr_self */ - "thr_kill", /* 433 = thr_kill */ - "_umtx_lock", /* 434 = _umtx_lock */ - "_umtx_unlock", /* 435 = _umtx_unlock */ - "jail_attach", /* 436 = jail_attach */ -}; diff --git a/sys/amd64/ia32/ia32_sysent.c b/sys/amd64/ia32/ia32_sysent.c deleted file mode 100644 index c39e4d9..0000000 --- a/sys/amd64/ia32/ia32_sysent.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * System call switch table. - * - * DO NOT EDIT-- this file is automatically generated. - * $FreeBSD$ - * created from FreeBSD: src/sys/amd64/ia32/syscalls.master,v 1.23 2003/08/21 03:48:05 peter Exp - */ - -#include "opt_compat.h" - -#include <sys/param.h> -#include <sys/sysent.h> -#include <sys/sysproto.h> -#include <sys/mount.h> -#include <amd64/ia32/ia32.h> -#include <amd64/ia32/ia32_proto.h> - -#define AS(name) (sizeof(struct name) / sizeof(register_t)) - -#ifdef COMPAT_FREEBSD4 -#define compat4(n, name) n, (sy_call_t *)__CONCAT(freebsd4_,name) -#else -#define compat4(n, name) 0, (sy_call_t *)nosys -#endif - -/* The casts are bogus but will do for now. */ -struct sysent ia32_sysent[] = { - { SYF_MPSAFE | 0, (sy_call_t *)nosys }, /* 0 = syscall */ - { SYF_MPSAFE | AS(sys_exit_args), (sy_call_t *)sys_exit }, /* 1 = exit */ - { SYF_MPSAFE | 0, (sy_call_t *)fork }, /* 2 = fork */ - { SYF_MPSAFE | AS(read_args), (sy_call_t *)read }, /* 3 = read */ - { SYF_MPSAFE | AS(write_args), (sy_call_t *)write }, /* 4 = write */ - { AS(ia32_open_args), (sy_call_t *)ia32_open }, /* 5 = ia32_open */ - { SYF_MPSAFE | AS(close_args), (sy_call_t *)close }, /* 6 = close */ - { SYF_MPSAFE | AS(ia32_wait4_args), (sy_call_t *)ia32_wait4 }, /* 7 = ia32_wait4 */ - { 0, (sy_call_t *)nosys }, /* 8 = obsolete old creat */ - { AS(link_args), (sy_call_t *)link }, /* 9 = link */ - { AS(unlink_args), (sy_call_t *)unlink }, /* 10 = unlink */ - { 0, (sy_call_t *)nosys }, /* 11 = obsolete execv */ - { AS(chdir_args), (sy_call_t *)chdir }, /* 12 = chdir */ - { AS(fchdir_args), (sy_call_t *)fchdir }, /* 13 = fchdir */ - { AS(mknod_args), (sy_call_t *)mknod }, /* 14 = mknod */ - { AS(chmod_args), (sy_call_t *)chmod }, /* 15 = chmod */ - { AS(chown_args), (sy_call_t *)chown }, /* 16 = chown */ - { SYF_MPSAFE | AS(obreak_args), (sy_call_t *)obreak }, /* 17 = break */ - { AS(ia32_getfsstat_args), (sy_call_t *)ia32_getfsstat }, /* 18 = ia32_getfsstat */ - { 0, (sy_call_t *)nosys }, /* 19 = obsolete olseek */ - { SYF_MPSAFE | 0, (sy_call_t *)getpid }, /* 20 = getpid */ - { AS(mount_args), (sy_call_t *)mount }, /* 21 = mount */ - { AS(unmount_args), (sy_call_t *)unmount }, /* 22 = unmount */ - { SYF_MPSAFE | AS(setuid_args), (sy_call_t *)setuid }, /* 23 = setuid */ - { SYF_MPSAFE | 0, (sy_call_t *)getuid }, /* 24 = getuid */ - { SYF_MPSAFE | 0, (sy_call_t *)geteuid }, /* 25 = geteuid */ - { AS(ptrace_args), (sy_call_t *)ptrace }, /* 26 = ptrace */ - { 0, (sy_call_t *)nosys }, /* 27 = recvmsg */ - { SYF_MPSAFE | AS(sendmsg_args), (sy_call_t *)sendmsg }, /* 28 = sendmsg */ - { SYF_MPSAFE | AS(recvfrom_args), (sy_call_t *)recvfrom }, /* 29 = recvfrom */ - { SYF_MPSAFE | AS(accept_args), (sy_call_t *)accept }, /* 30 = accept */ - { SYF_MPSAFE | AS(getpeername_args), (sy_call_t *)getpeername }, /* 31 = getpeername */ - { SYF_MPSAFE | AS(getsockname_args), (sy_call_t *)getsockname }, /* 32 = getsockname */ - { AS(ia32_access_args), (sy_call_t *)ia32_access }, /* 33 = ia32_access */ - { AS(ia32_chflags_args), (sy_call_t *)ia32_chflags }, /* 34 = ia32_chflags */ - { AS(fchflags_args), (sy_call_t *)fchflags }, /* 35 = fchflags */ - { 0, (sy_call_t *)sync }, /* 36 = sync */ - { SYF_MPSAFE | AS(kill_args), (sy_call_t *)kill }, /* 37 = kill */ - { 0, (sy_call_t *)nosys }, /* 38 = ostat */ - { SYF_MPSAFE | 0, (sy_call_t *)getppid }, /* 39 = getppid */ - { 0, (sy_call_t *)nosys }, /* 40 = olstat */ - { AS(dup_args), (sy_call_t *)dup }, /* 41 = dup */ - { 0, (sy_call_t *)pipe }, /* 42 = pipe */ - { SYF_MPSAFE | 0, (sy_call_t *)getegid }, /* 43 = getegid */ - { SYF_MPSAFE | AS(profil_args), (sy_call_t *)profil }, /* 44 = profil */ - { AS(ktrace_args), (sy_call_t *)ktrace }, /* 45 = ktrace */ - { 0, (sy_call_t *)nosys }, /* 46 = osigaction */ - { SYF_MPSAFE | 0, (sy_call_t *)getgid }, /* 47 = getgid */ - { 0, (sy_call_t *)nosys }, /* 48 = osigprocmask */ - { SYF_MPSAFE | AS(getlogin_args), (sy_call_t *)getlogin }, /* 49 = getlogin */ - { SYF_MPSAFE | AS(setlogin_args), (sy_call_t *)setlogin }, /* 50 = setlogin */ - { SYF_MPSAFE | AS(acct_args), (sy_call_t *)acct }, /* 51 = acct */ - { SYF_MPSAFE | 0, (sy_call_t *)sigpending }, /* 52 = sigpending */ - { AS(ia32_sigaltstack_args), (sy_call_t *)ia32_sigaltstack }, /* 53 = ia32_sigaltstack */ - { SYF_MPSAFE | AS(ioctl_args), (sy_call_t *)ioctl }, /* 54 = ioctl */ - { SYF_MPSAFE | AS(reboot_args), (sy_call_t *)reboot }, /* 55 = reboot */ - { AS(revoke_args), (sy_call_t *)revoke }, /* 56 = revoke */ - { AS(symlink_args), (sy_call_t *)symlink }, /* 57 = symlink */ - { AS(readlink_args), (sy_call_t *)readlink }, /* 58 = readlink */ - { AS(ia32_execve_args), (sy_call_t *)ia32_execve }, /* 59 = ia32_execve */ - { SYF_MPSAFE | AS(umask_args), (sy_call_t *)umask }, /* 60 = umask */ - { AS(chroot_args), (sy_call_t *)chroot }, /* 61 = chroot */ - { 0, (sy_call_t *)nosys }, /* 62 = obsolete ofstat */ - { 0, (sy_call_t *)nosys }, /* 63 = obsolete ogetkerninfo */ - { 0, (sy_call_t *)nosys }, /* 64 = obsolete ogetpagesize */ - { 0, (sy_call_t *)nosys }, /* 65 = obsolete omsync */ - { 0, (sy_call_t *)nosys }, /* 66 = obsolete ovfork */ - { 0, (sy_call_t *)nosys }, /* 67 = obsolete vread */ - { 0, (sy_call_t *)nosys }, /* 68 = obsolete vwrite */ - { SYF_MPSAFE | AS(sbrk_args), (sy_call_t *)sbrk }, /* 69 = sbrk */ - { SYF_MPSAFE | AS(sstk_args), (sy_call_t *)sstk }, /* 70 = sstk */ - { 0, (sy_call_t *)nosys }, /* 71 = obsolete ommap */ - { SYF_MPSAFE | AS(ovadvise_args), (sy_call_t *)ovadvise }, /* 72 = vadvise */ - { SYF_MPSAFE | AS(munmap_args), (sy_call_t *)munmap }, /* 73 = munmap */ - { SYF_MPSAFE | AS(mprotect_args), (sy_call_t *)mprotect }, /* 74 = mprotect */ - { SYF_MPSAFE | AS(madvise_args), (sy_call_t *)madvise }, /* 75 = madvise */ - { 0, (sy_call_t *)nosys }, /* 76 = obsolete vhangup */ - { 0, (sy_call_t *)nosys }, /* 77 = obsolete vlimit */ - { SYF_MPSAFE | AS(mincore_args), (sy_call_t *)mincore }, /* 78 = mincore */ - { SYF_MPSAFE | AS(getgroups_args), (sy_call_t *)getgroups }, /* 79 = getgroups */ - { SYF_MPSAFE | AS(setgroups_args), (sy_call_t *)setgroups }, /* 80 = setgroups */ - { SYF_MPSAFE | 0, (sy_call_t *)getpgrp }, /* 81 = getpgrp */ - { SYF_MPSAFE | AS(setpgid_args), (sy_call_t *)setpgid }, /* 82 = setpgid */ - { AS(ia32_setitimer_args), (sy_call_t *)ia32_setitimer }, /* 83 = ia32_setitimer */ - { 0, (sy_call_t *)nosys }, /* 84 = obsolete owait */ - { 0, (sy_call_t *)nosys }, /* 85 = obsolete oswapon */ - { 0, (sy_call_t *)nosys }, /* 86 = obsolete ogetitimer */ - { 0, (sy_call_t *)nosys }, /* 87 = obsolete ogethostname */ - { 0, (sy_call_t *)nosys }, /* 88 = obsolete osethostname */ - { SYF_MPSAFE | 0, (sy_call_t *)getdtablesize }, /* 89 = getdtablesize */ - { SYF_MPSAFE | AS(dup2_args), (sy_call_t *)dup2 }, /* 90 = dup2 */ - { 0, (sy_call_t *)nosys }, /* 91 = getdopt */ - { SYF_MPSAFE | AS(fcntl_args), (sy_call_t *)fcntl }, /* 92 = fcntl */ - { AS(ia32_select_args), (sy_call_t *)ia32_select }, /* 93 = ia32_select */ - { 0, (sy_call_t *)nosys }, /* 94 = setdopt */ - { AS(fsync_args), (sy_call_t *)fsync }, /* 95 = fsync */ - { SYF_MPSAFE | AS(setpriority_args), (sy_call_t *)setpriority }, /* 96 = setpriority */ - { SYF_MPSAFE | AS(socket_args), (sy_call_t *)socket }, /* 97 = socket */ - { SYF_MPSAFE | AS(connect_args), (sy_call_t *)connect }, /* 98 = connect */ - { SYF_MPSAFE | AS(accept_args), (sy_call_t *)accept }, /* 99 = accept */ - { SYF_MPSAFE | AS(getpriority_args), (sy_call_t *)getpriority }, /* 100 = getpriority */ - { 0, (sy_call_t *)nosys }, /* 101 = obsolete osend */ - { 0, (sy_call_t *)nosys }, /* 102 = obsolete orecv */ - { 0, (sy_call_t *)nosys }, /* 103 = obsolete osigreturn */ - { SYF_MPSAFE | AS(bind_args), (sy_call_t *)bind }, /* 104 = bind */ - { SYF_MPSAFE | AS(setsockopt_args), (sy_call_t *)setsockopt }, /* 105 = setsockopt */ - { SYF_MPSAFE | AS(listen_args), (sy_call_t *)listen }, /* 106 = listen */ - { 0, (sy_call_t *)nosys }, /* 107 = obsolete vtimes */ - { 0, (sy_call_t *)nosys }, /* 108 = obsolete osigvec */ - { 0, (sy_call_t *)nosys }, /* 109 = obsolete osigblock */ - { 0, (sy_call_t *)nosys }, /* 110 = obsolete osigsetmask */ - { 0, (sy_call_t *)nosys }, /* 111 = obsolete osigsuspend */ - { 0, (sy_call_t *)nosys }, /* 112 = obsolete osigstack */ - { 0, (sy_call_t *)nosys }, /* 113 = obsolete orecvmsg */ - { 0, (sy_call_t *)nosys }, /* 114 = obsolete osendmsg */ - { 0, (sy_call_t *)nosys }, /* 115 = obsolete vtrace */ - { AS(ia32_gettimeofday_args), (sy_call_t *)ia32_gettimeofday }, /* 116 = ia32_gettimeofday */ - { AS(ia32_getrusage_args), (sy_call_t *)ia32_getrusage }, /* 117 = ia32_getrusage */ - { SYF_MPSAFE | AS(getsockopt_args), (sy_call_t *)getsockopt }, /* 118 = getsockopt */ - { 0, (sy_call_t *)nosys }, /* 119 = resuba */ - { AS(ia32_readv_args), (sy_call_t *)ia32_readv }, /* 120 = ia32_readv */ - { AS(ia32_writev_args), (sy_call_t *)ia32_writev }, /* 121 = ia32_writev */ - { AS(ia32_settimeofday_args), (sy_call_t *)ia32_settimeofday }, /* 122 = ia32_settimeofday */ - { AS(fchown_args), (sy_call_t *)fchown }, /* 123 = fchown */ - { AS(fchmod_args), (sy_call_t *)fchmod }, /* 124 = fchmod */ - { SYF_MPSAFE | AS(recvfrom_args), (sy_call_t *)recvfrom }, /* 125 = recvfrom */ - { SYF_MPSAFE | AS(setreuid_args), (sy_call_t *)setreuid }, /* 126 = setreuid */ - { SYF_MPSAFE | AS(setregid_args), (sy_call_t *)setregid }, /* 127 = setregid */ - { AS(rename_args), (sy_call_t *)rename }, /* 128 = rename */ - { 0, (sy_call_t *)nosys }, /* 129 = obsolete otruncate */ - { 0, (sy_call_t *)nosys }, /* 130 = obsolete ftruncate */ - { SYF_MPSAFE | AS(flock_args), (sy_call_t *)flock }, /* 131 = flock */ - { AS(mkfifo_args), (sy_call_t *)mkfifo }, /* 132 = mkfifo */ - { SYF_MPSAFE | AS(sendto_args), (sy_call_t *)sendto }, /* 133 = sendto */ - { SYF_MPSAFE | AS(shutdown_args), (sy_call_t *)shutdown }, /* 134 = shutdown */ - { SYF_MPSAFE | AS(socketpair_args), (sy_call_t *)socketpair }, /* 135 = socketpair */ - { AS(mkdir_args), (sy_call_t *)mkdir }, /* 136 = mkdir */ - { AS(rmdir_args), (sy_call_t *)rmdir }, /* 137 = rmdir */ - { AS(ia32_utimes_args), (sy_call_t *)ia32_utimes }, /* 138 = ia32_utimes */ - { 0, (sy_call_t *)nosys }, /* 139 = obsolete 4.2 sigreturn */ - { AS(ia32_adjtime_args), (sy_call_t *)ia32_adjtime }, /* 140 = ia32_adjtime */ - { 0, (sy_call_t *)nosys }, /* 141 = obsolete ogetpeername */ - { 0, (sy_call_t *)nosys }, /* 142 = obsolete ogethostid */ - { 0, (sy_call_t *)nosys }, /* 143 = obsolete sethostid */ - { 0, (sy_call_t *)nosys }, /* 144 = obsolete getrlimit */ - { 0, (sy_call_t *)nosys }, /* 145 = obsolete setrlimit */ - { 0, (sy_call_t *)nosys }, /* 146 = obsolete killpg */ - { SYF_MPSAFE | 0, (sy_call_t *)setsid }, /* 147 = setsid */ - { AS(quotactl_args), (sy_call_t *)quotactl }, /* 148 = quotactl */ - { 0, (sy_call_t *)nosys }, /* 149 = obsolete oquota */ - { 0, (sy_call_t *)nosys }, /* 150 = obsolete ogetsockname */ - { 0, (sy_call_t *)nosys }, /* 151 = sem_lock */ - { 0, (sy_call_t *)nosys }, /* 152 = sem_wakeup */ - { 0, (sy_call_t *)nosys }, /* 153 = asyncdaemon */ - { 0, (sy_call_t *)nosys }, /* 154 = nosys */ - { 0, (sy_call_t *)nosys }, /* 155 = nfssvc */ - { AS(getdirentries_args), (sy_call_t *)getdirentries }, /* 156 = getdirentries */ - { AS(ia32_statfs_args), (sy_call_t *)ia32_statfs }, /* 157 = ia32_statfs */ - { AS(ia32_fstatfs_args), (sy_call_t *)ia32_fstatfs }, /* 158 = ia32_fstatfs */ - { 0, (sy_call_t *)nosys }, /* 159 = nosys */ - { 0, (sy_call_t *)nosys }, /* 160 = nosys */ - { AS(getfh_args), (sy_call_t *)getfh }, /* 161 = getfh */ - { SYF_MPSAFE | AS(getdomainname_args), (sy_call_t *)getdomainname }, /* 162 = getdomainname */ - { SYF_MPSAFE | AS(setdomainname_args), (sy_call_t *)setdomainname }, /* 163 = setdomainname */ - { SYF_MPSAFE | AS(uname_args), (sy_call_t *)uname }, /* 164 = uname */ - { AS(sysarch_args), (sy_call_t *)sysarch }, /* 165 = sysarch */ - { SYF_MPSAFE | AS(rtprio_args), (sy_call_t *)rtprio }, /* 166 = rtprio */ - { 0, (sy_call_t *)nosys }, /* 167 = nosys */ - { 0, (sy_call_t *)nosys }, /* 168 = nosys */ - { AS(ia32_semsys_args), (sy_call_t *)ia32_semsys }, /* 169 = ia32_semsys */ - { AS(ia32_msgsys_args), (sy_call_t *)ia32_msgsys }, /* 170 = ia32_msgsys */ - { AS(ia32_shmsys_args), (sy_call_t *)ia32_shmsys }, /* 171 = ia32_shmsys */ - { 0, (sy_call_t *)nosys }, /* 172 = nosys */ - { AS(ia32_pread_args), (sy_call_t *)ia32_pread }, /* 173 = ia32_pread */ - { AS(ia32_pwrite_args), (sy_call_t *)ia32_pwrite }, /* 174 = ia32_pwrite */ - { 0, (sy_call_t *)nosys }, /* 175 = nosys */ - { SYF_MPSAFE | AS(ntp_adjtime_args), (sy_call_t *)ntp_adjtime }, /* 176 = ntp_adjtime */ - { 0, (sy_call_t *)nosys }, /* 177 = sfork */ - { 0, (sy_call_t *)nosys }, /* 178 = getdescriptor */ - { 0, (sy_call_t *)nosys }, /* 179 = setdescriptor */ - { 0, (sy_call_t *)nosys }, /* 180 = nosys */ - { SYF_MPSAFE | AS(setgid_args), (sy_call_t *)setgid }, /* 181 = setgid */ - { SYF_MPSAFE | AS(setegid_args), (sy_call_t *)setegid }, /* 182 = setegid */ - { SYF_MPSAFE | AS(seteuid_args), (sy_call_t *)seteuid }, /* 183 = seteuid */ - { 0, (sy_call_t *)nosys }, /* 184 = lfs_bmapv */ - { 0, (sy_call_t *)nosys }, /* 185 = lfs_markv */ - { 0, (sy_call_t *)nosys }, /* 186 = lfs_segclean */ - { 0, (sy_call_t *)nosys }, /* 187 = lfs_segwait */ - { AS(ia32_stat_args), (sy_call_t *)ia32_stat }, /* 188 = ia32_stat */ - { AS(ia32_fstat_args), (sy_call_t *)ia32_fstat }, /* 189 = ia32_fstat */ - { AS(ia32_lstat_args), (sy_call_t *)ia32_lstat }, /* 190 = ia32_lstat */ - { AS(pathconf_args), (sy_call_t *)pathconf }, /* 191 = pathconf */ - { SYF_MPSAFE | AS(fpathconf_args), (sy_call_t *)fpathconf }, /* 192 = fpathconf */ - { 0, (sy_call_t *)nosys }, /* 193 = nosys */ - { SYF_MPSAFE | AS(__getrlimit_args), (sy_call_t *)getrlimit }, /* 194 = getrlimit */ - { SYF_MPSAFE | AS(__setrlimit_args), (sy_call_t *)setrlimit }, /* 195 = setrlimit */ - { AS(getdirentries_args), (sy_call_t *)getdirentries }, /* 196 = getdirentries */ - { AS(ia32_mmap_args), (sy_call_t *)ia32_mmap }, /* 197 = ia32_mmap */ - { 0, (sy_call_t *)nosys }, /* 198 = __syscall */ - { AS(ia32_lseek_args), (sy_call_t *)ia32_lseek }, /* 199 = ia32_lseek */ - { AS(ia32_truncate_args), (sy_call_t *)ia32_truncate }, /* 200 = ia32_truncate */ - { AS(ia32_ftruncate_args), (sy_call_t *)ia32_ftruncate }, /* 201 = ia32_ftruncate */ - { SYF_MPSAFE | AS(ia32_sysctl_args), (sy_call_t *)ia32_sysctl }, /* 202 = ia32_sysctl */ - { SYF_MPSAFE | AS(mlock_args), (sy_call_t *)mlock }, /* 203 = mlock */ - { SYF_MPSAFE | AS(munlock_args), (sy_call_t *)munlock }, /* 204 = munlock */ - { AS(undelete_args), (sy_call_t *)undelete }, /* 205 = undelete */ - { AS(futimes_args), (sy_call_t *)futimes }, /* 206 = futimes */ - { SYF_MPSAFE | AS(getpgid_args), (sy_call_t *)getpgid }, /* 207 = getpgid */ - { 0, (sy_call_t *)nosys }, /* 208 = newreboot */ - { SYF_MPSAFE | AS(poll_args), (sy_call_t *)poll }, /* 209 = poll */ - { 0, (sy_call_t *)nosys }, /* 210 = */ - { 0, (sy_call_t *)nosys }, /* 211 = */ - { 0, (sy_call_t *)nosys }, /* 212 = */ - { 0, (sy_call_t *)nosys }, /* 213 = */ - { 0, (sy_call_t *)nosys }, /* 214 = */ - { 0, (sy_call_t *)nosys }, /* 215 = */ - { 0, (sy_call_t *)nosys }, /* 216 = */ - { 0, (sy_call_t *)nosys }, /* 217 = */ - { 0, (sy_call_t *)nosys }, /* 218 = */ - { 0, (sy_call_t *)nosys }, /* 219 = */ - { SYF_MPSAFE | AS(__semctl_args), (sy_call_t *)__semctl }, /* 220 = __semctl */ - { SYF_MPSAFE | AS(semget_args), (sy_call_t *)semget }, /* 221 = semget */ - { SYF_MPSAFE | AS(semop_args), (sy_call_t *)semop }, /* 222 = semop */ - { 0, (sy_call_t *)nosys }, /* 223 = semconfig */ - { SYF_MPSAFE | AS(msgctl_args), (sy_call_t *)msgctl }, /* 224 = msgctl */ - { SYF_MPSAFE | AS(msgget_args), (sy_call_t *)msgget }, /* 225 = msgget */ - { SYF_MPSAFE | AS(msgsnd_args), (sy_call_t *)msgsnd }, /* 226 = msgsnd */ - { SYF_MPSAFE | AS(msgrcv_args), (sy_call_t *)msgrcv }, /* 227 = msgrcv */ - { SYF_MPSAFE | AS(shmat_args), (sy_call_t *)shmat }, /* 228 = shmat */ - { SYF_MPSAFE | AS(shmctl_args), (sy_call_t *)shmctl }, /* 229 = shmctl */ - { SYF_MPSAFE | AS(shmdt_args), (sy_call_t *)shmdt }, /* 230 = shmdt */ - { SYF_MPSAFE | AS(shmget_args), (sy_call_t *)shmget }, /* 231 = shmget */ - { SYF_MPSAFE | AS(clock_gettime_args), (sy_call_t *)clock_gettime }, /* 232 = clock_gettime */ - { SYF_MPSAFE | AS(clock_settime_args), (sy_call_t *)clock_settime }, /* 233 = clock_settime */ - { SYF_MPSAFE | AS(clock_getres_args), (sy_call_t *)clock_getres }, /* 234 = clock_getres */ - { 0, (sy_call_t *)nosys }, /* 235 = timer_create */ - { 0, (sy_call_t *)nosys }, /* 236 = timer_delete */ - { 0, (sy_call_t *)nosys }, /* 237 = timer_settime */ - { 0, (sy_call_t *)nosys }, /* 238 = timer_gettime */ - { 0, (sy_call_t *)nosys }, /* 239 = timer_getoverrun */ - { SYF_MPSAFE | AS(nanosleep_args), (sy_call_t *)nanosleep }, /* 240 = nanosleep */ - { 0, (sy_call_t *)nosys }, /* 241 = nosys */ - { 0, (sy_call_t *)nosys }, /* 242 = nosys */ - { 0, (sy_call_t *)nosys }, /* 243 = nosys */ - { 0, (sy_call_t *)nosys }, /* 244 = nosys */ - { 0, (sy_call_t *)nosys }, /* 245 = nosys */ - { 0, (sy_call_t *)nosys }, /* 246 = nosys */ - { 0, (sy_call_t *)nosys }, /* 247 = nosys */ - { 0, (sy_call_t *)nosys }, /* 248 = nosys */ - { 0, (sy_call_t *)nosys }, /* 249 = nosys */ - { SYF_MPSAFE | AS(minherit_args), (sy_call_t *)minherit }, /* 250 = minherit */ - { SYF_MPSAFE | AS(rfork_args), (sy_call_t *)rfork }, /* 251 = rfork */ - { SYF_MPSAFE | AS(openbsd_poll_args), (sy_call_t *)openbsd_poll }, /* 252 = openbsd_poll */ - { 0, (sy_call_t *)issetugid }, /* 253 = issetugid */ - { AS(lchown_args), (sy_call_t *)lchown }, /* 254 = lchown */ - { 0, (sy_call_t *)nosys }, /* 255 = nosys */ - { 0, (sy_call_t *)nosys }, /* 256 = nosys */ - { 0, (sy_call_t *)nosys }, /* 257 = nosys */ - { 0, (sy_call_t *)nosys }, /* 258 = nosys */ - { 0, (sy_call_t *)nosys }, /* 259 = nosys */ - { 0, (sy_call_t *)nosys }, /* 260 = nosys */ - { 0, (sy_call_t *)nosys }, /* 261 = nosys */ - { 0, (sy_call_t *)nosys }, /* 262 = nosys */ - { 0, (sy_call_t *)nosys }, /* 263 = nosys */ - { 0, (sy_call_t *)nosys }, /* 264 = nosys */ - { 0, (sy_call_t *)nosys }, /* 265 = nosys */ - { 0, (sy_call_t *)nosys }, /* 266 = nosys */ - { 0, (sy_call_t *)nosys }, /* 267 = nosys */ - { 0, (sy_call_t *)nosys }, /* 268 = nosys */ - { 0, (sy_call_t *)nosys }, /* 269 = nosys */ - { 0, (sy_call_t *)nosys }, /* 270 = nosys */ - { 0, (sy_call_t *)nosys }, /* 271 = nosys */ - { AS(getdents_args), (sy_call_t *)getdents }, /* 272 = getdents */ - { 0, (sy_call_t *)nosys }, /* 273 = nosys */ - { AS(lchmod_args), (sy_call_t *)lchmod }, /* 274 = lchmod */ - { AS(lchown_args), (sy_call_t *)lchown }, /* 275 = netbsd_lchown */ - { AS(lutimes_args), (sy_call_t *)lutimes }, /* 276 = lutimes */ - { SYF_MPSAFE | AS(msync_args), (sy_call_t *)msync }, /* 277 = netbsd_msync */ - { AS(nstat_args), (sy_call_t *)nstat }, /* 278 = nstat */ - { SYF_MPSAFE | AS(nfstat_args), (sy_call_t *)nfstat }, /* 279 = nfstat */ - { AS(nlstat_args), (sy_call_t *)nlstat }, /* 280 = nlstat */ - { 0, (sy_call_t *)nosys }, /* 281 = nosys */ - { 0, (sy_call_t *)nosys }, /* 282 = nosys */ - { 0, (sy_call_t *)nosys }, /* 283 = nosys */ - { 0, (sy_call_t *)nosys }, /* 284 = nosys */ - { 0, (sy_call_t *)nosys }, /* 285 = nosys */ - { 0, (sy_call_t *)nosys }, /* 286 = nosys */ - { 0, (sy_call_t *)nosys }, /* 287 = nosys */ - { 0, (sy_call_t *)nosys }, /* 288 = nosys */ - { 0, (sy_call_t *)nosys }, /* 289 = nosys */ - { 0, (sy_call_t *)nosys }, /* 290 = nosys */ - { 0, (sy_call_t *)nosys }, /* 291 = nosys */ - { 0, (sy_call_t *)nosys }, /* 292 = nosys */ - { 0, (sy_call_t *)nosys }, /* 293 = nosys */ - { 0, (sy_call_t *)nosys }, /* 294 = nosys */ - { 0, (sy_call_t *)nosys }, /* 295 = nosys */ - { 0, (sy_call_t *)nosys }, /* 296 = nosys */ - { AS(fhstatfs_args), (sy_call_t *)fhstatfs }, /* 297 = fhstatfs */ - { AS(fhopen_args), (sy_call_t *)fhopen }, /* 298 = fhopen */ - { AS(fhstat_args), (sy_call_t *)fhstat }, /* 299 = fhstat */ - { SYF_MPSAFE | AS(modnext_args), (sy_call_t *)modnext }, /* 300 = modnext */ - { SYF_MPSAFE | AS(modstat_args), (sy_call_t *)modstat }, /* 301 = modstat */ - { SYF_MPSAFE | AS(modfnext_args), (sy_call_t *)modfnext }, /* 302 = modfnext */ - { SYF_MPSAFE | AS(modfind_args), (sy_call_t *)modfind }, /* 303 = modfind */ - { SYF_MPSAFE | AS(kldload_args), (sy_call_t *)kldload }, /* 304 = kldload */ - { SYF_MPSAFE | AS(kldunload_args), (sy_call_t *)kldunload }, /* 305 = kldunload */ - { SYF_MPSAFE | AS(kldfind_args), (sy_call_t *)kldfind }, /* 306 = kldfind */ - { SYF_MPSAFE | AS(kldnext_args), (sy_call_t *)kldnext }, /* 307 = kldnext */ - { SYF_MPSAFE | AS(kldstat_args), (sy_call_t *)kldstat }, /* 308 = kldstat */ - { SYF_MPSAFE | AS(kldfirstmod_args), (sy_call_t *)kldfirstmod }, /* 309 = kldfirstmod */ - { SYF_MPSAFE | AS(getsid_args), (sy_call_t *)getsid }, /* 310 = getsid */ - { SYF_MPSAFE | AS(setresuid_args), (sy_call_t *)setresuid }, /* 311 = setresuid */ - { SYF_MPSAFE | AS(setresgid_args), (sy_call_t *)setresgid }, /* 312 = setresgid */ - { 0, (sy_call_t *)nosys }, /* 313 = obsolete signanosleep */ - { 0, (sy_call_t *)nosys }, /* 314 = aio_return */ - { 0, (sy_call_t *)nosys }, /* 315 = aio_suspend */ - { 0, (sy_call_t *)nosys }, /* 316 = aio_cancel */ - { 0, (sy_call_t *)nosys }, /* 317 = aio_error */ - { 0, (sy_call_t *)nosys }, /* 318 = aio_read */ - { 0, (sy_call_t *)nosys }, /* 319 = aio_write */ - { 0, (sy_call_t *)nosys }, /* 320 = lio_listio */ - { SYF_MPSAFE | 0, (sy_call_t *)yield }, /* 321 = yield */ - { 0, (sy_call_t *)nosys }, /* 322 = obsolete thr_sleep */ - { 0, (sy_call_t *)nosys }, /* 323 = obsolete thr_wakeup */ - { SYF_MPSAFE | AS(mlockall_args), (sy_call_t *)mlockall }, /* 324 = mlockall */ - { SYF_MPSAFE | 0, (sy_call_t *)munlockall }, /* 325 = munlockall */ - { AS(__getcwd_args), (sy_call_t *)__getcwd }, /* 326 = __getcwd */ - { SYF_MPSAFE | AS(sched_setparam_args), (sy_call_t *)sched_setparam }, /* 327 = sched_setparam */ - { SYF_MPSAFE | AS(sched_getparam_args), (sy_call_t *)sched_getparam }, /* 328 = sched_getparam */ - { SYF_MPSAFE | AS(sched_setscheduler_args), (sy_call_t *)sched_setscheduler }, /* 329 = sched_setscheduler */ - { SYF_MPSAFE | AS(sched_getscheduler_args), (sy_call_t *)sched_getscheduler }, /* 330 = sched_getscheduler */ - { SYF_MPSAFE | 0, (sy_call_t *)sched_yield }, /* 331 = sched_yield */ - { SYF_MPSAFE | AS(sched_get_priority_max_args), (sy_call_t *)sched_get_priority_max }, /* 332 = sched_get_priority_max */ - { SYF_MPSAFE | AS(sched_get_priority_min_args), (sy_call_t *)sched_get_priority_min }, /* 333 = sched_get_priority_min */ - { SYF_MPSAFE | AS(sched_rr_get_interval_args), (sy_call_t *)sched_rr_get_interval }, /* 334 = sched_rr_get_interval */ - { AS(utrace_args), (sy_call_t *)utrace }, /* 335 = utrace */ - { compat4(SYF_MPSAFE | AS(freebsd4_ia32_sendfile_args),ia32_sendfile) }, /* 336 = old ia32_sendfile */ - { AS(kldsym_args), (sy_call_t *)kldsym }, /* 337 = kldsym */ - { SYF_MPSAFE | AS(jail_args), (sy_call_t *)jail }, /* 338 = jail */ - { 0, (sy_call_t *)nosys }, /* 339 = pioctl */ - { SYF_MPSAFE | AS(sigprocmask_args), (sy_call_t *)sigprocmask }, /* 340 = sigprocmask */ - { SYF_MPSAFE | AS(sigsuspend_args), (sy_call_t *)sigsuspend }, /* 341 = sigsuspend */ - { compat4(AS(freebsd4_ia32_sigaction_args),ia32_sigaction) }, /* 342 = old ia32_sigaction */ - { SYF_MPSAFE | AS(sigpending_args), (sy_call_t *)sigpending }, /* 343 = sigpending */ - { compat4(SYF_MPSAFE | AS(freebsd4_ia32_sigreturn_args),ia32_sigreturn) }, /* 344 = old ia32_sigreturn */ - { 0, (sy_call_t *)nosys }, /* 345 = sigtimedwait */ - { 0, (sy_call_t *)nosys }, /* 346 = sigwaitinfo */ - { SYF_MPSAFE | AS(__acl_get_file_args), (sy_call_t *)__acl_get_file }, /* 347 = __acl_get_file */ - { SYF_MPSAFE | AS(__acl_set_file_args), (sy_call_t *)__acl_set_file }, /* 348 = __acl_set_file */ - { SYF_MPSAFE | AS(__acl_get_fd_args), (sy_call_t *)__acl_get_fd }, /* 349 = __acl_get_fd */ - { SYF_MPSAFE | AS(__acl_set_fd_args), (sy_call_t *)__acl_set_fd }, /* 350 = __acl_set_fd */ - { SYF_MPSAFE | AS(__acl_delete_file_args), (sy_call_t *)__acl_delete_file }, /* 351 = __acl_delete_file */ - { SYF_MPSAFE | AS(__acl_delete_fd_args), (sy_call_t *)__acl_delete_fd }, /* 352 = __acl_delete_fd */ - { SYF_MPSAFE | AS(__acl_aclcheck_file_args), (sy_call_t *)__acl_aclcheck_file }, /* 353 = __acl_aclcheck_file */ - { SYF_MPSAFE | AS(__acl_aclcheck_fd_args), (sy_call_t *)__acl_aclcheck_fd }, /* 354 = __acl_aclcheck_fd */ - { AS(extattrctl_args), (sy_call_t *)extattrctl }, /* 355 = extattrctl */ - { AS(extattr_set_file_args), (sy_call_t *)extattr_set_file }, /* 356 = extattr_set_file */ - { AS(extattr_get_file_args), (sy_call_t *)extattr_get_file }, /* 357 = extattr_get_file */ - { AS(extattr_delete_file_args), (sy_call_t *)extattr_delete_file }, /* 358 = extattr_delete_file */ - { 0, (sy_call_t *)nosys }, /* 359 = aio_waitcomplete */ - { SYF_MPSAFE | AS(getresuid_args), (sy_call_t *)getresuid }, /* 360 = getresuid */ - { SYF_MPSAFE | AS(getresgid_args), (sy_call_t *)getresgid }, /* 361 = getresgid */ - { SYF_MPSAFE | 0, (sy_call_t *)kqueue }, /* 362 = kqueue */ - { SYF_MPSAFE | AS(ia32_kevent_args), (sy_call_t *)ia32_kevent }, /* 363 = ia32_kevent */ - { 0, (sy_call_t *)nosys }, /* 364 = __cap_get_proc */ - { 0, (sy_call_t *)nosys }, /* 365 = __cap_set_proc */ - { 0, (sy_call_t *)nosys }, /* 366 = __cap_get_fd */ - { 0, (sy_call_t *)nosys }, /* 367 = __cap_get_file */ - { 0, (sy_call_t *)nosys }, /* 368 = __cap_set_fd */ - { 0, (sy_call_t *)nosys }, /* 369 = __cap_set_file */ - { 0, (sy_call_t *)nosys }, /* 370 = lkmressys */ - { AS(extattr_set_fd_args), (sy_call_t *)extattr_set_fd }, /* 371 = extattr_set_fd */ - { AS(extattr_get_fd_args), (sy_call_t *)extattr_get_fd }, /* 372 = extattr_get_fd */ - { AS(extattr_delete_fd_args), (sy_call_t *)extattr_delete_fd }, /* 373 = extattr_delete_fd */ - { SYF_MPSAFE | AS(__setugid_args), (sy_call_t *)__setugid }, /* 374 = __setugid */ - { 0, (sy_call_t *)nosys }, /* 375 = nfsclnt */ - { AS(eaccess_args), (sy_call_t *)eaccess }, /* 376 = eaccess */ - { 0, (sy_call_t *)nosys }, /* 377 = afs_syscall */ - { AS(nmount_args), (sy_call_t *)nmount }, /* 378 = nmount */ - { 0, (sy_call_t *)kse_exit }, /* 379 = kse_exit */ - { AS(kse_wakeup_args), (sy_call_t *)kse_wakeup }, /* 380 = kse_wakeup */ - { AS(kse_create_args), (sy_call_t *)kse_create }, /* 381 = kse_create */ - { AS(kse_thr_interrupt_args), (sy_call_t *)kse_thr_interrupt }, /* 382 = kse_thr_interrupt */ - { 0, (sy_call_t *)kse_release }, /* 383 = kse_release */ - { 0, (sy_call_t *)nosys }, /* 384 = __mac_get_proc */ - { 0, (sy_call_t *)nosys }, /* 385 = __mac_set_proc */ - { 0, (sy_call_t *)nosys }, /* 386 = __mac_get_fd */ - { 0, (sy_call_t *)nosys }, /* 387 = __mac_get_file */ - { 0, (sy_call_t *)nosys }, /* 388 = __mac_set_fd */ - { 0, (sy_call_t *)nosys }, /* 389 = __mac_set_file */ - { AS(kenv_args), (sy_call_t *)kenv }, /* 390 = kenv */ - { AS(lchflags_args), (sy_call_t *)lchflags }, /* 391 = lchflags */ - { AS(uuidgen_args), (sy_call_t *)uuidgen }, /* 392 = uuidgen */ - { SYF_MPSAFE | AS(ia32_sendfile_args), (sy_call_t *)ia32_sendfile }, /* 393 = ia32_sendfile */ - { 0, (sy_call_t *)nosys }, /* 394 = mac_syscall */ - { 0, (sy_call_t *)nosys }, /* 395 = nosys */ - { 0, (sy_call_t *)nosys }, /* 396 = nosys */ - { 0, (sy_call_t *)nosys }, /* 397 = nosys */ - { 0, (sy_call_t *)nosys }, /* 398 = nosys */ - { 0, (sy_call_t *)nosys }, /* 399 = nosys */ - { 0, (sy_call_t *)nosys }, /* 400 = ksem_close */ - { 0, (sy_call_t *)nosys }, /* 401 = ksem_post */ - { 0, (sy_call_t *)nosys }, /* 402 = ksem_wait */ - { 0, (sy_call_t *)nosys }, /* 403 = ksem_trywait */ - { 0, (sy_call_t *)nosys }, /* 404 = ksem_init */ - { 0, (sy_call_t *)nosys }, /* 405 = ksem_open */ - { 0, (sy_call_t *)nosys }, /* 406 = ksem_unlink */ - { 0, (sy_call_t *)nosys }, /* 407 = ksem_getvalue */ - { 0, (sy_call_t *)nosys }, /* 408 = ksem_destroy */ - { 0, (sy_call_t *)nosys }, /* 409 = __mac_get_pid */ - { 0, (sy_call_t *)nosys }, /* 410 = __mac_get_link */ - { 0, (sy_call_t *)nosys }, /* 411 = __mac_set_link */ - { 0, (sy_call_t *)nosys }, /* 412 = extattr_set_link */ - { 0, (sy_call_t *)nosys }, /* 413 = extattr_get_link */ - { 0, (sy_call_t *)nosys }, /* 414 = extattr_delete_link */ - { 0, (sy_call_t *)nosys }, /* 415 = __mac_execve */ - { AS(ia32_sigaction_args), (sy_call_t *)ia32_sigaction }, /* 416 = ia32_sigaction */ - { SYF_MPSAFE | AS(ia32_sigreturn_args), (sy_call_t *)ia32_sigreturn }, /* 417 = ia32_sigreturn */ - { 0, (sy_call_t *)nosys }, /* 418 = __xstat */ - { 0, (sy_call_t *)nosys }, /* 419 = __xfstat */ - { 0, (sy_call_t *)nosys }, /* 420 = __xlstat */ - { 0, (sy_call_t *)nosys }, /* 421 = getcontext */ - { 0, (sy_call_t *)nosys }, /* 422 = setcontext */ - { 0, (sy_call_t *)nosys }, /* 423 = swapcontext */ - { 0, (sy_call_t *)nosys }, /* 424 = swapoff */ - { 0, (sy_call_t *)nosys }, /* 425 = __acl_get_link */ - { 0, (sy_call_t *)nosys }, /* 426 = __acl_set_link */ - { 0, (sy_call_t *)nosys }, /* 427 = __acl_delete_link */ - { 0, (sy_call_t *)nosys }, /* 428 = __acl_aclcheck_link */ - { 0, (sy_call_t *)nosys }, /* 429 = sigwait */ - { SYF_MPSAFE | AS(thr_create_args), (sy_call_t *)thr_create }, /* 430 = thr_create */ - { SYF_MPSAFE | 0, (sy_call_t *)thr_exit }, /* 431 = thr_exit */ - { SYF_MPSAFE | AS(thr_self_args), (sy_call_t *)thr_self }, /* 432 = thr_self */ - { SYF_MPSAFE | AS(thr_kill_args), (sy_call_t *)thr_kill }, /* 433 = thr_kill */ - { SYF_MPSAFE | AS(_umtx_lock_args), (sy_call_t *)_umtx_lock }, /* 434 = _umtx_lock */ - { SYF_MPSAFE | AS(_umtx_unlock_args), (sy_call_t *)_umtx_unlock }, /* 435 = _umtx_unlock */ - { SYF_MPSAFE | AS(jail_attach_args), (sy_call_t *)jail_attach }, /* 436 = jail_attach */ -}; diff --git a/sys/amd64/ia32/ia32_sysvec.c b/sys/amd64/ia32/ia32_sysvec.c deleted file mode 100644 index cfd7d35..0000000 --- a/sys/amd64/ia32/ia32_sysvec.c +++ /dev/null @@ -1,283 +0,0 @@ -/*- - * Copyright (c) 2002 Doug Rabson - * Copyright (c) 2003 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include "opt_compat.h" - -#define __ELF_WORD_SIZE 32 - -#include <sys/param.h> -#include <sys/exec.h> -#include <sys/fcntl.h> -#include <sys/imgact.h> -#include <sys/kernel.h> -#include <sys/lock.h> -#include <sys/malloc.h> -#include <sys/mutex.h> -#include <sys/mman.h> -#include <sys/namei.h> -#include <sys/pioctl.h> -#include <sys/proc.h> -#include <sys/procfs.h> -#include <sys/resourcevar.h> -#include <sys/systm.h> -#include <sys/signalvar.h> -#include <sys/stat.h> -#include <sys/sx.h> -#include <sys/syscall.h> -#include <sys/sysctl.h> -#include <sys/sysent.h> -#include <sys/vnode.h> -#include <sys/imgact_elf.h> - -#include <vm/vm.h> -#include <vm/vm_kern.h> -#include <vm/vm_param.h> -#include <vm/pmap.h> -#include <vm/vm_map.h> -#include <vm/vm_object.h> -#include <vm/vm_extern.h> - -#include <amd64/ia32/ia32_util.h> -#include <amd64/ia32/ia32_proto.h> -#include <amd64/ia32/ia32_signal.h> -#include <machine/psl.h> -#include <machine/segments.h> -#include <machine/specialreg.h> -#include <machine/frame.h> -#include <machine/md_var.h> -#include <machine/pcb.h> -#include <machine/cpufunc.h> - -static register_t *ia32_copyout_strings(struct image_params *imgp); -static void ia32_setregs(struct thread *td, u_long entry, u_long stack, - u_long ps_strings); - -extern struct sysent ia32_sysent[]; - -struct sysentvec ia32_freebsd_sysvec = { - SYS_MAXSYSCALL, - ia32_sysent, - 0, - 0, - NULL, - 0, - NULL, - NULL, - elf32_freebsd_fixup, - ia32_sendsig, - ia32_sigcode, - &sz_ia32_sigcode, - NULL, - "FreeBSD ELF32", - elf32_coredump, - NULL, - MINSIGSTKSZ, - PAGE_SIZE, - 0, - IA32_USRSTACK, - IA32_USRSTACK, - IA32_PS_STRINGS, - VM_PROT_ALL, - ia32_copyout_strings, - ia32_setregs -}; - - - -static Elf32_Brandinfo ia32_brand_info = { - ELFOSABI_FREEBSD, - EM_386, - "FreeBSD", - "/compat/ia32", - "/usr/libexec/ld-elf.so.1", - &ia32_freebsd_sysvec - }; - -SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t) elf32_insert_brand_entry, - &ia32_brand_info); - -extern int _ucode32sel, _udatasel; - -static register_t * -ia32_copyout_strings(struct image_params *imgp) -{ - int argc, envc; - u_int32_t *vectp; - char *stringp, *destp; - u_int32_t *stack_base; - struct ia32_ps_strings *arginfo; - int szsigcode; - - /* - * Calculate string base and vector table pointers. - * Also deal with signal trampoline code for this exec type. - */ - arginfo = (struct ia32_ps_strings *)IA32_PS_STRINGS; - szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); - destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup((ARG_MAX - imgp->stringspace), sizeof(char *)); - - /* - * install sigcode - */ - if (szsigcode) - copyout(imgp->proc->p_sysent->sv_sigcode, - ((caddr_t)arginfo - szsigcode), szsigcode); - - /* - * If we have a valid auxargs ptr, prepare some room - * on the stack. - */ - if (imgp->auxargs) { - /* - * 'AT_COUNT*2' is size for the ELF Auxargs data. This is for - * lower compatibility. - */ - imgp->auxarg_size = (imgp->auxarg_size) ? imgp->auxarg_size - : (AT_COUNT * 2); - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets,and imgp->auxarg_size is room - * for argument of Runtime loader. - */ - vectp = (u_int32_t *) (destp - (imgp->argc + imgp->envc + 2 + - imgp->auxarg_size) * sizeof(u_int32_t)); - - } else - /* - * The '+ 2' is for the null pointers at the end of each of - * the arg and env vector sets - */ - vectp = (u_int32_t *) - (destp - (imgp->argc + imgp->envc + 2) * sizeof(u_int32_t)); - - /* - * vectp also becomes our initial stack base - */ - stack_base = vectp; - - stringp = imgp->stringbase; - argc = imgp->argc; - envc = imgp->envc; - /* - * Copy out strings - arguments and environment. - */ - copyout(stringp, destp, ARG_MAX - imgp->stringspace); - - /* - * Fill in "ps_strings" struct for ps, w, etc. - */ - suword32(&arginfo->ps_argvstr, (u_int32_t)(intptr_t)vectp); - suword32(&arginfo->ps_nargvstr, argc); - - /* - * Fill in argument portion of vector table. - */ - for (; argc > 0; --argc) { - suword32(vectp++, (u_int32_t)(intptr_t)destp); - while (*stringp++ != 0) - destp++; - destp++; - } - - /* a null vector table pointer separates the argp's from the envp's */ - suword32(vectp++, 0); - - suword32(&arginfo->ps_envstr, (u_int32_t)(intptr_t)vectp); - suword32(&arginfo->ps_nenvstr, envc); - - /* - * Fill in environment portion of vector table. - */ - for (; envc > 0; --envc) { - suword32(vectp++, (u_int32_t)(intptr_t)destp); - while (*stringp++ != 0) - destp++; - destp++; - } - - /* end of vector table is a null pointer */ - suword32(vectp, 0); - - return ((register_t *)stack_base); -} - -/* - * Clear registers on exec - */ -void -ia32_setregs(td, entry, stack, ps_strings) - struct thread *td; - u_long entry; - u_long stack; - u_long ps_strings; -{ - struct trapframe *regs = td->td_frame; - struct pcb *pcb = td->td_pcb; - - wrmsr(MSR_FSBASE, 0); - wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */ - pcb->pcb_fsbase = 0; - pcb->pcb_gsbase = 0; - load_ds(_udatasel); - load_es(_udatasel); - load_fs(_udatasel); - load_gs(_udatasel); - pcb->pcb_ds = _udatasel; - pcb->pcb_es = _udatasel; - pcb->pcb_fs = _udatasel; - pcb->pcb_gs = _udatasel; - - bzero((char *)regs, sizeof(struct trapframe)); - regs->tf_rip = entry; - regs->tf_rsp = stack; - regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); - regs->tf_ss = _udatasel; - regs->tf_cs = _ucode32sel; - regs->tf_rbx = ps_strings; - - /* - * Arrange to trap the next npx or `fwait' instruction (see npx.c - * for why fwait must be trapped at least if there is an npx or an - * emulator). This is mainly to handle the case where npx0 is not - * configured, since the npx routines normally set up the trap - * otherwise. It should be done only at boot time, but doing it - * here allows modifying `npx_exists' for testing the emulator on - * systems with an npx. - */ - load_cr0(rcr0() | CR0_MP | CR0_TS); - - fpstate_drop(td); - - /* Return via doreti so that we can change to a different %cs */ - pcb->pcb_flags |= PCB_FULLCTX; - td->td_retval[1] = 0; -} diff --git a/sys/amd64/ia32/ia32_util.h b/sys/amd64/ia32/ia32_util.h deleted file mode 100644 index 64fa293..0000000 --- a/sys/amd64/ia32/ia32_util.h +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * Copyright (c) 1998-1999 Andrew Gallatin - * 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 - * in this position and unchanged. - * 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 withough 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$ - */ - -#include <vm/vm.h> -#include <vm/vm_param.h> -#include <vm/pmap.h> - - -#include <sys/exec.h> -#include <sys/sysent.h> -#include <sys/cdefs.h> - -struct ia32_ps_strings { - u_int32_t ps_argvstr; /* first of 0 or more argument strings */ - int ps_nargvstr; /* the number of argument strings */ - u_int32_t ps_envstr; /* first of 0 or more environment strings */ - int ps_nenvstr; /* the number of environment strings */ -}; - -#define IA32_USRSTACK ((1ul << 32) - PAGE_SIZE) -#define IA32_PS_STRINGS (IA32_USRSTACK - sizeof(struct ia32_ps_strings)) - -static __inline caddr_t stackgap_init(void); -static __inline void *stackgap_alloc(caddr_t *, size_t); - -static __inline caddr_t -stackgap_init() -{ -#define szsigcode (*(curproc->p_sysent->sv_szsigcode)) - return (caddr_t)(((caddr_t)IA32_PS_STRINGS) - szsigcode - SPARE_USRSPACE); -#undef szsigcode -} - -static __inline void * -stackgap_alloc(sgp, sz) - caddr_t *sgp; - size_t sz; -{ - void *p; - - p = (void *) *sgp; - *sgp += ALIGN(sz); - return p; -} - - -extern const char ia32_emul_path[]; -int ia32_emul_find(struct thread *, caddr_t *, const char *, char *, - char **, int); - -#define CHECKALT(p, sgp, path, i) \ - do { \ - int _error; \ - \ - _error = ia32_emul_find(p, sgp, ia32_emul_path, path, \ - &path, i); \ - if (_error == EFAULT) \ - return (_error); \ - } while (0) - -#define CHECKALTEXIST(p, sgp, path) CHECKALT((p), (sgp), (path), 0) -#define CHECKALTCREAT(p, sgp, path) CHECKALT((p), (sgp), (path), 1) diff --git a/sys/amd64/ia32/syscalls.conf b/sys/amd64/ia32/syscalls.conf deleted file mode 100644 index 0e1ded3..0000000 --- a/sys/amd64/ia32/syscalls.conf +++ /dev/null @@ -1,12 +0,0 @@ -# $FreeBSD$ -sysnames="ia32_syscalls.c" -sysproto="ia32_proto.h" -sysproto_h=_IA32_SYSPROTO_H_ -syshdr="ia32_syscall.h" -syssw="ia32_sysent.c" -sysmk="/dev/null" -syshide="/dev/null" -syscallprefix="IA32_SYS_" -switchname="ia32_sysent" -namesname="ia32_syscallnames" -sysvec="\n" diff --git a/sys/amd64/ia32/syscalls.master b/sys/amd64/ia32/syscalls.master deleted file mode 100644 index 8dff9b5..0000000 --- a/sys/amd64/ia32/syscalls.master +++ /dev/null @@ -1,613 +0,0 @@ - $FreeBSD$ -; from: @(#)syscalls.master 8.2 (Berkeley) 1/13/94 -; from: src/sys/kern/syscalls.master 1.107 -; -; System call name/number master file. -; Processed to created init_sysent.c, syscalls.c and syscall.h. - -; Columns: number [M]type nargs namespc name alt{name,tag,rtyp}/comments -; number system call number, must be in order -; type one of [M]STD, [M]OBSOL, [M]UNIMPL, [M]COMPAT, [M]CPT_NOA, -; [M]LIBCOMPAT, [M]NODEF, [M]NOARGS, [M]NOPROTO, [M]NOIMPL, -; [M]NOSTD -; namespc one of POSIX, BSD, NOHIDE -; name psuedo-prototype of syscall routine -; If one of the following alts is different, then all appear: -; altname name of system call if different -; alttag name of args struct tag if different from [o]`name'"_args" -; altrtyp return type if not int (bogus - syscalls always return int) -; for UNIMPL/OBSOL, name continues with comments - -; types: -; [M] e.g. like MSTD -- means the system call is MP-safe. If no -; M prefix is used, the syscall wrapper will obtain the Giant -; lock for the syscall. -; STD always included -; COMPAT included on COMPAT #ifdef -; LIBCOMPAT included on COMPAT #ifdef, and placed in syscall.h -; OBSOL obsolete, not included in system, only specifies name -; UNIMPL not implemented, placeholder only -; NOSTD implemented but as a lkm that can be statically -; compiled in sysent entry will be filled with lkmsys -; so the SYSCALL_MODULE macro works - -; #ifdef's, etc. may be included, and are copied to the output files. - -#include <sys/param.h> -#include <sys/sysent.h> -#include <sys/sysproto.h> -#include <sys/mount.h> -#include <amd64/ia32/ia32.h> -#include <amd64/ia32/ia32_proto.h> - -; Reserved/unimplemented system calls in the range 0-150 inclusive -; are reserved for use in future Berkeley releases. -; Additional system calls implemented in vendor and other -; redistributions should be placed in the reserved range at the end -; of the current calls. - -0 MNOPROTO NOHIDE { int nosys(void); } syscall nosys_args int -1 MNOPROTO NOHIDE { void sys_exit(int rval); } exit sys_exit_args void -2 MNOPROTO POSIX { int fork(void); } -3 MNOPROTO POSIX { ssize_t read(int fd, void *buf, size_t nbyte); } -4 MNOPROTO POSIX { ssize_t write(int fd, const void *buf, size_t nbyte); } -5 STD POSIX { int ia32_open(char *path, int flags, int mode); } -; XXX should be { int open(const char *path, int flags, ...); } -; but we're not ready for `const' or varargs. -; XXX man page says `mode_t mode'. -6 MNOPROTO POSIX { int close(int fd); } -7 MSTD BSD { int ia32_wait4(int pid, int *status, int options, \ - struct rusage32 *rusage); } -8 OBSOL BSD old creat -9 NOPROTO POSIX { int link(char *path, char *link); } -10 NOPROTO POSIX { int unlink(char *path); } -11 OBSOL NOHIDE execv -12 NOPROTO POSIX { int chdir(char *path); } -13 NOPROTO BSD { int fchdir(int fd); } -14 NOPROTO POSIX { int mknod(char *path, int mode, int dev); } -15 NOPROTO POSIX { int chmod(char *path, int mode); } -16 NOPROTO POSIX { int chown(char *path, int uid, int gid); } -17 MNOPROTO BSD { int obreak(char *nsize); } break obreak_args int -18 STD BSD { int ia32_getfsstat(struct statfs32 *buf, \ - long bufsize, int flags); } -19 OBSOL POSIX olseek -20 MNOPROTO POSIX { pid_t getpid(void); } -21 NOPROTO BSD { int mount(char *type, char *path, int flags, \ - caddr_t data); } -; XXX `path' should have type `const char *' but we're not ready for that. -22 NOPROTO BSD { int unmount(char *path, int flags); } -23 MNOPROTO POSIX { int setuid(uid_t uid); } -24 MNOPROTO POSIX { uid_t getuid(void); } -25 MNOPROTO POSIX { uid_t geteuid(void); } -26 NOPROTO BSD { int ptrace(int req, pid_t pid, caddr_t addr, \ - int data); } -27 UNIMPL BSD recvmsg -28 MNOPROTO BSD { int sendmsg(int s, caddr_t msg, int flags); } -29 MNOPROTO BSD { int recvfrom(int s, caddr_t buf, size_t len, \ - int flags, caddr_t from, int *fromlenaddr); } -30 MNOPROTO BSD { int accept(int s, caddr_t name, int *anamelen); } -31 MNOPROTO BSD { int getpeername(int fdes, caddr_t asa, int *alen); } -32 MNOPROTO BSD { int getsockname(int fdes, caddr_t asa, int *alen); } -33 STD POSIX { int ia32_access(char *path, int flags); } -34 STD BSD { int ia32_chflags(char *path, int flags); } -35 NOPROTO BSD { int fchflags(int fd, int flags); } -36 NOPROTO BSD { int sync(void); } -37 MNOPROTO POSIX { int kill(int pid, int signum); } -38 UNIMPL POSIX ostat -39 MNOPROTO POSIX { pid_t getppid(void); } -40 UNIMPL POSIX olstat -41 NOPROTO POSIX { int dup(u_int fd); } -42 NOPROTO POSIX { int pipe(void); } -43 MNOPROTO POSIX { gid_t getegid(void); } -44 MNOPROTO BSD { int profil(caddr_t samples, size_t size, \ - size_t offset, u_int scale); } -45 NOPROTO BSD { int ktrace(const char *fname, int ops, int facs, \ - int pid); } -46 UNIMPL POSIX osigaction -47 MNOPROTO POSIX { gid_t getgid(void); } -48 UNIMPL POSIX osigprocmask -49 MNOPROTO BSD { int getlogin(char *namebuf, u_int namelen); } -50 MNOPROTO BSD { int setlogin(char *namebuf); } -51 MNOPROTO BSD { int acct(char *path); } -52 MNOPROTO POSIX { int sigpending(void); } -53 STD BSD { int ia32_sigaltstack(struct sigaltstack32 *ss, struct sigaltstack32 *oss); } -54 MNOPROTO POSIX { int ioctl(int fd, u_long com, caddr_t data); } -55 MNOPROTO BSD { int reboot(int opt); } -56 NOPROTO POSIX { int revoke(char *path); } -57 NOPROTO POSIX { int symlink(char *path, char *link); } -58 NOPROTO POSIX { int readlink(char *path, char *buf, int count); } -59 STD POSIX { int ia32_execve(char *fname, u_int32_t *argv, u_int32_t *envv); } -60 MNOPROTO POSIX { int umask(int newmask); } umask umask_args int -61 NOPROTO BSD { int chroot(char *path); } -62 OBSOL POSIX ofstat -63 OBSOL BSD ogetkerninfo -64 OBSOL BSD ogetpagesize -65 OBSOL BSD omsync -66 OBSOL BSD ovfork -67 OBSOL NOHIDE vread -68 OBSOL NOHIDE vwrite -69 MNOPROTO BSD { int sbrk(int incr); } -70 MNOPROTO BSD { int sstk(int incr); } -71 OBSOL BSD ommap -72 MNOPROTO BSD { int ovadvise(int anom); } vadvise ovadvise_args int -73 MNOPROTO BSD { int munmap(void *addr, size_t len); } -74 MNOPROTO BSD { int mprotect(const void *addr, size_t len, int prot); } -75 MNOPROTO BSD { int madvise(void *addr, size_t len, int behav); } -76 OBSOL NOHIDE vhangup -77 OBSOL NOHIDE vlimit -78 MNOPROTO BSD { int mincore(const void *addr, size_t len, \ - char *vec); } -79 MNOPROTO POSIX { int getgroups(u_int gidsetsize, gid_t *gidset); } -80 MNOPROTO POSIX { int setgroups(u_int gidsetsize, gid_t *gidset); } -81 MNOPROTO POSIX { int getpgrp(void); } -82 MNOPROTO POSIX { int setpgid(int pid, int pgid); } -83 STD BSD { int ia32_setitimer(u_int which, \ - struct itimerval32 *itv, \ - struct itimerval32 *oitv); } -84 OBSOL BSD owait -85 OBSOL BSD oswapon -86 OBSOL BSD ogetitimer -87 OBSOL BSD ogethostname -88 OBSOL BSD osethostname -89 MNOPROTO BSD { int getdtablesize(void); } -90 MNOPROTO POSIX { int dup2(u_int from, u_int to); } -91 UNIMPL BSD getdopt -92 MNOPROTO POSIX { int fcntl(int fd, int cmd, long arg); } -; XXX should be { int fcntl(int fd, int cmd, ...); } -; but we're not ready for varargs. -; XXX man page says `int arg' too. -93 STD BSD { int ia32_select(int nd, fd_set *in, fd_set *ou, \ - fd_set *ex, struct timeval32 *tv); } -; XXX need to override for big-endian - little-endian should work fine. -94 UNIMPL BSD setdopt -95 NOPROTO POSIX { int fsync(int fd); } -96 MNOPROTO BSD { int setpriority(int which, int who, int prio); } -97 MNOPROTO BSD { int socket(int domain, int type, int protocol); } -98 MNOPROTO BSD { int connect(int s, caddr_t name, int namelen); } -99 MNOPROTO BSD { int accept(int s, caddr_t name, int *anamelen); } \ - accept accept_args int -100 MNOPROTO BSD { int getpriority(int which, int who); } -101 OBSOL BSD osend -102 OBSOL BSD orecv -103 OBSOL BSD osigreturn -104 MNOPROTO BSD { int bind(int s, caddr_t name, int namelen); } -105 MNOPROTO BSD { int setsockopt(int s, int level, int name, \ - caddr_t val, int valsize); } -106 MNOPROTO BSD { int listen(int s, int backlog); } -107 OBSOL NOHIDE vtimes -108 OBSOL BSD osigvec -109 OBSOL BSD osigblock -110 OBSOL BSD osigsetmask -111 OBSOL POSIX osigsuspend -112 OBSOL BSD osigstack -113 OBSOL BSD orecvmsg -114 OBSOL BSD osendmsg -115 OBSOL NOHIDE vtrace -116 STD BSD { int ia32_gettimeofday(struct timeval32 *tp, \ - struct timezone *tzp); } -117 STD BSD { int ia32_getrusage(int who, struct rusage32 *rusage); } -118 MNOPROTO BSD { int getsockopt(int s, int level, int name, \ - caddr_t val, int *avalsize); } -119 UNIMPL NOHIDE resuba (BSD/OS 2.x) -120 STD BSD { int ia32_readv(int fd, struct iovec32 *iovp, u_int iovcnt); } -121 STD BSD { int ia32_writev(int fd, struct iovec32 *iovp, \ - u_int iovcnt); } -122 STD BSD { int ia32_settimeofday(struct timeval32 *tv, \ - struct timezone *tzp); } -123 NOPROTO BSD { int fchown(int fd, int uid, int gid); } -124 NOPROTO BSD { int fchmod(int fd, int mode); } -125 MNOPROTO BSD { int recvfrom(int s, caddr_t buf, size_t len, \ - int flags, caddr_t from, int *fromlenaddr); } \ - recvfrom recvfrom_args int -126 MNOPROTO BSD { int setreuid(int ruid, int euid); } -127 MNOPROTO BSD { int setregid(int rgid, int egid); } -128 NOPROTO POSIX { int rename(char *from, char *to); } -129 OBSOL BSD otruncate -130 OBSOL BSD ftruncate -131 MNOPROTO BSD { int flock(int fd, int how); } -132 NOPROTO POSIX { int mkfifo(char *path, int mode); } -133 MNOPROTO BSD { int sendto(int s, caddr_t buf, size_t len, \ - int flags, caddr_t to, int tolen); } -134 MNOPROTO BSD { int shutdown(int s, int how); } -135 MNOPROTO BSD { int socketpair(int domain, int type, int protocol, \ - int *rsv); } -136 NOPROTO POSIX { int mkdir(char *path, int mode); } -137 NOPROTO POSIX { int rmdir(char *path); } -138 STD BSD { int ia32_utimes(char *path, \ - struct timeval32 *tptr); } -139 OBSOL NOHIDE 4.2 sigreturn -140 STD BSD { int ia32_adjtime(struct timeval32 *delta, \ - struct timeval32 *olddelta); } -141 OBSOL BSD ogetpeername -142 OBSOL BSD ogethostid -143 OBSOL BSD sethostid -144 OBSOL BSD getrlimit -145 OBSOL BSD setrlimit -146 OBSOL BSD killpg -147 MNOPROTO POSIX { int setsid(void); } -148 NOPROTO BSD { int quotactl(char *path, int cmd, int uid, \ - caddr_t arg); } -149 OBSOL BSD oquota -150 OBSOL BSD ogetsockname - -; Syscalls 151-180 inclusive are reserved for vendor-specific -; system calls. (This includes various calls added for compatibity -; with other Unix variants.) -; Some of these calls are now supported by BSD... -151 UNIMPL NOHIDE sem_lock (BSD/OS 2.x) -152 UNIMPL NOHIDE sem_wakeup (BSD/OS 2.x) -153 UNIMPL NOHIDE asyncdaemon (BSD/OS 2.x) -154 UNIMPL NOHIDE nosys -; 155 is initialized by the NFS code, if present. -155 UNIMPL NOHIDE nfssvc -156 NOPROTO BSD { int getdirentries(int fd, char *buf, u_int count, \ - long *basep); } -157 STD BSD { int ia32_statfs(char *path, struct statfs32 *buf); } -158 STD BSD { int ia32_fstatfs(int fd, struct statfs32 *buf); } -159 UNIMPL NOHIDE nosys -160 UNIMPL NOHIDE nosys -161 NOPROTO BSD { int getfh(char *fname, struct fhandle *fhp); } -162 MNOPROTO BSD { int getdomainname(char *domainname, int len); } -163 MNOPROTO BSD { int setdomainname(char *domainname, int len); } -164 MNOPROTO BSD { int uname(struct utsname *name); } -165 NOPROTO BSD { int sysarch(int op, char *parms); } -166 MNOPROTO BSD { int rtprio(int function, pid_t pid, \ - struct rtprio *rtp); } -167 UNIMPL NOHIDE nosys -168 UNIMPL NOHIDE nosys -169 STD BSD { int ia32_semsys(int which, int a2, int a3, int a4, \ - int a5); } -170 STD BSD { int ia32_msgsys(int which, int a2, int a3, int a4, \ - int a5, int a6); } -171 STD BSD { int ia32_shmsys(int which, int a2, int a3, int a4); } -172 UNIMPL NOHIDE nosys -173 STD POSIX { ssize_t ia32_pread(int fd, void *buf, size_t nbyte, \ - int pad, u_int32_t offsetlo, u_int32_t offsethi); } -; XXX note - bigendian is different -174 STD POSIX { ssize_t ia32_pwrite(int fd, const void *buf, \ - size_t nbyte, int pad, u_int32_t offsetlo, \ - u_int32_t offsethi); } -; XXX note - bigendian is different -175 UNIMPL NOHIDE nosys -176 MNOPROTO BSD { int ntp_adjtime(struct timex *tp); } -177 UNIMPL NOHIDE sfork (BSD/OS 2.x) -178 UNIMPL NOHIDE getdescriptor (BSD/OS 2.x) -179 UNIMPL NOHIDE setdescriptor (BSD/OS 2.x) -180 UNIMPL NOHIDE nosys - -; Syscalls 181-199 are used by/reserved for BSD -181 MNOPROTO POSIX { int setgid(gid_t gid); } -182 MNOPROTO BSD { int setegid(gid_t egid); } -183 MNOPROTO BSD { int seteuid(uid_t euid); } -184 UNIMPL BSD lfs_bmapv -185 UNIMPL BSD lfs_markv -186 UNIMPL BSD lfs_segclean -187 UNIMPL BSD lfs_segwait -188 STD POSIX { int ia32_stat(char *path, struct stat32 *ub); } -189 STD POSIX { int ia32_fstat(int fd, struct stat32 *ub); } -190 STD POSIX { int ia32_lstat(char *path, struct stat32 *ub); } -191 NOPROTO POSIX { int pathconf(char *path, int name); } -192 MNOPROTO POSIX { int fpathconf(int fd, int name); } -193 UNIMPL NOHIDE nosys -194 MNOPROTO BSD { int getrlimit(u_int which, \ - struct rlimit *rlp); } \ - getrlimit __getrlimit_args int -195 MNOPROTO BSD { int setrlimit(u_int which, \ - struct rlimit *rlp); } \ - setrlimit __setrlimit_args int -196 NOPROTO BSD { int getdirentries(int fd, char *buf, u_int count, \ - long *basep); } -197 STD BSD { caddr_t ia32_mmap(caddr_t addr, size_t len, \ - int prot, int flags, int fd, int pad, \ - u_int32_t poslo, u_int32_t poshi); } -198 NOPROTO NOHIDE { int nosys(void); } __syscall __syscall_args int -; XXX note - bigendian is different -199 STD POSIX { off_t ia32_lseek(int fd, int pad, \ - u_int32_t offsetlo, u_int32_t offsethi, \ - int whence); } -; XXX note - bigendian is different -200 STD BSD { int ia32_truncate(char *path, int pad, \ - u_int32_t lengthlo, u_int32_t lengthhi); } -; XXX note - bigendian is different -201 STD BSD { int ia32_ftruncate(int fd, int pad, \ - u_int32_t lengthlo, u_int32_t lengthhi); } -202 MSTD BSD { int ia32_sysctl(int *name, u_int namelen, \ - void *old, u_int32_t *oldlenp, void *new, \ - u_int32_t newlen); } -203 MNOPROTO BSD { int mlock(const void *addr, size_t len); } -204 MNOPROTO BSD { int munlock(const void *addr, size_t len); } -205 NOPROTO BSD { int undelete(char *path); } -206 NOPROTO BSD { int futimes(int fd, struct timeval *tptr); } -207 MNOPROTO BSD { int getpgid(pid_t pid); } -208 UNIMPL NOHIDE newreboot (NetBSD) -209 MNOPROTO BSD { int poll(struct pollfd *fds, u_int nfds, \ - int timeout); } - -; -; The following are reserved for loadable syscalls -; -210 UNIMPL NOHIDE -211 UNIMPL NOHIDE -212 UNIMPL NOHIDE -213 UNIMPL NOHIDE -214 UNIMPL NOHIDE -215 UNIMPL NOHIDE -216 UNIMPL NOHIDE -217 UNIMPL NOHIDE -218 UNIMPL NOHIDE -219 UNIMPL NOHIDE - -; -; The following were introduced with NetBSD/4.4Lite-2 -; They are initialized by thier respective modules/sysinits -220 MNOPROTO BSD { int __semctl(int semid, int semnum, int cmd, \ - union semun *arg); } -221 MNOPROTO BSD { int semget(key_t key, int nsems, int semflg); } -222 MNOPROTO BSD { int semop(int semid, struct sembuf *sops, \ - u_int nsops); } -223 UNIMPL NOHIDE semconfig -224 MNOPROTO BSD { int msgctl(int msqid, int cmd, \ - struct msqid_ds *buf); } -225 MNOPROTO BSD { int msgget(key_t key, int msgflg); } -226 MNOPROTO BSD { int msgsnd(int msqid, void *msgp, size_t msgsz, \ - int msgflg); } -227 MNOPROTO BSD { int msgrcv(int msqid, void *msgp, size_t msgsz, \ - long msgtyp, int msgflg); } -228 MNOPROTO BSD { int shmat(int shmid, void *shmaddr, int shmflg); } -229 MNOPROTO BSD { int shmctl(int shmid, int cmd, \ - struct shmid_ds *buf); } -230 MNOPROTO BSD { int shmdt(void *shmaddr); } -231 MNOPROTO BSD { int shmget(key_t key, int size, int shmflg); } -; -232 MNOPROTO POSIX { int clock_gettime(clockid_t clock_id, \ - struct timespec *tp); } -233 MNOPROTO POSIX { int clock_settime(clockid_t clock_id, \ - const struct timespec *tp); } -234 MNOPROTO POSIX { int clock_getres(clockid_t clock_id, \ - struct timespec *tp); } -235 UNIMPL NOHIDE timer_create -236 UNIMPL NOHIDE timer_delete -237 UNIMPL NOHIDE timer_settime -238 UNIMPL NOHIDE timer_gettime -239 UNIMPL NOHIDE timer_getoverrun -240 MNOPROTO POSIX { int nanosleep(const struct timespec *rqtp, \ - struct timespec *rmtp); } -241 UNIMPL NOHIDE nosys -242 UNIMPL NOHIDE nosys -243 UNIMPL NOHIDE nosys -244 UNIMPL NOHIDE nosys -245 UNIMPL NOHIDE nosys -246 UNIMPL NOHIDE nosys -247 UNIMPL NOHIDE nosys -248 UNIMPL NOHIDE nosys -249 UNIMPL NOHIDE nosys -; syscall numbers initially used in OpenBSD -250 MNOPROTO BSD { int minherit(void *addr, size_t len, int inherit); } -251 MNOPROTO BSD { int rfork(int flags); } -252 MNOPROTO BSD { int openbsd_poll(struct pollfd *fds, u_int nfds, \ - int timeout); } -253 NOPROTO BSD { int issetugid(void); } -254 NOPROTO BSD { int lchown(char *path, int uid, int gid); } -255 UNIMPL NOHIDE nosys -256 UNIMPL NOHIDE nosys -257 UNIMPL NOHIDE nosys -258 UNIMPL NOHIDE nosys -259 UNIMPL NOHIDE nosys -260 UNIMPL NOHIDE nosys -261 UNIMPL NOHIDE nosys -262 UNIMPL NOHIDE nosys -263 UNIMPL NOHIDE nosys -264 UNIMPL NOHIDE nosys -265 UNIMPL NOHIDE nosys -266 UNIMPL NOHIDE nosys -267 UNIMPL NOHIDE nosys -268 UNIMPL NOHIDE nosys -269 UNIMPL NOHIDE nosys -270 UNIMPL NOHIDE nosys -271 UNIMPL NOHIDE nosys -272 NOPROTO BSD { int getdents(int fd, char *buf, size_t count); } -273 UNIMPL NOHIDE nosys -274 NOPROTO BSD { int lchmod(char *path, mode_t mode); } -275 NOPROTO BSD { int lchown(char *path, uid_t uid, gid_t gid); } netbsd_lchown lchown_args int -276 NOPROTO BSD { int lutimes(char *path, struct timeval *tptr); } -277 MNOPROTO BSD { int msync(void *addr, size_t len, int flags); } netbsd_msync msync_args int -278 NOPROTO BSD { int nstat(char *path, struct nstat *ub); } -279 MNOPROTO BSD { int nfstat(int fd, struct nstat *sb); } -280 NOPROTO BSD { int nlstat(char *path, struct nstat *ub); } -281 UNIMPL NOHIDE nosys -282 UNIMPL NOHIDE nosys -283 UNIMPL NOHIDE nosys -284 UNIMPL NOHIDE nosys -285 UNIMPL NOHIDE nosys -286 UNIMPL NOHIDE nosys -287 UNIMPL NOHIDE nosys -288 UNIMPL NOHIDE nosys -289 UNIMPL NOHIDE nosys -290 UNIMPL NOHIDE nosys -291 UNIMPL NOHIDE nosys -292 UNIMPL NOHIDE nosys -293 UNIMPL NOHIDE nosys -294 UNIMPL NOHIDE nosys -295 UNIMPL NOHIDE nosys -296 UNIMPL NOHIDE nosys -; XXX 297 is 300 in NetBSD -297 NOPROTO BSD { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } -298 NOPROTO BSD { int fhopen(const struct fhandle *u_fhp, int flags); } -299 NOPROTO BSD { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } -; syscall numbers for FreeBSD -300 MNOPROTO BSD { int modnext(int modid); } -301 MNOPROTO BSD { int modstat(int modid, struct module_stat* stat); } -302 MNOPROTO BSD { int modfnext(int modid); } -303 MNOPROTO BSD { int modfind(const char *name); } -304 MNOPROTO BSD { int kldload(const char *file); } -305 MNOPROTO BSD { int kldunload(int fileid); } -306 MNOPROTO BSD { int kldfind(const char *file); } -307 MNOPROTO BSD { int kldnext(int fileid); } -308 MNOPROTO BSD { int kldstat(int fileid, struct kld_file_stat* stat); } -309 MNOPROTO BSD { int kldfirstmod(int fileid); } -310 MNOPROTO BSD { int getsid(pid_t pid); } -311 MNOPROTO BSD { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } -312 MNOPROTO BSD { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } -313 OBSOL NOHIDE signanosleep -314 UNIMPL NOHIDE aio_return -315 UNIMPL NOHIDE aio_suspend -316 UNIMPL NOHIDE aio_cancel -317 UNIMPL NOHIDE aio_error -318 UNIMPL NOHIDE aio_read -319 UNIMPL NOHIDE aio_write -320 UNIMPL NOHIDE lio_listio -321 MNOPROTO BSD { int yield(void); } -322 OBSOL NOHIDE thr_sleep -323 OBSOL NOHIDE thr_wakeup -324 MNOPROTO BSD { int mlockall(int how); } -325 MNOPROTO BSD { int munlockall(void); } -326 NOPROTO BSD { int __getcwd(u_char *buf, u_int buflen); } - -327 MNOPROTO POSIX { int sched_setparam (pid_t pid, const struct sched_param *param); } -328 MNOPROTO POSIX { int sched_getparam (pid_t pid, struct sched_param *param); } - -329 MNOPROTO POSIX { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } -330 MNOPROTO POSIX { int sched_getscheduler (pid_t pid); } - -331 MNOPROTO POSIX { int sched_yield (void); } -332 MNOPROTO POSIX { int sched_get_priority_max (int policy); } -333 MNOPROTO POSIX { int sched_get_priority_min (int policy); } -334 MNOPROTO POSIX { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } -335 NOPROTO BSD { int utrace(const void *addr, size_t len); } -; XXX note - bigendian is different -336 MCOMPAT4 BSD { int ia32_sendfile(int fd, int s, u_int32_t offsetlo,\ - u_int32_t offsethi, size_t nbytes, \ - struct sf_hdtr *hdtr, off_t *sbytes, int flags); } -337 NOPROTO BSD { int kldsym(int fileid, int cmd, void *data); } -338 MNOPROTO BSD { int jail(struct jail *jail); } -339 UNIMPL BSD pioctl -340 MNOPROTO POSIX { int sigprocmask(int how, const sigset_t *set, \ - sigset_t *oset); } -341 MNOPROTO POSIX { int sigsuspend(const sigset_t *sigmask); } -342 COMPAT4 POSIX { int ia32_sigaction(int sig, \ - struct sigaction32 *act, \ - struct sigaction32 *oact); } -343 MNOPROTO POSIX { int sigpending(sigset_t *set); } -344 MCOMPAT4 BSD { int ia32_sigreturn(const struct __ucontext *sigcntxp); } -345 UNIMPL NOHIDE sigtimedwait -346 UNIMPL NOHIDE sigwaitinfo -347 MNOPROTO BSD { int __acl_get_file(const char *path, \ - acl_type_t type, struct acl *aclp); } -348 MNOPROTO BSD { int __acl_set_file(const char *path, \ - acl_type_t type, struct acl *aclp); } -349 MNOPROTO BSD { int __acl_get_fd(int filedes, acl_type_t type, \ - struct acl *aclp); } -350 MNOPROTO BSD { int __acl_set_fd(int filedes, acl_type_t type, \ - struct acl *aclp); } -351 MNOPROTO BSD { int __acl_delete_file(const char *path, \ - acl_type_t type); } -352 MNOPROTO BSD { int __acl_delete_fd(int filedes, acl_type_t type); } -353 MNOPROTO BSD { int __acl_aclcheck_file(const char *path, \ - acl_type_t type, struct acl *aclp); } -354 MNOPROTO BSD { int __acl_aclcheck_fd(int filedes, acl_type_t type, \ - struct acl *aclp); } -355 NOPROTO BSD { int extattrctl(const char *path, int cmd, \ - const char *filename, int attrnamespace, \ - const char *attrname); } -356 NOPROTO BSD { int extattr_set_file(const char *path, \ - int attrnamespace, const char *attrname, \ - void *data, size_t nbytes); } -357 NOPROTO BSD { ssize_t extattr_get_file(const char *path, \ - int attrnamespace, const char *attrname, \ - void *data, size_t nbytes); } -358 NOPROTO BSD { int extattr_delete_file(const char *path, \ - int attrnamespace, const char *attrname); } -359 UNIMPL NOHIDE aio_waitcomplete -360 MNOPROTO BSD { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } -361 MNOPROTO BSD { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } -362 MNOPROTO BSD { int kqueue(void); } -363 MSTD BSD { int ia32_kevent(int fd, \ - const struct kevent *changelist, int nchanges, \ - struct kevent *eventlist, int nevents, \ - const struct timespec *timeout); } -364 UNIMPL NOHIDE __cap_get_proc -365 UNIMPL NOHIDE __cap_set_proc -366 UNIMPL NOHIDE __cap_get_fd -367 UNIMPL NOHIDE __cap_get_file -368 UNIMPL NOHIDE __cap_set_fd -369 UNIMPL NOHIDE __cap_set_file -370 UNIMPL NOHIDE lkmressys -371 NOPROTO BSD { int extattr_set_fd(int fd, int attrnamespace, \ - const char *attrname, void *data, \ - size_t nbytes); } -372 NOPROTO BSD { ssize_t extattr_get_fd(int fd, int attrnamespace, \ - const char *attrname, void *data, size_t nbytes); } -373 NOPROTO BSD { int extattr_delete_fd(int fd, int attrnamespace, \ - const char *attrname); } -374 MNOPROTO BSD { int __setugid(int flag); } -375 UNIMPL BSD nfsclnt -376 NOPROTO BSD { int eaccess(char *path, int flags); } -377 UNIMPL BSD afs_syscall -378 NOPROTO BSD { int nmount(struct iovec *iovp, unsigned int iovcnt, \ - int flags); } -379 NOPROTO BSD { int kse_exit(void); } -380 NOPROTO BSD { int kse_wakeup(struct kse_mailbox *mbx); } -381 NOPROTO BSD { int kse_create(struct kse_mailbox *mbx, \ - int newgroup); } -382 NOPROTO BSD { int kse_thr_interrupt(struct kse_thr_mailbox *tmbx); } -383 NOPROTO BSD { int kse_release(void); } -384 UNIMPL BSD __mac_get_proc -385 UNIMPL BSD __mac_set_proc -386 UNIMPL BSD __mac_get_fd -387 UNIMPL BSD __mac_get_file -388 UNIMPL BSD __mac_set_fd -389 UNIMPL BSD __mac_set_file -390 NOPROTO BSD { int kenv(int what, const char *name, char *value, \ - int len); } -391 NOPROTO BSD { int lchflags(const char *path, int flags); } -392 NOPROTO BSD { int uuidgen(struct uuid *store, int count); } -393 MSTD BSD { int ia32_sendfile(int fd, int s, u_int32_t offsetlo, \ - u_int32_t offsethi, size_t nbytes, \ - struct sf_hdtr *hdtr, off_t *sbytes, int flags); } -394 UNIMPL NOHIDE mac_syscall -395 UNIMPL NOHIDE nosys -396 UNIMPL NOHIDE nosys -397 UNIMPL NOHIDE nosys -398 UNIMPL NOHIDE nosys -399 UNIMPL NOHIDE nosys -400 UNIMPL NOHIDE ksem_close -401 UNIMPL NOHIDE ksem_post -402 UNIMPL NOHIDE ksem_wait -403 UNIMPL NOHIDE ksem_trywait -404 UNIMPL NOHIDE ksem_init -405 UNIMPL NOHIDE ksem_open -406 UNIMPL NOHIDE ksem_unlink -407 UNIMPL NOHIDE ksem_getvalue -408 UNIMPL NOHIDE ksem_destroy -409 UNIMPL BSD __mac_get_pid -410 UNIMPL BSD __mac_get_link -411 UNIMPL BSD __mac_set_link -412 UNIMPL BSD extattr_set_link -413 UNIMPL BSD extattr_get_link -414 UNIMPL BSD extattr_delete_link -415 UNIMPL BSD __mac_execve -416 STD POSIX { int ia32_sigaction(int sig, \ - struct sigaction32 *act, \ - struct sigaction32 *oact); } -417 MSTD BSD { int ia32_sigreturn(const struct ia32_ucontext *sigcntxp); } -418 UNIMPL BSD __xstat -419 UNIMPL BSD __xfstat -420 UNIMPL BSD __xlstat -421 UNIMPL BSD getcontext -422 UNIMPL BSD setcontext -423 UNIMPL BSD swapcontext -424 UNIMPL BSD swapoff -425 UNIMPL BSD __acl_get_link -426 UNIMPL BSD __acl_set_link -427 UNIMPL BSD __acl_delete_link -428 UNIMPL BSD __acl_aclcheck_link -429 UNIMPL NOHIDE sigwait -430 MNOPROTO BSD { int thr_create(ucontext_t *ctx, thr_id_t *id, \ - int flag s); } -431 MNOPROTO BSD { void thr_exit(void); } -432 MNOPROTO BSD { int thr_self(thr_id_t *id); } -433 MNOPROTO BSD { int thr_kill(thr_id_t id, int sig); } -434 MNOPROTO BSD { int _umtx_lock(struct umtx *umtx); } -435 MNOPROTO BSD { int _umtx_unlock(struct umtx *umtx); } -436 MNOPROTO BSD { int jail_attach(int jid); } - |