Commit Graph

24209 Commits

Author SHA1 Message Date
wollman
08d0e8d96f Correct a comment. 2001-01-24 16:25:36 +00:00
jhb
cf8988088c Oops, when converting if (foo) panic() to a KASSERT(), you have to invert
the test case.

Spotted by:	peter, jasone
2001-01-24 13:10:17 +00:00
deischen
e70d7adf60 Bump FreeBSD version to reflect changes to libc and libc_r. 2001-01-24 13:08:12 +00:00
jhb
91e8162c0a Add a new item to kinfo_proc: ki_sflag to mirror p_sflag. 2001-01-24 12:49:52 +00:00
jasone
8d2ec1ebc4 Convert all simplelocks to mutexes and remove the simplelock implementations. 2001-01-24 12:35:55 +00:00
jhb
c5cc2f8e26 Argh, I didn't get this test right when I converted it. Break this up
into two separate if's instead of nested if's.  Also, reorder things
slightly to avoid unnecessary mutex operations.
2001-01-24 12:23:17 +00:00
jhb
9d4ef4f19c - Catch up to proc flag changes.
- Minimal proc locking.
- Use queue macros.
2001-01-24 11:28:36 +00:00
jhb
f2190e5fef Add mtx_assert()'s to verify that kmem_alloc() and kmem_free() are called
with Giant held.
2001-01-24 11:27:29 +00:00
jhb
9e1a5e2c5b - Catch up to proc flag changes.
- Proc locking in a few places.
- faultin() now must be called with the proc lock held.
- Split up swappable() into a couple of tests so that it can be locke in
  swapout_procs().
- Use queue macros.
2001-01-24 11:25:56 +00:00
jhb
963052ead7 - Catch up to proc flag changes. 2001-01-24 11:20:05 +00:00
jhb
a56633d331 - Catch up to proc flag changes.
- Assert sched_lock is held in proc_compare.
2001-01-24 11:15:59 +00:00
jhb
2a1df40436 - Catch up to proc flag changes.
- Update stopevent() to assert that the proc lock is held when it is
  held and is not recursed.  Note that the STOPEVENT() macro obtains
  the proc lock when calling this function.
2001-01-24 11:15:24 +00:00
jhb
13bef95f6e - Catch up to proc flag changes.
- Add proc locking for selwakeup() and selrecord().
2001-01-24 11:12:37 +00:00
jhb
d5d162ffe9 - Catch up to proc flag changes. 2001-01-24 11:11:35 +00:00
jhb
c0f4ac74f2 - Catch up to proc flag changes.
- Add in some locking ops that might fix SIGXCPU, but don't enable them
  yet.
- Assert that sched_lock is not recursed when mi_switch() is called.
2001-01-24 11:10:55 +00:00
jhb
d161c1e3f8 - Proc locking.
- Catch up to proc flag changes.
2001-01-24 11:08:02 +00:00
jhb
daef77c52d - Add a mtx_assert() for sched_lock in calcru().
- Protect calcru() with sched_lock later on in the file when it is called.
2001-01-24 11:06:39 +00:00
jhb
bd862d8954 - Proc locking.
- Catch up to proc flag changes.
- Reorder the way we get things in fill_kinfoproc() to minimize the
  number of locking operations.
2001-01-24 11:05:50 +00:00
jhb
233d6de215 - Don't use a union and fun tricks to shave one extra pointer off of struct
mtx right now as it makes debugging harder.  When we are in optimizing
  mode, we can revisit this.
- Fix the KTR trace messages to use %p rather than 0x%p to avoid duplicate
  0x's in KTR output.
- During witness_fixup, release Giant so that witness doesn't get confused.
  Also, grab all_mtx while walking the list of mutexes.
- Remove w_sleep and w_recurse.  Instead, perform checks on mutexes using
  the mutex's mtx_flags field.
- Allow debug.witness_ddb and debug.witness_skipspin to be set from the
  loader.
- Add Giant to the front of existing order_list entries to help ensure
  Giant is always first.
- Add an order entry for the various proc locks.  Note that this only
  helps keep proc in order mostly as the allproc and proctree mutexes are
  only obtained during a lockmgr operation on the specified mutex.
2001-01-24 10:57:01 +00:00
jhb
eccf4f41cd - Catch up to proc flag changes.
- Set the new P_KTHREAD flag for kthreads during kthread_create.
2001-01-24 10:47:50 +00:00
jhb
f739ee5728 - Catch up to proc flag changes.
- Add new fork_exit() and fork_return() MI C functions.
2001-01-24 10:47:14 +00:00
jhb
fdd3fb7200 Catch up to P_FOO -> PS_FOO changes in proc flags. 2001-01-24 10:44:01 +00:00
jhb
180bd8bf65 - Proc locking.
- P_FOO -> PS_FOO.
2001-01-24 10:43:25 +00:00
jhb
eef4e5d2f9 - Catch up to p_sflag changes.
- The MD code now initializes proc0.p_heldmtx, proc0.p_contested, and
  curproc.
- The MD code calls here with Giant already held.
- Proc locking.
2001-01-24 10:40:56 +00:00
jhb
8dae9bbc6a - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
2001-01-24 10:38:58 +00:00
jhb
af41b60632 - Proc locking.
- Update userret() to take a struct trapframe * as a second argument.
- Axe have_giant and use mtx_owned(&Giant) where appropriate.
2001-01-24 10:38:13 +00:00
jhb
9455afff84 - Proc locking.
- P_FOO -> PS_FOO.
2001-01-24 10:36:47 +00:00
jhb
4dc0bb19d1 - Proc locking.
- Bring across forwarded_statclock() fixes from i386 and alpha.
2001-01-24 10:36:21 +00:00
jhb
9c54776639 - Proc locking around the vinumdaemon dinking with its flags.
- P_INMEM -> PS_INMEM.
2001-01-24 10:28:19 +00:00
jhb
fb77bd069b Make mp_machdep.c be an optional file conditional on SMP. 2001-01-24 10:27:37 +00:00
jhb
1df50e8aac Proc locking. 2001-01-24 10:27:11 +00:00
jhb
02a611ef0c Use queue macros. 2001-01-24 10:26:51 +00:00
jhb
283a1150c5 Add a prototype for isa_irq_mask() to quiet a warning. 2001-01-24 10:25:44 +00:00
jhb
738a41fdee Wrap the IPI definitions and function prototypes in #ifdef SMP. 2001-01-24 10:25:09 +00:00
jhb
264b1fe22a - Rename the gd_cpuno member of struct globaldata to gd_cpuid.
- Add a globaldata_register() prototype in the SMP case.
2001-01-24 10:24:49 +00:00
jhb
77583447a9 - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
2001-01-24 10:23:54 +00:00
jhb
eabcf31b82 - Change userret() to take a struct trapframe * as its second argument and
to extract the PC from that to send to addupc_task() so that it can be
  called from MI code.
- Remove all traces of have_giant with extreme prejudice and use
  mtx_owned(&Giant) instead where appropriate.
- Proc locking.
- P_FOO -> PS_FOO.
- Don't grab Giant just to look in curproc's p_addr during a trap since we
  may choose to immediately exit.  Instead, delay grabbing Giant a bit
  until we actually need it.
- Don't reset 'p' to 'curproc' in syscall() to handle the case of a child
  returning from fork1() since children don't return via syscall().
- Remove an XXX comment in ast() that questions the correctness of the
  userland check.  The code is correct.
2001-01-24 10:23:21 +00:00
jhb
451c942dba - Proc locking.
- P_INMEM -> PS_INMEM.
2001-01-24 10:16:23 +00:00
jhb
8e27ac396a - Proc locking.
- Don't send IPIs for pmap_invalidate_page() or pmap_invalidate_all()
  in the UP case.
- Catch up to cpuno -> cpuid.
- Convert some sanity checks that were #ifdef DIAGNOSTIC to KASSERT()'s.
2001-01-24 10:16:01 +00:00
jhb
277ef6eaf3 - Adjust some whitespace to reduce diffs with the i386 version.
- Rename the per-CPU variable 'cpuno' to 'cpuid'.  This was done so that
  there is one consistent name across all architectures for a logical
  CPU id.
- Remove all traces of IRQ forwarding.
- Add globaldata_register() hook called by globaldata_init() to register
  globaldata structures in the cpuid_to_globaldata array.
- Catch up to P_FOO -> PS_FOO.
- Bring across some fixes for forwarded_statclock() from the i386 version
  to handle ithreads and idleproc properly.
- Rename addugd_intr_forwarded() to addupc_intr_forwarded() so that it is
  the same name on all architectures.
- Set flags in p_sflag instead of calling psignal() from
  forward_hardclock().
- Proc locking.
- When we handle an IPI, turn off its bit in the mask of IPI's we are
  currently handling so that an IPI doesn't send a CPU into an infinite
  loop.
2001-01-24 10:13:13 +00:00
jhb
a1ce5e9db8 - Initialize curproc, proc0.p_heldmtx, and proc0.p_contested earlier so
that mutex operations work.
- Enter Giant earlier so we hold it during boot.
- Proc locking.
- Move globaldata_init() into here from mp_machdep.c so that UP kernels
  don't depend on mp_machdep.c.  Use a callout in the SMP case to register
  the boot processor's globaldata in the cpuid_to_globaldata array.
2001-01-24 10:07:42 +00:00
jhb
8168399f03 - Wrap the IPI interrupt handler in #ifdef SMP.
- Catch up to cpuno -> cpuid change.
- Add parens around a subexpression to quiet a warning.
2001-01-24 10:05:24 +00:00
jhb
8c0af7d84b cpuno -> cpuid. 2001-01-24 10:04:32 +00:00
jhb
73a3d8450d Don't import the nonexistent astpending variable. 2001-01-24 10:03:05 +00:00
jhb
87deba6ead Wrap the startup code used by secondary processors in #ifdef SMP. 2001-01-24 10:01:53 +00:00
jhb
df7b91e66f Remove the Xforward_irq IPI. 2001-01-24 10:01:13 +00:00
jhb
0bd8027e4a - Remove all the #if 0'd code that used to implement IRQ forwarding.
- Remove #if 0'd lazy interrupt mask.
2001-01-24 10:00:07 +00:00
jhb
d04125226c Remove unused locks: cpl, fast_intr, intr, mpintr. 2001-01-24 09:58:56 +00:00
jhb
409b74b609 - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
- Remove obsolete prototype for MD fork_return().
2001-01-24 09:56:49 +00:00
jhb
39d78f3196 - Remove Xforward_irq, cpl_lock, and fast_intr_lock.
- Add fork_exit.
2001-01-24 09:55:39 +00:00
jhb
30a150609e Setup the return values for a child process in the trapframe when we setup
the rest of the trapframe instead of doing it in fork_return().
2001-01-24 09:54:44 +00:00
jhb
a539ffb3e7 - Kill the have_giant parameter to userret() along with all instances of
that name as a variable.  Use mtx_owned(&Giant) where appropriate
  instead.
- Proc locking.
- P_FOO -> PS_FOO.
- Update comments about enable interrupts during trap and why this may be
  bad if we trap while holding a spin mutex.
- Don't bother resetting p to curproc in syscall() in case we are the child
  returning from fork.  The child hasn't returned from fork through syscall
  in a while.
- Remove fork_return() as it has been superseded by the MI version.
2001-01-24 09:53:49 +00:00
jhb
1b7c29442e - Proc locking.
- P_INMEM -> PS_INMEM.
2001-01-24 09:49:49 +00:00
jhb
8e161d3269 - Relocate portions of this file to get it into an order closer to that of
the alpha mp_machdep.c.
- Proc locking.
- Catch up to the P_FOO -> PS_FOO proc flags changes.
- Stick ap_init()'s prototype with the other prototypes.
- Remove the Xforwardirq IPI.
- Remove unused simplelocks.
- Don't try to psignal() from forward_statclock(), but set the appropriate
  signal pending flag in p_sflag instead.
- Add in KTR_SMP tracepoints for various SMP functions.   (Brought over
  from the alpha port)
2001-01-24 09:48:52 +00:00
jhb
3a1caa00c3 - Proc locking.
- Setup proc0.p_heldmtx, proc0.contested, and curproc earlier so that we
  can use mutexes.
- Initialize sched_lock and Giant earlier and enter Giant during init386.
- Use suser(9) instead of checking cr_uid directly.
2001-01-24 09:45:20 +00:00
jhb
3b95ed413d Call fork_exit() now instead of futzing around in assembly during a fork
return.
2001-01-24 09:43:26 +00:00
jhb
e5adbdcf1b - Split p_flag up into two fields. p_flag keeps most of the previous flags
and is protected by the proc lock.  p_sflag is protected by sched_lock
  and holds the following flags: PS_INMEM, PS_OWEUPC, PS_PROFIL, PS_SINTR,
  PS_TIMEOUT, PS_ALRMPEND, PS_PROFPEND, PS_CVWAITQ, PS_SWAPINREQ, and
  PS_SWAPPING.
- p_klist is definitely locked now by the proc lock.
- p_runtime, p_[usi]u are locked by sched_lock.
- Add a new P_KTHREAD flag set for kernel threads created via
  kthread_create(9).
- STOPEVENT() only needs the proc lock, it does not need Giant.
- faultin() already checks PS_INMEM, so simplify the check in PHOLD() so
  that we only need to grab the proc lock and let faultin() perform the
  PS_INMEM check.
- Add a prototype for zpfind().
- Add prototypes for the new fork_exit() and fork_return() MI functions
  that manage the fork return path.
- Add a prototype for the MD function userret() so that it can be called
  from fork_return().
- Add needed include of <machine/frame.h> in the kernel.
2001-01-24 09:41:03 +00:00
jhb
558ee819ee Fix a typo.
Reported by:	albert
2001-01-24 08:42:39 +00:00
hm
70aff88d6b remove redundant definitions of card types:
- remove all occurances of FLAG_XXX values and replace with CARD_TYPEP_XXX
 - remove sc_flag from isic softc and replace it with sc_cardtyp
remove some left over redundant definitions from isic and i4b_l1.h
remove left over cvs id from i4b cvs repository
2001-01-24 08:41:52 +00:00
jhb
85f26795ce Add missing include. 2001-01-24 06:54:24 +00:00
mckusick
28dc76bebe Never reuse AUTO_OID values.
Approved by:	Alfred Perlstein <bright@wintelcom.net>
2001-01-24 04:35:13 +00:00
jhb
810630fa41 The lock being destroyed was misnamed, not unused. Add the lockdestroy()
back in but with the proper name so that this compiles.

Submitted by:	jasone
2001-01-24 02:18:54 +00:00
jhb
4fe63e40a8 #ifdef a local variable only used in debugging code.
Reviewed by:	-scsi
2001-01-24 01:46:57 +00:00
jhb
c7124acea7 Const'ify cam_sim.sim_name to quiet warnings.
Reviewed by:	-scsi
2001-01-24 01:46:18 +00:00
cg
2565bf6979 don't grope around inside snd_dbuf structures as they will change in future 2001-01-24 01:36:15 +00:00
cg
99127615ba fix certain cards failing to attach
Submitted by:	Russell Cattelan <cattelan@thebarn.com>
2001-01-24 01:27:31 +00:00
cg
456c0fc978 fix blocksizing for playback, implement blocksizing for record 2001-01-24 01:22:53 +00:00
cg
9de50bdcce some cosmetics, changed channel setup and revamped irq handling - ignore
repeated interrupts
2001-01-24 01:20:04 +00:00
cg
2cc907a0c7 prevent excessively small buffer sizes resulting in hundreds of irqs per
second
2001-01-24 01:15:50 +00:00
jhb
fa0d2b97b0 Don't grab Giant when calling kmem_alloc/kmem_free as this is just
encouraging other people to follow the same practice.  If this is going
to be done, then it should be done inside of those two functions instead.
2001-01-24 00:36:03 +00:00
jhb
7c01c0a2c2 Proc locking. 2001-01-24 00:35:12 +00:00
jhb
1046fa2a8d - Proc locking.
- Protect calcru() with sched_lock.
2001-01-24 00:33:44 +00:00
jhb
065a35fbb6 - Proc locking.
- Protect calcru() with sched_lock.
2001-01-24 00:28:07 +00:00
jhb
a294d4e362 Proc locking. 2001-01-24 00:27:28 +00:00
jhb
f540aca984 Proc locking to protect p_ucred while we obtain additional references. 2001-01-24 00:26:19 +00:00
jhb
733f2050f9 - Proc locking.
- Use FreeBSD stackgap_init() semantics.
- Adjust some #ifdef's to hide unused variables.
2001-01-24 00:24:57 +00:00
jhb
370523c244 - Proc locking.
- Use NULL instead of 0.
2001-01-24 00:23:30 +00:00
mjacob
3403eb045d "Rejected with status" is better than "Rejected for status". 2001-01-24 00:14:37 +00:00
jhb
0717c33b64 Use selrecord() instead of doing the work ourselves. 2001-01-24 00:06:26 +00:00
jhb
b5d0418fc1 Make the device name in an isa_device a const char * instead of a char *
to silence cast-qual warnings.
2001-01-24 00:05:13 +00:00
jhb
a98f3e67f7 Use queue macros. 2001-01-24 00:01:42 +00:00
jhb
80649f2bc1 Proc locking. 2001-01-23 23:59:38 +00:00
jhb
f5fbc62142 - Use 'p' instead of 'curproc' for the namei lookup as this is what
other image activators use.
- Proc locking.
2001-01-23 23:59:30 +00:00
jhb
08fe94fb94 Proc locking. 2001-01-23 23:51:56 +00:00
mjacob
6811103a87 Allow fxp to configure in I/O space if the user wants it and specifies
an override as a loader settable variable (fxp_iomap). fxp_iomap is
a bitmap of fxp units that should be configured to use PCI I/O space
in stead of PCI Memory space.

Reviewed by:	Kees Jan Koster <dutchman@tccn.cs.kun.nl>, dg@freebsd.org
2001-01-23 23:22:17 +00:00
jhb
45daa2e3ce Proc locking, mostly protecting p_ucred while obtaining additional
references.
2001-01-23 22:41:15 +00:00
jhb
24fda4f13e - Remove unused header include.
- Use queue macros.
2001-01-23 22:38:38 +00:00
jhb
e7cd4ee729 Proc locking to protect p_ucred while we obtain an additional reference. 2001-01-23 22:38:15 +00:00
jhb
c55210afc5 - FreeBSD doesn't have an abortop vnop as far as I can tell, so #ifdef
references to the hpf op out.
- Remove a lockdestroy() on a non-existent variable.
2001-01-23 22:37:30 +00:00
jhb
fe7d8cee8f Tag unused functions with __unused. 2001-01-23 22:24:26 +00:00
jhb
b4eb86c28d Proc locking to protect p_ucred while we obtain another reference to it. 2001-01-23 22:23:25 +00:00
jhb
600bbce055 Use suser(9) instead of checking p->p_ucred->cr_uid directly. 2001-01-23 22:22:25 +00:00
jhb
dede119c77 Remove a prototype for an unused and undefined debugging function. 2001-01-23 22:21:14 +00:00
jhb
4799f0d266 Tag unused functions with __unused. 2001-01-23 22:18:41 +00:00
jhb
e01b490c7e - Move stg_card_intr()'s prototype and definition inside appropriate
#ifdef's as it is is only used on older versions of FreeBSD.
- #ifdef a local variable only used on older versions of FreeBSD.
2001-01-23 22:18:07 +00:00
gibbs
f2a4379534 When flipping the first entry in the qinfifo with the "next queued SCB",
we must also inform the card of this change.  Otherwise the sequencer
will traverse a corrupt list of SCBS.  The side effects of this problem
were unknown SCBs completing in the qoutfifo or worse yet, panics due
to sequencer interrupts that referenced what, to the kernel, were invalid
SCB ids.
2001-01-23 22:17:03 +00:00
jhb
2207837a49 Relocate the 'hwfuncs' functions below the inlined functions they attempt
to call so that the other functions can actually be inlined.
2001-01-23 22:16:18 +00:00
jhb
ce468ee38d - Proc locking.
- Use queue macros.
- Use NULL instead of 0 for pointers.

Reviewed by:	des
2001-01-23 22:13:07 +00:00
jhb
1442e82d08 Move nsp_card_intr()'s prototype and definition inside the appropriate
#ifdef's as it is only used in older versions of FreeBSD.
2001-01-23 22:09:04 +00:00
jhb
3ed8c05491 Move the definition of nsp_start_timer() earlier in the file before it is
called so that it can be inlined.
2001-01-23 22:08:21 +00:00