Commit Graph

229 Commits

Author SHA1 Message Date
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
drochner 4f4ec7e627 regen after __HAVE_SIGINFO removal 2004-03-26 15:29:28 +00:00
drochner 9fd8e8983b all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:18:54 +00:00
drochner 4f5b1431f9 all ports define __HAVE_SIGINFO now, so remove the CPP conditionals 2004-03-26 15:01:16 +00:00
atatat c2309bcca6 *Don't* call sys___sysctl() from within the kernel. Use old_sysctl()
instead.
2004-03-09 03:18:03 +00:00
junyoung 9a410f9ed0 Rename es_check in struct execsw to es_makecmds. 2004-02-06 08:02:58 +00:00
fvdl d99705e941 Put back Emmanuel's sigfilter hooks, as decided by Core. 2003-12-20 19:01:29 +00:00
manu b23b73b953 Introduce lwp_emuldata and the associated hooks. No hook is provided for the
exec case, as the emulation already has the ability to intercept that
with the e_proc_exec hook. It is the responsability of the emulation to
take appropriaye action about lwp_emuldata in e_proc_exec.

Patch reviewed by Christos.
2003-12-20 18:22:16 +00:00
jdolecek 0e253cf5f5 back the sigfilter emulation hook change off 2003-12-05 21:12:42 +00:00
manu 18e13eee35 Add a sigfilter emulation hook. It is used at the beginning of kpsignal2()
so that a specific emulation has the oportunity to filter out some signals.

if sigfilter returns 0, then no signal is sent by kpsignal2().

There is another place where signals can be generated: trapsignal. Since this
function is already an emulation hook, no call to the sigfilter hook was
introduced in trapsignal.

This is needed to emulate the softsignal feature in COMPAT_DARWIN (signals
sent as Mach exception messages)
2003-12-03 20:24:51 +00:00
christos 42e971bfba Previous fix was incomplete; did not handle negative values.
It is best to use size_t's when dealing with sizes, so that
testing for negative ones, is not needed.
2003-11-19 15:46:16 +00:00
itojun 7db67502f8 avoid integer type truncation. be picky about integer computation overflow.
inspired by ftp://ftp.openbsd.org/pub/OpenBSD/patches/3.3/i386/011_ibcs2.patch
2003-11-18 19:46:37 +00:00
thorpej 052ba0ec50 We have CVS; there is no reason to make .bak files when generating the
syscall tables.
2003-11-15 20:30:59 +00:00
christos 82812c7677 remove malloc.h (we don't need it) 2003-11-05 04:03:43 +00:00
christos 293ab5b508 limit malloc so that corrupted executables don't allocate a lot of memory. 2003-11-05 04:03:21 +00:00
drochner 714de0452f adapt for changes to kern/exec_elf32.c 2003-10-31 14:04:35 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
itojun f8641ea112 avoid out-of-bound memory access. found by openbsd "bound" C attribute. 2003-10-01 08:03:48 +00:00
simonb 550b4bef88 Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
2003-09-26 12:02:55 +00:00
christos cfba45c856 constify sendsig/trapsignal 2003-09-25 22:00:02 +00:00
christos 0c73068f06 regen 2003-09-13 18:44:49 +00:00
christos 2cfe0b047e add __HAVE_SIGINFO 2003-09-13 18:44:30 +00:00
christos 9a680b9da0 regen 2003-09-10 19:47:49 +00:00
christos df9305fe0c sys__sigreturn14 -> compat_16_sys___sigreturn14 2003-09-10 19:47:40 +00:00
christos e2c278d8c0 SA_SIGINFO changes 2003-09-06 22:09:20 +00:00
chs 939df36e55 add support for non-executable mappings (where the hardware allows this)
and make the stack and heap non-executable by default.  the changes
fall into two basic catagories:

 - pmap and trap-handler changes.  these are all MD:
   = alpha: we already track per-page execute permission with the (software)
	PG_EXEC bit, so just have the trap handler pay attention to it.
   = i386: use a new GDT segment for %cs for processes that have no
	executable mappings above a certain threshold (currently the
	bottom of the stack).  track per-page execute permission with
	the last unused PTE bit.
   = powerpc/ibm4xx: just use the hardware exec bit.
   = powerpc/oea: we already track per-page exec bits, but the hardware only
	implements non-exec mappings at the segment level.  so track the
	number of executable mappings in each segment and turn on the no-exec
	segment bit iff the count is 0.  adjust the trap handler to deal.
   = sparc (sun4m): fix our use of the hardware protection bits.
	fix the trap handler to recognize text faults.
   = sparc64: split the existing unified TSB into data and instruction TSBs,
	and only load TTEs into the appropriate TSB(s) for the permissions.
	fix the trap handler to check for execute permission.
   = not yet implemented: amd64, hppa, sh5

 - changes in all the emulations that put a signal trampoline on the stack.
   instead, we now put the trampoline into a uvm_aobj and map that into
   the process separately.

originally from openbsd, adapted for netbsd by me.
2003-08-24 17:52:28 +00:00
christos 3b9c3c5aab - GC all the setup_stack functions
- add one for linux/i386
2003-08-08 18:57:01 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +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
itojun 51110d0c20 use strlcpy
[compat/svr4_32 should have bound check for SVR4_32_AUX_ARGSIZ]
2003-05-16 14:36:30 +00:00
dsl 60418b39b7 Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
2003-03-21 21:13:50 +00:00
jdolecek 853290d652 remove local idea of ELF_AUX_ARGSIZ - since this emul uses elf32_copyargs(),
it shouldn't override the size
2003-02-19 09:45:48 +00:00
atatat bede65472d Cull unused variables. Sigh.
PS - Cross compilers are cool.
2003-01-29 07:00:35 +00:00
atatat 59b8237f5e No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
2003-01-28 21:57:42 +00:00
simonb 2eaedc2774 Remove variables that are only assigned too but not referenced. 2003-01-20 01:35:11 +00:00
thorpej a03cb2b851 Regen to get correct RCS ID. 2003-01-18 23:28:15 +00:00
thorpej 062c115a84 Regen: Merge the nathanw_sa branch. 2003-01-18 07:41:34 +00:00
thorpej a9d45e7ce9 Merge the nathanw_sa branch. 2003-01-18 07:40:44 +00:00
kristerw 084ae1f838 ibcs2_debug is used only for IBCS2_DEBUG, so no need to define it otherwise. 2002-12-21 15:48:57 +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
christos 116bcb05d0 rename: s/sa_/<compat>sa/g 2002-11-26 18:43:20 +00:00
jdolecek 1524c4bf08 set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL 2002-11-01 19:26:21 +00:00
chs 993948e989 count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
2002-10-05 22:34:02 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
simonb 4e3613273b Remove breaks after returns, unreachable returns and returns after
returns(!).
2002-09-23 05:51:10 +00:00
simonb c8cb48355a Commit remaining part of PR1623 so the code in the PR actually gets
executed(!).
2002-09-23 04:55:09 +00:00
simonb 67f65715f9 ttspeedtab() is a function that returns an int, and returns -1 if
there's an error.  Store the result of this function in a signed
variable instead of an unsigned variable before checking if the return
value is greater than zero.
2002-09-23 04:49:32 +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
itojun f731d2b75a wrong semicolon at EOL. notified by wiz 2002-08-08 00:15:32 +00:00