Commit graph

39416 commits

Author SHA1 Message Date
Poul-Henning Kamp d98777f8db Remove the now unused hardcoded g_post_event() event support. 2003-04-23 20:25:33 +00:00
John Hay d8422795fa Use bus_space*() instead of in*() and out*(). 2003-04-23 20:22:32 +00:00
Poul-Henning Kamp 9ab3ea7841 Turn EV_NEW_PROVIDER into a g_call_me() event. 2003-04-23 20:16:13 +00:00
Poul-Henning Kamp f2e9a09494 Convert EV_SPOILED event to use g_call_me(). 2003-04-23 20:06:38 +00:00
John Baldwin cf60731b01 Remove Giant from osigblock(), osigsetmask(), and kern_sigaltstack(). 2003-04-23 19:49:18 +00:00
Poul-Henning Kamp 9972896c00 Turn the hardwired NEW_CLASS event into a g_call_me() event. 2003-04-23 19:34:38 +00:00
Poul-Henning Kamp b5cba4167f Move the shutdown eventhandler stuff to a more logical place. 2003-04-23 19:15:27 +00:00
John Baldwin 48fdefd188 Update many of the locking notes and comments for struct
thread/kse/ksegroup/proc.
2003-04-23 18:54:30 +00:00
John Baldwin 5eac9e2dcb The signotify() sanity check in userret() doesn't need Giant anymore. 2003-04-23 18:51:55 +00:00
John Baldwin 2056d0a168 Add lock assertions for various proc/thread/kse/ksegroup fields to the
scheduler functions.
2003-04-23 18:51:05 +00:00
John Baldwin 5afe0c9947 - Reorganize osigstack() to do the copyin first, grab the proc lock once,
do all the various sigstack dances, unlock the proc lock, and finally do
  the copyout.  This more closely resembles the behavior of
  kern_sigaltstack() and closes a small race.
- Remove Giant from osigstack as it is no longer needed.
2003-04-23 18:50:25 +00:00
John Baldwin 4d923fe3f5 Remove Giant from [gs]etpriority(). 2003-04-23 18:48:55 +00:00
John Baldwin 112afcb232 - Protect p_numthreads with the sched_lock.
- Protect p_singlethread with both the sched_lock and the proc lock.
- Protect p_suspcount with the proc lock.
2003-04-23 18:46:51 +00:00
Archie Cobbs 79db6ff316 Fix a case where the return value from m_copy() was not being checked
for NULL before proceeding, causing a crash if mbufs were exhausted.

MFC after:	3 days
Reported by:	Mark Gooderum <mark@verniernetworks.com>
2003-04-23 18:35:40 +00:00
John Baldwin 11edc1e0d7 Fix compiling in the NO_SWAPPING case.
Submitted by:	bde (partially)
2003-04-23 18:21:41 +00:00
John Baldwin c6004a6202 Fix a lock order reversal. Unlock the proc before calling fget().
Reported by:	kris
2003-04-23 18:13:26 +00:00
John Baldwin 6faa2f6d6e Comment out the mixer entry for igain for the mic 20dB boost for now since
it can cause feedback problems on some laptops.

Reviewed by:	orion
2003-04-23 16:49:53 +00:00
Dag-Erling Smørgrav bd9155712b Add constants for USB programming interfaces. These are already defined
(with other names) in the USB driver sources, but I felt that pcireg.h
should have a complete list - at least of classes and interfaces that we
know about and use.
2003-04-23 15:51:36 +00:00
John Hay e37d1c1488 Get rid of kvtop().
Change inb() and outb() to use bus_space*().
2003-04-23 15:40:11 +00:00
Poul-Henning Kamp bf9ab27afb Implement CONFIG_GEOM verbs "write label" and "write bootcode". 2003-04-23 08:23:01 +00:00
Poul-Henning Kamp a357555867 Introduce a #define for the length of the bootloader code. 2003-04-23 08:04:30 +00:00
Poul-Henning Kamp ca3d750e73 Introduce gctl_get_paraml() which gets a parameter only if it has the
right length.
2003-04-23 08:03:47 +00:00
Poul-Henning Kamp fb9483af54 Make gctl_error() take printfline varargs. 2003-04-23 07:50:01 +00:00
Poul-Henning Kamp 668ae29c71 Remove unused event pointers in object structures.
Remove KASSERTS which checked that they were unused.
2003-04-23 06:54:44 +00:00
David E. O'Brien 2603007ace Add /dev to the Alpha manual mount root example. 2003-04-23 05:02:40 +00:00
Don Lewis 8b3182e212 Release the vnode interlock in nfs_flush() before calling nfs_sigintr(),
and grab it again later if necessary.  This prevents a lock order reversal
because nfs_sigintr() calls PROC_LOCK().
2003-04-23 02:58:26 +00:00
Poul-Henning Kamp b874183561 Change the locking so that the _modify function is called with topology
held.

The only place where we want to not hold topology is when we read
(or write) the label to disk: in the case of a disk error with a
long recovery time, holding topology would prevent open/close of
any disk device.
2003-04-22 21:29:58 +00:00
Poul-Henning Kamp b09d72daf8 We don't need to have a slice->start() function. 2003-04-22 21:24:37 +00:00
Poul-Henning Kamp d3a1a13766 Do not mandate that slicers have a private ->start(), they may not need
one.  KASSERT() that they have one if G_SLICE_HOT_START is used.
2003-04-22 21:19:17 +00:00
Poul-Henning Kamp ea9ab6bed2 Implement handling of CONFIG_GEOM OAM request. 2003-04-22 21:01:46 +00:00
Poul-Henning Kamp 2c30da600e Add "CONFIG_GEOM" operation to the OAM API. 2003-04-22 21:00:49 +00:00
John Baldwin 9752f794c7 - Move PS_PROFIL and its new cousin PS_STOPPROF back over to p_flag and
rename them appropriately.  Protect both flags with both the proc lock
  and the sched_lock.
- Protect p_profthreads with the proc lock.
- Remove Giant from profil(2).
2003-04-22 20:54:04 +00:00
John Baldwin 0b5318c81a - Assert that the proc lock and sched_lock are held in sched_nice().
- For the 4BSD scheduler, this means that all callers of the static
  function resetpriority() now always hold sched_lock, so don't lock
  sched_lock explicitly in that function.
2003-04-22 20:50:38 +00:00
John Baldwin a15cc35909 Lock both the proc lock and sched_lock when calling sched_nice since
kg_nice is now protected by both.  Being protected by both means that
other places in the kernel that want to read kg_nice only need one of the
two locks.
2003-04-22 20:45:38 +00:00
John Baldwin 897ecacd64 Lock the proc to check p_flag and several other related tests in
vm_daemon().  We don't need to hold sched_lock as long now as a result.
2003-04-22 20:03:08 +00:00
John Baldwin eeec6bab2e Prefer the proc lock to sched_lock when testing PS_INMEM now that it is
safe to do so.
2003-04-22 20:01:56 +00:00
John Baldwin 664f718ba1 - Always call faultin() in _PHOLD() if PS_INMEM is clear. This closes a
race where a thread could assume that a process was swapped in by
  PHOLD() when it actually wasn't fully swapped in yet.
- In faultin(), always msleep() if PS_SWAPPINGIN is set instead of doing
  this check after bumping p_lock in the PS_INMEM == 0 case.  Also,
  sched_lock is only needed for setting and clearning swapping PS_*
  flags and the swap thread inhibitor.
- Don't set and clear the thread swap inhibitor in the same loops as the
  pmap_swapin/out_thread() since we have to do it under sched_lock.
  Instead, mimic the treatment of the PS_INMEM flag and use separate loops
  to set the inhibitors when clearing PS_INMEM and clear the inhibitors
  when setting PS_INMEM.
- swapout() now returns with the proc lock held as it holds the lock
  while adjusting the swapping-related PS_* flags so that the proc lock
  can be used to test those flags.
- Only use the proc lock to check the swapping-related PS_* flags in
  several places.
- faultin() no longer requires sched_lock to be held by callers.
- Rename PS_SWAPPING to PS_SWAPPINGOUT to be less ambiguous now that we
  have PS_SWAPPINGIN.
2003-04-22 20:00:26 +00:00
John Baldwin 828e7683bf Protect p_swtime with the sched_lock. 2003-04-22 19:48:25 +00:00
John Baldwin a6f37ac9d6 - Mark the kse_purge_group() and kse_purge() definitions static to match
their prototypes.
- Remove sched_lock locking from kse_purge() as all callers already lock
  the sched_lock before calling it.
- Hold the proc lock slightly longer to protect P_SHOULDSTOP().
2003-04-22 19:47:55 +00:00
John Baldwin 7b5e3e1239 Keep the proc locked while we set PS_INMEM so that either of the proc lock
or sched_lock are sufficient to test this flag.

XXX: vinum should really be using a kernel process via kthread_create()
instead of this hack.  I'm not even sure PS_INMEM can be clear at this
point anyways.
2003-04-22 19:45:26 +00:00
Poul-Henning Kamp 70b4ddbb09 Collapse meta arguments into regular arguments, the distinction is
more trouble than it is worth.
2003-04-22 19:42:05 +00:00
John Baldwin fe8cdcae87 - Replace inline implementations of sigprocmask() with calls to
kern_sigprocmask() in the various binary compatibility emulators.
- Replace calls to sigsuspend(), sigaltstack(), sigaction(), and
  sigprocmask() that used the stackgap with calls to the corresponding
  kern_sig*() functions instead without using the stackgap.
2003-04-22 18:23:49 +00:00
Alan Cox 2e9d00a15d Revision 1.246 should have also included
- Weaken the assertion in vm_page_insert() to require Giant only if the
   vm_object isn't locked.

Reported by:	 "Ilmar S. Habibulin" <ilmar@watson.org>
2003-04-22 14:26:02 +00:00
Yoshihiro Takahashi 2f4f42d484 Comment out firewire devices. 2003-04-22 12:14:19 +00:00
David Xu 97637bcfb2 Move down intr level testing code a bit, cpu_switch_load_gs fault can be at
interrupt nested time.
2003-04-22 08:12:03 +00:00
David Xu 5515888875 Fix some problems for cpu_switch_load_gs. when fault address is at
cpu_switch_load_gs, cpu is in context switch, so don't enable interrupt.
because it is in context switch, it is expected sched_lock was held,
so don't PROC_LOCK(p) and psignal, it is LOR, probably we can
set a P_XSIGBUS like flag in p_sflags, and set TDF_ASTPENDING in
td_flags, in ast(), post a SIGBUS to process if P_XSIGBUS was set.
2003-04-22 07:45:47 +00:00
Alan Cox 26da32cc73 Remove unused declarations. 2003-04-22 06:26:42 +00:00
Alan Cox 03d4c1e644 Revision 1.52 of vm/uma_core.c has led to UMA's obj_alloc() being
called without Giant; and obj_alloc() in turn calls vm_page_alloc()
without Giant.  This causes an assertion failure in vm_page_alloc().
Fortunately, obj_alloc() is now MPSAFE.  So, we need only clean up
some assertions.

 - Weaken the assertion in vm_page_lookup() to require Giant only
   if the vm_object isn't locked.
 - Remove an assertion from vm_page_alloc() that duplicates a check
   performed in vm_page_lookup().

In collaboration with:	gallatin, jake, jeff
2003-04-22 05:36:14 +00:00
Alan Cox 1c067f7ebc Add VM_OBJECT_LOCKED(). 2003-04-22 04:47:29 +00:00
Hidetoshi Shimokawa f73a5a7f66 add scbus for FireWire. 2003-04-22 04:39:20 +00:00