Commit Graph

287 Commits

Author SHA1 Message Date
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
tv e58532a4bf No-op commit to force update to a non-"-kk" revision. 2001-01-18 17:47:58 +00:00
fvdl 07ca2a03bf Correct copyright year. 2001-01-10 02:33:47 +00:00
fvdl d772be168f Declare linux_ioctl_blkio and call it from the main routine. 2001-01-10 02:28:38 +00:00
fvdl da9e8a988d Add some BLK* ioctl calls. Currently only the easy and useful ones
are implemented.
2001-01-10 02:28:01 +00:00
fvdl 3950869204 Set Linux version to 2.0.38 for now, until the clone + "real time signal"
problems are fixed.
2001-01-05 15:31:15 +00:00
fvdl 2d53941bd4 Hardcode what the linux uname() calls return (Linux 2.2.5 is the current
value). A few major applications check for this (like VMware), and
there is no other way to trick them. Needs a more generic solution
eventually.
2000-12-29 21:07:16 +00:00
fvdl f90b2fc517 Avoid sign extension problem in offset. 2000-12-29 20:08:54 +00:00
fvdl 77765cf28f Do alternate path checks for link(2). 2000-12-29 20:08:31 +00:00
fvdl 6f552a029f Allow the EJUSTRETURN hack for PTIOCLINUX-passed through ioctl calls. 2000-12-29 20:07:53 +00:00
fvdl 62af6738b1 Use CHECK_ALT_* for chown and lchown, missed in my previous commit.
Get *id16 calls right; most can be passed through directly, but
some need the 16->32 check for -1 values.
2000-12-27 22:01:42 +00:00
fvdl e60e785474 Don't do the syscall with modified ioctl command if we've successfully
done a 'passthrough' ioctl.
2000-12-22 23:41:16 +00:00
jdolecek e9e91a0fb5 split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
2000-12-22 22:58:52 +00:00
fvdl 1a09a359eb Add SIOCGIFBR and SIOCSIFBR (more for reference than anything, currently). 2000-12-22 11:24:43 +00:00
thorpej f7a4dd48fd Only include the 16-bit uid/gid stuff if on i386 or m68k. This is a
little ugly, but hey, so is Linux.
2000-12-21 20:19:22 +00:00
thorpej e57273c82e Only include the 16-bit chown/fchown/lchown stuff if on i386 or m68k.
This is a little ugly, but hey, so is Linux.
2000-12-21 20:15:53 +00:00
fvdl b542c20c5b Fix yet another typo. 2000-12-21 13:37:02 +00:00
fvdl b76b718303 Fix another pasto. 2000-12-19 22:24:03 +00:00
fvdl b7ffc98bf8 Fix pasto in previous. 2000-12-18 16:27:20 +00:00
fvdl 865e7b1375 Pass SIOC* calls that are done on devices (not sockets) through
without trying to interpret done, as is done on Linux. The device
will get them as PTIOCLINUX, with command and arg in the structure
passed in.
2000-12-18 14:46:36 +00:00
fvdl 8578d458e5 Define LINUX_SIOCDEVPRIVATE (currently not emulated for sockets). 2000-12-18 14:44:44 +00:00
fvdl 4d193ccde8 Add seperate entries for 16 bit uid/gid calls, so that border cases
like 0xffff can be handled better (not done yet).
2000-12-18 14:40:02 +00:00
mycroft b29180b2ff Tighten up the ELF signature checks, and actually look for the ABI tag added
in newer glibc versions.
2000-12-15 06:14:21 +00:00
augustss ccf2c891cc Implement sysinfo. 2000-12-13 21:41:23 +00:00
jdolecek 638d27777e add linux_sys_truncate64() 2000-12-12 22:24:56 +00:00
jdolecek daff00c255 add emulation of Linux truncate64(2), ftruncate64(2), *stat64(2) 2000-12-12 19:01:59 +00:00
jdolecek f8d1770316 define EXEC_AOUT (if not defined) before including linux_syscallargs.h,
to get linux_sys_uselib() prototype
2000-12-12 17:52:56 +00:00
mycroft f495cd9dc6 Introduce 2 new flags in types.h:
* __HAVE_SYSCALL_INTERN.  If this is defined, e_syscall is replaced by
  e_syscall_intern, which is called at key places in the kernel.  This can be
  used to set a MD syscall handler pointer.  This obsoletes and replaces the
  *_HAS_SEPARATED_SYSCALL flags.
* __HAVE_MINIMAL_EMUL.  If this is defined, certain (deprecated) elements in
  struct emul are omitted.
2000-12-11 05:28:59 +00:00
fvdl a499e56944 Add some ioctls for harddisk, floppy disk and console handling.
Implement a few extra cdrom ioctl calls.
Make sure to correctly use FILE_USE and FILE_UNUSE.
2000-12-10 14:12:16 +00:00
fvdl ec9b1e3f5e The gist of the Linux _IOX definitions was the same for all platforms;
move it to the MI linux_ioctl.h and only leave the MD bits in the MD
header files.

Add defintions for linux_ioctl_hdio and linux_ioctl_fdio.
2000-12-10 14:08:48 +00:00
jdolecek a6ca890142 always fill in e_syscall in respective emul_*; if the emulation doesn't
have it's own separated *_syscall() function, use syscall()
2000-12-09 12:38:23 +00:00
jdolecek 1acf11b550 add emulation of linux swapoff(2) 2000-12-02 16:43:50 +00:00
jdolecek da1aefe9bf if machdep define LINUX_MACHDEP_HAS_SEPARATED_SYSCALL is defined, put
linux_syscall() to emul_linux
define LINUX_MACHDEP_HAS_SEPARATED_SYSCALL for i386
2000-12-02 16:05:04 +00:00
jdolecek 445c16b759 implement linux_sys_setdomainname()/linux_sys_swapon(), using code
from compat_09_sys_setdomainname()/compat_12_sys_swapon().
2000-12-01 21:14:42 +00:00
jdolecek b490742cef if LINUX_MACHDEP_PASS_PPID_AND_EUID is defined for given arch, add
flags EMUL_GETPID_PASS_PPID|EMUL_GETID_PASS_EID to emul_linux
define this option for alpha
2000-12-01 20:31:13 +00:00
jdolecek 011229ffcb make LKM safe 2000-12-01 18:16:54 +00:00
jdolecek 798f64c85b put linux_sys_uselib() to separate file linux_uselib.c 2000-12-01 13:49:35 +00:00
jdolecek 01040d97a2 add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
2000-12-01 12:28:30 +00:00
jdolecek 73f3cd8c7e LKMify 2000-11-29 21:51:49 +00:00
jdolecek a53687b13e (de)allocate linux emuldata on fork/exec/exit as needed 2000-11-21 12:23:29 +00:00
jdolecek 33d7a60ccc comment out ps_siginfo from struct emuldata for now, add int debugreg[8]
update comment a bit
2000-11-21 12:21:43 +00:00
jdolecek baae0324b9 restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and
  provide single struct emul per emulation
* elf:
  - kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry
    per emulation and contains pointer to respective probe function
  - interp is allocated via MALLOC() rather than on stack
  - elf_args structure is allocated via MALLOC() rather than malloc()
* ecoff: the per-emulation hooks moved from alpha and mips specific code
  to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per
  emulation supporting ecoff with appropriate probe function
* the makecmds/probe functions don't set emulation, pointer to emulation is
  part of appropriate execsw[] entry
* constify couple of structures
2000-11-21 00:37:49 +00:00
erh f96aee80d6 Make the linux compatibilty code work on the alpha. (horay!) (at last!)
Two main changes:
	Create a linux_elf64_copyargs that uses the linux specific LinuxAuxInfo
	structure.  This is only used on the alpha.  i386 and m68k use the
	standard elf copyargs function.

	Since linux's approach to binary compatibilty is to look as much
	like osf1 as possible, add all the osf1 syscalls that we have
	implemented to the linux syscall table.  This includes get/setsysinfo,
	ported from FreeBSD.

In order for linux compat to work you must have COMPAT_OSF1, COMPAT_43,
COMPAT_09, COMPAT_12 and COMPAT_13 on also.
2000-11-17 03:55:17 +00:00
jdolecek 78b866e95a change the type of *syscallnames[] array to 'const char * const foo[]' 2000-11-13 21:32:15 +00:00
jdolecek 8d9bc8494c move definition of LINUX_PTRACE_{SET|GET}(FP)REGS flags to
sys/compat/linux/common/linux_ptrace.h, they seem to be actually MI
2000-11-01 21:02:08 +00:00
jdolecek 7b1d98353d Linux LINUX_PTRACE_SINGLESTEP operation should have same
semantics as NetBSD's PT_STEP, so support it on archs which have it
under Linux, ptrace(PTRACE_CONT, pid, 0, 0) is used to continue the
traced process where it left off; adjust addr to (caddr_t) 1 so that
the NetBSD syscall code DTRT
some sligh const poisoning
2000-11-01 20:56:30 +00:00
fvdl 7f5724ad4c In the case of MAP_ANON, Linux mmap ignores the fd argument completely.
So, always pass -1 to the native syscall in that case, to avoid
errors if a Linux app doesn't specify -1 as the fd (which some do).
2000-09-07 22:20:45 +00:00
sommerfeld 6b88a0fc51 Emulation stackgap sanity checks, based partly on fixes from
FreeBSD-SA00:42.

Change stackgap_alloc to bounds-check the allocation vs. the stack
gap, returning NULL if there isn't room for the allocation.

Change emul_find() to check for a NULL return from stackgap_alloc()
and convert that into ENAMETOOLONG.

Reorder various emulation syscalls so that all *_CHECK_ALT_{EXIST,CREAT}
calls (which turn into emul_find() under the covers come *after* small,
fixed-size stackgap_alloc() calls.

Clean up ibcs2 {get,set}groups.
2000-08-29 14:33:25 +00:00
thorpej 4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
christos e2bcf6b0b5 add support for sigaltstack(2) needed for jvm-1.3 support.
XXX: Only on i386, don't have access to other linuxes...
2000-08-23 17:02:18 +00:00