Commit Graph

47 Commits

Author SHA1 Message Date
mrg 131dc6aa08 catch up with changes in sparc64/autoconf.c. 2002-12-22 02:54:34 +00:00
jdolecek 47cd9b85d6 Get the dynamic interpreter location using emul_find_interp(), so that
it checks both the alternative/emul tree, and the non-emul tree.
This makes it possible to run chrooted emulated binaries without need
to setup shadow /emul tree within the chroot hierarchy.
Only tested for COMPAT_LINUX, changes to other compat modules were
mechanical.
Fixes kern/19161 by Christian Groessler.
2002-11-29 19:13:14 +00:00
atatat 7caa308c63 Complete the rename: s/sa_/<compat>_sa_/g
Also tweak the darwin siginfo stuff to avoid the same type of collision.
2002-11-27 16:44:01 +00:00
jdolecek 1524c4bf08 set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL 2002-11-01 19:26:21 +00:00
manu 80ee637534 - Introduce a e_fault field in struct proc to provide emulation specific
memory fault handler. IRIX uses irix_vm_fault, and all other emulation
use NULL, which means to use uvm_fault.

- While we are there, explicitely set to NULL the uninitialized fields in
struct emul: e_fault and e_sysctl on most ports

- e_fault is used by the trap handler, for now only on mips. In order to avoid
intrusive modifications in UVM, the function pointed by e_fault does not
has exactly the same protoype as uvm_fault:
int uvm_fault __P((struct vm_map *, vaddr_t, vm_fault_t, vm_prot_t));
int e_fault __P((struct proc *, vaddr_t, vm_fault_t, vm_prot_t));

- In IRIX share groups, all the VM space is shared, except one page.
This bounds us to have different VM spaces and synchronize modifications
to the VM space accross share group members. We need an IRIX specific hook
to the page fault handler in order to propagate VM space modifications
caused by page faults.
2002-09-21 21:14:54 +00:00
christos 9cf6437e8f Fix internal copyargs too. 2002-08-29 14:01:08 +00:00
christos ff79c1e140 adjust copyargs signature to pass struct proc. 2002-08-29 13:59:23 +00:00
christos 830c5c171a Implement passing AT_{E,R}{U,G}ID in the elf aux vector, like solaris.
- pass struct proc to copyargs.
- eliminate svr4_copyargs, since it is the same as ours now.
2002-08-26 21:05:59 +00:00
jdolecek 4be499b52b Convert to use p_opptr rather than p_oppid. Part of fix for
security/14444 by David Sainty.
2002-07-28 18:42:41 +00:00
matt c172e4d8e8 Make SVR4_32 work with the sparc32 version of setiathome. This required
fixing the socket syscall and the SIOGIFCONF ioctl code.
2002-07-22 05:31:18 +00:00
thorpej 011d4d5f44 Add kernel support for having userland provide the signal trampoline:
* struct sigacts gets a new sigact_sigdesc structure, which has the
  sigaction and the trampoline/version.  Version 0 means "legacy kernel
  provided trampoline".  Other versions are coordinated with machine-
  dependent code in libc.
* sigaction1() grows two more arguments -- the trampoline pointer and
  the trampoline version.
* A new __sigaction_sigtramp() system call is provided to register a
  trampoline along with a signal handler.
* The handler is no longer passed to sensig() functions.  Instead,
  sendsig() looks up the handler by peeking in the sigacts for the
  process getting the signal (since it has to look in there for the
  trampoline anyway).
* Native sendsig() functions now select the appropriate trampoline and
  its arguments based on the trampoline version in the sigacts.

Changes to libc to use the new facility will be checked in later.  Kernel
version not bumped; we will ride the 1.6C bump made recently.
2002-07-04 23:32:02 +00:00
christos ac29fb3782 make signal array handling uniform, and put signal arrays in a separate
file. This is simular to errno array handling.
2002-03-31 22:22:43 +00:00
jdolecek bbee4277ca fd_revoke(): don't assume that f_type other DTYPE_VNODE and DTYPE_SOCKET
is automatically bogus, make the code return EINVAL for all non-vnode
descriptors
2002-03-24 15:32:51 +00:00
christos e88e90e3bf use 64 signals. 2002-03-20 17:50:07 +00:00
christos 381e6a7764 make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
2002-03-16 20:43:48 +00:00
tv aa7e03f796 Handle MAP_ANON (0x100 in Solaris8, not 0x1000) properly, by factoring out
the flags common to SVR4 and NetBSD, and mapping the rest manually.
2002-02-07 23:22:24 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
atatat 23b1a14d0d compile in the absense of SYSVSHM and SYSVSEM. 2001-11-12 01:23:51 +00:00
thorpej 2708743345 Make this compile again. 2001-09-20 20:28:41 +00:00
jdolecek ef8abe0767 Make the setregs hook emulation-specific, rather than executable
format specific.
Struct emul has a e_setregs hook back, which points to emulation-specific
setregs function. es_setregs of struct execsw now only points to
optional executable-specific setup function (this is only used for
ECOFF).
2001-09-18 19:36:32 +00:00
wiz c52d355d71 "wierd" is weird. 2001-08-20 12:20:01 +00:00
eeh e31ca9e045 regen. 2001-08-15 05:27:29 +00:00
eeh 950d07bdf7 Use the netbsd32 version of anything that takes args. 2001-08-15 05:18:11 +00:00
christos 934898bc32 Adjust to the new copyargs() footprint. 2001-07-29 21:28:45 +00:00
thorpej d0f766fb5c Regen; use the generic close(2). 2001-07-01 16:55:41 +00:00
thorpej ee8334823e No need to have a SVR4-32 specific close(2). 2001-07-01 16:55:19 +00:00
jdolecek 26d45c1101 Back off the sendit()/recvit() change, some have problems with it 2001-06-25 20:46:11 +00:00
jdolecek 7f7c60e827 Add 'kernsa' parameter for sendit()/recvit(); if nonzero, msg->msg_name
is supposed to point directly to struct mbuf or struct sockaddr in kernel
space as appropriate, rather than being a pointer to memory in userland.

This is to be used by compat/* when emulation needs to wrap
send{to|msg}(2)/recv{from|msg}(2) and modify the passed struct
sockaddr.
2001-06-25 19:24:02 +00:00
christos 0f380fac15 Add an e_trapsignal member to struct emul, so that emulated processes can
send the appropriate signal depending on the trap type.
2001-06-18 02:00:48 +00:00
manu a7cdf998ec Removed obsoletes EMUL_NO_BSD_ASYNCIO_PIPE and EMUL_NO_SIGIO_ON_READ flags.
Async I/O OS specifities should now handled in OS specific code. Linux
has been done, but other emulation should be handled. See case LINUX_F_SETFL
in sys/compat/linux/common/linux_file.c:linux_sys_fcntl() for more details.

The data that has been collected yet:

                                  Net Free Open Linux SunOS AIX OSF1 Darwin
send SIGIO to write end of pipe		Y  N    N     N     N    N   Y     Y
send SIGIO to read end of pipe      Y  Y    N     N     N    ?   Y     ?
send SIGIO to write end of socket   Y  Y    Y     N     N    Y   Y     Y
send SIGIO to read end of socket    Y  Y    Y     Y     Y    ?   Y     ?
2001-06-16 21:44:27 +00:00
thorpej 80cc38a1af Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads.  What we do is stick descriptors in the table, but
mark them as "larval".  This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again.  When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
2001-06-14 20:32:41 +00:00
mrg 0b7f4cf1ba avoid trigraphs 2001-06-08 12:50:11 +00:00
mrg c59b99f5c8 use _KERNEL_OPT, catch up with constification in compat/svr4. 2001-06-04 22:00:10 +00:00
mrg 6a89288a37 use _KERNEL_OPT. 2001-05-30 11:37:21 +00:00
kleink 045d2b0272 Make this build again. 2001-05-11 19:19:44 +00:00
manu 7e6929fe90 Changed EMUL_BSD_ASYNCIO_PIPE to EMUL_NO_BSD_ASYNCIO_PIPE, so that
the native emulation (NetBSD) does not have a flag.
2001-05-07 09:55:12 +00:00
ross 6b9d94cd8c Fix overflow errors in brk(2). 2001-05-06 04:32:08 +00:00
eeh 511e0204b1 Update to conform to new interface. 2001-04-10 18:57:49 +00:00
mrg 85b0b4096f s/rv/error/ in a uprintf(). (rv isn't defined.) 2001-03-16 04:05:15 +00:00
chs ac3bc537bd eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>
2001-03-15 06:10:32 +00:00
eeh e330ffed34 Remove conflicts with changes made to COMPAT_SVR4. 2001-02-28 15:58:35 +00:00
eeh 82deda03bf Fixup compile problems. 2001-02-19 19:49:35 +00:00
eeh 800c3c476d Use svr4_ttold.c since it has no LP64 issues. 2001-02-19 15:48:59 +00:00
mrg bc003b5676 use svr4_32 ttold ioctl types. 2001-02-18 00:27:20 +00:00
eeh 82ca5fba5b Fixes to get dynamic binaries working. 2001-02-11 01:10:24 +00:00
eeh 967cc758a6 Add 32-bit svr4 emulation (for 64-bit machines). 2001-02-06 16:37:56 +00:00