Commit Graph

310 Commits

Author SHA1 Message Date
christos
2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
gmcgarry
65b9855fd5 Replace gcc initialisers with c99 designated initialisers. 2009-03-26 22:22:14 +00:00
dyoung
a3bde60951 #include "opt_compat_netbsd.h" for COMPAT_20. 2009-03-17 00:08:10 +00:00
dyoung
1290eea0cb Add #include "opt_compat_netbsd.h" for COMPAT_09. 2009-03-17 00:01:54 +00:00
nakayama
c99ea852e4 - fix copyout size in CLOCKCTL_O?ADJTIME.
- add missing break in CLOCKCTL_NTP_ADJTIME.
2009-02-22 13:06:58 +00:00
njoly
3e5b27ff8e Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
2009-01-26 13:00:04 +00:00
christos
d3baa5ffd2 compile into nothing if not compat 50. 2009-01-21 16:12:20 +00:00
christos
143e6033a9 Provide compatibility for pre-christos-time_t sysv sysctls. 2009-01-19 19:39:41 +00:00
njoly
25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
njoly
39f5db2b54 In rusage_to_rusage50() function, fix memcpy size to include last
struct member (ru_nivcsw) which was missing.

ok by christos.
2009-01-14 22:50:12 +00:00
martin
90daabb504 Add a few missing includes, so the ifdefs work as expected. 2009-01-13 20:47:47 +00:00
christos
91306aae6f fix lutimes. 2009-01-11 21:23:22 +00:00
christos
52ef6203ff *utimes should allow NULL tvp. 2009-01-11 20:46:53 +00:00
tsutsui
348730301a <sys/syscallargs.h> requires <sys/sched.h> for cpuset_t. 2009-01-11 12:19:14 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad
11c98a4abf PR port-amd64 modules/compat missing symbols on amd64
Also, test for compat_??_machdep.c so we don't have to grow more ifdefs
in the makefile.
2008-11-20 09:22:57 +00:00
cegger
89ba8d828a make this compile (for next68k) 2008-11-19 23:31:13 +00:00
ad
c4d65a7c5e Additionally, set emul_netbsd_object=NULL after detaching it. 2008-11-19 21:29:25 +00:00
ad
5473327d60 compat_modcmd: emul_netbsd_object will be NULL if no exec has taken place
between load and unload of the compat module.
2008-11-19 21:27:54 +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
martin
42cab0447c Make it compile 2008-11-16 15:17:05 +00:00
ad
57de28fac5 - Move some more compat code into sys/compat.
- Split 4.3BSD ifioctl stuff into its own file.
- Remove some ifdefs that include small fragments of vfs compat code
  which are difficult to relocate elsewhere.
2008-11-14 23:10:57 +00:00
ad
c5122072aa _KERNEL_OPT 2008-11-14 13:10:33 +00:00
ad
a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
tsutsui
d7d2a525b1 Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t. 2008-06-17 16:17:21 +00:00
mrg
c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
ad
42d0626726 PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 18:43:44 +00:00
ad
104f8564ec Remove unneeded includes. 2008-05-05 00:33:32 +00:00
ad
928a6b2096 PR kern/38135 vfs_busy/vfs_trybusy confusion
The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.
2008-04-30 12:49:16 +00:00
ad
e3610f1886 kern/38135 vfs_busy/vfs_trybusy confusion
The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
  unmounting the file system. Simple contention on mnt_lock doesn't
  cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.
2008-04-29 23:51:04 +00:00
ad
e8acac827e Remove now bogus assertion. 2008-04-29 19:02:14 +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
15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
ad
494c1ad8d6 Fix locking. 2008-04-23 13:44:46 +00:00
ad
8d0205c623 Grab kernel_lock for cpu_reboot(). 2008-04-23 13:40:17 +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
martin
c84d2ae11b Remove compat code for posix_fadvise 2008-02-24 12:54:15 +00:00
ad
25153c3ec9 PR kern/37706 (forced unmount of file systems is unsafe):
- Do reference counting for 'struct mount'. Each vnode associated with a
  mount takes a reference, and in turn the mount takes a reference to the
  vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
  locking inherited from 4.4BSD with a recursable rwlock.
2008-01-30 11:46:59 +00:00
martin
2e87d89112 Implement new version of posix_fadvise as a stub callinig the real
worker function, and compatibility stub doing the same with old argument
sturcture.
2008-01-27 16:16:50 +00:00
dsl
56cba2eaaa Remove stackgap functions externs. 2008-01-20 09:37:58 +00:00
martin
1ae6b7fd19 #ifdef COMPAT_20 the ioctls only available conditionally. Patch from
Geoff Wing.
2008-01-15 09:25:26 +00:00
martin
a5134c7940 Add net80211 ioctls that I apparently ovelooked when grepping for ioctls
that need "struct ifreq" compat treatment.
This makes for example old (like 4.0) wpa_supplicant work with -current
kernels.
2008-01-14 21:38:55 +00:00
elad
3d902dfb3e Make compat_43_sys_sethostid() use old_sysctl(), allowing for the removal
of a kauth(9) call.

okay christos@.
2008-01-08 22:08:45 +00:00
ad
eb4920235a Don't drop vnode refs until we are done with the mount. 2008-01-07 16:08:46 +00:00
ad
e5942a85c1 Missing lock acquire. 2008-01-05 23:54:24 +00:00
ad
2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +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
f9ade37fe1 compat_file.[ch] are no longer used 2007-12-12 21:37:26 +00:00