Commit Graph

154 Commits

Author SHA1 Message Date
mrg 272c549ab2 copy exec_aout.c:exec_aout_setup_stack to netbsd32_exec_aout_setup_stack,
but use USRSTACK32 not USRSTACK, so that we get 32-bit stack addresses.

now 32 bit a.out binaries work on sparc64.
2000-12-18 14:50:04 +00:00
mycroft 455360f941 Do the __HAVE_SYSCALL_INTERN and __HAVE_MINIMAL_EMUL dance. 2000-12-12 08:00:26 +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
mycroft f348afacb9 Regen. 2000-12-09 05:37:01 +00:00
mycroft 9682cf0b09 Add the %% separators. 2000-12-09 05:27:28 +00:00
jdolecek 0576f87ad3 add infrastructure to load emulations and their executable support dynamically
via LKM
2000-12-08 19:42:11 +00:00
eeh 433c92930e Fix uninitialized pointer bug. 2000-12-05 15:25:57 +00:00
fvdl c3d820fa5d Use a copied fktrace syscall arg structure with out 'const int' for the
filedescriptor to copy arguments, avoiding a warning. XXX
2000-12-03 14:48:29 +00:00
fvdl 5ce71a2aed Include opt_* files to make sure prototypes are included. 2000-12-03 14:47:27 +00:00
fvdl 8537802e8d Add systm.h to pull in copyout* prototypes. 2000-12-03 13:15:38 +00:00
mrg f5a3788577 pull over lost fix from nebsd32_exec.c:
>revision 1.25
>date: 2000/12/01 08:59:02;  author: mrg;  state: Exp;  lines: +2 -2
>in netbsd32_elf32_probe(), 'pos' is really a pointer to an Elf_Addr, not a
>vaddr_t.  cast the pointer before dereferencing it to avoid the alignment
>fault that broke compat_netbsd32, cuz pos is defined like:
>        Elf_Addr phdr = 0, pos = 0;
>in exec_elf32.c.
2000-12-02 04:08:35 +00:00
jdolecek df127e0001 make netbsd32_copyargs() an inline 2000-12-01 22:05:18 +00:00
jdolecek e53f148af5 put a.out/elf32 specific things in netbsd32_exec_{aout|elf32}.c
emul_netbsd32 was moved to netbsd32_netbsd.c
g/c netbsd32_exec.c now
2000-12-01 21:51:08 +00:00
jdolecek 758d9354ff always define COMPAT_OLDSOCK (this tracks rev.1.55 of kern/uipc_syscalls.c)
move definition of emul_netbsd32 from netbsd32_exec.c here
fix couple of compile nits I encountered while compiling this with
sparc cross-compiler
2000-12-01 21:48:24 +00:00
jdolecek 70569d32c8 prototype netbsd32_stat12_to_netbsd32() 2000-12-01 19:18:46 +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
mrg 7af8b6448c in netbsd32_elf32_probe(), 'pos' is really a pointer to an Elf_Addr, not a
vaddr_t.  cast the pointer before dereferencing it to avoid the alignment
fault that broke compat_netbsd32, cuz pos is defined like:
	Elf_Addr phdr = 0, pos = 0;
in exec_elf32.c.
2000-12-01 08:59:02 +00:00
jdolecek 50d91bb255 fix typo - it should be compat_09_netbsd32_uname, not compat_09_netbsd32_ouname 2000-11-30 19:19:43 +00:00
jdolecek e8fcbc2bf1 always include netbsd32_ntp_adjtime(), LKMify 2000-11-30 19:17:56 +00:00
jdolecek cad0013a61 only define SYSVMSG, SYSVSEM, SYSVSHM if it's not defined already 2000-11-30 19:14:35 +00:00
jdolecek 6b1add13dc sync netbsd32_execve() with sys_execve() - this involves
VMCMD_RELATIVE support, couple of debugging printfs and addition of
doexechooks() call
also fix one FREE() which should be free()
2000-11-30 12:54:38 +00:00
jdolecek 73f3cd8c7e LKMify 2000-11-29 21:51:49 +00:00
mrg 87650daf07 make this compile again, after execsw/lkm changes. 2000-11-28 13:07:27 +00:00
jdolecek d9f0dcbe03 adapt to execsw[] changes 2000-11-27 17:25:24 +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
mrg 822cec2475 get rid of remaining warnings. 2000-11-18 03:23:53 +00:00
mrg e4f5ca29a9 kill gcc warnings. 2000-11-18 02:00:50 +00:00
jdolecek 78b866e95a change the type of *syscallnames[] array to 'const char * const foo[]' 2000-11-13 21:32:15 +00:00
eeh 1ecf6779be Add support for variable end of user stacks needed to support COMPAT_NETBSD32:
`struct vmspace' has a new field `vm_minsaddr' which is the user TOS.

	PS_STRINGS is deprecated in favor of curproc->p_pstr which is derived
	from `vm_minsaddr'.

	Bump the kernel version number.
2000-09-28 19:05:06 +00:00
martin 41c6b720f1 The ovadvise syscall is (correctly) listed as STD, so move it's implementation
to another place. This makes kernels without options COMPAT_43 link.
2000-09-24 13:09:31 +00:00
mrg 8638251139 declare struct firm_event32 2000-08-22 03:35:14 +00:00
eeh 1e8c5f2119 Fix netbsd32_ioctls. 2000-08-19 14:38:18 +00:00
cgd 0199b04bef update for changed makesyscalls.master 2000-08-18 19:35:15 +00:00
cgd 3af42e5211 update for changed makesyscalls.sh 2000-08-18 19:26:56 +00:00
bjh21 24f9914cb3 Second phase of changes to remove ntp_adjtime(2) from the kernel entirely if
NTP is not defined.

Also removes sysctl_ntptime, since that's unreferenced without NTP.

ntp_gettime(2) is left alone, since it doesn't raise SIGSYS, which sys_nosys()
does.
2000-08-07 18:10:20 +00:00
bjh21 a9397f5bfc Changes to syscalls.master to exclude ntp_adjtime(2) entirely if NTP is not
defined.  Changes to other files will follow in a moment.
2000-08-07 17:59:33 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
thorpej 195bf5c09f - Fix the likely cause of the "ps(1) hangs machine" problem. Always
vslock the user pages for the data being copied out to userspace,
  so that we won't sleep while holding a lock in case we need to
  fault the pages in.
- Sprinkle some const and ANSI'ify some things while here.
2000-07-14 07:21:21 +00:00
thorpej 75159452f1 Sync w/ kern_time.c and sys_generic.c 2000-07-13 17:39:03 +00:00
mrg d132b13d89 regen 2000-07-09 13:40:20 +00:00
mrg 8f9515257a - massive warning fix fest.
- fix pread/pwrite return values (plus some other syscalls that looked
  similarly broken).
- prototypes and clean up for netbsd32_ioctl.c

now getpw*() works under compat32!
2000-07-09 13:39:31 +00:00
mrg 18c0283349 look in /emul/netbsd32 for __stat13() and __lstat13(). 2000-07-09 03:03:35 +00:00
mrg 13f211c52e remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-28 15:39:24 +00:00
mrg 2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
soren a9aa2abf94 defopt SYSCALL_DEBUG. 2000-06-06 18:52:30 +00:00
eeh 7a92eda021 Include "opt_DDB.h" to enable the DDB sysctls. 2000-05-30 20:54:26 +00:00
thorpej 21fc65e1a8 sleep() -> tsleep() 2000-05-27 04:52:27 +00:00
sommerfeld 40339b39f9 Reduce use of curproc in several places:
- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()
2000-05-27 00:40:29 +00:00
chs a6d33cc1f2 add a new function vn_marktext() for exec code to let others know
that the vnode is now being used as process text.
2000-04-11 04:37:47 +00:00
augustss a82aeb5508 Kill register declarations. 2000-03-30 11:24:16 +00:00
thorpej 7b918b4088 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 06:40:33 +00:00
eeh cde9dba8ab Add support for -current's ELF32 exec format. 2000-02-06 16:45:56 +00:00
christos 3cb8a24438 Regen 2000-01-31 16:41:20 +00:00
christos 7ccc44e6f7 __semctl13 -> ____semctl13 2000-01-31 15:59:58 +00:00
eeh a7474fcab6 netbsd32_close() would work better if it called sys_close() rather than
sys_write().
netbsd32_getfsstat() cannot just copyin()/copyout(), convert the structures,
and call sys_getffstat().  sys_getffstat() wants to do its own
copyin()/copyout().  So we need to implent the whole of sys_getffstat()
in netbsd32_getfsstat().
1999-12-31 22:26:21 +00:00
eeh a65e57bfc6 Update to 32-bit compatibility routines. 1999-12-30 15:40:45 +00:00
eeh 1f45477db9 Add netbsd32_compat_14.c
Rename everything from compat_netbsd32 -> netbsd32 so we don't have silly
names like compat_14_compat_netbsd32_sys_shmctl().
1999-10-11 01:36:21 +00:00
bouyer 52497e180a Remplace kern.shortcorename sysctl with a more flexible sheme,
core filename format, which allow to change the name of the core dump,
and to relocate it in a directory. Credits to Bill Sommerfeld for giving me
the idea :)
The default core filename format can be changed by options DEFCORENAME and/or
kern.defcorename
Create a new sysctl tree, proc, which holds per-process values (for now
the corename format, and resources limits). Process is designed by its pid
at the second level name. These values are inherited on fork, and the corename
fomat is reset to defcorename on suid/sgid exec.
Create a p_sugid() function, to take appropriate actions on suid/sgid
exec (for now set the P_SUGID flag and reset the per-proc corename).
Adjust dosetrlimit() to allow changing limits of one proc by another, with
credential controls.
1999-09-28 14:47:00 +00:00
thorpej eb20bbc780 Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied.  Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX.  This platforms still have this bug until their
XXX spl*() functions are fixed.
1999-08-05 18:08:08 +00:00
thorpej 32e1fd0d03 Move the call of cpu_wait() out of the wait4() functions, and into the
body of reaper(), right before the call to uvm_exit().  cpu_wait() must
be done before uvm_exit() because the resources it frees might be located
in the PCB.
1999-07-20 21:54:05 +00:00
kleink e79a283e47 XSH5: change function signature to `void *sbrk(intptr_t)'. 1999-07-12 21:55:19 +00:00
thorpej 12347b2657 Make uvm_vslock() return the error code from uvm_fault_wire(). All places
which use uvm_vslock() should now test the return value.  If it's not
KERN_SUCCESS, wiring the pages failed, so the operation which is using
uvm_vslock() should error out.

XXX We currently just EFAULT a failed uvm_vslock().  We may want to do
more about translating error codes in the future.
1999-06-17 15:47:22 +00:00
christos 354ba222e6 Regen 1999-06-09 04:50:32 +00:00
christos b7a0cd53a2 Propagate kern changes 1999-06-09 04:50:10 +00:00
thorpej 497248ca55 XXX Pass VM_PROT_NONE to uvm_vslock() as access_type. Why are we even
vslocking here?!  copyout() on its own seems to suffice just about everwhere
else, and it's not like the process is going to exit; it's in a system
call!
1999-05-26 01:07:06 +00:00
thorpej e3669c3393 Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
1999-05-05 20:01:01 +00:00
eeh 96b63fc788 Don't defopt COMPAT_NETBSD32 here; it's done in sys/conf/files. 1999-04-24 19:17:33 +00:00
mrg 7007bb40d6 fix errors in the copyright on this. 1999-04-14 02:50:38 +00:00
eeh 69d1f9d0d3 COMPAT_SPARC32 -> COMPAT_NETBSD32 1999-03-26 04:29:20 +00:00
mrg 54ab2e1e54 clean and up make compile 1999-03-25 17:49:43 +00:00
mrg c3b0d25b27 SPARC32->NETBSD32 1999-03-25 16:58:39 +00:00
mrg 8df6f0c629 regen 1999-03-25 16:32:27 +00:00
mrg 6f5ceb781e include the MD header. 1999-03-25 16:27:56 +00:00
mrg a5867d9385 move sparc32 to netbsd32; split out MD part (signal handling) (mostly via repository copy, rename and perl -pi :-) 1999-03-25 16:22:49 +00:00
mrg 8f32e2fbc8 regen 1999-03-25 15:51:50 +00:00
mrg 7f7d23b4a6 formatting nits 1999-03-25 15:34:37 +00:00
mrg ad412a0e07 make this match the main syscalls.master a bit better. 1999-03-25 15:33:48 +00:00
mrg d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
drochner 9d0b08a2b5 OMPAT_xxx option review: add missing opt_compat_sunos.h 1998-12-18 15:08:21 +00:00
drochner c22ef79250 solve the COMPAT_OLDSOCK/MSG_COMPAT problem differently:
The source files which need MSG_COMPAT define COMPAT_OLDSOCK.
1998-12-18 13:18:42 +00:00
christos f0c7751046 Regen 1998-12-10 17:13:06 +00:00
christos b0b86b5b7f Defopt COMPAT_43 1998-12-10 17:03:19 +00:00
mrg 993fb9ff04 add some missing comment ends. 1998-11-24 13:18:42 +00:00
tron 7453aacea0 Regen. 1998-10-19 22:39:49 +00:00
tron 120e9f4e91 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:37:53 +00:00
eeh 0aa87c38cc Overhaul. Now will run simple things like /bin/sh and /bin/echo. 1998-10-01 14:27:56 +00:00
eeh 44725836bc Add some copyin()/copyout()s. These need to be done but there are more
annoying issues, so I'll just check in this snapshot.
1998-09-11 00:01:57 +00:00
eeh eb1f80313d Use correct 32-bit signal trampoline code in the emul. 1998-09-10 23:55:15 +00:00
thorpej a6c6b5a26b Cosmetic changes. 1998-09-09 23:46:31 +00:00
thorpej 5ff9df860c If we don't find a valid magic, return ENOEXEC, not EINVAL. 1998-09-09 23:37:27 +00:00
thorpej 0d779b28ba If we succeed in preparing the exec package, set the package's emulation
to emul_sparc32.
1998-09-09 23:36:15 +00:00
thorpej 7377cf7f4d MID_MACHINE -> MID_SPARC 1998-09-09 10:29:18 +00:00
eeh 0a6f6c904d Need to make sure high bits of addresses are zeroed out. 1998-09-07 01:38:03 +00:00
eeh 269f667cb0 Copyout 32-bit args. 1998-09-06 04:34:49 +00:00
eeh 26d2d906c7 Some more 64-bit cleanup. Now everything compiles. 1998-08-30 15:32:16 +00:00
eeh d581aadc3e Some more 64-bit-ification. 1998-08-29 18:16:56 +00:00
mrg edda33e00c move <vm/vm_swap.h> to <sys/swap.h>. <vm/vm_swap.h> still works for now (goes away later) 1998-08-29 17:01:14 +00:00
mrg 1f9d0626af regen. 1998-08-26 13:46:56 +00:00
mrg fa380eed0f make oreboot work. 1998-08-26 13:42:50 +00:00
mrg c757d26220 use right syscalls. add converters for timespec and semid_ds 1998-08-26 13:42:22 +00:00