Commit Graph

24329 Commits

Author SHA1 Message Date
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
des
2df3945063 Call vm_zone_init() at the appropriate time.
Reviewed by:	jasone, jhb
2001-01-22 07:02:42 +00:00
des
70f4a96824 Give this code a major facelift:
- replace the simplelock in struct vm_zone with a mutex.

 - use a proper SLIST rather than a hand-rolled job for the zone list.

 - add a subsystem lock that protects the zone list and the statistics
   counters.

 - merge _zalloc() into zalloc() and _zfree() into zfree(), and
   move them below _zget() so there's no need for a prototype.

 - add two initialization functions: one which initializes the
   subsystem mutex and the zone list, and one that currently doesn't
   do anything.

 - zap zerror(); use KASSERTs instead.

 - dike out half of sysctl_vm_zone(), which was mostly trying to do
   manually what the snprintf() call could do better.

Reviewed by:	jhb, jasone
2001-01-22 07:01:50 +00:00
jasone
ebb2b48547 Print correct file name and line number in mtx_assert().
Noticed by:	jake
2001-01-22 05:56:55 +00:00
msmith
15072b1756 Plug a memory leak in AcpiOsDeleteSemaphore where the mutex is not properly
destroyed.

Submitted by:	bmilekic
2001-01-22 05:33:36 +00:00
julian
b776a74a2a remove stupid braino (recursive mutex)
tripped over by: PHK
2001-01-21 23:32:00 +00:00
phk
3058425f42 General cleanup. 2001-01-21 22:57:56 +00:00
jasone
fea289bf4f Move most of sys/mutex.h into kern/kern_mutex.c, thereby making the mutex
inline functions non-inlined.  Hide parts of the mutex implementation that
should not be exposed.

Make sure that WITNESS code is not executed during boot until the mutexes
are fully initialized by SI_SUB_MUTEX (the original motivation for this
commit).

Submitted by:	peter
2001-01-21 22:34:43 +00:00
des
30f25a749c First step towards an MP-safe zone allocator:
- have zalloc() and zfree() always lock the vm_zone.
 - remove zalloci() and zfreei(), which are now redundant.

Reviewed by:	bmilekic, jasone
2001-01-21 22:23:11 +00:00
phk
8b2619ab98 Update these netgraph drivers in current so that these changes can be
MFC'ed i due time.  I can't test it under current right now because
netgraph seems to do unethical things with mutexes.

musycc:
	Add status per channel.
	Reduce printf chattyness
	Keep error counters line if_mn does.
	Increase descriptor count.

if_mn:
	Support experimental unframed E1 lines.

These two drivers should share more code relating to framed channelized
TDM media in general (T1/E1/E3/T3, Sonet).  Anyone interested email me.
2001-01-21 22:16:20 +00:00
phk
c353a306c3 Convert a Debugger(3) to a panic(9) and a EINVAL.
Reminded by:	bde
2001-01-21 21:19:49 +00:00
jake
6a7cb81133 Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context.  This is also necessary
in order to context switch from sched_ithd() directly.

Reviewed By:	peter
2001-01-21 19:25:07 +00:00
imp
831116b833 wi has been converted to NEWCARD, so included it when pccard is
included.

Also, I forgot to update this to the new cis[] structure last night,
mainly due to the above omission.
2001-01-21 18:10:38 +00:00
sos
b6113cac71 Correct botchup in last commit that made older VIA chips fail... 2001-01-21 16:13:03 +00:00
ume
7c55ea95cf permit icmp6 type <= 256 (was 32).
Obtained from:	KAME
2001-01-21 16:07:08 +00:00
jasone
5e36e6ba79 Make the order of the static initializer for all_mtx match the order of
fields in struct mtx.

Found by:	jake
2001-01-21 11:05:02 +00:00
hm
edaa19fd37 Update the iwic driver: fix error handling for rx errors on the D-channel
which prevents erroneous packets from being put onto the protocol stack;
enhance error detection for B-channel HDLC errors; remove old cvs id´s.
2001-01-21 10:12:50 +00:00
imp
0e917ae244 Add a bunch of entries from NetBSD's if_ne_pcmcia.c v1.67. We still
need to verify that all the entries in pccard.conf are present in this
table.
2001-01-21 08:20:23 +00:00
imp
90da38b688 Use PCCARD_CIS_xxx #defines for the table of oem ids. These usually
translate to all NULLs (as for all the ones in this commit).
2001-01-21 08:15:37 +00:00
imp
25d55c6636 Convert the vendor/product cis strings to an array of CIS entries. This
allows us to use the PCCARD_CIS #defines generated to distinguish cards
that don't have a Manufacturer and OEM.
2001-01-21 08:09:00 +00:00
peter
e04645ca26 Remove APIC_INTR_DIAGNOSTIC - this has been disabled for some time now.
Remove some leftovers of removed SMP options.
2001-01-21 07:54:10 +00:00
jasone
8b989ad875 Remove MUTEX_DECLARE() and MTX_COLD. Instead, postpone full mutex
initialization until after malloc() is safe to call, then iterate through
all mutexes and complete their initialization.

This change is necessary in order to avoid some circular bootstrapping
dependencies.
2001-01-21 07:52:20 +00:00
peter
b654aa0202 Remove the MAYBE_PANIC and GUARD_CPU macros - unused. 2001-01-21 07:26:31 +00:00
jake
b11e081b3b Remove the per-cpu pages used for copy and zero-ing pages of memory
for SMP; just use the same ones as UP.  These weren't used without
holding Giant anyway, and the routines that use them would have to
be protected from pre-emption to avoid migrating cpus.
2001-01-21 06:50:03 +00:00
imp
62e3a85e72 Break the isa attachment of the Crystal Semiconductor 89x0 into two
parts: isa and pccard.  The isa one is known to work with an IBM
EtherJet ISA card.  The pccard one isn't known to work because the
EtherJet pccard I purchased recently arrived DOA :-(.  I'll commit the
pccard.conf entry when the replacement card arrives.

I plan on MFC this in a week or two.
2001-01-21 04:56:12 +00:00
imp
cd445931b4 remove duplicate entry that snuck in during the merge. 2001-01-21 04:33:12 +00:00
jake
a763e62721 Implement optimized PCPU accessors. These are necessary to support a
pre-emptable kernel.  For variables of size 4 bytes or less they compile
to a single instruction, which does not allow a process to migrate cpus
in the middle, and get the value for the "wrong" cpu.
2001-01-21 03:11:03 +00:00
mjacob
21c966158a Make residuals signed.
PR:		24221
2001-01-21 01:34:14 +00:00
jhb
4ee8d8995d - All of proc_compare needs sched_lock, so hold it for the for loop that
calls it rather than obtaining and releasing it a lot in proc_compare.
- Collect all of the data gathering and stick it just after the
  proc_compare loop.  This way, we only have to grab sched_lock once now
  when handling SIGINFO.  All the printf's are done after the values are
  calculated.

Submitted mostly by:	bde
2001-01-20 23:03:20 +00:00
ume
ba69c5a017 When ip6_fw_ctl() or soopt_mcopyout() return without success,
don't free mbuf.  It is already freed by these routins.

PR:		kern/24248
2001-01-20 22:37:24 +00:00
bmilekic
e5596dd432 When short of mbufs or mbuf clusters, we sleep on appropriate "counters."
The counters are incremented when a thread goes to sleep and decremented
either when a thread is woken up by another thread or when the sleep
times out. There existed a race where the sleep count could be decremented
twice resulting in an eventual underflow.
Move the decrementing of the "counters" to the thread initiating the sleep
and thus remedy the problem.
2001-01-20 21:29:10 +00:00
asmodai
f448f1f8f6 Document some more options.
Apologies to Bruce for not yet cleaning it up in sections.  Coming
soon.
2001-01-20 12:34:53 +00:00
jake
1284a94f83 Rename the ASSYM MTX_RECURSE to MTX_RECURSECNT in order to not conflict
with the flag of the same name.
2001-01-20 06:07:36 +00:00
jake
37c5ce65b4 Simplify the i386 asm MTX_{ENTER,EXIT} macros to just call the
appropriate function, rather than doing a horse-and-buggy
acquire.  They now take the mutex type as an arg and can be
used with sleep as well as spin mutexes.
2001-01-20 04:14:25 +00:00
grog
a8b82c3f50 Correct check for partition c. Previously the check was for drive 2,
which did not exactly have the desired result.

Submitted by:	Akira Watanabe <akira@myaw.ei.meisei-u.ac.jp>
2001-01-20 03:46:19 +00:00
wollman
ea03348371 Do not recursively include <sys/selinfo.h> from <sys/select.h>; all in-tree
clients have been fixed.  (So far as I can tell, all of the user-land
clients of <sys/select.h> do so vacuously, in the expectation that select()
might be declared there.)
2001-01-20 03:11:47 +00:00
jhb
4ec44ab6ef Temporarily disable the printf() for micruptime() going backwards, the
SIGXCPU signal, and killing of processes that exceed their allowed run
time until they can play nice with sched_lock.  Right now they are just
potentital panics waiting to happen.  The printf() has bitten several
people.
2001-01-20 02:57:59 +00:00
jake
7a02f89d89 - Make npx_intr INTR_MPSAFE and move acquiring Giant into the
function itself.
- Remove a hack to allow acquiring Giant from the npx asm trap
  vector.
2001-01-20 02:30:58 +00:00
wollman
603fb7f029 Finish deprecating <sys/select.h> in favor of <sys/selinfo.h> in kernel code. 2001-01-20 02:24:07 +00:00
jhb
acf5a8d2d2 Be more careful with sched_lock in the SIGINFO handler. Specifically, do
not hold sched_lock while calling ttyprintf().  If we are on a serial
console, then ttyprintf() will end up getting the sio lock, resulting in
a lock order violation.

Noticed by:	des
2001-01-20 02:04:44 +00:00
imp
56b0811452 Sync to pccarddevs 1.9 2001-01-20 02:04:26 +00:00
imp
4dd96a2569 Sync with NetBSD (again, after I got the most up to date file):
o 1.111 imp Sync with FreeBSD.
o 1.110 nonaka Add Roland SCP-55
o 1.109 ichiro add NANOSPEED ROOT-RZ2000 WLAN Card
o 1.108 ichiro add EMTAC A2424i 11Mbps WLAN Card
2001-01-20 02:03:53 +00:00
imp
2aae626031 sync with pccarddevs 1.8. 2001-01-20 01:49:17 +00:00
imp
fccedef3c9 Correct entry for RATOC REX_R280 to comply with style used in the rest
of the file.
2001-01-20 01:48:55 +00:00
imp
29958f3c69 Sync with pccarddevs. 2001-01-20 01:42:22 +00:00
imp
63db43a780 Sync with NetBSD. v1.98->1.107:
o 1.107 haya	Add IO Data CBIDE2 ata interface card.
o 1.106 jhawk	s/NULL}/NULL }/
o 1.105 thorpej	" " -> "&sp" in two entries, per Rafal Boni.
o 1.104 thorpej	Add SMC 2632W.  From Rafal Boni, kern/11775.
o 1.103 drochner add IBM microdrive
o 1.102 soren	Typo.
o 1.101 hubertf	Add ELSA WaveLAN card & a noname clone(?)
o 1.100 toddpw	Socket Comm. PC Card Ethernet, and tidy up naming.
o 1.99 msaitoh MELCO LPC2-TX, Telecom Device TCD-HPC100,
	        MACNICA ME1-JEIDA
o 1.98 imp	Sort BAY into numerical order. (already in FreeBSD)
2001-01-20 01:41:25 +00:00
wpaul
2ceeaae1ed Check the return value of sf_encap() and handle errors accordingly. 2001-01-20 00:50:51 +00:00
wpaul
a703e05f9b Set the OACTIVE flag if vr_encap() fails. 2001-01-20 00:47:55 +00:00
wpaul
7049e585af Silence compiler warnings. 2001-01-20 00:07:49 +00:00
wpaul
977d89a21f Bug fixes that I've put together while working on a project in the office:
if_vr: handle the case where vr_encap() returns failure: bust out of the
       packet sending loop instead of panicking. Also add some missing
       newlines to some printf()s.

if_dc: The miibus_read and miibus_write methods keep swapping in and
       out of MII mode by fiddling with CSR6 for cards with MII PHYs.
       This is a hack to support the original Macronix 98713 card which
       has built-in NWAY that uses an MII-like management interface
       even though it uses serial transceivers. Conditionalize this
       so that we only do this on 98713 chips, since it does bad things
       to genuine tulip chips (and maybe other clones).
2001-01-19 23:55:07 +00:00
mjacob
371aa8fa98 Make some attempt to accomodate kern/24221- propate residual to mt_resid
even if it might overflow.

If we do a read or set of hardware or logical block position, we also
clear Tape Frozen status.
2001-01-19 21:08:15 +00:00
jhb
6d693f912b Change the reinstall.debug target to depend on
{kernel,modules}-reinstall.debug rather than {kernel,modules}-reinstall.
Otherwise, the '.debug' portion of the target is lost, and you end up
reinstalling the non debug version instead of the debug version.
2001-01-19 19:43:45 +00:00
peter
b78891d717 Sync with GENERIC - drop I386_CPU 2001-01-19 14:23:51 +00:00
peter
e92245cb55 Convert apm from a bogus 'count' into a plain option. Clean out some
other cruft from the files.alpha and files.ia64 that were related to this.
2001-01-19 14:09:54 +00:00
peter
983568c1fd Zap unused #include "apm.h" 2001-01-19 13:56:31 +00:00
peter
a4025eb6eb Zap some cut-paste code that isn't used. It #included "apm.h" and
an apm include file but had no other apm references.
2001-01-19 13:55:08 +00:00
peter
3e52f243e4 Zap #include "apm.h" - it was not used. 2001-01-19 13:53:54 +00:00
peter
085d133e59 Use #ifdef DEV_NPX from opt_npx.h instead of #if NNPX > 0 from npx.h 2001-01-19 13:19:02 +00:00
peter
606cb3752f EEK! vm86bios.s has got #if NNPX > 0 code without a corresponding
#include "npx.h" - the code has been dead for a while and vm86 calls
have not been saving FPU context it seems.
2001-01-19 13:14:09 +00:00
peter
11019bbfee At great personal risk to my sanity, turn off COMPAT_OLDISA and the
two drivers that depend on it - ie and le.  The compat code has not been
disabled.
2001-01-19 13:06:37 +00:00
peter
66fd366d3c Add missing twe (3ware) and ahb (adaptec 174x) devices (!) 2001-01-19 13:04:58 +00:00
peter
bc9532f31d This conf file seems to have rotted quite a bit.. 2001-01-19 13:03:41 +00:00
peter
ec49373b08 Corresponding version bump for config with the DEV_FOO replacement for
the NFOO count option.
2001-01-19 12:50:16 +00:00
peter
be7df476d4 This driver needs COMPAT_OLDISA too. Sigh. 2001-01-19 11:46:57 +00:00
jhb
62d6835ac1 Add in a space that got lost in the previous commit in some debugging code
so that '&' becomes a binary operator and not a unary operator.
2001-01-19 11:43:13 +00:00
peter
5349e35cc2 EEK! I missed a couple of places with the 24->32 interrupt change. 2001-01-19 10:55:13 +00:00
peter
14bf80e300 Remove #defines for the old lock function names and spl0/splz 2001-01-19 10:52:47 +00:00
peter
a73c36d488 Remove reference to splz_unpend - it is long gone. 2001-01-19 10:51:13 +00:00
peter
7b830cf422 Catch a few alternative names for the syscall entry frame, eg: post-ELF
and int $0x80 entry methods.
2001-01-19 10:49:20 +00:00
peter
6dc8c6a1f7 apic_itrace_splz[] is unused 2001-01-19 10:48:35 +00:00
peter
0ae3008f16 Remove unused splsoftcambio(), splsoftcamnet(), splq() and splz() inlines. 2001-01-19 10:46:58 +00:00
peter
7b6417aacb Remove the now-empty ipl_funcs.c file on all platforms. 2001-01-19 09:59:56 +00:00
peter
4e4862d4e2 Remove the static splXXX functions and replace them by static __inline
stubs.  Remove the xxx_imask variables which have been all but gone for
a while.
2001-01-19 09:57:29 +00:00
jhb
5d6013b1ce - Remove an unused write_ivars function that didn't do anything anyway.
- Return NULL from mca_alloc_resource() instead of ENOENT if we are
  passed in an empty resource list.
2001-01-19 09:29:34 +00:00
peter
74fb668851 Fix a warning due to missing prototype. 2001-01-19 09:10:14 +00:00
peter
ab925f4f81 Fix a warning (the prototypes probably shouldn't be so over-zealously
#ifdef'ed though)
2001-01-19 09:07:16 +00:00
jhb
1b396c51c8 Warning police:
- Share the ex_stop() prototype in if_exvar.h
- Remove an unused local variable.
2001-01-19 09:04:56 +00:00
peter
044a84b843 Fix a maybe-not-so-harmless warning. 2001-01-19 09:02:40 +00:00
jhb
b1da41f4a5 Add in an interrupt type for this driver. I have no idea how this could
have ever worked without this.

Reviewed by:	peter
2001-01-19 08:55:14 +00:00
jhb
907cf4ad4b Revert revision 1.102. I don't think p_nice needs to be protected with
sched_lock, and I'm fairly certain P_TRACED will be protected with the
proc lock instead.

Pointed out indirectly by:	bde
2001-01-19 08:23:22 +00:00
dillon
de98c0fa63 Do not cluster with B_LOCKED buffers.
This is an odd one.  This patch appears to fix a panic related to background
bitmap writes (for FFS), though neither Kirk, Ian, or I can figure out how
B_CLUSTEROK could possibly be set on a bitmap block to cause the clustering
code to improperly cluster with a buffer undergoing a background write.

In anycase, the clustering code is very fragile and this patch helps with
that, as well as possibly fixing a bug Andre was having.

Suggested by: Ian Dowse <iedowse@maths.tcd.ie>
Testing by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
2001-01-19 05:31:07 +00:00
bmilekic
f651960449 Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb
2001-01-19 01:59:14 +00:00
sos
5818f21df4 When blocksize is set to 2352, alwas read 2352 bytes.
This means it might read more than just data, but that is exactly
what we want here (for reading VCD's fx)
2001-01-18 15:20:18 +00:00
jhb
221742d57c Protect p_stat and p_oncpu with sched_lock in forward_signal(). 2001-01-18 08:19:25 +00:00
itojun
df3d761304 workaround; be sure to initialize nd6 interface information when IPv6
interface address gets added.  this will avoid presenting EMSGSIZE when
outgoing interface is down (and never brought up).

sync with kame.
2001-01-18 06:07:53 +00:00
n_hibma
44bf835654 Nikon E990 and Nomad MP3 player Ids.
Submitted by:	pete@altadena.net
2001-01-18 00:15:49 +00:00
peter
65700a5d3f Argh! add card_if.h to the generated list. This fixes kernel builds for
those who haven't added 'NO_MODULES=off' to /etc/make.conf.
2001-01-17 22:36:49 +00:00
jedgar
32e6852634 - Reverse the order of two loop invariant to ensure strlcat() does not
attempt to read memory when siz is 0
- Clarify comments referring to strlcat() usage

PR:		24278, 24295
Submitted by:	Tony Finch <dot@dotat.at>
		Richard Kettlewell <rjk@greenend.org.uk>
Reviewed by:	-audit
2001-01-17 20:51:16 +00:00
dmlb
3b115ab48c Take advantage of the fixes to the pcic code that allows multiple
active memory maps. This removes the need to change the memory
map from common to attribute every time a packet is sent/received.

This increases performance and decreases cpu load (ping times on
slow machines improve by about 1.5ms).

Move out the old common memory/attrbiute memory hack functions to a
new header file to tidy up the main code. I want to keep them available
for a while.
2001-01-17 17:55:00 +00:00
peter
4942910125 Add NEWCARD hooks. This seems to work just fine. 2001-01-17 12:31:59 +00:00
sos
881fb24c9c Add first cut support for the ATA100 capable VIA82c686b. 2001-01-17 09:22:13 +00:00
jhb
ca5ddb1fa8 - Sort of lie and say that %eax is an output only and not an input for the
non-386 atomic_load_acq().  %eax is an input since its value is used in
  the cmpxchg instruction, but we don't care what value it is, so setting
  it to a specific value is just wasteful.  Thus, it is being used without
  being initialized as the warning stated, but it is ok for it to be used
  because its value isn't important.  Thus, we are only sort of lying when
  we say it is an output only operand.
- Add "cc" to the clobber list for atomic_load_acq() since the cmpxchgl
  changes ZF.
2001-01-17 02:15:11 +00:00
peter
779d59924e The stallion.c pci driver is broken. Emit a warning if compiling LINT. 2001-01-17 01:21:08 +00:00
peter
920faac2a2 Use pci_get_revid() rather than groping around the PCI register space
using the removed compatability register names.  (this broke LINT)
2001-01-17 01:17:00 +00:00
peter
34ce3a2360 Fix breakage unconvered by LINT - dont refer to undefined variables in
KASSERT()
2001-01-17 01:10:23 +00:00
luigi
06e2d4da2d Document data structures and operation on dummynet so next time
I or someone else browse through this code I do not have a hard
time understanding what is going on.
2001-01-17 01:09:40 +00:00
peter
27717c4b84 Minor tweaks to get these to stop breaking LINT. They still dont work
and emit warnings, but we need to get the test coverage elsewhere.
2001-01-17 01:08:50 +00:00
peter
7fcc516524 Special case for compiling LINT - just give a warning and continue on.
At least we have a chance at getting test compile coverage for the rest
of the kernel now.
2001-01-17 00:47:46 +00:00
peter
e439bec2cf Remove unneeded (and compile-breaking) #include "alpm.h" 2001-01-17 00:38:06 +00:00
luigi
0c07baea69 Some dummynet patches that I forgot to commit last summer.
One of them fixes a potential panic when bridging is used and
you run out of mbufs (though i have no idea if the bug has
ever hit anyone).
2001-01-16 23:49:49 +00:00
mjacob
c2e51aef93 Add tags quirk for IBM DNES drives.
PR:		21139
Obtained from:	campt@miralink.com
2001-01-16 17:02:16 +00:00
des
bb906fd508 Change NSWAPDEV to something else than the default value. 2001-01-16 10:48:58 +00:00
phk
51c2db8c76 These files have been on deathrow for a couple of months, no appeal. 2001-01-16 10:01:56 +00:00
ru
b1e891e706 Prepare for mdoc(7)NG. 2001-01-16 09:39:23 +00:00
peter
dc0c31e801 Stop doing runtime checking on i386 cpus for cpu class. The cpu is
slow enough as it is, without having to constantly check that it really
is an i386 still.  It was possible to compile out the conditionals for
faster cpus by leaving out 'I386_CPU', but it was not possible to
unconditionally compile for the i386.  You got the runtime checking whether
you wanted it or not.  This makes I386_CPU mutually exclusive with the
other cpu types, and tidies things up a little in the process.

Reviewed by:  alfred, markm, phk, benno, jlemon, jhb, jake, grog, msmith,
              jasone, dcs, des (and a bunch more people who encouraged it)
2001-01-16 09:10:34 +00:00
mjacob
27ff46e5cd Guard against overflow of the calculated timeout value. 2001-01-16 07:15:36 +00:00
jhb
8bd051461a Argh, disable the micro-ops again. I didn't test these adequately and
managed to lock up one of my machines in world again.

Pointy-hat to:	me
2001-01-16 04:48:38 +00:00
jhb
1828f64418 - Use "+a" instead of "=&a" for several constraints. This should fix
compiling errors where gcc would run out of registers.
- Add "cc" to the list of clobbers for micro-ops where we perform
  instructions that alter %eflags.
- Use xchgl instead of cmpxchgl to release a spin lock.  This could allow
  for more efficient register allocation as we no longer mandate that %eax
  be used.
- Reenable the optimized mutex micro-ops in the non-i386 case.
2001-01-16 03:45:54 +00:00
jhb
e5729f8a57 Free the intrhand name when free'ing a intrhand.
Submitted by:	bde
2001-01-16 02:17:51 +00:00
bmilekic
0c184cfc2b Add some KASSERTs valid if WITNESS is defined to verify that the mbuf
allocation routines are being called safely. Since we drop our relevant
mbuf mutex and acquire Giant before we call kmem_malloc(), we have
to make sure that this does not pave the way for a fatal lock order
reversal. Check that either Giant is already held (in which case it's safe
to grab it again and recurse on it) or, if Giant is not held, that no
other locks are held before we try to acquire Giant.

Similarily, add a KASSERT valid in the WITNESS case in m_reclaim() to
nail callers who end up in m_reclaim() and hold a lock.

Pointed out by: jhb
2001-01-16 01:53:13 +00:00
jasone
7039671ae9 Implement condition variables. 2001-01-16 01:00:43 +00:00
mjacob
cef3dc7af2 Use the residual from a spacing operation to try and figure out where
we *really* are.

It should be noted that there is a degenerate case where soft tape
location will be lost (not causing a frozen state- but causing
the loss of reporting fileno/blockno)- that's where you backspace
over a filemark- you stop backspacing as soon as you cross the
filemark, but you have no idea what the record number now is because
you have no idea how many records you are into the file you just
backed into. Such is life.

While I'm at it, also pick up residuals from writing filemarks.

PR:		24222
2001-01-16 00:53:45 +00:00
mjacob
38dcec0505 Get rid of those pesky "driver mistake" messages... destroy the create_d dev_t
when you take down the device.

Reviewed by:	audit@freebsd.org (Warner, Justin)
2001-01-16 00:30:37 +00:00
jhb
879e58da0c - Fix atomic_load_* and atomic_store_* to generate functions for atomic.c
that modules can call.
- Remove the old gcc <= 2.8 versions of the atomic ops.
- Resort the order of some things in the file so that there is only
  one #ifdef for KLD_MODULE, and so that all WANT_FUNCTIONS stuff is
  moved to the bottom of the file.
- Remove ATOMIC_ACQ_REL() and just use explicit macros instead.
2001-01-16 00:18:36 +00:00
mjacob
7db03d9320 Fix PR 24220 by using the periph private field0 for a CCB for not
only CCB type but also extra flags- one of which can be "position
updated".

In other changes: Add in a SA_QUIRK_NO_CPAGE quirk so that it's possible
to avoid using a (broken) device's implementation of he DEVICE COMPRESSION
page.

Also do a couple of printout cleanups.

As per some discussion on FreeBSD-scsi, skip doing tape flushing
if we're reading tape logical block location (MTIOCRDSPOS).
2001-01-15 22:28:11 +00:00
markm
688ed1320f Clean up Makefile, and remove the last vestiges of NOBLOCKRANDOM. 2001-01-15 19:35:00 +00:00
mjacob
5708658e84 Add was_fabric_dev/fabric_dev tags to our local FC database structure
(so we can see rapidly whether something was a fabric device but is
now gone).

Add a tag which says what role this adapter should take. It can take
on the value of None, Target, Initiator or Both. None is useful for
warm failover purposes. Remove the ISP_CFG_NOINIT silliness since
a role of "None" does this.

Add a isp_lastmbxcmd tag to store the opcode for the last mailbox
command used.
2001-01-15 18:40:37 +00:00
mjacob
8d07c480d9 Put in offset definitions for FPM and FBM registers, plus just enough
bits defined so we can reset them.
2001-01-15 18:37:14 +00:00
mjacob
6ecc8a9728 Set default adapter role. 2001-01-15 18:36:39 +00:00
mjacob
be10817665 Use the isp_lastmbxcmd tag to report timed out mailbox commands.
Arrrggghhhh! Very likely fix 22650 by remembering to, ahem, set
CAM_AUTOSNS_VALID when one has sense data.
2001-01-15 18:36:09 +00:00
mjacob
6e6cef101a Do more cleanup of the usage of 0..125 for F-port topologies. 2001-01-15 18:34:49 +00:00
mjacob
c471cf10f1 When resetting the Qlogic 2X00 units, reset the FPM (Fibre Protocol
Module) and FBM (Fibre Buffer Modules). Also remember to clear the
semaphore registers. Tell the RISC processor to not halt on FPM
parity errors.

Throw out the ISP_CFG_NOINIT silliness and instead go to the use of
adapter 'roles' to see whether one completes initialization or not
(mostly for Fibre Channel). The ultimate intent, btw, of all of this
is to have a warm standby adapter for failover reasons.  Because
we do roles now, setting of Target Capable Class 3 service parameters
in the ICB for the 2x00 cards reflects from role. Also, in isp_start,
if we're not supporting an initiator role, we bounce outgoing commands
with a Selection Timeout error. Also clean out the TOGGLE_TMODE
goop for FC- there is no toggling of target mode like there is
for parallel SCSI cards.

Do more cleanup with respect to using target ids 0..125 in F-port
topologies. Also keep track of things which *were* fabric devices
so that when you rescan the fabric you can notify the outer layers
when fabric devices go away.

Only force a LOGOUT for fabric devices if they're still logged in
(i.e., you cat their Port Database entry. Clean up the Get All Next
scanning.

Finally, use a new tag in the softc to store the opcode for the
last mailbox command used so we can report which opcode timed
out.
2001-01-15 18:33:08 +00:00
iedowse
5c5ba0de81 The ffs superblock includes a 128-byte region for use by temporary
in-core pointers to summary information. An array in this region
(fs_csp) could overflow on filesystems with a very large number of
cylinder groups (~16000 on i386 with 8k blocks). When this happens,
other fields in the superblock get corrupted, and fsck refuses to
check the filesystem.

Solve this problem by replacing the fs_csp array in 'struct fs'
with a single pointer, and add padding to keep the length of the
128-byte region fixed. Update the kernel and userland utilities
to use just this single pointer.

With this change, the kernel no longer makes use of the superblock
fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c
to indicate that these fields must be calculated for compatibility
with older kernels.

Reviewed by:	mckusick
2001-01-15 18:30:40 +00:00
hm
d6384b91d4 it seems that a commit to i4b/drivers/i4b_ispppsubr.c on 2000-01-12 has
broken the handling of uncompressed VJ packets. The attached diff should
hopefully fix that.
Submitted by:	Thomas Moestl <tmoestl@gmx.net>
Reviewed by:	Sergio de Souza Prallon <prallon@tmp.com.br>
2001-01-15 14:58:46 +00:00
hm
332f302797 Reenable support for FreeBSD 4.x and possibly the other supported BSD's 2001-01-15 14:54:43 +00:00
toshi
0fca655b38 Add support for SMC91C100FD chip of MELCO LPC-TX.
sn1 at port 0x240-0x24f irq 10 slot 0 on pccard0
sn1:  SMC91C100FD UTP MAC address 00:a0:dc:22:26:8c

Submitted by:	"KOMURO" <komujun@nifty.com>
2001-01-15 12:01:14 +00:00
dillon
ac43de4213 Make NSWAPDEV reasonable so people do not mistakenly use unreasonable
values when creating custom kernels from LINT.

Suggested-by: "Louis A. Mamakos" <louie@TransSys.COM>
2001-01-15 06:45:01 +00:00
peter
95938d30bd Implement an optimization for INTREN/INTRDIS that bde pointed out last
time I tinkered around here.  Since INTREN is called from the interrupt
critical path now, it should not be too expensive.  In this case, we
look at the bits being changed to decide which 8 bit IO port to write to
rather than unconditionally writing to both.  I could probably have gone
further and only done the write if the bits actually changed, but that
seemed overkill for the usual case in interrupt threads.

[an outb is rather expensive when it has to cross the ISA bus]
2001-01-15 04:18:58 +00:00
joe
d73659400d Instead of hard coding the major numbers for IDE and SCSI disks
look in the device's cdevsw for the D_DISK flag.
2001-01-14 23:33:50 +00:00
julian
5c148d65ef Add a generic "queued function callin" mechanism
Use it to implement (hopefully) SMP safe node/hook addition
and removal.
Fix some debug stuff.
2001-01-14 23:25:54 +00:00
sos
c06b370f5c Use prober atomic operations when test&set'ing ->active.
This turns some of my lockups under SMP into spontanious reboots...
2001-01-14 19:36:20 +00:00
des
3b4704d90b Add {ACD,AST,ATAPI,ATA}_DEBUG.
Approved by:	sos
2001-01-14 19:03:53 +00:00
phk
bd904c548a A bit of sanity-checking in bioqdisksort(): panic if we recurse. 2001-01-14 18:48:42 +00:00
mjacob
2fbc843cf8 The size of kinfo_proc on an alpha is 904 (not 640). 2001-01-14 18:21:19 +00:00
des
d7ab45ad14 The Linuxulator needs sysvipc to work. 2001-01-14 18:16:01 +00:00
des
91c8ffb52c Use predictable internal names for the sysvipc modules, so we have a
chance of getting dependencies working.
2001-01-14 18:04:30 +00:00
markm
5c5d1dadd5 Remove NOBLOCKRANDOM as a compile-time option. Instead, provide
exactly the same functionality via a sysctl, making this feature
a run-time option.

The default is 1(ON), which means that /dev/random device will
NOT block at startup.

setting kern.random.sys.seeded to 0(OFF) will cause /dev/random
to block until the next reseed, at which stage the sysctl
will be changed back to 1(ON).

While I'm here, clean up the sysctls, and make them dynamic.
Reviewed by:		des
Tested on Alpha by:	obrien
2001-01-14 17:50:15 +00:00