Commit Graph

170 Commits

Author SHA1 Message Date
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
tsarna 72489e1ea0 uuidgen(2) syscall. Originally from FreeBSD, ported by John Franklin in
PR#23470, with minor updates by me. This is only the syscall support
from that PR, for now.

Changes: port over fix from FreeBSD for multicast address generation.
Changed bcopy to memcpy.  For now, #ifdef notyet the portions of
kern_uuid.c that are meant to be used by (currently nonexistent) other
things in the kernel.  Added syscall to COMPAT_FREEBSD as well, though
that's currently not useful, as any program new enough to use this call
also uses other syscalls we don't (yet) emulate.
2004-01-29 02:00:02 +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
jdolecek 6a23b29f58 Regen: add new syscalls to the list 2003-11-26 19:23:29 +00:00
jdolecek 95ad68c571 add the new syscalls to the list 2003-11-26 19:22:57 +00:00
keihan 0714799990 www.netbsd.org -> www.NetBSD.org 2003-11-17 10:07:58 +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
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
christos cfba45c856 constify sendsig/trapsignal 2003-09-25 22:00:02 +00:00
pooka ec398e6f4d regen 2003-09-18 14:50:07 +00:00
pooka 3e2a629fec Add a good enuf emulation of the MAP_STACK flag to the mmap()
syscall.  This allows programs which use MAP_STACK to work instead
of failing in weird and wonderous ways.
2003-09-18 14:44:09 +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
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
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
thorpej a03cb2b851 Regen to get correct RCS ID. 2003-01-18 23:28:15 +00:00
thorpej acac9c96bb Regen: Merge the nathanw_sa branch. 2003-01-18 07:33:52 +00:00
thorpej 6762b37e5a Merge the nathanw_sa branch. 2003-01-18 07:28:34 +00:00
gmcgarry 66c19fc50c Add stubs for scheduler syscalls. 2002-12-22 00:05:59 +00:00
gmcgarry 87aecbbd2c Add scheduler syscalls. 2002-12-22 00:04:29 +00:00
thorpej e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
manu 3bc2c4cf57 Now it uses BSD system calls with alternate path checks in compat/common,
Darwin does not need freebsd_file.c anymore.
2002-12-08 00:52:04 +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
jdolecek b3b1ed9f7d back previous off, it makes the probe function mistaken some linux
binaries as freebsd
problem reported in thread 'installing suse_base on current
i386 sets time to 1970' on current-users
2002-11-28 15:08:36 +00:00
christos 116bcb05d0 rename: s/sa_/<compat>sa/g 2002-11-26 18:43:20 +00:00
christos 733d2a038f Make the OSABI and the branding optional. Tested by Ben Collver, thanks. 2002-11-19 22:38:07 +00:00
christos 7ae22e4da5 it is not kosher to include the same file twice. 2002-11-15 16:10:51 +00:00
jdolecek 1524c4bf08 set struct emul's nsysent to compat SYS_NSYSENT, not SYS_MAXSYSCALL 2002-11-01 19:26:21 +00:00
pooka 8e4950499d regen for rfork 2002-10-09 20:24:10 +00:00
pooka 324d517241 FreeBSD rfork emulation 2002-10-09 20:22:47 +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
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
eeh 89e107d917 Regen. 2002-05-03 00:22:16 +00:00
eeh 9bd29db83b Use #if defined(_LP64) to determine if we're generating 64-bit binaries,
not #if defined(alpha).
2002-05-03 00:20:56 +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
lukem dab6ef8b56 add RCSIDs (including regeneration of files as appropriate) 2001-11-13 02:07:52 +00:00
jdolecek 9f2548a603 Regen:
Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
2001-10-27 10:02:57 +00:00
jdolecek 084e319b3f Hook in minherit(2), fhstatfs(2), fhopen(2), fhstat(2).
Adresses kern/8622 by Paul Shupak.
2001-10-27 10:00:55 +00:00
jdolecek dab7dee0f2 Add a comment regarding the ELFOSABI_FREEBSD thing,
and reformat the condition a bit to avoid nested if
2001-10-27 09:50:22 +00:00
christos 8101253d41 KNF. 2001-10-23 16:43:33 +00:00
christos 9c0bd73ac9 PR/14332: Shingo WATANABE: Regognize new ELFOSABI_FREEBSD branded executables. 2001-10-23 16:41:36 +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 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +00:00
christos 97c9d7a9dd rename elf32_read_from to exec_read_from since it is used in many places
now.
2001-07-14 02:05:05 +00:00