Commit Graph

173 Commits

Author SHA1 Message Date
manu c6eca571d5 irix_elf32_probe is now responsible for finding interpreter's load
address. We do that through the irix_load_addr function, which is
not IRIX specific at all. If another emulation needs it, it can
easily move to compat_util.c

With this change, IRIX dynamic binaries are able to link and run again
(top down UVM broke them a few weeks ago)
2003-08-06 01:04:44 +00:00
mrg caa408bca7 (void_cast_for_gcc_3_3_msg_goes_here *) 2003-07-29 16:18:54 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
he 86cc24bba0 #ifdef _KERNEL_OPT police. 2003-06-28 08:31:16 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
itojun 51110d0c20 use strlcpy
[compat/svr4_32 should have bound check for SVR4_32_AUX_ARGSIZ]
2003-05-16 14:36:30 +00:00
cgd cd122e4a2d in irix_syssgi_mapelf: use vn_marktext where necessary, and make sure
a file isn't accidentally left 'USE'd if an error occurs.  reviewed
by simonb.
2003-02-28 02:12:55 +00:00
dsl 71d53fb2ed Use find_stopped_child() and proc_free() in compat wait() code to
avoid code duplication.
(approved by christos)
2003-02-14 10:19:14 +00:00
manu 26723dc292 lwpified sproc emulation so that it builds and works again. COMPAT_IRIX
now has the level of functionnality it had before SA merge
2003-01-28 23:47:42 +00:00
rafal 4490fd7293 Last bit of LWP'ification of compat_irix; this is probably wrong, but at
least it compiles and manu said he'd fix it up and test the whole kit when
he had a chance.
2003-01-22 21:04:50 +00:00
rafal 5234d1eb92 Mechanical LWP'ification of IRIX compat code; untested as of right now. 2003-01-22 12:58:22 +00:00
thorpej a03cb2b851 Regen to get correct RCS ID. 2003-01-18 23:28:15 +00:00
thorpej 16311b53c0 Regen: Merge the nathanw_sa branch. 2003-01-18 07:45:34 +00:00
thorpej 064d091d71 Merge the nathanw_sa branch. 2003-01-18 07:44:50 +00:00
jdolecek e1e0ff678b move ELF-specific items from irix_exec.c to irix_exec_elf32.c
merge the two emul_irix structures; the only difference was
  setregs function, which can be handled by exec-specific setregs hook
rename setregs_n32() to irix_n32_setregs(), and make it suitable
  as the exec-specific setregs hook
make irix_check_exec() a macro now that just single compare
2002-11-30 13:18:13 +00:00
jdolecek 6826135dbc make LKM friendlier by only including opt_* #ifdef _KERNEL_OPT 2002-11-30 12:28:26 +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
manu 99bc517790 Added sysctl to change all IRIX kernel values reported by uname and systeminfo:
OS name, hw name, kernel version, and so forth.
2002-11-09 09:03:56 +00:00
jdolecek e608322a28 regen: bump nsysent to nearest p-o-2 (256) 2002-11-01 19:30:28 +00:00
jdolecek a0d3a3c03f bump nsysent to nearest p-o-2 2002-11-01 19:29:21 +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 f8aec0fd04 Added a cleanup function for the (un)shared region list, so that it does
not grow forever.
2002-10-23 21:30:46 +00:00
manu 13a3d2ed82 In mmap, use the address returned by sys_mmap to keep track of (un)shared
regions
2002-10-23 20:45:38 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
manu eeb799a6c9 Implement MAP_LOCAL option to mmap, which enable the mapping of regions
private to the process within the share group.

There is one bit missing in this implementation: when replicating a change
in a process VM to the other process of the share group, we avoid copying
mappings for private regions in the target process, but we don't prevent
copying private regions from the source process.
2002-10-14 21:14:23 +00:00
manu f3d9e2a4ab Implement IRIX_SGI_NUM_MODULES and IRIX_SGI_MODULE_INFO syssgi() commands. 2002-10-13 22:13:47 +00:00
manu 9d7899c2dc Return the hostid when equested HW_SERIAL (it seems it works like this) 2002-10-13 21:07:41 +00:00
manu 2001eb6db2 Added SGI_RUSAGE command to syssgi (this is a BSD rusage) 2002-10-12 08:53:46 +00:00
jdolecek 63c35652f5 replace irix_usemaFOO functions with noFOO/nullFOO as approprite in cdevsw,
g/c now unneeded functions
2002-10-11 20:07:48 +00:00
manu 075c3542d8 Added uname emulation so that IRIX's uname -s returns IRIX 2002-10-05 23:17:29 +00:00
manu e9b4436254 Fixed typo in a comment 2002-10-05 23:15:58 +00:00
manu 6589fa5eda Added an ioctl emulation so that IRIX's tar is able to extract a file. 2002-10-05 21:29:02 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
manu deca50b66c Fill BADVADDR and CAUSE in sigcontext. We still don't restore them, but
it actually fixes a problem:
When /bin/sh gets a SIGSEGV, its signal handler calls brk and the offending
instruction is retried. Usually it gets another SIGSEGV, and things loops
until it pases without the SIGSEGV. This is the normal mode of operation, and
it can be reproduced on IRIX by a 10kB shell script starting by echo /*

However... the signal handler checks for BADVADDR in the saved registers
in struct sigcontext. If it does not find it, it gives up and exit instead
of retrying. Filling the field enables us to carry on normal operation
(which is to get dozens of SIGSEGV) instead of getting a failure at the
first SIGSEGV.
2002-09-25 19:39:16 +00:00
manu 7216eba62a We now fill the struct siginfo when requested (SA_SIGINFO flag to sigaction) 2002-09-25 19:09:50 +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
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +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
manu 652fe89179 - add locks to structures used by the /dev/usema driver and the
usync_cntl() system calls.

- when usync_cntl is used and the process is aborted (eg: by kill -9)
libc does not call usync_cntl() to unblock things. We have to cleanup
data allocated in the kernel. This is now done through the emulation
specific exit hook

- IRIX initialize some data in the system part of the PRDA: the pid and
a prid (PRDA ID?). We initialize both to pid.

- Move back struct irix_share_group from irix_exec.h to irix_prctl.h, it
is more revelant here.

- fix a few typos
2002-08-25 19:03:12 +00:00
manu 08b6896ef2 Added a sleep on the parent so that the parent cannot die while the child
needs to access information from it.
2002-08-12 20:11:38 +00:00
manu 652d91cab0 Introduce a shared group structure, and make the sproc implementation
more SMP friendly.
2002-08-02 23:02:51 +00:00
manu 2ce44de983 typo 2002-08-02 22:52:50 +00:00
manu 0e12143ef8 Missing P_ZERO in priority mask 2002-08-02 22:52:36 +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
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
manu 7d2ac48550 Fixed a typo that borke build with DEBUG_IRIX 2002-06-22 13:02:39 +00:00
manu 758eb330b4 build without DEBUG_IRIX 2002-06-17 05:01:56 +00:00
manu 0e28620e0f Two forgotten files in last commit for get/setrlimit 2002-06-14 20:33:11 +00:00
manu 022bd85d32 When sproc is used to create a share group with shared memory, there is a
private area called PRDA that remains unshared. We implement this by using
different vmspace for each share group member, and keeping the memory
appings in sync on each mmap/munmap/mprotect/break...

We use irix_saddr_sync_vmcmd and irix_saddr_sync_syscall to apply a
vmcmd or a syscall to all share group member, this makes the job a bit
easier.

Also implements {get|set}rlimit{64}.
2002-06-12 20:33:20 +00:00