Commit Graph

39497 Commits

Author SHA1 Message Date
phk
ffd04bfbdd Introduce a g_waitfor_event() function which posts an event and waits for
it to be run (or cancelled) and use this instead of home-rolled versions.
2003-04-23 21:28:27 +00:00
phk
7a7d406136 More of the event stuff can now be private to geom_event.c 2003-04-23 20:54:42 +00:00
phk
3bbfe9f43b Rename g_call_me() to g_post_event(), and give it a flag
argument to determine if we can M_WAITOK in malloc.
2003-04-23 20:46:12 +00:00
phk
b4c26d2e1a Remove the now unused hardcoded g_post_event() event support. 2003-04-23 20:25:33 +00:00
jhay
7c3a9405f3 Use bus_space*() instead of in*() and out*(). 2003-04-23 20:22:32 +00:00
phk
7c462ceb2b Turn EV_NEW_PROVIDER into a g_call_me() event. 2003-04-23 20:16:13 +00:00
phk
67a31a6107 Convert EV_SPOILED event to use g_call_me(). 2003-04-23 20:06:38 +00:00
jhb
9b55ca02a0 Remove Giant from osigblock(), osigsetmask(), and kern_sigaltstack(). 2003-04-23 19:49:18 +00:00
phk
16bcc257a6 Turn the hardwired NEW_CLASS event into a g_call_me() event. 2003-04-23 19:34:38 +00:00
phk
51e68a1f27 Move the shutdown eventhandler stuff to a more logical place. 2003-04-23 19:15:27 +00:00
jhb
fe0dcbf0db Update many of the locking notes and comments for struct
thread/kse/ksegroup/proc.
2003-04-23 18:54:30 +00:00
jhb
2c416d197d The signotify() sanity check in userret() doesn't need Giant anymore. 2003-04-23 18:51:55 +00:00
jhb
26097c18e1 Add lock assertions for various proc/thread/kse/ksegroup fields to the
scheduler functions.
2003-04-23 18:51:05 +00:00
jhb
89c52cff2e - 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
jhb
2958cf621b Remove Giant from [gs]etpriority(). 2003-04-23 18:48:55 +00:00
jhb
a0bf3a3e6f - 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
84db389df4 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
jhb
485007051a Fix compiling in the NO_SWAPPING case.
Submitted by:	bde (partially)
2003-04-23 18:21:41 +00:00
jhb
3df03e8316 Fix a lock order reversal. Unlock the proc before calling fget().
Reported by:	kris
2003-04-23 18:13:26 +00:00
jhb
df96ff7f37 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
des
649f6ec094 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
jhay
f639676ede Get rid of kvtop().
Change inb() and outb() to use bus_space*().
2003-04-23 15:40:11 +00:00
phk
15a332bfd6 Implement CONFIG_GEOM verbs "write label" and "write bootcode". 2003-04-23 08:23:01 +00:00
phk
cc4a9d46fe Introduce a #define for the length of the bootloader code. 2003-04-23 08:04:30 +00:00
phk
2d7e7620e8 Introduce gctl_get_paraml() which gets a parameter only if it has the
right length.
2003-04-23 08:03:47 +00:00
phk
90684346d6 Make gctl_error() take printfline varargs. 2003-04-23 07:50:01 +00:00
phk
ee10d53986 Remove unused event pointers in object structures.
Remove KASSERTS which checked that they were unused.
2003-04-23 06:54:44 +00:00
obrien
590e10e4ac Add /dev to the Alpha manual mount root example. 2003-04-23 05:02:40 +00:00
truckman
b8272feca3 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
phk
1e2ee18100 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
phk
5d4dba6264 We don't need to have a slice->start() function. 2003-04-22 21:24:37 +00:00
phk
13d95d603f 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
phk
c5dae9372b Implement handling of CONFIG_GEOM OAM request. 2003-04-22 21:01:46 +00:00
phk
02c40a0b9d Add "CONFIG_GEOM" operation to the OAM API. 2003-04-22 21:00:49 +00:00
jhb
128ae3c8d8 - 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
jhb
41837c0a14 - 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
jhb
ced60d737a 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
jhb
18f0a39a3f 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
jhb
d5cf4c5275 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
jhb
82ad2123a7 - 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
jhb
8c172a3498 Protect p_swtime with the sched_lock. 2003-04-22 19:48:25 +00:00
jhb
cfedd4c7d6 - 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
jhb
1fb058ce86 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
phk
817cb6ca1f Collapse meta arguments into regular arguments, the distinction is
more trouble than it is worth.
2003-04-22 19:42:05 +00:00
jhb
146e8aecec - 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
alc
eb6d5ae625 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
nyan
0157864ca9 Comment out firewire devices. 2003-04-22 12:14:19 +00:00
davidxu
0a01dd83c5 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
davidxu
d0165cba28 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
alc
b78fdbef61 Remove unused declarations. 2003-04-22 06:26:42 +00:00