Commit Graph

281 Commits

Author SHA1 Message Date
cegger c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
pooka 5d19acad62 Regen to prove I didn't screw up the conversion: purely RCSID changes. 2009-01-13 22:33:08 +00:00
pooka a9a2ce837b Convert the syscalls.master to a format from which it is easier
to parse and generate the compat name and basename (e.g. __stat50
and stat).  Use this to autogenerate __RENAME()'s to the rump_syscalls
header so that they can be called e.g. rump_sys_socket() instead
of rump_sys___socket30().
2009-01-13 22:27:43 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad 92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
ad 0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
wrstuden fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
rmind 160268aca6 Remove proc_representative_lwp(), use a simple LIST_FIRST() instead.
OK by <ad>.
2008-07-02 19:49:58 +00:00
ad a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
ad f9e99b470b PPWAIT is now in proc::p_lflag. 2008-06-16 12:25:54 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
ad dd55791531 Regen. 2008-04-23 14:10:03 +00:00
ad 7cb840338e -SYCALL_MPSAFE 2008-04-23 14:07:49 +00:00
yamt 3426b80b5e - l_wmesg is not always valid. check l_wchan when using l_wmesg.
should fix a crash reported by Juan RP on current-users@.
- ttyinfo: lock lwp when accessing l_wmesg.
- fill_lwp: add an assertion.
2008-04-05 14:03:16 +00:00
christos c2126f5e21 print size_t with %zu. 2008-03-30 20:58:08 +00:00
cube d94699ecbb Split device_t and softc for wskbd(4), wsmouse(4) and that creepy wsmux(4). 2008-03-25 00:49:19 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
joerg e69482d49d Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.
2008-02-12 17:30:57 +00:00
ad 77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
yamt 97436a1e88 fix malloc type mismatches. 2008-01-03 14:25:49 +00:00
dsl 6fb2884c3a regen 2007-12-20 23:07:25 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
dsl 63f7948f02 Call sys_open() not bsd_sys_open(). 2007-12-13 07:54:22 +00:00
dsl f9ade37fe1 compat_file.[ch] are no longer used 2007-12-12 21:37:26 +00:00
dsl 9ae4eb70ff Regen 2007-12-12 21:29:43 +00:00
dsl e26d16aac3 No need for any of the bsd_sys_foo() calls since they only wrapped
CHECK_ALT_XXX() for filenames - which got killed earlier in the year.
Substitute the same functions as in compat_file.c
2007-12-12 21:24:36 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
dsl 28bae79b27 ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
2007-12-08 18:35:53 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
dsl ddd89ca02b regen 2007-11-10 13:24:27 +00:00
dsl b6b07a31fd Mark 'syscall' as 'NOARGS INDIR" 2007-11-10 13:23:18 +00:00
dsl ee077208d9 Regen 2007-11-09 15:10:27 +00:00
dsl 3107f9cd42 Add arguments to sys_syscall and sys___syscall.
Use MI wrappers for them in netbsd32.
Change prefix for constants from netbsd32 to NETBSD32 (used in #defines etc).
2007-11-09 15:05:33 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
ad 63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
dsl 8d3eb2476f Comment out the code that uses the stackgap to issue the WSDISPLAYIO_PUTCMAP
ioctl in order to change the display colours.
Changing the code to not need the stackgap is rather pervasive, and it isn't
at all clear this is useful effort given the suspected bitrottedness
of compat darwin.
2007-07-01 20:14:17 +00:00
dsl 53e0243f27 Changes to sompat socket function to avoid the dreaded stackgap. 2007-06-30 15:31:49 +00:00
dsl a150e6e4f5 Use do_sys_recvmsg(), so_sys_accept(), do_sys_getsockname() and do_sys_senmsg()
in order to avoid the stackgap (etc).
Note that since changing the darwin socket address is simply a matter of
  translating the address family and adding sa_len, it can easily be done
  on the mbuf resident address before/after copying to/from userspace.
Simplify the convertion of AF_LOCAL addresses by usingthe user-supplied
  buffer length instead of dowing an unbounded strlen().
Untested - did this work before?
2007-06-24 18:07:34 +00:00
dsl 4147586696 There is no need for the stackgap in sys_bind() and sys_connect().
If sa_len is zero, believing the size passed to bind/connect seems
better than trying to strlen somthing that might run off the mapped kma.
Verify the address family against the array size before indexing.
2007-06-17 21:30:11 +00:00
dsl cf80941288 Kill that stackgap...
Use vn_stat() and dostatvfs() on the vnode the code always has got - even
though it used compat versions of the other syscalls.
2007-06-17 20:43:10 +00:00
dsl 95206f19b1 No need for stackgap for darwin_sys_sigaction and sigprocmask.
XXX: it doesn't look right that the new and old 'sigaction' parameters
have different types.
2007-06-17 20:15:19 +00:00
christos c61eed39a8 rename si_sigval -> si_value to match POSIX RTS. 2007-05-21 15:35:47 +00:00
yamt f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
dsl 906b9af2a7 Rework compat stat() and statvfs() code so that it no longer uses the stackgap. 2007-04-30 14:05:47 +00:00
dsl b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
dsl 007d96a7bb Get emul_find() to update SCARG(uap, path) instead of assuming that the
updated path parameter is ever valid - especially when emul_find() fails.
Use the modified path for the access() calls.
Found when compiling with emul_find() hacked to always fail.
2007-04-05 07:37:14 +00:00