Commit Graph

24365 Commits

Author SHA1 Message Date
jake
7f8ca5454d Clear intr_nesting_level when an interrupt thread has no more
handlers and wants to exit, so it doesn't panic in exit1()
which malloc()s with M_WAITOK.

Reported by:	Bob Bishop <rb@gid.co.uk>
2001-01-28 17:20:11 +00:00
julian
8f85fcd191 Add a new distribution algorythm to the 'one2many' node type.
The new method is 'flood' (in addition to the old round-robin)
in which incoming packets are sent to more than one outgoing hook.
(I'm not sure what Rogier is using this for but it seems generally useful
and isn't much extra)

Submitted by:   Rogier R. Mulhuijzen (drwilco@drwilco.net )
2001-01-28 15:37:06 +00:00
kato
35f496038d Merged from sys/i386/isa/npx.c revisions 1.88 and 1.89. 2001-01-28 12:31:03 +00:00
kato
1f2162efe6 Synced with sys/i386/i386/machdep.c revision 1.436. 2001-01-28 11:06:28 +00:00
marcel
50ecf90607 Add gd_witness_spin_check. 2001-01-28 08:06:50 +00:00
marcel
8f415b859c Fix typo. 2001-01-28 08:05:55 +00:00
marcel
259a965d62 Improve kernel bootstrapping:
o  Use objdump instead of gensetdefs(1) to build the linker sets.
o  Allow overriding of nm and objdump in resp. genassym.sh and
   gensetdefs.pl for non-native toolchains.

Reviewed by: arch
Perl improvements: Jos Backus <josb@cncdsl.com>, benno
2001-01-28 06:39:56 +00:00
bmilekic
e973a2097e Move the setting of curproc to idleproc up earlier in ap_init(). The
problem is that a mutex lock, prior to this change, is acquired before
the curproc is set to idleproc, so we mess ourselves up by calling
the mutex lock routine with curproc == NULL.

Moving it up after the aps_ready spin-wait has us hopefully setting it
after idleproc is setup.

Solved by: jake (the allmighty) :-)
2001-01-28 03:41:01 +00:00
tegge
e5ad093955 Defer assignment of low level interrupt handlers for PCI interrupts
described in the MP table until something asks for the interrupt number
later on.
2001-01-28 01:07:54 +00:00
des
f8b630b644 Remove an assertion I forgot to remove in the previous commit: sbuf_len()
may now be called with an unfinished sbuf.
For consistency, copy the related comment from sbuf_delete() to sbuf_clear()
and sbuf_len().
2001-01-28 00:33:58 +00:00
des
d44e193035 Add sbuf_clear() and sbuf_overflowed().
Move the helper macros from sbuf.h to sbuf.c
Use ints instead of size_ts.
Relax the requirements for sbuf_finish(): it is now possible to finish an
overflowed buffer.
Make sbuf_len() return -1 instead of 0 if the sbuf overflowed.

Requested by:	gibbs
2001-01-28 00:13:01 +00:00
gallatin
6eba810946 The API UP1100 is close enough to a UP1000 that FreeBSD just works on it, so
document that fact.

Thanks to Peter Petrakis <ppetrakis@alphalinux.org> for doing a test boot.
2001-01-27 20:56:00 +00:00
gibbs
f0a7c36922 Update Copyright notices for new year. (should have been in last commit). 2001-01-27 20:54:24 +00:00
nyan
603702dd39 Merged from sys/isa/sio.c revision 1.320. 2001-01-27 13:02:06 +00:00
jhb
0ab9c00c3a Turn on DEVFS by default for the alpha. Aside from vinum as mentioned by
phk it should work fine.  If you need vinum, then don't add this to your
kernel config until vinum catches up to DEVFS.
2001-01-27 08:34:58 +00:00
phk
adee43800a Turn DEVFS on by default.
You may need to turn this off if you you vinum.  Apart from that I know of
no reason not to run with DEVFS.
2001-01-27 08:18:36 +00:00
jhb
65cd0e9fe4 Add a new ddb command 'witness_list' that lists the mutexes held by
curproc.

Requested by:	peter
2001-01-27 07:51:34 +00:00
peter
440f608351 p->p_intr_nesting_level is MI now and initialized to 0 in kern_fork.c,
so it should be save to KASSERT() on it even on an arch that may not
use it.
2001-01-27 06:32:20 +00:00
peter
f37e30da1a Bah, as my luck would have it, I had a kernel source tree in the window
while strlcpy() existed, before it got backed out due to an extended
bikeshed argument.  Sigh.  Back to the old version with the redundant
code to terminate the string. :-(
2001-01-27 06:01:48 +00:00
peter
dc24199262 Use strlcpy() in TUNABLE_STR_xxx() and avoid an off-by-one.
Noticed by: dfr
2001-01-27 05:43:58 +00:00
luigi
11e2347178 Make sure we do not follow an invalid pointer in ipfw_report
when we get an incomplete packet or m_pullup fails.
2001-01-27 02:31:08 +00:00
jhb
6f36272449 Back out proc locking to protect p_ucred for obtaining additional
references along with the actual obtaining of additional references.
2001-01-27 00:01:31 +00:00
jhb
12f0c46097 - Back out over-aggressive locking of p->p_cred.
- Back out locking ucred's and bumping refcounts for vnode operations.
2001-01-26 23:54:40 +00:00
jhb
2ae0bfa0c0 Fix fork_exit() to take a pointer to a function that returns void as its
first argument rather than a function that returns a void *.

Noticed by:	jake
2001-01-26 23:51:41 +00:00
jhb
affc1ab289 Update some comments, s0 in the pcb of a child returning from fork1() is
now passed in as a0 to fork_exit() and and s2 is passed in as a1.
2001-01-26 23:32:38 +00:00
luigi
1730cea3d2 Minor cleanups after yesterday's patch.
The code (bridging and dummynet) actually worked fine!
2001-01-26 19:43:54 +00:00
dfr
da083c2ba9 Initialise proc0.p_heldmtx and proc0.p_contested and call
mtx_enter(&Giant, MTX_DEF) after Giant is initialised.

Reviewed by: jhb
2001-01-26 17:52:34 +00:00
gallatin
0b1a847980 The osfulator needs sysvipc to work. Thanks to DES's commit to
the i386 linulator for pointing this out.

The alpha linulator doesn't need a dependancy, as it already
depends on the osfulator.
2001-01-26 17:12:30 +00:00
hm
bb5102c97b Add experimental support for Eicon.Diehl DIVA 2.0 and 2.02 ISA PnP cards. 2001-01-26 13:22:18 +00:00
hm
a39290d44c Add experimental support for Eicon.Diehl DIVA 2.0 and 2.02 ISA PnP cards.
Thanks a lot to Jakob Schripsema (sch@kpn.com) for pointing out similarities
of the Eicon 2.02 to the Siemens I-surf driver !
2001-01-26 13:16:11 +00:00
hm
607e4ada09 Add experimental support for Eicon.Diehl DIVA 2.0 and 2.02 ISA PnP cards.
Increment i4b minor revision (=step) so a buildworld or a make install in
/usr/src/sys/include is necessary to get isdnd and i4b kernel parts in sync.
2001-01-26 13:12:56 +00:00
julian
49e27f0a8b Swap egress hooks for packets entering from the monitor hooks. 2001-01-26 11:35:36 +00:00
luigi
75ddda7a15 Bring dummynet in line with the code that now works in -STABLE.
It compiles, but I cannot test functionality yet.
2001-01-26 06:49:34 +00:00
luigi
01d9410928 Bring bridging code in line with the one which works on -STABLE.
It compiles on -CURRENT, but I can not test functionality yet.
2001-01-26 06:47:19 +00:00
jake
5e2dbbc129 Push Giant down into the trap handlers that need it, instead of
acquiring it unconditionally.

Reviewed by:	jhb
2001-01-26 04:16:16 +00:00
jhb
c926f86aaa - Don't pass in MTX_NORECURSE, as that is only used with spin mutexes and
is going away soon anyways.  Instead, don't pass MTX_RECURSE to mtx_init,
  so that WITNESS will panic if the driver mutex is recursed on.
- Use MTX_DEF in mtx_init() instead of assuming that it will be 0.
2001-01-26 03:18:17 +00:00
luigi
92d02e3144 Comment the interface to ether_input() and the way is normally
used by most ethernet drivers.
2001-01-25 23:56:13 +00:00
julian
102ce4d3f9 Only clear the 'free' bit if we were successful in getting a queue item off the free list.
Found by: Harti Brandt (address unknown)
2001-01-25 19:48:57 +00:00
jhb
2938e8ca35 Whitespace fix: convert code indented 6 spaces to use tabs instead. 2001-01-25 19:37:26 +00:00
nsouch
7b010d5fa3 Discard extra status information if -1. This has been breaking the
PS/2 mode for ZIP+ drives for a long time. Thanks Jonathon.

Submitted by:	j mckitrick <jcm@FreeBSD-uk.eu.org>
2001-01-25 13:07:55 +00:00
nsouch
0c699761e2 Consider that the chipset may be in ECP mode (from BIOS settings)
even if mode PS/2 is forced with bootflags. As a matter of fact,
chipsets needs some extra configuration for accessing PS/2 mode
from ECP. The current patch is only relevant for generic chipsets
since specific code is supposed to deal with this during detection.
2001-01-25 10:51:41 +00:00
nyan
e497d85bcf Added necessary include for pc98. 2001-01-25 09:56:04 +00:00
jasone
6246d53c0d Remove CV_DECLARE(), which serves no useful purpose. 2001-01-25 07:29:54 +00:00
cokane
fb40cecf08 Add some description and clarification as to the use of the tdfx device.
Answers many questions I have recieved and has a short description of what
the driver actually does.
2001-01-25 06:58:53 +00:00
luigi
219a2624e1 Pass up errors returned by dummynet. The same should be done with
divert.
2001-01-25 02:06:38 +00:00
peter
ffa6143a8f Disable cy - it is now completely broken and needs non-trivial work. 2001-01-25 01:56:27 +00:00
jhb
95349eb329 - Doh, lock faultin() with proc lock in scheduler().
- Lock p_swtime with sched_lock in scheduler() as well.
2001-01-25 01:38:09 +00:00
jhb
2bb7d52e4c Back out over-aggressive locking of p->p_cred.
Requested by:	alfred
2001-01-25 01:09:44 +00:00
jhb
c84589fe1e Remove prototype for child_return(). 2001-01-24 22:00:13 +00:00
jhb
fc78cf242b - Change fork_exit() to take a pointer to a trapframe as its 3rd argument
instead of a trapframe directly.  (Requested by bde.)
- Convert the alpha switch_trampoline to call fork_exit() and use the MI
  fork_return() instead of child_return().
- Axe child_return().
2001-01-24 21:59:25 +00:00
julian
d039536316 Don't crash the kernel if the user tries to load a netgraph
module with the wrong version number.
2001-01-24 21:29:57 +00:00
phk
9e83e91395 DEVFS cloning for if_tap.
Submitted by:	Maksim Yevmenkin <m_evmenkin@yahoo.com>
2001-01-24 20:59:34 +00:00
jhb
8f7685fa4f - Remove some unused and unneeded atomic operations sitting in mp_machdep.c
that are already implemented in atomic.h.
- Fix SMP kernel builds.
2001-01-24 19:49:13 +00:00
jhay
b5b8fa9bc0 Newbusify ar(4). 2001-01-24 18:45:29 +00:00
dfr
819d06e129 Change cpuno to cpuid. 2001-01-24 17:12:37 +00:00
dfr
cd8c15f9e2 Fix typo. 2001-01-24 17:11:33 +00:00
wollman
d348219c78 Correct a comment. 2001-01-24 16:25:36 +00:00
jhb
c7b69b31a2 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
7e9eab8e8e Bump FreeBSD version to reflect changes to libc and libc_r. 2001-01-24 13:08:12 +00:00
jhb
ccb75c53c5 Add a new item to kinfo_proc: ki_sflag to mirror p_sflag. 2001-01-24 12:49:52 +00:00
jasone
cd97c8f6f2 Convert all simplelocks to mutexes and remove the simplelock implementations. 2001-01-24 12:35:55 +00:00
jhb
ff529a881e 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
f91002ae2c - Catch up to proc flag changes.
- Minimal proc locking.
- Use queue macros.
2001-01-24 11:28:36 +00:00
jhb
9ba952646e 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
391eb9e84d - 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
e60d6c91c9 - Catch up to proc flag changes. 2001-01-24 11:20:05 +00:00
jhb
27370a8708 - Catch up to proc flag changes.
- Assert sched_lock is held in proc_compare.
2001-01-24 11:15:59 +00:00
jhb
61f9769bdd - 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
cfa11c1b07 - Catch up to proc flag changes.
- Add proc locking for selwakeup() and selrecord().
2001-01-24 11:12:37 +00:00
jhb
fff6e3ff53 - Catch up to proc flag changes. 2001-01-24 11:11:35 +00:00
jhb
0bbbf07821 - 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
8ac5ec57f9 - Proc locking.
- Catch up to proc flag changes.
2001-01-24 11:08:02 +00:00
jhb
e4ed3d1d25 - 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
e47cbd857c - 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
956f6c959f - 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
6dc4c08ec1 - 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
62144ff854 - 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
58fa219215 Catch up to P_FOO -> PS_FOO changes in proc flags. 2001-01-24 10:44:01 +00:00
jhb
ff64252151 - Proc locking.
- P_FOO -> PS_FOO.
2001-01-24 10:43:25 +00:00
jhb
eb059639dd - 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
9515f553b6 - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
2001-01-24 10:38:58 +00:00
jhb
6f98eef946 - 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
193b4aced8 - Proc locking.
- P_FOO -> PS_FOO.
2001-01-24 10:36:47 +00:00
jhb
2a0c88ae19 - Proc locking.
- Bring across forwarded_statclock() fixes from i386 and alpha.
2001-01-24 10:36:21 +00:00
jhb
9f31d96548 - Proc locking around the vinumdaemon dinking with its flags.
- P_INMEM -> PS_INMEM.
2001-01-24 10:28:19 +00:00
jhb
0828bc3bfe Make mp_machdep.c be an optional file conditional on SMP. 2001-01-24 10:27:37 +00:00
jhb
a2fcfc567a Proc locking. 2001-01-24 10:27:11 +00:00
jhb
9e3015a286 Use queue macros. 2001-01-24 10:26:51 +00:00
jhb
beceb8caee Add a prototype for isa_irq_mask() to quiet a warning. 2001-01-24 10:25:44 +00:00
jhb
6e6c76c7d0 Wrap the IPI definitions and function prototypes in #ifdef SMP. 2001-01-24 10:25:09 +00:00
jhb
d52c0c6ea1 - 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
df9c3cf98b - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
2001-01-24 10:23:54 +00:00
jhb
23bb2d4bad - 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
c34c042a99 - Proc locking.
- P_INMEM -> PS_INMEM.
2001-01-24 10:16:23 +00:00
jhb
da946d8969 - 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
581f857bf7 - 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
f48160c48f - 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
a3fd111073 - 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
b2ab26c2b7 cpuno -> cpuid. 2001-01-24 10:04:32 +00:00
jhb
d506473705 Don't import the nonexistent astpending variable. 2001-01-24 10:03:05 +00:00
jhb
7b61119005 Wrap the startup code used by secondary processors in #ifdef SMP. 2001-01-24 10:01:53 +00:00
jhb
482ba83ff5 Remove the Xforward_irq IPI. 2001-01-24 10:01:13 +00:00
jhb
9945ab1a04 - 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
4888e39288 Remove unused locks: cpl, fast_intr, intr, mpintr. 2001-01-24 09:58:56 +00:00
jhb
f02fc13086 - Proc locking.
- P_OWEUPC -> PS_OWEUPC.
- Remove obsolete prototype for MD fork_return().
2001-01-24 09:56:49 +00:00
jhb
b1611f4267 - Remove Xforward_irq, cpl_lock, and fast_intr_lock.
- Add fork_exit.
2001-01-24 09:55:39 +00:00
jhb
07118968a1 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
54a1024949 - 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
e994d4f39f - Proc locking.
- P_INMEM -> PS_INMEM.
2001-01-24 09:49:49 +00:00
jhb
5cbe07ba8c - 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
7d8717edb0 - 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
f016f2f696 Call fork_exit() now instead of futzing around in assembly during a fork
return.
2001-01-24 09:43:26 +00:00
jhb
c4aad774b6 - 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
87a1f683c2 Fix a typo.
Reported by:	albert
2001-01-24 08:42:39 +00:00
hm
e09a1d15f7 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
a39fd0be31 Add missing include. 2001-01-24 06:54:24 +00:00
mckusick
2cf239a333 Never reuse AUTO_OID values.
Approved by:	Alfred Perlstein <bright@wintelcom.net>
2001-01-24 04:35:13 +00:00
jhb
24678cfc4c 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
bd55440dc2 #ifdef a local variable only used in debugging code.
Reviewed by:	-scsi
2001-01-24 01:46:57 +00:00
jhb
204e39abca Const'ify cam_sim.sim_name to quiet warnings.
Reviewed by:	-scsi
2001-01-24 01:46:18 +00:00
cg
ad9b75b8d8 don't grope around inside snd_dbuf structures as they will change in future 2001-01-24 01:36:15 +00:00
cg
63d51b135b fix certain cards failing to attach
Submitted by:	Russell Cattelan <cattelan@thebarn.com>
2001-01-24 01:27:31 +00:00
cg
3f9a54eb71 fix blocksizing for playback, implement blocksizing for record 2001-01-24 01:22:53 +00:00
cg
7d3f51788a some cosmetics, changed channel setup and revamped irq handling - ignore
repeated interrupts
2001-01-24 01:20:04 +00:00
cg
da008aa586 prevent excessively small buffer sizes resulting in hundreds of irqs per
second
2001-01-24 01:15:50 +00:00
jhb
5347f14027 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
71076fb810 Proc locking. 2001-01-24 00:35:12 +00:00
jhb
f0f2d7e83d - Proc locking.
- Protect calcru() with sched_lock.
2001-01-24 00:33:44 +00:00
jhb
7f22502c01 - Proc locking.
- Protect calcru() with sched_lock.
2001-01-24 00:28:07 +00:00
jhb
d48032d919 Proc locking. 2001-01-24 00:27:28 +00:00
jhb
05ee51d1fd Proc locking to protect p_ucred while we obtain additional references. 2001-01-24 00:26:19 +00:00
jhb
7f61d08541 - Proc locking.
- Use FreeBSD stackgap_init() semantics.
- Adjust some #ifdef's to hide unused variables.
2001-01-24 00:24:57 +00:00
jhb
f94d1d1f84 - Proc locking.
- Use NULL instead of 0.
2001-01-24 00:23:30 +00:00
mjacob
ed826b2127 "Rejected with status" is better than "Rejected for status". 2001-01-24 00:14:37 +00:00
jhb
f0e859069f Use selrecord() instead of doing the work ourselves. 2001-01-24 00:06:26 +00:00
jhb
20e05070da 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
6a6543f69a Use queue macros. 2001-01-24 00:01:42 +00:00
jhb
178a9bc8ea Proc locking. 2001-01-23 23:59:38 +00:00
jhb
6828646cc5 - 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
fb73177d57 Proc locking. 2001-01-23 23:51:56 +00:00
mjacob
f6221d8f93 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
c826bfbd81 Proc locking, mostly protecting p_ucred while obtaining additional
references.
2001-01-23 22:41:15 +00:00
jhb
3bcce57593 - Remove unused header include.
- Use queue macros.
2001-01-23 22:38:38 +00:00
jhb
c268e525d3 Proc locking to protect p_ucred while we obtain an additional reference. 2001-01-23 22:38:15 +00:00
jhb
b54863a2cc - 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
0a42e9edc9 Tag unused functions with __unused. 2001-01-23 22:24:26 +00:00
jhb
e52a3dbc17 Proc locking to protect p_ucred while we obtain another reference to it. 2001-01-23 22:23:25 +00:00
jhb
396796285c Use suser(9) instead of checking p->p_ucred->cr_uid directly. 2001-01-23 22:22:25 +00:00
jhb
527a57859e Remove a prototype for an unused and undefined debugging function. 2001-01-23 22:21:14 +00:00
jhb
9561c92386 Tag unused functions with __unused. 2001-01-23 22:18:41 +00:00
jhb
32350721ff - 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
e6a64d2cfe 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
6c229bbe49 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
3ebca2f4c3 - Proc locking.
- Use queue macros.
- Use NULL instead of 0 for pointers.

Reviewed by:	des
2001-01-23 22:13:07 +00:00
jhb
13abd6efd7 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
8c32a32066 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
jhb
5ecde0ad05 The ncv_card_intr function is only used in older versions of FreeBSD, so
move its prototype and definition inside the appropriate #ifdef's.
2001-01-23 22:06:10 +00:00
jhb
8cfd611d33 Use the 'slp' local variable that was otherwise unused instead of casting
the driver softc under the assumption that the first part of it was a
struct scsi_low_softc.
2001-01-23 22:05:07 +00:00
jhb
14851ec048 #if 0 out local variables only used in #if 0'd code and remove unused
local variables.
2001-01-23 22:02:08 +00:00
jhb
8a3c854cd4 Add curly braces ({}) around each struct speedtab to quiet warnings. 2001-01-23 22:00:05 +00:00
jhb
0287483ac3 Proc locking in the form of using the proc lock to protect p_ucred while
we obtain another reference to it for vnode operations.
2001-01-23 21:58:44 +00:00
jhb
41ef4a417c Axe unused local variable. 2001-01-23 21:53:44 +00:00
jhb
e366165f18 - Mark an unused function with __unused.
- Temporarily #if 0 some unused local variables.
2001-01-23 21:52:34 +00:00
jhb
c8edcaccfb Axe an unused static softc. 2001-01-23 21:51:26 +00:00
jhb
77bc0d1ccd Move a temporary #ifdef of code (just the #ifdef part) up so that it is
above the local variable declaration to quiet warnings about unused
variables.
2001-01-23 21:45:05 +00:00
jhb
fc1d89e75d Kill a warning by marking an unused function with __unused. 2001-01-23 21:43:47 +00:00
jhb
55e163980d Argh, atomic_store_rel -> atomic_store_rel_int. 2001-01-23 21:40:07 +00:00
jhb
b12abb0009 Woops, add in missing headers. 2001-01-23 21:39:15 +00:00
jhb
a3ac657f1f Proc locking. 2001-01-23 21:33:55 +00:00
jhb
7e8797a19c Use queue macros. 2001-01-23 21:32:02 +00:00
jhb
c339c345f5 - Add proc locking.
- Fix several bugs in the wait syscall, including freeing the actual
  proc start, freeing the args, freeing the prison, and other minor
  nits.
- Use appropriate queue(3) macros.
- Use zpfind() instead of walking zombproc ourselves.
2001-01-23 21:30:25 +00:00
kris
216b15914c Fix the vulnerability with TCP ECE packets recently fixed in ipfw.
This is untested, but believed to work.
2001-01-23 21:11:28 +00:00
jhb
a6a7540093 - Use proper atomic operations to make the run time initialization
controlled by svr_str_initialized be MP safe.
2001-01-23 21:07:16 +00:00
jhb
a5671be914 - Add necessary proc locking.
- Use proper atomic operations to make the run time initialization
  controlled by svr_str_initialized be MP safe.
- Use appropriate queue(3) macros where needed.
2001-01-23 21:06:30 +00:00
jhb
9dcfcfc840 FreeBSD doesn't have p_emuldata, and our stackgap_init() doesn't take an
argument.
2001-01-23 21:02:44 +00:00
jhb
ec1d1e9e28 Use proc lock to safely obtain references to p_ucred before vnode
operations.
2001-01-23 20:52:50 +00:00
jhb
729766c296 Protect calcru() with sched_lock. 2001-01-23 20:50:40 +00:00
mjacob
eb8c448a9c Do not do the commenting out the way that saves bytes and looks cleaner
to you. Do it the way Vox Populi wants it.
2001-01-23 16:35:33 +00:00
takawata
0d758740be Map BSS section in PECOFF executable.
Submitted by:	 KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
2001-01-23 16:19:37 +00:00
ume
247d9e1859 Add mibs to hold the number of forks since boot. New mibs are:
vm.stats.vm.v_forks
	vm.stats.vm.v_vforks
	vm.stats.vm.v_rforks
	vm.stats.vm.v_kthreads
	vm.stats.vm.v_forkpages
	vm.stats.vm.v_vforkpages
	vm.stats.vm.v_rforkpages
	vm.stats.vm.v_kthreadpages

Submitted by:	Paul Herman <pherman@frenchfries.net>
Reviewed by:	alfred
2001-01-23 14:32:01 +00:00
nyan
a5348a7a75 Added pc98 apm driver.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2001-01-23 12:37:15 +00:00
joerg
271766943f Mark the (ancient) MaxOptix Tahiti 1 drive as a known rogue that would
respond to all LUNs.

Reviewed by:	ken
2001-01-23 10:49:30 +00:00
hm
ab434887cd Remove useless variable vjlen.
Submitted by:	Sergio de Souza Prallon <prallon@tmp.com.br>
2001-01-23 10:01:55 +00:00
peter
d3ab9a5e47 In answer to the comment: /* XXX is it OK to block here? */, the answer
is definately NO! as we are in interrupt context and malloc() does a
KASSERT() to be sure.
2001-01-23 09:43:23 +00:00
wes
12b2e23029 When attempting to bind to an ephemeral port, if no such port is
available, the error return should be EADDRNOTAVAIL rather than
EAGAIN.

PR:		14181
Submitted by:	Dima Dorfman <dima@unixfreak.org>
Reviewed by:	Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
2001-01-23 07:27:56 +00:00
wollman
8bd9ff85b1 This file declares `struct timespec' so that we can have a single,
centralized declaration (this will become useful later when we declare
struct timespec in all the places it is supposed to be).
2001-01-23 04:44:04 +00:00
wollman
2ff8ac1036 Synchronize with some of my local changes. To quote:
* This file must be kept synchronized with <sys/timespec.h>.
 * It defines a structure which must be a type pun for
 * `struct timespec'; this structure is used in header files where
 * the ABI uses a `struct timespec' but standards prohibit its
 * definition.  (Currently only <sys/stat.h>.)
2001-01-23 04:40:54 +00:00
rwatson
dc1002d8c0 o The move to using VADMIN under vaccess() resulted in some system
calls returning EACCES instead of EPERM.  This patch modifies vaccess()
  to return EPERM instead of EACCES if VADMIN is among the requested
  rights.  This affects functions normally limited to the owners of
  a file, such as chmod(), as EPERM is the error indicating that
  privilege would allow the operation, rather than a chance in mandatory
  or discretionary rights.

Reported by:	bde
2001-01-23 04:15:19 +00:00
mckusick
f154a592bb Add function prototype for libc function sysctlnametomib() 2001-01-23 03:42:20 +00:00
jake
209674cbd7 Sigh. atomic_add_int takes a pointer, not an integer.
Pointy-hat-to:	des
2001-01-23 03:40:27 +00:00
des
a42173af54 Use atomic operations to update the stat counters. 2001-01-23 01:11:11 +00:00
luigi
cb05b9d344 Change critical section protection for dummynet from splnet() to
splimp() -- we need it because dummynet can be invoked by the
bridging code at splimp().

This should cure the pipe "stalls" that several people have been
reporting on -stable while using bridging+dummynet (the problem
would not affect routers using dummynet).
2001-01-22 23:04:13 +00:00
dwmalone
fb101c7f51 Free the kbd pointer when it isn't NULL, as opposed to when it is.
This was a typo in the M_ZERO patches.

Submitted by:	Mike Silbersack <silby@silby.com>
2001-01-22 22:54:02 +00:00
luigi
8159adfe2b Assorted bugfixes:
+ configuration: make sure that the NUL at the end of the config
   string is properly detected and handled, and the stats passed
   up via sysctl properly reflect which interfaces do bridging.
   (The whole config support might make good use of some cleanup
   in the future).

 + fixed some bugs related to the corruption of multicast and
   broadcast packets: make sure that for those packets the entire
   IP + ethernet header is in the mbuf, not in a cluster, so
   that writes performed in that area by the upper layers do
   not affect us.

 + performance: when calling m_pullup, make room for the ethernet header
   as well, we are going to add it in right after. Also, change an m_dup
   back to m_copypacket. The former is not necessary anymore now, and
   it did not help, anyways.

I will do a fast MFC because 95% of this patch is fixing bad bugs
and i doubt anyone would test the fix in CURRENT. Plus the last
two items mostly bring back some code which was already there in 4.0
times.
2001-01-22 22:34:53 +00:00
mjacob
8bc61e5793 Move (now) unused variable declaration inside the block (now commented out). 2001-01-22 22:22:38 +00:00
gibbs
dee148abf1 ahc_eisa.c:
Initialize rid to 0.  This doesn't seem to make any difference
	(the driver doesn't care what rid it gets and no-one seems to
	check rid's value), but follows standard conventions.

	Pass in our device_t to ahc_alloc().  We now use device_T
	softc storage, so passing NULL results in a panic.

	Set the unit number in our softc so that the driver core
	can retrieve it.

ahc_pci.c:
	Set the unit number in our softc so that the driver core
	can retrieve it.

aic7770.c:
	Insert our softc into the list of softcs when initialization
	is successful.

aic7xxx.c:
	Remove a workaround for an aic7895 bug we will never trigger.

	Add additional diagnostic info to ahc_dump_card_state().

	Always panic the system if a sequencer assertion fails.

	AHC_SCB_BTT is a "flag" not a "feature".  Check the right
	field in the softc.

	Replace a hard coded number with a constant.

	Guard against looping forever in ahc_pause_and_flushwork().
	A hot eject or card failure may make the intstat register
	return 0xFF, so limit the number of interrupts we'll process.

	Correct the code in ahc_search_qinfifo() that guarantees that
	the sequencer will see an abort collision if the qinfifo is
	modified when a DMA is in progress.  We now do this fixup
	after modifying the queue.  This guarantees that the HSCB
	we place at the head of the queue is not the same as the
	old head.  Using "next hscb" (guaranteed not to be the
	same as the first SCB) before clearing the queue could free
	up the original head hscb to be used during a remove operation
	placing it again at the head of the qinfifo.

aic7xxx.h:
	Reduce the maximum number of outstanding commands to 253 from
	254.  To handle our output queue correctly on machines that only
	support 32bit stores, we must clear the array 4 bytes at a
	time.  To avoid colliding with a DMA write from the sequencer,
	we must be sure that 4 slots are empty when we write to clear
	the queue.  This reduces us to 253 SCBs: 1 that just completed
	and the known three additional empty slots in the queue that
	preceed it.  Yahoo was able to force this race on one of their
	systems.  Interrupts were disabled for such a time that the
	entire output queue was filled (254 entries complete without
	any processing), and our 32bit write to clear the status clobbered
	one entry.

	Add a feature tag for devices that are removable.

aic7xxx.reg:
	Never use the sequencer interrupt value of 0xF0.  We need
	to guanrantee that an INTSTAT value of 0xFF can only occur
	during card failure or a hot-eject.

	Align the busy targets table with the begining of scratch
	space.  This seems to appease a chip bug in the aic7895.

aic7xxx.seq:
	Be sure to disable select-out after a bus free event that occurs
	early in a selection.  If we don't disable select-out, we will
	believe that it is enabled even though a new selection will never
	occur.

	Move the clearing of SELDI to just before a jump.  This appeases
	another chip bug of the aic7895.

	Make the target mode command loop a bit more efficient.

	AHC_SCB_BTT is a "flag" not a "feature".  Check the right
	field in the softc.

	Properly cleanup the last SCB we tested against should we
	fail to properly find an SCB for a reselection.

	Add some additional sequencer debugging code.

aic7xxx_freebsd.c:
	Limit the driver to 253 outstanding commands per adapter.

	Guard against overflow in timeout handling.

aic7xxx_inline.h:
	AHC_SCB_BTT is a "flag" not a "feature".  Check the right
	field in the softc.

aic7xxx_pci.c:
	Set the removable feature for the apa1480 cardbus and the 29160C
	Compact PCI card.

	Don't report high byte termination information for narrow cards.

	Use a PCI read rather than a questionable delay when fetching/setting
	termination settings.
2001-01-22 21:03:48 +00:00
ume
eaae652dc4 avoid conflicting #define symbol (s/FW_IFNLEN/IP6&/).
Obtained from:	KAME
2001-01-22 19:20:06 +00:00
julian
84c301f7b0 Add MTX_SPIN to an mtx_init( 2001-01-22 17:51:48 +00:00
ume
f4ad8f0e06 on in6_ifdetach(), do not remove default route mistakenly
Obtained from:	KAME
2001-01-22 13:02:10 +00:00
nyan
be11d2e149 Added PC-98 apm support.
Submitted by:	MURAMATSU Atsushi <amura@ma3.seikyou.ne.jp>
2001-01-22 11:27:25 +00:00