diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 2000-03-13 04:59:44 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 2000-03-13 04:59:44 +0000 |
| commit | 842f30848780866cb822fe01c4d3d4576718ddb3 (patch) | |
| tree | 212d1aae25966b1cb7769409e1ae97e626a32b95 /sys/alpha | |
| parent | dd3552c8a7b2b6823668c2834f667466844698de (diff) | |
Notes
Diffstat (limited to 'sys/alpha')
| -rw-r--r-- | sys/alpha/conf/NOTES | 162 | ||||
| -rw-r--r-- | sys/alpha/include/_limits.h | 96 | ||||
| -rw-r--r-- | sys/alpha/linux/Makefile | 13 | ||||
| -rw-r--r-- | sys/alpha/linux/linux.h | 416 | ||||
| -rw-r--r-- | sys/alpha/linux/linux_dummy.c | 114 | ||||
| -rw-r--r-- | sys/alpha/linux/linux_genassym.c | 13 | ||||
| -rw-r--r-- | sys/alpha/linux/linux_ioctl.h | 437 | ||||
| -rw-r--r-- | sys/alpha/linux/linux_sysvec.c | 511 | ||||
| -rw-r--r-- | sys/alpha/linux/syscalls.master | 286 |
9 files changed, 0 insertions, 2048 deletions
diff --git a/sys/alpha/conf/NOTES b/sys/alpha/conf/NOTES deleted file mode 100644 index dcedd7d76ac7..000000000000 --- a/sys/alpha/conf/NOTES +++ /dev/null @@ -1,162 +0,0 @@ -# -# GENERIC -- Generic kernel configuration file for FreeBSD/alpha -# -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: -# -# http://www.freebsd.org/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.ORG/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../i386/conf/LINT configuration file. -# If you are in doubt as to the purpose or necessity of a line, check first -# in LINT. Please note that this is the i386 LINT, but it still contains -# valuable info for alpha too -# -# For hardware specific information check HARDWARE.TXT -# -# $FreeBSD$ - -machine alpha -cpu EV4 -cpu EV5 -ident GENERIC -maxusers 32 - -#makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols - -# Platforms supported -options DEC_AXPPCI_33 # UDB, Multia, AXPpci33, Noname -options DEC_EB164 # EB164, PC164, PC164LX, PC164SX -options DEC_EB64PLUS # EB64+, Aspen Alpine, etc -options DEC_2100_A50 # AlphaStation 200, 250, 255, 400 -options DEC_KN20AA # AlphaStation 500, 600 -options DEC_ST550 # Personal Workstation 433, 500, 600 -options DEC_ST6600 # xp1000, dp264, ds20, ds10, family -options DEC_3000_300 # DEC3000/300* Pelic* family -options DEC_3000_500 # DEC3000/[4-9]00 Flamingo/Sandpiper family -options DEC_1000A # AlphaServer 1000, 1000A, 800 - -options INET #InterNETworking -options INET6 #IPv6 communications protocols -options FFS #Berkeley Fast Filesystem -options FFS_ROOT #FFS usable as root device [keep this!] -options MFS #Memory Filesystem -options MD_ROOT #MD is a potential root device -options NFS #Network Filesystem -options NFS_ROOT #NFS usable as root device -options MSDOSFS #MSDOS Filesystem -options CD9660 #ISO 9660 Filesystem -options CD9660_ROOT #CD-ROM usable as root device -options PROCFS #Process filesystem -options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] -options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI -options UCONSOLE #Allow users to grab the console -options KTRACE #ktrace(1) syscall trace support -options SYSVSHM #SYSV-style shared memory -options SYSVMSG #SYSV-style message queues -options SYSVSEM #SYSV-style semaphores -options P1003_1B #Posix P1003_1B real-time extentions -options _KPOSIX_PRIORITY_SCHEDULING -options ICMP_BANDLIM #Rate limit bad replies - -# Standard busses -device isa -device pci - -# Floppy drives -device fdc0 at isa? port IO_FD1 irq 6 drq 2 -device fd0 at fdc0 drive 0 - -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives - -# SCSI Controllers -device ahc # AHA2940 and onboard AIC7xxx devices -#device esp # 53C94 & friends, not CAM-ified -device isp # Qlogic family -device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets) - -# SCSI peripherals -device scbus # SCSI bus (required) -device da # Direct Access (disks) -device sa # Sequential Access (tape etc) -device cd # CD -device pass # Passthrough device (direct SCSI access) - -# atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc0 at isa? port IO_KBD -device atkbd0 at atkbdc? irq 1 -device psm0 at atkbdc? irq 12 - -device vga0 at isa? - -# splash screen/screen saver -pseudo-device splash - -# syscons is the default console driver, resembling an SCO console -device sc0 at isa? - -# real time clock -device mcclock0 at isa? port 0x70 - -# Serial (COM) ports -device sio0 at isa? port IO_COM1 irq 4 -device sio1 at isa? port IO_COM2 irq 3 flags 0x50 - -# PCI Ethernet NICs. -device de # DEC/Intel DC21x4x (``Tulip'') -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device le # Lance -device wx # Intel Gigabit Ethernet Card (``Wiseman'') - -# PCI Ethernet NICs that use the common MII bus controller code. -device miibus # MII bus support -device dc # DEC/Intel 21143 and workalikes -device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') -device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device ste # Sundance ST201 (D-Link DFE-550TX) -device tl # Texas Instruments ThunderLAN -device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F -device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') - -# Pseudo devices - the number indicates how many units to allocated. -pseudo-device loop # Network loopback -pseudo-device ether # Ethernet support -pseudo-device sl 1 # Kernel SLIP -pseudo-device ppp 1 # Kernel PPP -pseudo-device tun # Packet tunnel. -pseudo-device pty # Pseudo-ttys (telnet etc) -pseudo-device md # Memory "disks" -pseudo-device gif 4 # IPv6 and IPv4 tunneling -pseudo-device faith 1 # IPv6-to-IPv4 relaying/(translation) - -# The `bpf' pseudo-device enables the Berkeley Packet Filter. -# Be aware of the administrative consequences of enabling this! -pseudo-device bpf #Berkeley packet filter - -# USB support -#device uhci # UHCI PCI->USB interface -#device ohci # OHCI PCI->USB interface -#device usb # USB Bus (required) -#device ugen # Generic -#device uhid # "Human Interface Devices" -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage - Requires scbus and da0 -#device ums # Mouse -# USB Ethernet -#device aue # ADMtek USB ethernet -#device cue # CATC USB ethernet -#device kue # Kawasaki LSI USB ethernet diff --git a/sys/alpha/include/_limits.h b/sys/alpha/include/_limits.h deleted file mode 100644 index 99ca2d89843f..000000000000 --- a/sys/alpha/include/_limits.h +++ /dev/null @@ -1,96 +0,0 @@ -/* $FreeBSD$ */ -/* From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp */ - -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)limits.h 8.3 (Berkeley) 1/4/94 - */ - -#define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - * These numbers work for pcc as well. The UINT_MAX and ULONG_MAX values - * are written as hex so that GCC will be quiet about large integer constants. - */ -#define SCHAR_MAX 0x7f /* max value for a signed char */ -#define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ - -#define UCHAR_MAX 0xffU /* max value for an unsigned char */ -#define CHAR_MAX 0x7f /* max value for a char */ -#define CHAR_MIN (-0x7f-1) /* min value for a char */ - -#define USHRT_MAX 0xffffU /* max value for an unsigned short */ -#define SHRT_MAX 0x7fff /* max value for a short */ -#define SHRT_MIN (-0x7fff-1) /* min value for a short */ - -#define UINT_MAX 0xffffffffU /* max value for an unsigned int */ -#define INT_MAX 0x7fffffff /* max value for an int */ -#define INT_MIN (-0x7fffffff-1) /* min value for an int */ - -#define ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */ -#define LONG_MAX 0x7fffffffffffffffL /* max for a long */ -#define LONG_MIN (-0x7fffffffffffffffL-1) /* min for a long */ - -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX LONG_MAX /* max value for a ssize_t */ - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define SIZE_T_MAX ULONG_MAX /* max value for a size_t */ - -/* Quads and longs are the same on the alpha */ -#define UQUAD_MAX (ULONG_MAX) /* max value for a uquad_t */ -#define QUAD_MAX (LONG_MAX) /* max value for a quad_t */ -#define QUAD_MIN (LONG_MIN) /* min value for a quad_t */ - -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ - -#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE) -#define LONG_BIT 64 -#define WORD_BIT 32 - -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157E+308 -#define DBL_MIN 2.2250738585072014E-308 - -#define FLT_DIG 6 -#define FLT_MAX 3.40282347E+38F -#define FLT_MIN 1.17549435E-38F -#endif diff --git a/sys/alpha/linux/Makefile b/sys/alpha/linux/Makefile deleted file mode 100644 index c062c96ec177..000000000000 --- a/sys/alpha/linux/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for syscall tables -# -# $FreeBSD$ - -all: - @echo "make linux_sysent.c only" - -linux_sysent.c linux_syscall.h linux_proto.h: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - -mv -f linux_sysent.c linux_sysent.c.bak - -mv -f linux_syscall.h linux_syscall.h.bak - -mv -f linux_proto.h linux_proto.h.bak - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf diff --git a/sys/alpha/linux/linux.h b/sys/alpha/linux/linux.h deleted file mode 100644 index 528a5914134c..000000000000 --- a/sys/alpha/linux/linux.h +++ /dev/null @@ -1,416 +0,0 @@ -/*- - * Copyright (c) 1994-1996 Søren Schmidt - * 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$ - */ - -#ifndef _I386_LINUX_LINUX_H_ -#define _I386_LINUX_LINUX_H_ - -#include <i386/linux/linux_syscall.h> - -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_LINUX); -#endif - -/* - * Miscellaneous - */ -#define LINUX_NAME_MAX 255 -#define LINUX_MAX_UTSNAME 65 - -/* Scheduling policies */ -#define LINUX_SCHED_OTHER 0 -#define LINUX_SCHED_FIFO 1 -#define LINUX_SCHED_RR 2 - -/* Resource limits */ -#define LINUX_RLIMIT_CPU 0 -#define LINUX_RLIMIT_FSIZE 1 -#define LINUX_RLIMIT_DATA 2 -#define LINUX_RLIMIT_STACK 3 -#define LINUX_RLIMIT_CORE 4 -#define LINUX_RLIMIT_RSS 5 -#define LINUX_RLIMIT_NPROC 6 -#define LINUX_RLIMIT_NOFILE 7 -#define LINUX_RLIMIT_MEMLOCK 8 -#define LINUX_RLIMIT_AS 9 /* address space limit */ - -#define LINUX_RLIM_NLIMITS 10 - -/* mmap options */ -#define LINUX_MAP_SHARED 0x0001 -#define LINUX_MAP_PRIVATE 0x0002 -#define LINUX_MAP_FIXED 0x0010 -#define LINUX_MAP_ANON 0x0020 -#define LINUX_MAP_GROWSDOWN 0x0100 - -typedef char * linux_caddr_t; -typedef long linux_clock_t; -typedef u_short linux_dev_t; -typedef u_short linux_gid_t; -typedef u_long linux_ino_t; -typedef int linux_key_t; /* XXX */ -typedef u_short linux_mode_t; -typedef u_short linux_nlink_t; -typedef long linux_off_t; -typedef int linux_pid_t; -typedef u_int linux_size_t; -typedef long linux_time_t; -typedef u_short linux_uid_t; - -typedef struct { - long val[2]; -} linux_fsid_t; - -struct linux_new_utsname { - char sysname[LINUX_MAX_UTSNAME]; - char nodename[LINUX_MAX_UTSNAME]; - char release[LINUX_MAX_UTSNAME]; - char version[LINUX_MAX_UTSNAME]; - char machine[LINUX_MAX_UTSNAME]; - char domainname[LINUX_MAX_UTSNAME]; -}; - -/* - * Signalling - */ -#define LINUX_SIGHUP 1 -#define LINUX_SIGINT 2 -#define LINUX_SIGQUIT 3 -#define LINUX_SIGILL 4 -#define LINUX_SIGTRAP 5 -#define LINUX_SIGABRT 6 -#define LINUX_SIGIOT LINUX_SIGABRT -#define LINUX_SIGBUS 7 -#define LINUX_SIGFPE 8 -#define LINUX_SIGKILL 9 -#define LINUX_SIGUSR1 10 -#define LINUX_SIGSEGV 11 -#define LINUX_SIGUSR2 12 -#define LINUX_SIGPIPE 13 -#define LINUX_SIGALRM 14 -#define LINUX_SIGTERM 15 -#define LINUX_SIGSTKFLT 16 -#define LINUX_SIGCHLD 17 -#define LINUX_SIGCONT 18 -#define LINUX_SIGSTOP 19 -#define LINUX_SIGTSTP 20 -#define LINUX_SIGTTIN 21 -#define LINUX_SIGTTOU 22 -#define LINUX_SIGURG 23 -#define LINUX_SIGXCPU 24 -#define LINUX_SIGXFSZ 25 -#define LINUX_SIGVTALRM 26 -#define LINUX_SIGPROF 27 -#define LINUX_SIGWINCH 28 -#define LINUX_SIGIO 29 -#define LINUX_SIGPOLL LINUX_SIGIO -#define LINUX_SIGPWR 30 -#define LINUX_SIGUNUSED 31 - -#define LINUX_NSIG 64 -#define LINUX_SIGTBLSZ 31 - -/* sigaction flags */ -#define LINUX_SA_NOCLDSTOP 0x00000001 -#define LINUX_SA_NOCLDWAIT 0x00000002 -#define LINUX_SA_SIGINFO 0x00000004 -#define LINUX_SA_RESTORER 0x04000000 -#define LINUX_SA_ONSTACK 0x08000000 -#define LINUX_SA_RESTART 0x10000000 -#define LINUX_SA_INTERRUPT 0x20000000 -#define LINUX_SA_NOMASK 0x40000000 -#define LINUX_SA_ONESHOT 0x80000000 - -/* sigprocmask actions */ -#define LINUX_SIG_BLOCK 0 -#define LINUX_SIG_UNBLOCK 1 -#define LINUX_SIG_SETMASK 2 - -/* sigset_t macros */ -#define LINUX_SIGEMPTYSET(set) (set).__bits[0] = (set).__bits[1] = 0 -#define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig) -#define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig) - -typedef void (*linux_handler_t)(int); -typedef u_long linux_osigset_t; - -typedef struct { - u_int __bits[2]; -} linux_sigset_t; - -typedef struct { - linux_handler_t lsa_handler; - linux_osigset_t lsa_mask; - u_long lsa_flags; - void (*lsa_restorer)(void); -} linux_osigaction_t; - -typedef struct { - linux_handler_t lsa_handler; - u_long lsa_flags; - void (*lsa_restorer)(void); - linux_sigset_t lsa_mask; -} linux_sigaction_t; - -typedef struct { - void *ss_sp; - int ss_flags; - linux_size_t ss_size; -} linux_stack_t; - -/* The Linux sigcontext, pretty much a standard 386 trapframe. */ -struct linux_sigcontext { - int sc_gs; - int sc_fs; - int sc_es; - int sc_ds; - int sc_edi; - int sc_esi; - int sc_ebp; - int sc_esp; - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; - int sc_trapno; - int sc_err; - int sc_eip; - int sc_cs; - int sc_eflags; - int sc_esp_at_signal; - int sc_ss; - int sc_387; - int sc_mask; - int sc_cr2; -}; - -/* - * We make the stack look like Linux expects it when calling a signal - * handler, but use the BSD way of calling the handler and sigreturn(). - * This means that we need to pass the pointer to the handler too. - * It is appended to the frame to not interfere with the rest of it. - */ -struct linux_sigframe { - int sf_sig; - struct linux_sigcontext sf_sc; - linux_handler_t sf_handler; -}; - -extern int bsd_to_linux_signal[]; -extern int linux_to_bsd_signal[]; - -/* - * Pluggable ioctl handlers - */ -struct linker_set; -struct linux_ioctl_args; -struct proc; - -typedef int linux_ioctl_function_t(struct proc *, struct linux_ioctl_args *); - -struct linux_ioctl_handler { - linux_ioctl_function_t *func; - int low, high; -}; - -int linux_ioctl_register_handler(struct linux_ioctl_handler *h); -int linux_ioctl_register_handlers(struct linker_set *s); -int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); -int linux_ioctl_unregister_handlers(struct linker_set *s); - -/* - * open/fcntl flags - */ -#define LINUX_O_RDONLY 00 -#define LINUX_O_WRONLY 01 -#define LINUX_O_RDWR 02 -#define LINUX_O_CREAT 0100 -#define LINUX_O_EXCL 0200 -#define LINUX_O_NOCTTY 0400 -#define LINUX_O_TRUNC 01000 -#define LINUX_O_APPEND 02000 -#define LINUX_O_NONBLOCK 04000 -#define LINUX_O_NDELAY LINUX_O_NONBLOCK -#define LINUX_O_SYNC 010000 -#define LINUX_FASYNC 020000 - -#define LINUX_F_DUPFD 0 -#define LINUX_F_GETFD 1 -#define LINUX_F_SETFD 2 -#define LINUX_F_GETFL 3 -#define LINUX_F_SETFL 4 -#define LINUX_F_GETLK 5 -#define LINUX_F_SETLK 6 -#define LINUX_F_SETLKW 7 -#define LINUX_F_SETOWN 8 -#define LINUX_F_GETOWN 9 - -#define LINUX_F_RDLCK 0 -#define LINUX_F_WRLCK 1 -#define LINUX_F_UNLCK 2 - -/* - * SystemV IPC defines - */ -#define LINUX_SEMOP 1 -#define LINUX_SEMGET 2 -#define LINUX_SEMCTL 3 -#define LINUX_MSGSND 11 -#define LINUX_MSGRCV 12 -#define LINUX_MSGGET 13 -#define LINUX_MSGCTL 14 -#define LINUX_SHMAT 21 -#define LINUX_SHMDT 22 -#define LINUX_SHMGET 23 -#define LINUX_SHMCTL 24 - -#define LINUX_IPC_RMID 0 -#define LINUX_IPC_SET 1 -#define LINUX_IPC_STAT 2 -#define LINUX_IPC_INFO 3 - -#define LINUX_SHM_LOCK 11 -#define LINUX_SHM_UNLOCK 12 -#define LINUX_SHM_STAT 13 -#define LINUX_SHM_INFO 14 - -#define LINUX_SHM_RDONLY 0x1000 -#define LINUX_SHM_RND 0x2000 -#define LINUX_SHM_REMAP 0x4000 - -/* semctl commands */ -#define LINUX_GETPID 11 -#define LINUX_GETVAL 12 -#define LINUX_GETALL 13 -#define LINUX_GETNCNT 14 -#define LINUX_GETZCNT 15 -#define LINUX_SETVAL 16 -#define LINUX_SETALL 17 - -/* - * Socket defines - */ -#define LINUX_SOCKET 1 -#define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 -#define LINUX_GETSOCKNAME 6 -#define LINUX_GETPEERNAME 7 -#define LINUX_SOCKETPAIR 8 -#define LINUX_SEND 9 -#define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 -#define LINUX_SETSOCKOPT 14 -#define LINUX_GETSOCKOPT 15 -#define LINUX_SENDMSG 16 -#define LINUX_RECVMSG 17 - -#define LINUX_AF_UNSPEC 0 -#define LINUX_AF_UNIX 1 -#define LINUX_AF_INET 2 -#define LINUX_AF_AX25 3 -#define LINUX_AF_IPX 4 -#define LINUX_AF_APPLETALK 5 - -#define LINUX_SOL_SOCKET 1 -#define LINUX_SOL_IP 0 -#define LINUX_SOL_IPX 256 -#define LINUX_SOL_AX25 257 -#define LINUX_SOL_TCP 6 -#define LINUX_SOL_UDP 17 - -#define LINUX_SO_DEBUG 1 -#define LINUX_SO_REUSEADDR 2 -#define LINUX_SO_TYPE 3 -#define LINUX_SO_ERROR 4 -#define LINUX_SO_DONTROUTE 5 -#define LINUX_SO_BROADCAST 6 -#define LINUX_SO_SNDBUF 7 -#define LINUX_SO_RCVBUF 8 -#define LINUX_SO_KEEPALIVE 9 -#define LINUX_SO_OOBINLINE 10 -#define LINUX_SO_NO_CHECK 11 -#define LINUX_SO_PRIORITY 12 -#define LINUX_SO_LINGER 13 - -#define LINUX_IP_TOS 1 -#define LINUX_IP_TTL 2 -#define LINUX_IP_HDRINCL 3 -#define LINUX_IP_OPTIONS 4 - -#define LINUX_IP_MULTICAST_IF 32 -#define LINUX_IP_MULTICAST_TTL 33 -#define LINUX_IP_MULTICAST_LOOP 34 -#define LINUX_IP_ADD_MEMBERSHIP 35 -#define LINUX_IP_DROP_MEMBERSHIP 36 - -struct linux_sockaddr { - u_short sa_family; - char sa_data[14]; -}; - -struct linux_ifmap { - u_long mem_start; - u_long mem_end; - u_short base_addr; - u_char irq; - u_char dma; - u_char port; -}; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 - -struct linux_ifreq { - union { - char ifrn_name[LINUX_IFNAMSIZ]; - } ifr_ifrn; - - union { - struct linux_sockaddr ifru_addr; - struct linux_sockaddr ifru_dstaddr; - struct linux_sockaddr ifru_broadaddr; - struct linux_sockaddr ifru_netmask; - struct linux_sockaddr ifru_hwaddr; - short ifru_flags; - int ifru_metric; - int ifru_mtu; - struct linux_ifmap ifru_map; - char ifru_slave[LINUX_IFNAMSIZ]; /* Just fits the size */ - linux_caddr_t ifru_data; - } ifr_ifru; -}; - -#define ifr_name ifr_ifrn.ifrn_name /* interface name */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ - -#endif /* !_I386_LINUX_LINUX_H_ */ diff --git a/sys/alpha/linux/linux_dummy.c b/sys/alpha/linux/linux_dummy.c deleted file mode 100644 index 4124e990b6ca..000000000000 --- a/sys/alpha/linux/linux_dummy.c +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * Copyright (c) 1994-1995 Søren Schmidt - * 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 <sys/param.h> -#include <sys/systm.h> -#include <sys/proc.h> - -#include <i386/linux/linux.h> -#include <i386/linux/linux_proto.h> - -#define DUMMY(s) \ -int \ -linux_ ## s(struct proc *p, struct linux_ ## s ## _args *args) \ -{ \ - return (unsupported_msg(p, #s)); \ -} \ -struct __hack - -static int -unsupported_msg(struct proc *p, const char *fname) -{ - printf("linux: syscall %s is obsoleted or not implemented (pid=%ld)\n", - fname, (long)p->p_pid); - return (ENOSYS); -} - -DUMMY(setup); -DUMMY(break); -DUMMY(stat); -DUMMY(mount); -DUMMY(umount); -DUMMY(stime); -DUMMY(ptrace); -DUMMY(fstat); -DUMMY(stty); -DUMMY(gtty); -DUMMY(ftime); -DUMMY(prof); -DUMMY(umount2); -DUMMY(lock); -DUMMY(mpx); -DUMMY(ulimit); -DUMMY(olduname); -DUMMY(ksyslog); -DUMMY(uname); -DUMMY(vhangup); -DUMMY(idle); -DUMMY(vm86old); -DUMMY(swapoff); -DUMMY(sysinfo); -DUMMY(adjtimex); -DUMMY(create_module); -DUMMY(init_module); -DUMMY(delete_module); -DUMMY(get_kernel_syms); -DUMMY(quotactl); -DUMMY(bdflush); -DUMMY(sysfs); -DUMMY(afs_syscall); -DUMMY(setfsuid); -DUMMY(setfsgid); -DUMMY(getsid); -DUMMY(sysctl); -DUMMY(getresuid); -DUMMY(vm86); -DUMMY(query_module); -DUMMY(nfsservctl); -DUMMY(getresgid); -DUMMY(prctl); -DUMMY(rt_sigreturn); -DUMMY(rt_sigpending); -DUMMY(rt_sigtimedwait); -DUMMY(rt_sigqueueinfo); -DUMMY(pread); -DUMMY(pwrite); -DUMMY(capget); -DUMMY(capset); -DUMMY(sendfile); -DUMMY(getpmsg); -DUMMY(putpmsg); -DUMMY(ugetrlimit); -DUMMY(mmap2); -DUMMY(truncate64); -DUMMY(ftruncate64); -DUMMY(stat64); -DUMMY(lstat64); -DUMMY(fstat64); diff --git a/sys/alpha/linux/linux_genassym.c b/sys/alpha/linux/linux_genassym.c deleted file mode 100644 index 25e20af9c790..000000000000 --- a/sys/alpha/linux/linux_genassym.c +++ /dev/null @@ -1,13 +0,0 @@ -/* $FreeBSD$ */ - -#include <stddef.h> - -#include <sys/param.h> -#include <sys/assym.h> - -#include <i386/linux/linux.h> - -ASSYM(LINUX_SIGF_HANDLER, offsetof(struct linux_sigframe, sf_handler)); -ASSYM(LINUX_SIGF_SC, offsetof(struct linux_sigframe, sf_sc)); -ASSYM(LINUX_SC_GS, offsetof(struct linux_sigcontext, sc_gs)); -ASSYM(LINUX_SC_EFLAGS, offsetof(struct linux_sigcontext, sc_eflags)); diff --git a/sys/alpha/linux/linux_ioctl.h b/sys/alpha/linux/linux_ioctl.h deleted file mode 100644 index 1ed49012547f..000000000000 --- a/sys/alpha/linux/linux_ioctl.h +++ /dev/null @@ -1,437 +0,0 @@ -/*- - * Copyright (c) 1999 Marcel Moolenaar - * 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$ - */ - -#ifndef _LINUX_IOCTL_H_ -#define _LINUX_IOCTL_H_ - -/* - * disk - */ -#define LINUX_BLKROSET 0x125d -#define LINUX_BLKROGET 0x125e -#define LINUX_BLKRRPART 0x125f -#define LINUX_BLKGETSIZE 0x1260 -#define LINUX_BLKFLSBUF 0x1261 -#define LINUX_BLKRASET 0x1262 -#define LINUX_BLKRAGET 0x1263 -#define LINUX_BLKFRASET 0x1264 -#define LINUX_BLKFRAGET 0x1265 -#define LINUX_BLKSECTSET 0x1266 -#define LINUX_BLKSECTGET 0x1267 -#define LINUX_BLKSSZGET 0x1268 - -#define LINUX_IOCTL_DISK_MIN LINUX_BLKROSET -#define LINUX_IOCTL_DISK_MAX LINUX_BLKSSZGET - -/* - * cdrom - */ -#define LINUX_CDROMPAUSE 0x5301 -#define LINUX_CDROMRESUME 0x5302 -#define LINUX_CDROMPLAYMSF 0x5303 -#define LINUX_CDROMPLAYTRKIND 0x5304 -#define LINUX_CDROMREADTOCHDR 0x5305 -#define LINUX_CDROMREADTOCENTRY 0x5306 -#define LINUX_CDROMSTOP 0x5307 -#define LINUX_CDROMSTART 0x5308 -#define LINUX_CDROMEJECT 0x5309 -#define LINUX_CDROMVOLCTRL 0x530a -#define LINUX_CDROMSUBCHNL 0x530b -#define LINUX_CDROMREADMODE2 0x530c -#define LINUX_CDROMREADMODE1 0x530d -#define LINUX_CDROMREADAUDIO 0x530e -#define LINUX_CDROMEJECT_SW 0x530f -#define LINUX_CDROMMULTISESSION 0x5310 -#define LINUX_CDROM_GET_UPC 0x5311 -#define LINUX_CDROMRESET 0x5312 -#define LINUX_CDROMVOLREAD 0x5313 -#define LINUX_CDROMREADRAW 0x5314 -#define LINUX_CDROMREADCOOKED 0x5315 -#define LINUX_CDROMSEEK 0x5316 -#define LINUX_CDROMPLAYBLK 0x5317 -#define LINUX_CDROMREADALL 0x5318 -#define LINUX_CDROMCLOSETRAY 0x5319 -#define LINUX_CDROMLOADFROMSLOT 0x531a - -#define LINUX_IOCTL_CDROM_MIN LINUX_CDROMPAUSE -#define LINUX_IOCTL_CDROM_MAX LINUX_CDROMLOADFROMSLOT - -#define LINUX_CDROM_LBA 0x01 -#define LINUX_CDROM_MSF 0x02 - -/* - * console - */ -#define LINUX_KIOCSOUND 0x4B2F -#define LINUX_KDMKTONE 0x4B30 -#define LINUX_KDGETLED 0x4B31 -#define LINUX_KDSETLED 0x4B32 -#define LINUX_KDSETMODE 0x4B3A -#define LINUX_KDGETMODE 0x4B3B -#define LINUX_KDGKBMODE 0x4B44 -#define LINUX_KDSKBMODE 0x4B45 -#define LINUX_VT_OPENQRY 0x5600 -#define LINUX_VT_GETMODE 0x5601 -#define LINUX_VT_SETMODE 0x5602 -#define LINUX_VT_GETSTATE 0x5603 -#define LINUX_VT_RELDISP 0x5605 -#define LINUX_VT_ACTIVATE 0x5606 -#define LINUX_VT_WAITACTIVE 0x5607 - -#define LINUX_IOCTL_CONSOLE_MIN LINUX_KIOCSOUND -#define LINUX_IOCTL_CONSOLE_MAX LINUX_VT_WAITACTIVE - -#define LINUX_LED_SCR 0x01 -#define LINUX_LED_NUM 0x02 -#define LINUX_LED_CAP 0x04 - -#define LINUX_KD_TEXT 0x0 -#define LINUX_KD_GRAPHICS 0x1 -#define LINUX_KD_TEXT0 0x2 -#define LINUX_KD_TEXT1 0x3 - -#define LINUX_KBD_RAW 0 -#define LINUX_KBD_XLATE 1 -#define LINUX_KBD_MEDIUMRAW 2 - -/* - * socket - */ -#define LINUX_FIOSETOWN 0x8901 -#define LINUX_SIOCSPGRP 0x8902 -#define LINUX_FIOGETOWN 0x8903 -#define LINUX_SIOCGPGRP 0x8904 -#define LINUX_SIOCATMARK 0x8905 -#define LINUX_SIOCGSTAMP 0x8906 -#define LINUX_SIOCGIFCONF 0x8912 -#define LINUX_SIOCGIFFLAGS 0x8913 -#define LINUX_SIOCGIFADDR 0x8915 -#define LINUX_SIOCGIFDSTADDR 0x8917 -#define LINUX_SIOCGIFBRDADDR 0x8919 -#define LINUX_SIOCGIFNETMASK 0x891b -#define LINUX_SIOCGIFHWADDR 0x8927 -#define LINUX_SIOCADDMULTI 0x8931 -#define LINUX_SIOCDELMULTI 0x8932 - -#define LINUX_IOCTL_SOCKET_MIN LINUX_FIOSETOWN -#define LINUX_IOCTL_SOCKET_MAX LINUX_SIOCDELMULTI - -/* - * sound - */ -#define LINUX_SOUND_MIXER_WRITE_VOLUME 0x4d00 -#define LINUX_SOUND_MIXER_WRITE_BASS 0x4d01 -#define LINUX_SOUND_MIXER_WRITE_TREBLE 0x4d02 -#define LINUX_SOUND_MIXER_WRITE_SYNTH 0x4d03 -#define LINUX_SOUND_MIXER_WRITE_PCM 0x4d04 -#define LINUX_SOUND_MIXER_WRITE_SPEAKER 0x4d05 -#define LINUX_SOUND_MIXER_WRITE_LINE 0x4d06 -#define LINUX_SOUND_MIXER_WRITE_MIC 0x4d07 -#define LINUX_SOUND_MIXER_WRITE_CD 0x4d08 -#define LINUX_SOUND_MIXER_WRITE_IMIX 0x4d09 -#define LINUX_SOUND_MIXER_WRITE_ALTPCM 0x4d0A -#define LINUX_SOUND_MIXER_WRITE_RECLEV 0x4d0B -#define LINUX_SOUND_MIXER_WRITE_IGAIN 0x4d0C -#define LINUX_SOUND_MIXER_WRITE_OGAIN 0x4d0D -#define LINUX_SOUND_MIXER_WRITE_LINE1 0x4d0E -#define LINUX_SOUND_MIXER_WRITE_LINE2 0x4d0F -#define LINUX_SOUND_MIXER_WRITE_LINE3 0x4d10 -#define LINUX_OSS_GETVERSION 0x4d76 -#define LINUX_SOUND_MIXER_READ_DEVMASK 0x4dfe -#define LINUX_SNDCTL_DSP_RESET 0x5000 -#define LINUX_SNDCTL_DSP_SYNC 0x5001 -#define LINUX_SNDCTL_DSP_SPEED 0x5002 -#define LINUX_SNDCTL_DSP_STEREO 0x5003 -#define LINUX_SNDCTL_DSP_GETBLKSIZE 0x5004 -#define LINUX_SNDCTL_DSP_SETBLKSIZE LINUX_SNDCTL_DSP_GETBLKSIZE -#define LINUX_SNDCTL_DSP_SETFMT 0x5005 -#define LINUX_SOUND_PCM_WRITE_CHANNELS 0x5006 -#define LINUX_SOUND_PCM_WRITE_FILTER 0x5007 -#define LINUX_SNDCTL_DSP_POST 0x5008 -#define LINUX_SNDCTL_DSP_SUBDIVIDE 0x5009 -#define LINUX_SNDCTL_DSP_SETFRAGMENT 0x500A -#define LINUX_SNDCTL_DSP_GETFMTS 0x500B -#define LINUX_SNDCTL_DSP_GETOSPACE 0x500C -#define LINUX_SNDCTL_DSP_GETISPACE 0x500D -#define LINUX_SNDCTL_DSP_NONBLOCK 0x500E -#define LINUX_SNDCTL_DSP_GETCAPS 0x500F -#define LINUX_SNDCTL_DSP_GETTRIGGER 0x5010 -#define LINUX_SNDCTL_DSP_SETTRIGGER LINUX_SNDCTL_DSP_GETTRIGGER -#define LINUX_SNDCTL_DSP_GETIPTR 0x5011 -#define LINUX_SNDCTL_DSP_GETOPTR 0x5012 -#define LINUX_SNDCTL_DSP_GETODELAY 0x5017 -#define LINUX_SNDCTL_SEQ_RESET 0x5100 -#define LINUX_SNDCTL_SEQ_SYNC 0x5101 -#define LINUX_SNDCTL_SYNTH_INFO 0x5102 -#define LINUX_SNDCTL_SEQ_CTRLRATE 0x5103 -#define LINUX_SNDCTL_SEQ_GETOUTCOUNT 0x5104 -#define LINUX_SNDCTL_SEQ_GETINCOUNT 0x5105 -#define LINUX_SNDCTL_SEQ_PERCMODE 0x5106 -#define LINUX_SNDCTL_FM_LOAD_INSTR 0x5107 -#define LINUX_SNDCTL_SEQ_TESTMIDI 0x5108 -#define LINUX_SNDCTL_SEQ_RESETSAMPLES 0x5109 -#define LINUX_SNDCTL_SEQ_NRSYNTHS 0x510A -#define LINUX_SNDCTL_SEQ_NRMIDIS 0x510B -#define LINUX_SNDCTL_MIDI_INFO 0x510C -#define LINUX_SNDCTL_SEQ_TRESHOLD 0x510D -#define LINUX_SNDCTL_SYNTH_MEMAVL 0x510E - -#define LINUX_IOCTL_SOUND_MIN LINUX_SOUND_MIXER_WRITE_VOLUME -#define LINUX_IOCTL_SOUND_MAX LINUX_SNDCTL_SYNTH_MEMAVL - -/* - * termio - */ -#define LINUX_TCGETS 0x5401 -#define LINUX_TCSETS 0x5402 -#define LINUX_TCSETSW 0x5403 -#define LINUX_TCSETSF 0x5404 -#define LINUX_TCGETA 0x5405 -#define LINUX_TCSETA 0x5406 -#define LINUX_TCSETAW 0x5407 -#define LINUX_TCSETAF 0x5408 -#define LINUX_TCSBRK 0x5409 -#define LINUX_TCXONC 0x540A -#define LINUX_TCFLSH 0x540B -#define LINUX_TIOCEXCL 0x540C -#define LINUX_TIOCNXCL 0x540D -#define LINUX_TIOCSCTTY 0x540E -#define LINUX_TIOCGPGRP 0x540F -#define LINUX_TIOCSPGRP 0x5410 -#define LINUX_TIOCOUTQ 0x5411 -#define LINUX_TIOCSTI 0x5412 -#define LINUX_TIOCGWINSZ 0x5413 -#define LINUX_TIOCSWINSZ 0x5414 -#define LINUX_TIOCMGET 0x5415 -#define LINUX_TIOCMBIS 0x5416 -#define LINUX_TIOCMBIC 0x5417 -#define LINUX_TIOCMSET 0x5418 -#define LINUX_TIOCGSOFTCAR 0x5419 -#define LINUX_TIOCSSOFTCAR 0x541A -#define LINUX_FIONREAD 0x541B -#define LINUX_TIOCINQ FIONREAD -#define LINUX_TIOCLINUX 0x541C -#define LINUX_TIOCCONS 0x541D -#define LINUX_TIOCGSERIAL 0x541E -#define LINUX_TIOCSSERIAL 0x541F -#define LINUX_TIOCPKT 0x5420 -#define LINUX_FIONBIO 0x5421 -#define LINUX_TIOCNOTTY 0x5422 -#define LINUX_TIOCSETD 0x5423 -#define LINUX_TIOCGETD 0x5424 -#define LINUX_TCSBRKP 0x5425 -#define LINUX_TIOCTTYGSTRUCT 0x5426 -#define LINUX_FIONCLEX 0x5450 -#define LINUX_FIOCLEX 0x5451 -#define LINUX_FIOASYNC 0x5452 -#define LINUX_TIOCSERCONFIG 0x5453 -#define LINUX_TIOCSERGWILD 0x5454 -#define LINUX_TIOCSERSWILD 0x5455 -#define LINUX_TIOCGLCKTRMIOS 0x5456 -#define LINUX_TIOCSLCKTRMIOS 0x5457 - -#define LINUX_IOCTL_TERMIO_MIN LINUX_TCGETS -#define LINUX_IOCTL_TERMIO_MAX LINUX_TIOCSLCKTRMIOS - -/* arguments for tcflow() and LINUX_TCXONC */ -#define LINUX_TCOOFF 0 -#define LINUX_TCOON 1 -#define LINUX_TCIOFF 2 -#define LINUX_TCION 3 - -/* arguments for tcflush() and LINUX_TCFLSH */ -#define LINUX_TCIFLUSH 0 -#define LINUX_TCOFLUSH 1 -#define LINUX_TCIOFLUSH 2 - -/* line disciplines */ -#define LINUX_N_TTY 0 -#define LINUX_N_SLIP 1 -#define LINUX_N_MOUSE 2 -#define LINUX_N_PPP 3 - -/* Linux termio c_cc values */ -#define LINUX_VINTR 0 -#define LINUX_VQUIT 1 -#define LINUX_VERASE 2 -#define LINUX_VKILL 3 -#define LINUX_VEOF 4 -#define LINUX_VTIME 5 -#define LINUX_VMIN 6 -#define LINUX_VSWTC 7 -#define LINUX_NCC 8 - -/* Linux termios c_cc values */ -#define LINUX_VSTART 8 -#define LINUX_VSTOP 9 -#define LINUX_VSUSP 10 -#define LINUX_VEOL 11 -#define LINUX_VREPRINT 12 -#define LINUX_VDISCARD 13 -#define LINUX_VWERASE 14 -#define LINUX_VLNEXT 15 -#define LINUX_VEOL2 16 -#define LINUX_NCCS 19 - -#define LINUX_POSIX_VDISABLE '\0' - -/* Linux c_iflag masks */ -#define LINUX_IGNBRK 0x0000001 -#define LINUX_BRKINT 0x0000002 -#define LINUX_IGNPAR 0x0000004 -#define LINUX_PARMRK 0x0000008 -#define LINUX_INPCK 0x0000010 -#define LINUX_ISTRIP 0x0000020 -#define LINUX_INLCR 0x0000040 -#define LINUX_IGNCR 0x0000080 -#define LINUX_ICRNL 0x0000100 -#define LINUX_IUCLC 0x0000200 -#define LINUX_IXON 0x0000400 -#define LINUX_IXANY 0x0000800 -#define LINUX_IXOFF 0x0001000 -#define LINUX_IMAXBEL 0x0002000 - -/* Linux c_oflag masks */ -#define LINUX_OPOST 0x0000001 -#define LINUX_OLCUC 0x0000002 -#define LINUX_ONLCR 0x0000004 -#define LINUX_OCRNL 0x0000008 -#define LINUX_ONOCR 0x0000010 -#define LINUX_ONLRET 0x0000020 -#define LINUX_OFILL 0x0000040 -#define LINUX_OFDEL 0x0000080 -#define LINUX_NLDLY 0x0000100 - -#define LINUX_NL0 0x0000000 -#define LINUX_NL1 0x0000100 -#define LINUX_CRDLY 0x0000600 -#define LINUX_CR0 0x0000000 -#define LINUX_CR1 0x0000200 -#define LINUX_CR2 0x0000400 -#define LINUX_CR3 0x0000600 -#define LINUX_TABDLY 0x0001800 -#define LINUX_TAB0 0x0000000 -#define LINUX_TAB1 0x0000800 -#define LINUX_TAB2 0x0001000 -#define LINUX_TAB3 0x0001800 -#define LINUX_XTABS 0x0001800 -#define LINUX_BSDLY 0x0002000 -#define LINUX_BS0 0x0000000 -#define LINUX_BS1 0x0002000 -#define LINUX_VTDLY 0x0004000 -#define LINUX_VT0 0x0000000 -#define LINUX_VT1 0x0004000 -#define LINUX_FFDLY 0x0008000 -#define LINUX_FF0 0x0000000 -#define LINUX_FF1 0x0008000 - -#define LINUX_CBAUD 0x0000100f -#define LINUX_B0 0x00000000 -#define LINUX_B50 0x00000001 -#define LINUX_B75 0x00000002 -#define LINUX_B110 0x00000003 -#define LINUX_B134 0x00000004 -#define LINUX_B150 0x00000005 -#define LINUX_B200 0x00000006 -#define LINUX_B300 0x00000007 -#define LINUX_B600 0x00000008 -#define LINUX_B1200 0x00000009 -#define LINUX_B1800 0x0000000a -#define LINUX_B2400 0x0000000b -#define LINUX_B4800 0x0000000c -#define LINUX_B9600 0x0000000d -#define LINUX_B19200 0x0000000e -#define LINUX_B38400 0x0000000f -#define LINUX_EXTA LINUX_B19200 -#define LINUX_EXTB LINUX_B38400 -#define LINUX_CBAUDEX 0x00001000 -#define LINUX_B57600 0x00001001 -#define LINUX_B115200 0x00001002 - -#define LINUX_CSIZE 0x00000030 -#define LINUX_CS5 0x00000000 -#define LINUX_CS6 0x00000010 -#define LINUX_CS7 0x00000020 -#define LINUX_CS8 0x00000030 -#define LINUX_CSTOPB 0x00000040 -#define LINUX_CREAD 0x00000080 -#define LINUX_PARENB 0x00000100 -#define LINUX_PARODD 0x00000200 -#define LINUX_HUPCL 0x00000400 -#define LINUX_CLOCAL 0x00000800 -#define LINUX_CRTSCTS 0x80000000 - -/* Linux c_lflag masks */ -#define LINUX_ISIG 0x00000001 -#define LINUX_ICANON 0x00000002 -#define LINUX_XCASE 0x00000004 -#define LINUX_ECHO 0x00000008 -#define LINUX_ECHOE 0x00000010 -#define LINUX_ECHOK 0x00000020 -#define LINUX_ECHONL 0x00000040 -#define LINUX_NOFLSH 0x00000080 -#define LINUX_TOSTOP 0x00000100 -#define LINUX_ECHOCTL 0x00000200 -#define LINUX_ECHOPRT 0x00000400 -#define LINUX_ECHOKE 0x00000800 -#define LINUX_FLUSHO 0x00001000 -#define LINUX_PENDIN 0x00002000 -#define LINUX_IEXTEN 0x00008000 - -/* serial_struct values for TIOC[GS]SERIAL ioctls */ -#define LINUX_ASYNC_CLOSING_WAIT_INF 0 -#define LINUX_ASYNC_CLOSING_WAIT_NONE 65535 - -#define LINUX_PORT_UNKNOWN 0 -#define LINUX_PORT_8250 1 -#define LINUX_PORT_16450 2 -#define LINUX_PORT_16550 3 -#define LINUX_PORT_16550A 4 -#define LINUX_PORT_CIRRUS 5 -#define LINUX_PORT_16650 6 - -#define LINUX_PORT_MAX 6 - -#define LINUX_ASYNC_HUP_NOTIFY 0x0001 -#define LINUX_ASYNC_FOURPORT 0x0002 -#define LINUX_ASYNC_SAK 0x0004 -#define LINUX_ASYNC_SPLIT_TERMIOS 0x0008 -#define LINUX_ASYNC_SPD_MASK 0x0030 -#define LINUX_ASYNC_SPD_HI 0x0010 -#define LINUX_ASYNC_SPD_VHI 0x0020 -#define LINUX_ASYNC_SPD_CUST 0x0030 -#define LINUX_ASYNC_SKIP_TEST 0x0040 -#define LINUX_ASYNC_AUTO_IRQ 0x0080 -#define LINUX_ASYNC_SESSION_LOCKOUT 0x0100 -#define LINUX_ASYNC_PGRP_LOCKOUT 0x0200 -#define LINUX_ASYNC_CALLOUT_NOHUP 0x0400 -#define LINUX_ASYNC_FLAGS 0x0FFF - -#endif /* !_LINUX_IOCTL_H_ */ diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c deleted file mode 100644 index 39f3000153d2..000000000000 --- a/sys/alpha/linux/linux_sysvec.c +++ /dev/null @@ -1,511 +0,0 @@ -/*- - * Copyright (c) 1994-1996 Søren Schmidt - * 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$ - */ - -/* XXX we use functions that might not exist. */ -#include "opt_compat.h" - -#ifndef COMPAT_43 -#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!" -#endif - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/buf.h> -#include <sys/proc.h> -#include <sys/sysent.h> -#include <sys/imgact.h> -#include <sys/imgact_aout.h> -#include <sys/imgact_elf.h> -#include <sys/signalvar.h> -#include <sys/malloc.h> -#include <vm/vm.h> -#include <vm/vm_param.h> -#include <vm/vm_page.h> -#include <vm/vm_extern.h> -#include <sys/exec.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <machine/cpu.h> - -#include <i386/linux/linux.h> -#include <i386/linux/linux_proto.h> - -MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); - -extern char linux_sigcode[]; -extern int linux_szsigcode; - -extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; - -extern struct linker_set linux_ioctl_handler_set; - -static int linux_fixup __P((register_t **stack_base, - struct image_params *iparams)); -static int elf_linux_fixup __P((register_t **stack_base, - struct image_params *iparams)); -static void linux_prepsyscall __P((struct trapframe *tf, int *args, - u_int *code, caddr_t *params)); -static void linux_sendsig __P((sig_t catcher, int sig, sigset_t *mask, - u_long code)); - -/* - * Linux syscalls return negative errno's, we do positive and map them - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75, -6, -84 -}; - -int bsd_to_linux_signal[LINUX_SIGTBLSZ] = { - LINUX_SIGHUP, LINUX_SIGINT, LINUX_SIGQUIT, LINUX_SIGILL, - LINUX_SIGTRAP, LINUX_SIGABRT, 0, LINUX_SIGFPE, - LINUX_SIGKILL, LINUX_SIGBUS, LINUX_SIGSEGV, 0, - LINUX_SIGPIPE, LINUX_SIGALRM, LINUX_SIGTERM, LINUX_SIGURG, - LINUX_SIGSTOP, LINUX_SIGTSTP, LINUX_SIGCONT, LINUX_SIGCHLD, - LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGIO, LINUX_SIGXCPU, - LINUX_SIGXFSZ, LINUX_SIGVTALRM, LINUX_SIGPROF, LINUX_SIGWINCH, - 0, LINUX_SIGUSR1, LINUX_SIGUSR2 -}; - -int linux_to_bsd_signal[LINUX_SIGTBLSZ] = { - SIGHUP, SIGINT, SIGQUIT, SIGILL, - SIGTRAP, SIGABRT, SIGBUS, SIGFPE, - SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, - SIGPIPE, SIGALRM, SIGTERM, SIGBUS, - SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, - SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, - SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, - SIGIO, SIGURG, 0 -}; - -/* - * If FreeBSD & Linux have a difference of opinion about what a trap - * means, deal with it here. - */ -static int -translate_traps(int signal, int trap_code) -{ - if (signal != SIGBUS) - return signal; - switch (trap_code) { - case T_PROTFLT: - case T_TSSFLT: - case T_DOUBLEFLT: - case T_PAGEFLT: - return SIGSEGV; - default: - return signal; - } -} - -static int -linux_fixup(register_t **stack_base, struct image_params *imgp) -{ - register_t *argv, *envp; - - argv = *stack_base; - envp = *stack_base + (imgp->argc + 1); - (*stack_base)--; - **stack_base = (intptr_t)(void *)envp; - (*stack_base)--; - **stack_base = (intptr_t)(void *)argv; - (*stack_base)--; - **stack_base = imgp->argc; - return 0; -} - -static int -elf_linux_fixup(register_t **stack_base, struct image_params *imgp) -{ - Elf32_Auxargs *args = (Elf32_Auxargs *)imgp->auxargs; - register_t *pos; - - pos = *stack_base + (imgp->argc + imgp->envc + 2); - - if (args->trace) { - AUXARGS_ENTRY(pos, AT_DEBUG, 1); - } - if (args->execfd != -1) { - AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); - } - AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); - AUXARGS_ENTRY(pos, AT_PHENT, args->phent); - AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum); - AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); - AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); - AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); - AUXARGS_ENTRY(pos, AT_BASE, args->base); - AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_cred->p_ruid); - AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_cred->p_svuid); - AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_cred->p_rgid); - AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_cred->p_svgid); - AUXARGS_ENTRY(pos, AT_NULL, 0); - - free(imgp->auxargs, M_TEMP); - imgp->auxargs = NULL; - - (*stack_base)--; - **stack_base = (long)imgp->argc; - return 0; -} - -extern int _ucodesel, _udatasel; - -/* - * Send an interrupt to process. - * - * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user - * specified pc, psl. - */ - -static void -linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) -{ - register struct proc *p = curproc; - register struct trapframe *regs; - struct linux_sigframe *fp, frame; - struct sigacts *psp = p->p_sigacts; - int oonstack; - - regs = p->p_md.md_regs; - oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; - -#ifdef DEBUG - printf("Linux-emul(%ld): linux_sendsig(%p, %d, %p, %lu)\n", - (long)p->p_pid, catcher, sig, (void*)mask, code); -#endif - /* - * Allocate space for the signal handler context. - */ - if ((p->p_flag & P_ALTSTACK) && !oonstack && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct linux_sigframe *)(p->p_sigstk.ss_sp + - p->p_sigstk.ss_size - sizeof(struct linux_sigframe)); - p->p_sigstk.ss_flags |= SS_ONSTACK; - } else { - fp = (struct linux_sigframe *)regs->tf_esp - 1; - } - - /* - * grow() will return FALSE if the fp will not fit inside the stack - * and the stack can not be grown. useracc will return FALSE - * if access is denied. - */ - if ((grow_stack (p, (int)fp) == FALSE) || - !useracc((caddr_t)fp, sizeof (struct linux_sigframe), - VM_PROT_WRITE)) { - /* - * Process has trashed its stack; give it an illegal - * instruction to halt it in its tracks. - */ - SIGACTION(p, SIGILL) = SIG_DFL; - SIGDELSET(p->p_sigignore, SIGILL); - SIGDELSET(p->p_sigcatch, SIGILL); - SIGDELSET(p->p_sigmask, SIGILL); - psignal(p, SIGILL); - return; - } - - /* - * Build the argument list for the signal handler. - */ - if (p->p_sysent->sv_sigtbl) - if (sig <= p->p_sysent->sv_sigsize) - sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - - frame.sf_handler = catcher; - frame.sf_sig = sig; - - /* - * Build the signal context to be used by sigreturn. - */ - frame.sf_sc.sc_mask = mask->__bits[0]; - frame.sf_sc.sc_gs = rgs(); - frame.sf_sc.sc_fs = regs->tf_fs; - frame.sf_sc.sc_es = regs->tf_es; - frame.sf_sc.sc_ds = regs->tf_ds; - frame.sf_sc.sc_edi = regs->tf_edi; - frame.sf_sc.sc_esi = regs->tf_esi; - frame.sf_sc.sc_ebp = regs->tf_ebp; - frame.sf_sc.sc_ebx = regs->tf_ebx; - frame.sf_sc.sc_edx = regs->tf_edx; - frame.sf_sc.sc_ecx = regs->tf_ecx; - frame.sf_sc.sc_eax = regs->tf_eax; - frame.sf_sc.sc_eip = regs->tf_eip; - frame.sf_sc.sc_cs = regs->tf_cs; - frame.sf_sc.sc_eflags = regs->tf_eflags; - frame.sf_sc.sc_esp_at_signal = regs->tf_esp; - frame.sf_sc.sc_ss = regs->tf_ss; - frame.sf_sc.sc_err = regs->tf_err; - frame.sf_sc.sc_trapno = code; /* XXX ???? */ - - if (copyout(&frame, fp, sizeof(frame)) != 0) { - /* - * Process has trashed its stack; give it an illegal - * instruction to halt it in its tracks. - */ - sigexit(p, SIGILL); - /* NOTREACHED */ - } - - /* - * Build context to run handler in. - */ - regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); - regs->tf_eflags &= ~PSL_VM; - regs->tf_cs = _ucodesel; - regs->tf_ds = _udatasel; - regs->tf_es = _udatasel; - regs->tf_fs = _udatasel; - load_gs(_udatasel); - regs->tf_ss = _udatasel; -} - -/* - * System call to cleanup state after a signal - * has been taken. Reset signal mask and - * stack state from context left by sendsig (above). - * Return to previous pc and psl as specified by - * context left by sendsig. Check carefully to - * make sure that the user has not modified the - * psl to gain improper privileges or to cause - * a machine fault. - */ -int -linux_sigreturn(p, args) - struct proc *p; - struct linux_sigreturn_args *args; -{ - struct linux_sigcontext *scp, context; - register struct trapframe *regs; - int eflags; - - regs = p->p_md.md_regs; - -#ifdef DEBUG - printf("Linux-emul(%ld): linux_sigreturn(%p)\n", - (long)p->p_pid, (void *)args->scp); -#endif - /* - * The trampoline code hands us the context. - * It is unsafe to keep track of it ourselves, in the event that a - * program jumps out of a signal handler. - */ - scp = SCARG(args,scp); - if (copyin((caddr_t)scp, &context, sizeof(*scp)) != 0) - return (EFAULT); - - /* - * Check for security violations. - */ -#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) - eflags = context.sc_eflags; - /* - * XXX do allow users to change the privileged flag PSL_RF. The - * cpu sets PSL_RF in tf_eflags for faults. Debuggers should - * sometimes set it there too. tf_eflags is kept in the signal - * context during signal handling and there is no other place - * to remember it, so the PSL_RF bit may be corrupted by the - * signal handler without us knowing. Corruption of the PSL_RF - * bit at worst causes one more or one less debugger trap, so - * allowing it is fairly harmless. - */ - if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - return(EINVAL); - } - - /* - * Don't allow users to load a valid privileged %cs. Let the - * hardware check for invalid selectors, excess privilege in - * other selectors, invalid %eip's and invalid %esp's. - */ -#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) - if (!CS_SECURE(context.sc_cs)) { - trapsignal(p, SIGBUS, T_PROTFLT); - return(EINVAL); - } - - p->p_sigstk.ss_flags &= ~SS_ONSTACK; - SIGSETOLD(p->p_sigmask, context.sc_mask); - SIG_CANTMASK(p->p_sigmask); - - /* - * Restore signal context. - */ - /* %gs was restored by the trampoline. */ - regs->tf_fs = context.sc_fs; - regs->tf_es = context.sc_es; - regs->tf_ds = context.sc_ds; - regs->tf_edi = context.sc_edi; - regs->tf_esi = context.sc_esi; - regs->tf_ebp = context.sc_ebp; - regs->tf_ebx = context.sc_ebx; - regs->tf_edx = context.sc_edx; - regs->tf_ecx = context.sc_ecx; - regs->tf_eax = context.sc_eax; - regs->tf_eip = context.sc_eip; - regs->tf_cs = context.sc_cs; - regs->tf_eflags = eflags; - regs->tf_esp = context.sc_esp_at_signal; - regs->tf_ss = context.sc_ss; - - return (EJUSTRETURN); -} - -static void -linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, caddr_t *params) -{ - args[0] = tf->tf_ebx; - args[1] = tf->tf_ecx; - args[2] = tf->tf_edx; - args[3] = tf->tf_esi; - args[4] = tf->tf_edi; - *params = NULL; /* no copyin */ -} - -struct sysentvec linux_sysvec = { - LINUX_SYS_MAXSYSCALL, - linux_sysent, - 0xff, - LINUX_SIGTBLSZ, - bsd_to_linux_signal, - ELAST + 1, - bsd_to_linux_errno, - translate_traps, - linux_fixup, - linux_sendsig, - linux_sigcode, - &linux_szsigcode, - linux_prepsyscall, - "Linux a.out", - aout_coredump -}; - -struct sysentvec elf_linux_sysvec = { - LINUX_SYS_MAXSYSCALL, - linux_sysent, - 0xff, - LINUX_SIGTBLSZ, - bsd_to_linux_signal, - ELAST + 1, - bsd_to_linux_errno, - translate_traps, - elf_linux_fixup, - linux_sendsig, - linux_sigcode, - &linux_szsigcode, - linux_prepsyscall, - "Linux ELF", - elf_coredump -}; - -static Elf32_Brandinfo linux_brand = { - "Linux", - "/compat/linux", - "/lib/ld-linux.so.1", - &elf_linux_sysvec - }; - -static Elf32_Brandinfo linux_glibc2brand = { - "Linux", - "/compat/linux", - "/lib/ld-linux.so.2", - &elf_linux_sysvec - }; - -Elf32_Brandinfo *linux_brandlist[] = { - &linux_brand, - &linux_glibc2brand, - NULL - }; - -static int -linux_elf_modevent(module_t mod, int type, void *data) -{ - Elf32_Brandinfo **brandinfo; - int error; - - error = 0; - - switch(type) { - case MOD_LOAD: - for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) - if (elf_insert_brand_entry(*brandinfo) < 0) - error = EINVAL; - if (error) - printf("cannot insert Linux elf brand handler\n"); - else { - linux_ioctl_register_handlers(&linux_ioctl_handler_set); - if (bootverbose) - printf("Linux-ELF exec handler installed\n"); - } - break; - case MOD_UNLOAD: - linux_ioctl_unregister_handlers(&linux_ioctl_handler_set); - for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) - if (elf_brand_inuse(*brandinfo)) - error = EBUSY; - - if (error == 0) { - for (brandinfo = &linux_brandlist[0]; - *brandinfo != NULL; ++brandinfo) - if (elf_remove_brand_entry(*brandinfo) < 0) - error = EINVAL; - } - if (error) - printf("Could not deinstall ELF interpreter entry\n"); - else if (bootverbose) - printf("Linux-elf exec handler removed\n"); - break; - default: - break; - } - return error; -} -static moduledata_t linux_elf_mod = { - "linuxelf", - linux_elf_modevent, - 0 -}; -DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); diff --git a/sys/alpha/linux/syscalls.master b/sys/alpha/linux/syscalls.master deleted file mode 100644 index e276c9309f5e..000000000000 --- a/sys/alpha/linux/syscalls.master +++ /dev/null @@ -1,286 +0,0 @@ - $FreeBSD$ - -; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 -; System call name/number master file (or rather, slave, from LINUX). -; Processed to created linux_sysent.c, linux_syscalls.c and linux_syscall.h. - -; Columns: number type nargs namespc name alt{name,tag,rtyp}/comments -; number system call number, must be in order -; type one of STD, OBSOL, UNIMPL, COMPAT -; namespc one of POSIX, BSD, STD, NOHIDE (I dont care :-) -Peter -; 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: -; 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 - -#include "opt_compat.h" -#include <sys/param.h> -#include <sys/sysent.h> -#include <sys/sysproto.h> -#include <i386/linux/linux.h> -#include <i386/linux/linux_proto.h> - -; #ifdef's, etc. may be included, and are copied to the output files. - -0 STD LINUX { int linux_setup(void); } -1 NOPROTO LINUX { int exit(int rval); } -2 STD LINUX { int linux_fork(void); } -3 NOPROTO LINUX { int read(int fd, char *buf, u_int nbyte); } -4 NOPROTO LINUX { int write(int fd, char *buf, u_int nbyte); } -5 STD LINUX { int linux_open(char *path, int flags, int mode); } -6 NOPROTO LINUX { int close(int fd); } -7 STD LINUX { int linux_waitpid(int pid, int *status, \ - int options); } -8 STD LINUX { int linux_creat(char *path, int mode); } -9 STD LINUX { int linux_link(char *path, char *to); } -10 STD LINUX { int linux_unlink(char *path); } -11 STD LINUX { int linux_execve(char *path, char **argp, \ - char **envp); } -12 STD LINUX { int linux_chdir(char *path); } -13 STD LINUX { int linux_time(linux_time_t *tm); } -14 STD LINUX { int linux_mknod(char *path, int mode, int dev); } -15 STD LINUX { int linux_chmod(char *path, int mode); } -16 STD LINUX { int linux_lchown(char *path, int uid, int gid); } -17 STD LINUX { int linux_break(char *nsize); } -18 STD LINUX { int linux_stat(char *path, struct ostat *up); } -19 STD LINUX { int linux_lseek(int fdes, long off, int whence); } -20 NOPROTO LINUX { int getpid(void); } -21 STD LINUX { int linux_mount(void); } -22 STD LINUX { int linux_umount(void); } -23 NOPROTO LINUX { int setuid(uid_t uid); } -24 NOPROTO LINUX { int getuid(void); } -25 STD LINUX { int linux_stime(void); } -26 STD LINUX { int linux_ptrace(void); } -27 STD LINUX { int linux_alarm(unsigned int secs); } -28 STD LINUX { int linux_fstat(int fd, struct ostat *up); } -29 STD LINUX { int linux_pause(void); } -30 STD LINUX { int linux_utime(char *fname, \ - struct linux_utimbuf *times); } -31 STD LINUX { int linux_stty(void); } -32 STD LINUX { int linux_gtty(void); } -33 STD LINUX { int linux_access(char *path, int flags); } -34 STD LINUX { int linux_nice(int inc); } -35 STD LINUX { int linux_ftime(void); } -36 NOPROTO LINUX { int sync(void); } -37 STD LINUX { int linux_kill(int pid, int signum); } -38 STD LINUX { int linux_rename(char *from, char *to); } -39 STD LINUX { int linux_mkdir(char *path, int mode); } -40 STD LINUX { int linux_rmdir(char *path); } -41 NOPROTO LINUX { int dup(u_int fd); } -42 STD LINUX { int linux_pipe(int *pipefds); } -43 STD LINUX { int linux_times(struct linux_times_argv *buf); } -44 STD LINUX { int linux_prof(void); } -45 STD LINUX { int linux_brk(char *dsend); } -46 NOPROTO LINUX { int setgid(gid_t gid); } -47 NOPROTO LINUX { int getgid(void); } -48 STD LINUX { int linux_signal(int sig, linux_handler_t handler); } -49 NOPROTO LINUX { int geteuid(void); } -50 NOPROTO LINUX { int getegid(void); } -51 NOPROTO LINUX { int acct(char *path); } -52 STD LINUX { int linux_umount2(void); } -53 STD LINUX { int linux_lock(void); } -54 STD LINUX { int linux_ioctl(int fd, u_long cmd, int arg); } -55 STD LINUX { int linux_fcntl(int fd, int cmd, int arg); } -56 STD LINUX { int linux_mpx(void); } -57 NOPROTO LINUX { int setpgid(int pid, int pgid); } -58 STD LINUX { int linux_ulimit(void); } -59 STD LINUX { int linux_olduname(void); } -60 NOPROTO LINUX { int umask(int newmask); } -61 NOPROTO LINUX { int chroot(char *path); } -62 STD LINUX { int linux_ustat(linux_dev_t dev, \ - struct linux_ustat *ubuf); } -63 NOPROTO LINUX { int dup2(u_int from, u_int to); } -64 NOPROTO LINUX { int getppid(void); } -65 NOPROTO LINUX { int getpgrp(void); } -66 NOPROTO LINUX { int setsid(void); } -67 STD LINUX { int linux_sigaction(int sig, \ - linux_osigaction_t *nsa, \ - linux_osigaction_t *osa); } -68 STD LINUX { int linux_siggetmask(void); } -69 STD LINUX { int linux_sigsetmask(linux_osigset_t mask); } -70 NOPROTO LINUX { int setreuid(int ruid, int euid); } -71 NOPROTO LINUX { int setregid(int rgid, int egid); } -72 STD LINUX { int linux_sigsuspend(int restart, \ - linux_osigset_t oldmask, \ - linux_osigset_t mask); } -73 STD LINUX { int linux_sigpending(linux_osigset_t *mask); } -74 NOPROTO LINUX { int osethostname(char *hostname, u_int len); } -75 STD LINUX { int linux_setrlimit(u_int resource, \ - struct ogetrlimit *rlim); } -76 STD LINUX { int linux_getrlimit(u_int resource, \ - struct ogetrlimit *rlim); } -77 NOPROTO LINUX { int getrusage(int who, struct rusage *rusage); } -78 NOPROTO LINUX { int gettimeofday(struct timeval *tp, \ - struct timezone *tzp); } -79 NOPROTO LINUX { int settimeofday(struct timeval *tp, \ - struct timezone *tzp); } -80 STD LINUX { int linux_getgroups(u_int gidsetsize, \ - linux_gid_t *gidset); } -81 STD LINUX { int linux_setgroups(u_int gidsetsize, \ - linux_gid_t *gidset); } -82 STD LINUX { int linux_select(struct linux_select_argv *ptr); } -83 STD LINUX { int linux_symlink(char *path, char *to); } -84 NOPROTO LINUX { int ostat(char *path, struct ostat *up); } -85 STD LINUX { int linux_readlink(char *name, char *buf, \ - int count); } -86 STD LINUX { int linux_uselib(char *library); } -87 NOPROTO LINUX { int swapon(char *name); } -88 NOPROTO LINUX { int reboot(int opt); } -89 STD LINUX { int linux_readdir(int fd, \ - struct linux_dirent *dent, \ - unsigned int count); } -90 STD LINUX { int linux_mmap(struct linux_mmap_argv *ptr); } -91 NOPROTO LINUX { int munmap(caddr_t addr, int len); } -92 STD LINUX { int linux_truncate(char *path, long length); } -93 NOPROTO LINUX { int oftruncate(int fd, long length); } -94 NOPROTO LINUX { int fchmod(int fd, int mode); } -95 NOPROTO LINUX { int fchown(int fd, int uid, int gid); } -96 NOPROTO LINUX { int getpriority(int which, int who); } -97 NOPROTO LINUX { int setpriority(int which, int who, int prio); } -98 NOPROTO LINUX { int profil(caddr_t samples, u_int size, \ - u_int offset, u_int scale); } -99 STD LINUX { int linux_statfs(char *path, \ - struct linux_statfs_buf *buf); } -100 STD LINUX { int linux_fstatfs(int fd, \ - struct linux_statfs_buf *buf); } -101 STD LINUX { int linux_ioperm(unsigned int start, \ - unsigned int length, int enable); } -102 STD LINUX { int linux_socketcall(int what, void *args); } -103 STD LINUX { int linux_ksyslog(int what); } -104 STD LINUX { int linux_setitimer(u_int which, \ - struct itimerval *itv, \ - struct itimerval *oitv); } -105 STD LINUX { int linux_getitimer(u_int which, \ - struct itimerval *itv); } -106 STD LINUX { int linux_newstat(char *path, \ - struct linux_newstat *buf); } -107 STD LINUX { int linux_newlstat(char *path, \ - struct linux_newstat *buf); } -108 STD LINUX { int linux_newfstat(int fd, \ - struct linux_newstat *buf); } -109 STD LINUX { int linux_uname(void); } -110 STD LINUX { int linux_iopl(int level); } -111 STD LINUX { int linux_vhangup(void); } -112 STD LINUX { int linux_idle(void); } -113 STD LINUX { int linux_vm86old(void); } -114 STD LINUX { int linux_wait4(int pid, int *status, \ - int options, struct rusage *rusage); } -115 STD LINUX { int linux_swapoff(void); } -116 STD LINUX { int linux_sysinfo(void); } -117 STD LINUX { int linux_ipc(int what, int arg1, int arg2, \ - int arg3, caddr_t ptr); } -118 NOPROTO LINUX { int fsync(int fd); } -119 STD LINUX { int linux_sigreturn(struct linux_sigcontext *scp); } -120 STD LINUX { int linux_clone(int flags, void *stack); } -121 NOPROTO LINUX { int setdomainname(char *name, int len); } -122 STD LINUX { int linux_newuname(struct linux_new_utsname *buf); } -123 STD LINUX { int linux_modify_ldt(int func, void *ptr, \ - size_t bytecount); } -124 STD LINUX { int linux_adjtimex(void); } -125 NOPROTO LINUX { int mprotect(caddr_t addr, int len, int prot); } -126 STD LINUX { int linux_sigprocmask(int how, \ - linux_osigset_t *mask, \ - linux_osigset_t *omask); } -127 STD LINUX { int linux_create_module(void); } -128 STD LINUX { int linux_init_module(void); } -129 STD LINUX { int linux_delete_module(void); } -130 STD LINUX { int linux_get_kernel_syms(void); } -131 STD LINUX { int linux_quotactl(void); } -132 STD LINUX { int linux_getpgid(int pid); } -133 NOPROTO LINUX { int fchdir(int fd); } -134 STD LINUX { int linux_bdflush(void); } -135 STD LINUX { int linux_sysfs(int option, u_long arg1, \ - u_long arg2); } -136 STD LINUX { int linux_personality(int per); } -137 STD LINUX { int linux_afs_syscall(void); } -138 STD LINUX { int linux_setfsuid(linux_uid_t uid); } -139 STD LINUX { int linux_setfsgid(linux_gid_t gid); } -140 STD LINUX { int linux_llseek(int fd, u_int32_t ohigh, \ - u_int32_t olow, caddr_t res, int whence); } -141 STD LINUX { int linux_getdents(int fd, void *dent, \ - unsigned count); } -142 STD LINUX { int linux_newselect(int nfds, fd_set *readfds, \ - fd_set *writefds, fd_set *exceptfds, \ - struct timeval *timeout); } -143 NOPROTO LINUX { int flock(int fd, int how); } -144 STD LINUX { int linux_msync(caddr_t addr, int len, int fl); } -145 NOPROTO LINUX { int readv(int fd, struct iovec *iovp, \ - u_int iovcnt); } -146 NOPROTO LINUX { int writev(int fd, struct iovec *iovp, \ - u_int iovcnt); } -147 STD LINUX { int linux_getsid(linux_pid_t pid); } -148 STD LINUX { int linux_fdatasync(int fd); } -149 STD LINUX { int linux_sysctl(void); } -150 NOPROTO BSD { int mlock(const void *addr, size_t len); } -151 NOPROTO BSD { int munlock(const void *addr, size_t len); } -152 NOPROTO BSD { int mlockall(int how); } -153 NOPROTO BSD { int munlockall(void); } -154 NOPROTO POSIX { int sched_setparam (pid_t pid, \ - const struct sched_param *param); } -155 NOPROTO POSIX { int sched_getparam (pid_t pid, \ - struct sched_param *param); } -156 STD POSIX { int linux_sched_setscheduler(pid_t pid, int policy, \ - const struct sched_param *param); } -157 STD POSIX { int linux_sched_getscheduler(pid_t pid); } -158 NOPROTO POSIX { int sched_yield (void); } -159 NOPROTO POSIX { int sched_get_priority_max (int policy); } -160 NOPROTO POSIX { int sched_get_priority_min (int policy); } -161 NOPROTO POSIX { int sched_rr_get_interval (pid_t pid, \ - struct timespec *interval); } -162 NOPROTO POSIX { int nanosleep(const struct timespec *rqtp, \ - struct timespec *rmtp); } -163 STD LINUX { int linux_mremap(caddr_t addr, int old_len, \ - int new_len, int flags); } -164 NOPROTO LINUX { int setresuid(int ruid, int euid, int suid); } -165 STD LINUX { int linux_getresuid(linux_uid_t *ruid, \ - linux_uid_t *euid, linux_uid_t *suid); } -166 STD LINUX { int linux_vm86(void); } -167 STD LINUX { int linux_query_module(void); } -168 NOPROTO LINUX { int poll(struct pollfd*, unsigned int nfds, \ - long timeout); } -169 STD LINUX { int linux_nfsservctl(void); } -170 NOPROTO LINUX { int setresgid(int rgid, int egid, int sgid); } -171 STD LINUX { int linux_getresgid(linux_gid_t *rgid, \ - linux_gid_t *egid, linux_gid_t *sgid); } -172 STD LINUX { int linux_prctl(void); } -173 STD LINUX { int linux_rt_sigreturn(void); } -174 STD LINUX { int linux_rt_sigaction(int sig, \ - linux_sigaction_t *act, \ - linux_sigaction_t *oact, \ - size_t sigsetsize); } -175 STD LINUX { int linux_rt_sigprocmask(int how, \ - linux_sigset_t *mask, linux_sigset_t *omask, \ - size_t sigsetsize); } -176 STD LINUX { int linux_rt_sigpending(void); } -177 STD LINUX { int linux_rt_sigtimedwait(void); } -178 STD LINUX { int linux_rt_sigqueueinfo(void); } -179 STD LINUX { int linux_rt_sigsuspend(linux_sigset_t *newset, \ - size_t sigsetsize); } -180 STD LINUX { int linux_pread(void); } -181 STD LINUX { int linux_pwrite(void); } -182 STD LINUX { int linux_chown(char *path, int uid, int gid); } -183 STD LINUX { int linux_getcwd(char *buf, unsigned long bufsize); } -184 STD LINUX { int linux_capget(void); } -185 STD LINUX { int linux_capset(void); } -186 STD LINUX { int linux_sigaltstack(const linux_stack_t *uss, \ - linux_stack_t *uoss); } -187 STD LINUX { int linux_sendfile(void); } -188 STD LINUX { int linux_getpmsg(void); } -189 STD LINUX { int linux_putpmsg(void); } -190 STD LINUX { int linux_vfork(void); } -191 STD LINUX { int linux_ugetrlimit(void); } -192 STD LINUX { int linux_mmap2(void); } -193 STD LINUX { int linux_truncate64(void); } -194 STD LINUX { int linux_ftruncate64(void); } -195 STD LINUX { int linux_stat64(void); } -196 STD LINUX { int linux_lstat64(void); } -197 STD LINUX { int linux_fstat64(void); } |
