Commit Graph

163 Commits

Author SHA1 Message Date
thorpej 7767121514 I can't win today -- make this link. 2001-12-10 04:05:23 +00:00
thorpej 06920aef28 Move the code that walks the process's VM map during a coredump
into uvm_coredump_walkmap(), and use callbacks into the coredump
routine to do something with each section.
2001-12-10 01:52:26 +00:00
thorpej d0e51ba7da Fix compilation problems. 2001-12-09 23:08:34 +00:00
thorpej 205c159f0e Make the coredump routine exec-format/emulation specific. Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).
2001-12-08 00:35:25 +00:00
jdolecek bf7f67be85 if the LKM support is not compiled in, don't bother using exec_lock
at all, it's only needed in LKM case

use #if defined(LKM) || defined(_LKM) condition for netbsd32_execve.c,
to DTRT when either compiled statically into kernel with LKM support,
or compiled as a LKM
2001-11-23 22:02:39 +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
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +00:00
thorpej e38a2e561a machine/fbio.h -> dev/sun/fbio.h 2001-09-19 18:10:32 +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
mrg e63635fdcd update copyright notices. 2001-08-25 15:06:02 +00:00
eeh 16b1f7aae0 Fix bug in netbsd32_compat_43_olseek return value. 2001-08-15 05:16:59 +00:00
eeh 8180bfa441 Add missing `error'. 2001-07-30 22:04:08 +00:00
christos 934898bc32 Adjust to the new copyargs() footprint. 2001-07-29 21:28:45 +00:00
christos b474b9ac65 carry on the copyargs() and exit1() changes from kern_exec.c 2001-07-29 21:28:20 +00:00
jdolecek 588b94c0a2 Expel MSG_COMPAT/COMPAT_OLDSOCK, make the COMPAT_43 wrappers
arrange things as needed.  Unfortunately, the check in sockargs()
have to stay, since 4.3BSD bind(2), connect(2) and sendto(2) were
not versioned at the time :(

This code was tested to pass regression tests.
2001-07-17 11:49:40 +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
fvdl fe75469d65 Some of this was sparc-specific, so ifdef __sparc__ it (XXX). Also,
change the alignment of one structure with an MD ifdef. Should
be moved into the netbsd32_machdep parts.
2001-06-19 00:36:21 +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
thorpej 7660fd850d In check_exec(), don't bother checking P_TRACED along with
MNT_NOSUID, just check MNT_NOSUID to clear the S{U,G}ID bits
in the attributes for the vnode we're about to exec.

We now check P_TRACED right before we would actually perform
the s{u,g}id function in the exec code.

This closes a race condition between exec of a setuid binary
and ptrace(2).
2001-06-15 17:24:19 +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 25e7951011 proto for coredump32 2001-06-06 21:45:56 +00:00
mrg a6a28df3e2 add netbsd32_uvm_unix.c and netbsd32_kern_sig.c 2001-06-06 21:30:28 +00:00
mrg 06f624518c sync with uvm_unix.c 1.23 2001-06-06 21:30:07 +00:00
mrg 85794da2bd LKM friendly: move coredump32() here 2001-06-06 21:25:11 +00:00
mrg 5677baf886 LKM friendly: move uvm_coredump32() here 2001-06-06 21:24:39 +00:00
mrg 6a89288a37 use _KERNEL_OPT. 2001-05-30 11:37:21 +00:00
kleink 0e1ec27466 Regen. 2001-04-10 11:12:12 +00:00
kleink 7b62f6ff28 Slight indentation nit. 2001-04-10 11:11:17 +00:00
jdolecek b6d1d4db02 Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more
consistent with rest of fileops routines and also makes the fo_stat
match FreeBSD as an added bonus.
Discussed with Luke Mewburn on tech-kern@.
2001-04-09 10:22:00 +00:00
jdolecek 3fc6fc58e6 Call file descriptor stat function via (*fp->f_ops->fo_stat) instead
of a switch statement and explicit call.
Sprinkle some FILE_USE()/FILE_UNUSE() as appropriate.
2001-04-09 09:39:09 +00:00
ross 2d8e2c19d6 Fix soo_stat() calls for the new parameter, even if the direct call is
now obsolete, so that kernels will at least compile. I guess it was too
much trouble to change all 10 call sites, or perhaps, these days, only
things that build on i386 are important. Maybe it's the full moon tonight.
2001-04-08 08:01:36 +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
mrg f1a8e2ab5f be more verbose about failed vmcmds. 2001-03-04 13:42:32 +00:00
eeh 8a4a682091 Support flexible process address space limits and bump kernel version number. 2001-02-14 18:21:42 +00:00
eeh a562e38910 Don't play fast and loose with pointers. 2001-02-11 00:00:29 +00:00
mrg da9e4bd3a1 split up netbsd32_netbsd.c into 9 new files, leaving only those syscalls that
have no special interpretations besides simple syscall args conversion.
2001-02-08 13:19:33 +00:00
mrg e927957b42 move the static inline conversion functions into a header file so other
files can see these.  note a bunch of functions that should be moved
into their own files.
2001-02-07 15:22:39 +00:00
mrg 7217f71af3 compat_12_netbsd32_{,fl}stat12() were not copyout()ing the converted result. 2001-02-07 13:15:54 +00:00
mrg c1b372c5ca fix the glaring errors in compat_13_netbsd32_sigaltstack13 2001-02-07 13:14:07 +00:00
mrg 7a908a5f44 compat_sunos needs netbsd32_compat_09.c 2001-02-07 13:13:01 +00:00
eeh 4380259bc7 Specify a process' address space limits for uvmspace_exec(). 2001-02-06 17:01:51 +00:00
mrg 8e76e697d7 fix the glaring errors in emulations for osendmsg, orecvmsg, osigvec and osigstack. 2001-02-05 06:32:55 +00:00
mrg 32fdb6e321 change_utimes32() was copyin()ing a struct timeval, not netbsd32_timeval.
general clean up.
2001-02-04 09:00:14 +00:00
mrg a531aa1597 emulate kern.boottime. now 32-bit w(1) works properly. 2001-02-04 07:08:51 +00:00
mrg 2aa001b546 make sysctl vm.loadavg work. 2001-02-04 06:35:07 +00:00
mrg ef777aa80b sync a comment from sys_execve().
make netbsd32_recvfrom() work.
2001-02-03 12:46:55 +00:00
mrg dabf2a8634 s/sizeof(struct exec)/sizeof(struct netbsd32_exec)/ when calculating file offsets. now sunos32 nmagic/omagic work. 2001-02-03 12:45:44 +00:00
mrg eefaef162b properly implement compat_43_netbsd32_stat43, compat_43_netbsd32_lstat43
and compat_43_netbsd32_fstat43.  now 32-bit ls(1) works.  so does static
sunos `/sbin/sh' on sparc64.
2001-02-02 13:06:48 +00:00