Commit Graph

39390 Commits

Author SHA1 Message Date
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
David Xu
5b70587b8a Remove single threading detecting code, these code really should be
replaced by thread_user_enter(), but current we don't want to enable
this in trap.
2003-04-22 03:17:41 +00:00
Hidetoshi Shimokawa
85b2d114c0 Set the local bus address in xfer->dst.
Submitted by: Buzz Slye <buzz@gaia.arc.nasa.gov>
2003-04-22 02:31:31 +00:00
Marcel Moolenaar
148eac48f1 Don't use the tpa instruction to implement pmap_kextract. The tpa
instruction requires that a translation is present in the TC. This
may trigger a TLB miss and a subsequent call to vm_fault().
This implementation is deliberately non-inline for debugging and
profiling purposes. Partial or full inlining should eventually be
done.

Valuable insights by: jake
2003-04-22 01:48:43 +00:00
Poul-Henning Kamp
18fdae6bd8 Now that all uses of this file use explicit encoding/decoding, remove
all the bits we do not need, and drop the attempt at "disk-image"
structure definition.

Add idempotency (sp?) #ifdef
2003-04-21 20:40:41 +00:00
Poul-Henning Kamp
989afda211 Implement a hotspot for the sunlabel.
This means that you can no longer trash your opened partitions by writing to
the sunlabel through another partition.  This is similar to the semantics
implemented for BSD labels.
2003-04-21 20:14:36 +00:00
Poul-Henning Kamp
666223979c Update GEOM::SUN to use the decoding functions in geom_sunlabel_enc.c
and #defines from sys/sun_disklabel.h.
2003-04-21 19:54:11 +00:00
Poul-Henning Kamp
9bd6be665d Use #defines from <sys/sun_disklabel.h> instead of private ones. 2003-04-21 19:42:36 +00:00
Poul-Henning Kamp
e268e8c725 Add defines for number of partitions, raw partition index and size of
encoded data structure.
2003-04-21 19:38:33 +00:00
Poul-Henning Kamp
0b60aa467b Add prototypes for sunlabel_dec() and sunlabel_enc().
Assume (for now) that all sun labels are big endian.
2003-04-21 19:31:42 +00:00
Poul-Henning Kamp
941a2f8cb5 Functions to encode and decode Sun Microsystems disk partitioning data
structures.

Mostly by:	jake
2003-04-21 18:41:12 +00:00
Warner Losh
214073e5e4 Use newly minted device_is_attached rather than device_is_alive to see
if attach succeeded.  device_is_alive just tells us that probe
succeeded.  Since we were using it to do things like detach net
interfaces, this caused problems when there were errors in the attach
routine.

Symptoms of problem reported by: martin blapp
2003-04-21 18:34:04 +00:00
Warner Losh
01a9b4348f Create a new function, device_is_attached(), that is like
device_is_alive() that tells us if the device has successfully
attached.  device_is_alive just tells us that the device has
successfully probed.
2003-04-21 18:19:08 +00:00
Takanori Watanabe
1f96e3e8b9 Regen. 2003-04-21 17:36:03 +00:00
Takanori Watanabe
beb4384bf8 Add another product ID for if_axe and correct vendor ID description
for Linksys USB200M.The USB vendor ID list is available from
http://www.usb.org/app/pub/dump/comp_dump/

Reviewed by: wpaul
2003-04-21 17:34:13 +00:00
Hidetoshi Shimokawa
092cd06fcd Add FireWire drivers to GENERIC. 2003-04-21 16:44:05 +00:00
Hidetoshi Shimokawa
e863fbcdb0 Remove unused code. 2003-04-21 16:41:20 +00:00
David E. O'Brien
b67eb8b080 Explicitly declare 'int' parameters. 2003-04-21 16:34:18 +00:00
David E. O'Brien
40373d8796 Assembly files put thru the C preprocessor need to have C style comments. 2003-04-21 16:30:12 +00:00
David E. O'Brien
152385d122 Explicitly declare 'int' parameters. 2003-04-21 16:27:46 +00:00
David Xu
6625036082 Reset pcb_gs and %gs before possibly invalidating it. 2003-04-21 15:05:05 +00:00
David Xu
11b20c685b Fix lock order reversal problem. 2003-04-21 14:42:04 +00:00
David Xu
1ecb38a365 Introduce two flags to control upcall behaviour:
o KMF_NOUPCALL
	Ask kse_release to not return to userland upcall entry, but instead
	direct returns to userland by using current thread's stack and return
	address on stack. This flags is intended to be used by UTS in critical
	region to wait another UTS thread to leave critical region, by using
	kse_release with this flag to avoid spinnng and burning CPU. Also this
	flags can be used by UTS to poll completed context when there is nothing
	to do in userland and needn't restart from its entry like normal upcall.

o KMF_NOCOMPLETED
	Ask kernel to not bring completed thread contexts back to userland when
	doing upcall, this flags is intend to be used with above flag when an
	upcall thread is in critical region and can not process completed contexts
	at that time.

Tested by: deischen
2003-04-21 07:27:59 +00:00
David Xu
bb3578eb65 Add a member field for kse_upcall to cache kse mailbox flags.
Code for this will be committed soon.
2003-04-21 07:02:37 +00:00
Alan Cox
d647a0ed5a - Assert that the vm_object is locked in vm_object_clear_flag(),
vm_object_pip_add() and vm_object_pip_wakeup().
 - Remove GIANT_REQUIRED from vm_object_pip_subtract() and
   vm_object_pip_subtract().
 - Lock the vm_object when performing vm_object_page_remove().
2003-04-21 06:33:52 +00:00
Warner Losh
e22b0bf4b8 Fix /dev/devctl's implementation of poll. We should only be setting
the poll bits when there's actually something in the queue.
Otherwise, select always returned '2' when there were no items to be
read, and '3' when there were.  This would preclude being able to read
in a threaded (libc_r) program, as well as checking to see if there
were pending events or not.
2003-04-21 05:58:51 +00:00
Orion Hodson
61a0da1de5 Add eMicro codec ids. 2003-04-21 04:48:40 +00:00