Commit Graph

23173 Commits

Author SHA1 Message Date
Peter Wemm
5e12cd9b80 Argh, I have fixed this cut/paste error twice before. I must have
committed the wrong patch. :-(  sn_pccard_products[] should have
been static anyway.
2000-11-25 07:25:08 +00:00
Jonathan Lemon
747fa57549 Update to reflect the disappearance of getsock().
Found by:  LINT
2000-11-25 07:16:06 +00:00
Jonathan Lemon
14db7f978b Correct a misnamed argument hidden behind a #ifdef DEBUG
Found by:  LINT
2000-11-25 07:04:43 +00:00
Jonathan Lemon
e82ac18e52 Revert the last commit to the callout interface, and add a flag to
callout_init() indicating whether the callout is safe or not.  Update
the callers of callout_init() to reflect the new interface.

Okayed by: Jake
2000-11-25 06:22:16 +00:00
Jonathan Lemon
6e47e42f8d Don't attach the interface twice. While I'm here, add a driver
mutex.
2000-11-25 06:04:18 +00:00
Peter Wemm
c20d96e7c4 Regenerate. Note that pccarddevs_data.h is not used. 2000-11-25 03:43:37 +00:00
Peter Wemm
1d75be41ac Add Kingston and the KNE-PC2 card 2000-11-25 03:42:06 +00:00
Peter Wemm
b3d39a56ae Update the ed driver to probe and attach under a NEWCARD kernel (I was
using a cardbus based system with pccbb providing the pcic interface).
Something isn't quite right.. when the driver allocates and activates
its resources, the IO space that was requested reads as all zeros (versus
the original 0xff's as it normally is when there is no device responding).

Also, deactivate the resources before releasing them.  OLDCARD doesn't
seem to care but NEWCARD/CARDBUS get rather unhappy if you release
a resource that hasn't been deactivated yet.

Make pcic_p.c only compile with oldcard kernels.
2000-11-25 03:36:09 +00:00
Jake Burkholder
249849e0b9 - Rename callout_reset to _callout_reset and add a flags argument.
- Add macros callout_reset, which does the obvious, and
  mp_callout_reset, which passes the CALLOUT_MPSAFE flag.
2000-11-25 03:34:49 +00:00
Peter Wemm
3f964411b5 Make the xxxFILES= list generation generic. This makes it easier to add
things like MFILES= or CONFFILES= without having to modify config code.
2000-11-25 03:25:34 +00:00
Alfred Perlstein
ed0fe1449c add threadsafe version of inet_ntoa (inet_ntoa_r takes a buffer to fill)
this is used by some debugging functions
2000-11-25 03:14:31 +00:00
Alfred Perlstein
d28632c097 These files are mpsafe. 2000-11-25 03:01:05 +00:00
Roger Hardiman
0eaa901ba7 Print a warning when we detect a Realtek 8139B chip
(identified by the IO map being 256 bytes long instead of 128)

This chip works very unreliably on my Lanner embedded PC with the rl driver.
Lots of watchdog timeouts or poor performance.

Forcing the media type to 10 Meg (ifconfig rl0 media 10baseT/UTP) is a good
workaround.

This looks very similar to the problem reported in PR kern/18790

It is interesting to note that the linux driver has lots of special
case code for this chip.
2000-11-24 17:36:07 +00:00
Mark Murray
9dd471dfa5 Add a module makefile for if_ep.
This is not enabled by default, as the module is missing a bunch of
useful stuff (like the ability to unload).

Not objected to by:	mdodd
2000-11-24 17:04:51 +00:00
Bosko Milekic
a352dd9a71 Fixup (hopefully) bridging + ipfw + dummynet together...
* Some dummynet code incorrectly handled a malloc()-allocated pseudo-mbuf
  header structure, called "pkt," and could consequently pollute the mbuf
  free list if it was ever passed to m_freem(). The fix involved passing not
  pkt, but essentially pkt->m_next (which is a real mbuf) to the mbuf
  utility routines.

* Also, for dummynet, in bdg_forward(), made the code copy the ethernet header
  back into the mbuf (prepended) because the dummynet code that follows expects
  it to be there but it is, unfortunately for dummynet, passed to bdg_forward
  as a seperate argument.

PRs: kern/19551 ; misc/21534 ; kern/23010
Submitted by: Thomas Moestl <tmoestl@gmx.net>
Reviewed by: bmilekic
Approved by: luigi
2000-11-23 22:25:03 +00:00
Matthew Dillon
e0be78f6dc Forgot to patch this file in file descriptor race fix commit
Submitted-by: "Danny J. Zerkel" <dzerkel@columbus.rr.com>
2000-11-23 11:05:14 +00:00
Marcel Moolenaar
cc6ca9b35c o Change the argument of linux_sigreturn to be a pointer to a
struct sigframe. We need more than only the signal context.

o  Properly convert the signal mask when setting up the signal
   frame in linux_sendsig and properly convert it back in
   linux_sigreturn.

Do some cleanups and improve style while here.
2000-11-23 08:55:30 +00:00
Marcel Moolenaar
e26cc4467b Change the argument of linux_sigreturn to be a pointer to a
struct sigframe.
2000-11-23 08:53:19 +00:00
Bill Paul
0b32bab160 Add a forgotten mutex_exit()/KUE_UNLOCK() to kue_init(). 2000-11-23 05:58:48 +00:00
Marcel Moolenaar
466b14d758 Don't unregister the ioctl handlers before we verified we
can unload. Doing so leaves the linuxulator in a crippled
state (no ioctl support) when Linux binaries are run at
unload time.

While here, consistently spell ELF in capitals and perform
some minor style improvements.

ELF spelling submitted by: asmodai
2000-11-23 03:21:58 +00:00
John Baldwin
f377b2b19e Fix the KTR tracepoints for mtx_enter/exit/try_enter to properly order the
parameters for the KTR_EXTEND case.
2000-11-23 00:38:45 +00:00
Bill Paul
bade6e5e6b Update the probe some more to deal with 16/32 bit issues. If the chip
is already in 32-bit mode, we need to be able to detect this and still
read the chip ID code. Detecting 32-bit mode is actually a little
tricky, since we want to avoid turning it on accidentally. The easiest
way to do it is to just try and read the PCI subsystem ID from the
bus control registers using 16-bit accesses and compare that with the
value read from PCI config space. If they match, then we know we're in
16-bit mode, otherwise we assume 32-bit mode.
2000-11-23 00:28:43 +00:00
Archie Cobbs
7cc2023054 Add one2many subdirectory (previously forgotten). 2000-11-22 19:04:42 +00:00
Jeroen Ruigrok van der Werven
e255a226a2 Reduce number of #ifdef nestings.
Submitted by:	bde
2000-11-22 14:38:30 +00:00
Ruslan Ermilov
f4d874a1db mdoc(7) police: do not split author names in the AUTHORS section. 2000-11-22 09:35:58 +00:00
Ruslan Ermilov
1b7b85c4d6 mdoc(7) police: use the new feature of the An macro. 2000-11-22 08:47:35 +00:00
Jake Burkholder
553629ebc9 Protect the following with a lockmgr lock:
allproc
	zombproc
	pidhashtbl
	proc.p_list
	proc.p_hash
	nextpid

Reviewed by:	jhb
Obtained from:	BSD/OS and netbsd
2000-11-22 07:42:04 +00:00
Doug Rabson
8707b6f032 Protect the bounce page list with a mutex instead of using splhigh(). 2000-11-22 07:16:51 +00:00
John Baldwin
0959cc6680 Ahem, fix the disclaimer portion of the copyright so it disclaim's the
voices in my head.  You can sue the voices in Bill Paul's head all you
want.

Noticed by:	jhb
2000-11-21 21:10:15 +00:00
Julian Elischer
93cded6e45 Devices that are running at splimp MUST use ng_queue_data()
instead of ng_send_data().
The latter could lead to running the IP stack at splimp
instead of splnet, (among other problems) (that MAY be safe
but I wouldn't count on it).

Noticed while preparing a new set of netgraph stuff.
2000-11-21 20:48:54 +00:00
Jonathan Lemon
4a476efa51 Protect p_wchan with sched_lock in selwakeup(). 2000-11-21 20:22:34 +00:00
Mark Murray
39413503a4 Assembler fixes.
Fix opcodes that were typed as ".byte 0xNN, 0xMM" when an older
assembler could not recognise the newer Pentium instructions.
Reviewed by:	jhb
2000-11-21 20:16:49 +00:00
Mark Murray
5855006767 Add a consistent API to a feature that most modern CPUs have; a fast
counter register in-CPU.

This is to be used as a fast "timer", where linearity is more important
than time, and multiple lines in the linearity caused by multiple CPUs
in an SMP machine is not a problem.

This adds no code whatsoever to the FreeBSD kernel until it is actually
used, and then as a single-instruction inline routine (except for the
80386 and 80486 where it is some more inline code around nanotime(9).

Reviewed by:	bde, kris, jhb
2000-11-21 19:55:21 +00:00
Alan Cox
c6fa9f78d2 Provide a new interface for the user of aio_read() and aio_write() to request
a kevent upon completion of the I/O.  Specifically, introduce a new type
of sigevent notification, SIGEV_EVENT.  If sigev_notify is SIGEV_EVENT,
then sigev_notify_kqueue names the kqueue that should receive the event
and sigev_value contains the "void *" is copied into the kevent's udata
field.

In contrast to the existing interface, this one: 1) works on
the Alpha 2) avoids the extra copyin() call for the kevent because all
of the information needed is in the sigevent and 3) could be
applied to request a single kevent upon completion of an entire lio_listio().

Reviewed by:	jlemon
2000-11-21 19:36:36 +00:00
John Baldwin
0fb3a41200 Stop handcoding a couple of instructions since gas 2.10 can properly
assemble 16-bit code.

Noticed by:	markm
2000-11-21 18:36:10 +00:00
Julian Elischer
07076ce1f7 Bump the buffersize from 0x1000 to 0x4000.
0x1000 gets underflows on my dell 7500 whenever I moved the mouse.
(reported as "hwptr went backwards...", with jumpy sound)
Sounds great now....
2000-11-21 12:22:11 +00:00
Mike Smith
6e64832134 Don't test the return value from the actual command when determining
success/failure for submission of the command.  The caller will want
to deal with this itself.
2000-11-21 06:58:24 +00:00
Andrew Gallatin
c75fa7f70c fix isa DMA on pyxis based machines:
- move the call to cia_init_sgmap() to after we've determined if we're a pyxis
- convert needed splhigh() in cia_sgmap_invalidate_pyxis() to disable_intr()

Previously, any isa DMA on a pyxis based machine would cause a panic
in cia_sgmap_invalidate_pyxis() because the pyxis workaround was never
setup.

- while i'm at it, convert needed splhigh() in cia_swiz_set_hae_mem to
disable_intr()
2000-11-21 03:25:31 +00:00
Poul-Henning Kamp
d7450ce6d5 Make programs which still #include <machine/{mouse,console}.h> fail
at compiletime, with an explanatory error message.  Previously they
would only get a warning.

These files will be finally removed 2001-01-15
2000-11-20 22:00:25 +00:00
Ruslan Ermilov
d5874785b9 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 17:05:46 +00:00
Julian Elischer
06525b98f2 Duh. These have been sitting in my tree since I committed this stuff.
Thes are identical to what I committed except that they had the correct
copyright headers. This is what I was SUPPOSED to have checked in..
2000-11-20 13:43:40 +00:00
KATO Takenori
76b86dfba6 Merged from sys/i386/i386/machdep.c revision 1.421. 2000-11-20 12:06:08 +00:00
Kirk McKusick
71868b020d More aggressively rate limit the growth of soft dependency structures
in the face of multiple processes doing massive numbers of filesystem
operations. While this patch will work in nearly all situations, there
are still some perverse workloads that can overwhelm the system.
Detecting and handling these perverse workloads will be the subject
of another patch.

Reviewed by:	Paul Saab <ps@yahoo-inc.com>
Obtained from:	Ethan Solomita <ethan@geocast.com>
2000-11-20 06:22:39 +00:00
Alfred Perlstein
830fedd28f Accept filters broke kernels compiled without options INET.
Make accept filters conditional on INET support to fix.

Pointed out by: bde
Tested and assisted by: Stephen J. Kiernan <sab@vegamuse.org>
2000-11-20 01:35:25 +00:00
Robert Watson
7f112b0489 o Export cp_time ("CPU time statistics") using SYSCTL_OPAQUE.
This removes a reason that systat requires setgid kmem.  More to
  come.
2000-11-20 00:44:58 +00:00
Robert Watson
aa5429970c o Export nchstats ("VFS cache effectiveness statistics") using
SYSCTL_OPAQUE.  This removes a reason that systat requires
  setgid kmem.  More to come.
2000-11-20 00:41:11 +00:00
Robert Watson
cee313c431 o Export dmmax ("Maximum size of a swap block") using SYSCTL_INT.
This removes a reason that systat requires setgid kmem.  More to
  come.
2000-11-20 00:39:04 +00:00
Scott Long
affec73ebd Disable calling timeout() when doing bio. It was causing more prolems than
solving.  This will be fixed for real soon.
2000-11-19 23:46:21 +00:00
David Malone
32af0d74f0 Make sbcompress use the new M_WRITABLE macro. Previously sbcompress
could not compress into clusters. This could result in lots of
wasted clusters while recieving small packets from an interface
that uses clusters for all it's packets.

Patch is partially from BSDi (limiting the size of the copy) and
based on a patch for 4.1 by Ian Dowse <iedowse@maths.tcd.ie> and
myself.

Reviewed by:	bmilekic
Obtained From:	BSDi
Submitted by:	iedowse
2000-11-19 22:22:47 +00:00
Doug Rabson
35cd89e7e5 Convert various calls to splhigh() to disable_intr() since splhigh() is
now a no-op.
2000-11-19 12:28:42 +00:00
Doug Rabson
bcc542cb4e We don't need <stddef.h> for offsetof() any more. 2000-11-19 12:26:14 +00:00
Jake Burkholder
fa2fbc3dac - Protect the callout wheel with a separate spin mutex, callout_lock.
- Use the mutex in hardclock to ensure no races between it and
  softclock.
- Make softclock be INTR_MPSAFE and provide a flag,
  CALLOUT_MPSAFE, which specifies that a callout handler does not
  need giant.  There is still no way to set this flag when
  regstering a callout.

Reviewed by:	-smp@, jlemon
2000-11-19 06:02:32 +00:00
Matthew Dillon
936524aa02 Implement a low-memory deadlock solution.
Removed most of the hacks that were trying to deal with low-memory
    situations prior to now.

    The new code is based on the concept that I/O must be able to function in
    a low memory situation.  All major modules related to I/O (except
    networking) have been adjusted to allow allocation out of the system
    reserve memory pool.  These modules now detect a low memory situation but
    rather then block they instead continue to operate, then return resources
    to the memory pool instead of cache them or leave them wired.

    Code has been added to stall in a low-memory situation prior to a vnode
    being locked.

    Thus situations where a process blocks in a low-memory condition while
    holding a locked vnode have been reduced to near nothing.  Not only will
    I/O continue to operate, but many prior deadlock conditions simply no
    longer exist.

Implement a number of VFS/BIO fixes

	(found by Ian): in biodone(), bogus-page replacement code, the loop
        was not properly incrementing loop variables prior to a continue
        statement.  We do not believe this code can be hit anyway but we
        aren't taking any chances.  We'll turn the whole section into a
        panic (as it already is in brelse()) after the release is rolled.

	In biodone(), the foff calculation was incorrectly
        clamped to the iosize, causing the wrong foff to be calculated
        for pages in the case of an I/O error or biodone() called without
        initiating I/O.  The problem always caused a panic before.  Now it
        doesn't.  The problem is mainly an issue with NFS.

	Fixed casts for ~PAGE_MASK.  This code worked properly before only
        because the calculations use signed arithmatic.  Better to properly
        extend PAGE_MASK first before inverting it for the 64 bit masking
        op.

	In brelse(), the bogus_page fixup code was improperly throwing
        away the original contents of 'm' when it did the j-loop to
        fix the bogus pages.  The result was that it would potentially
        invalidate parts of the *WRONG* page(!), leading to corruption.

	There may still be cases where a background bitmap write is
        being duplicated, causing potential corruption.  We have identified
        a potentially serious bug related to this but the fix is still TBD.
        So instead this patch contains a KASSERT to detect the problem
  	and panic the machine rather then continue to corrupt the filesystem.
	The problem does not occur very often..  it is very hard to
	reproduce, and it may or may not be the cause of the corruption
	people have reported.

Review by: (VFS/BIO: mckusick, Ian Dowse <iedowse@maths.tcd.ie>)
Testing by: (VM/Deadlock) Paul Saab <ps@yahoo-inc.com>
2000-11-18 23:06:26 +00:00
Matthew Dillon
ef0646f9d8 Add the splvm()'s suggested in PR 20609 to protect vm_pager_page_unswapped().
The remainder of the PR is still open.

PR: kern/20609 (partial fix)
2000-11-18 21:11:23 +00:00
Matthew Dillon
279d722604 This patchset fixes a large number of file descriptor race conditions.
Pre-rfork code assumed inherent locking of a process's file descriptor
    array.  However, with the advent of rfork() the file descriptor table
    could be shared between processes.  This patch closes over a dozen
    serious race conditions related to one thread manipulating the table
    (e.g. closing or dup()ing a descriptor) while another is blocked in
    an open(), close(), fcntl(), read(), write(), etc...

PR: kern/11629
Discussed with: Alexander Viro <viro@math.psu.edu>
2000-11-18 21:01:04 +00:00
David Malone
ca89ee278e Further use of M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Approved by:	msmith
2000-11-18 15:21:22 +00:00
David Malone
99cdf4ccb2 Add the use of M_ZERO to netgraph.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
Submitted by:	archie
Approved by:	archie
2000-11-18 15:17:43 +00:00
Søren Schmidt
374940a184 Fix a braino .. 2000-11-18 12:14:35 +00:00
Cameron Grant
612276f48c do not blindly assume 8khz is supported on open(). try for 8khz but respect
minspeed/maxspeed specified by the hw driver.

Submitted by:	Andrew Gordon <arg@arg1.demon.co.uk>
2000-11-18 03:43:04 +00:00
Boris Popov
f2b1e0d206 Use vop_defaultop() instead of ntfs_bypass().
PR:		kern/22756
2000-11-18 02:47:12 +00:00
John Baldwin
b6b55e27a4 Release sched_lock very briefly to give interrupts a chance to fire if we
are in softclock() for a long time.  The old code already did an
splx()/slphigh() pair here, I just missed adding in the equivalent mutex
operations on sched_lock earlier.
2000-11-18 00:21:00 +00:00
Tor Egge
e5c5b82950 Don't attempt to cluster write buffers where the VMIO flag isn't set. 2000-11-17 23:40:08 +00:00
Dag-Erling Smørgrav
cd085280b5 Make sure we don't cross stripe boundaries when reviving striped plexes.
This makes crash recovery work for stripe sizes that are not multiples of
DEFAULT_REVIVE_BLOCKSIZE (currently 64 kB).
While we're here, fix a few cosmetic nits.

Reviewed by:	grog
Sponsored by:	Enitel ASA (http://www.enitel.no/)
2000-11-17 23:40:01 +00:00
David E. O'Brien
363ea5eadf Fix the `make -jX' (X>1) breakage.
Based on patch submitted by:	Makoto MATSUSHITA <matusita@jp.freebsd.org>
Reviewed by:	marcel, bde
2000-11-17 21:25:15 +00:00
Jake Burkholder
7da6f97772 - Split the run queue and sleep queue linkage, so that a process
may block on a mutex while on the sleep queue without corrupting
it.
- Move dropping of Giant to after the acquire of sched_lock.

Tested by:	John Hay <jhay@icomtek.csir.co.za>
		jhb
2000-11-17 18:09:18 +00:00
John Baldwin
835a748f30 - Change extra sanity checks in cpu_switch() to be conditional on INVARIANTS
instead of DIAGNOSTIC.
- Remove the p_wchan check as it no longer applies since a process may be
  switched out during CURSIG() within msleep() or mawait().
- Remove an extra sanity check only needed during the early SMPng work.
2000-11-17 17:37:43 +00:00
Ruslan Ermilov
251c176f41 mdoc(7) police: use certified section headers wherever possible. 2000-11-17 11:44:16 +00:00
Mike Smith
1d6dc22916 The default kernel filename is "kernel" again, not "kernel.ko".
Submitted by:	mckusick
2000-11-17 04:43:56 +00:00
Mike Smith
0fd18bb21b Add the 'gdt' and 'gdtd' devices for the ICP Vortex RAID controller family. 2000-11-17 01:36:34 +00:00
Brian Somers
27121ab1a4 Go back to using data_len in struct ngpppoe_init_data after discussions
with Julian and Archie.

Implement a new ``sizedstring'' parse type for dealing with field pairs
consisting of a uint16_t followed by a data field of that size, and use
this to deal with the data_len and data fields.

Written by:		Archie with some input by me
Agreed in principle by:	julian
2000-11-16 23:14:53 +00:00
John Baldwin
cb799bfef9 The recent changes to msleep() and mawait() resulted in timeout() and
untimeout() not being called with Giant in those functions.  For now,
use the sched_lock to protect the callout wheel in softclock() and in
the various timeout and callout functions.

Noticed by:	tegge
2000-11-16 21:20:52 +00:00
Bill Paul
da6e4b77bb When checking the device code in the probe routine, leave the chip in
16-bit mode. Technically, pcn_probe() is destructive because once the
chip goes into 32-bit mode, the only way to get it out again is a
hardware reset. And once the device is in 32-bit mode, the lnc driver
won't be able to talk to it. So if pcn_probe() is called before the
lnc probe routine, and pcn_probe() rejects the chip as one it doesn't
support, the lnc driver will be SOL.

I don't like this. I think it's a design flaw that you can't switch
the chip out of 32-bit mode once it's selected. The only 'right'
solution is for the pcn driver to support all of the PCI devices
in 32-bit mode, however I don't have samples of all the PCnet series
cards for testing.
2000-11-16 19:56:09 +00:00
Archie Cobbs
7d7a5b89a7 Add kernel option NETGRAPH_ONE2MANY. 2000-11-16 16:59:26 +00:00
Warner Losh
c9527183c9 vx is now optional rather than taking a count. Reflect that in the
files.  Also a minor white space nit.

Submitted by: bde
2000-11-16 15:16:41 +00:00
Søren Schmidt
18434d5214 Put the probe verboseness behind bootverbose 2000-11-16 10:52:00 +00:00
Archie Cobbs
6e8d625628 New netgraph node type ng_one2many(4). 2000-11-16 05:58:33 +00:00
John Baldwin
20cdcc5b73 Don't release and acquire Giant in mi_switch(). Instead, release and
acquire Giant as needed in functions that call mi_switch().  The releases
need to be done outside of the sched_lock to avoid potential deadlocks
from trying to acquire Giant while interrupts are disabled.

Submitted by:	witness
2000-11-16 02:16:44 +00:00
Andrew Gallatin
088638dae4 remove redundant declaration of bsd_to_linux_sigset()
reviewed by: marcel
2000-11-16 02:08:40 +00:00
Andrew Gallatin
b595ab370b fix glaring bugs in rt signals -- copyout the right signal mask in
linux_rt_sendsig() and restore the same signal mask linux does
in rt_sigreturn().  This gets us saving/restoring all 64-bits of the
linux sigset_t in rt signals.

Reviewed by: marcel
2000-11-16 02:07:05 +00:00
John Baldwin
92c79c7e3e Argh, add in a missing release of the sched_lock. 2000-11-16 01:16:54 +00:00
John Baldwin
95de685572 CURSIG() calls functions that acquire sleep mutexes, so it is not a good
idea to be holding the sched_lock while we are calling it.  As such,
release sched_lock before calling CURSIG() in msleep() and mawait() and
reacquire it after CURSIG() returns.

Submitted by:	witness
2000-11-16 01:07:19 +00:00
Andrew Gallatin
930a65fe47 Use the linux_connect() on alpha rather than passing directly through
to our native connect().  This is required to deal with the differences
in the way linux handles connects on non-blocking sockets.

This gets the private beta of the Compaq Linux/alpha JDK working
on FreeBSD/alpha

Approved by: marcel
2000-11-16 01:05:53 +00:00
Andrew Gallatin
e652fd8417 make the fcntl() flags match what the linux/alpha port uses, not
what linux/i386 uses
2000-11-16 00:58:07 +00:00
John Baldwin
b84988521c - Rename await() to mawait(). mawait() is to await() as msleep() is to
tsleep().  Namely, mawait() takes an extra argument which is a mutex
  to drop when going to sleep.  Just as with msleep(), if the priority
  argument includes the PDROP flag, then the mutex will be dropped and will
  not be reacquired when the process wakes up.
- Add in a backwards compatible macro await() that passes in NULL as the
  mutex argument to mawait().
2000-11-15 22:39:35 +00:00
John Baldwin
3ae4dd935b - Replace a KASSERT() that knew too much about mutex internals with a
mtx_assert() that ensures the mutex we release during msleep() is both
  not recursed and owned by the current process.
2000-11-15 22:30:48 +00:00
John Baldwin
f33a072eb9 - Convert references from tsleep() -> msleep()
- Fix a buglet in a comment above await()
2000-11-15 22:27:38 +00:00
John Baldwin
9cce2a0c0d - Add a new macro DROP_GIANT_NOSWITCH() that is similar to DROP_GIANT()
except that it uses the MTX_NOSWITCH flag while it releases Giant via
  mtx_exit().
- Add a mtx_recursed() primitive.  This primitive should only be used on
  a mutex owned by the current process.  It will return non-zero if the
  mutex is recursively owned, or zero otherwise.
- Add two new flags MA_RECURSED and MA_NOTRECURSED that can be used in
  conjuction with MA_OWNED to control the assertion checked by mtx_assert().
- Fix some of the KTR tracepoint strings to use %p when displaying the lock
  field of a mutex, which is a uintptr_t.
2000-11-15 22:12:33 +00:00
John Baldwin
9c36c934a1 Include the right headers to get the DDB #define and the db_active variable. 2000-11-15 22:08:16 +00:00
John Baldwin
896c2303d4 - Replace some instances of sched_ithd with sched_swi in KTR tracepoints.
- Assert that Giant is not owned during the main loop of sithd_loop().
2000-11-15 22:05:23 +00:00
John Baldwin
7c06c69188 Assert that Giant is not owned during the main loop of ithd_loop(). 2000-11-15 22:03:26 +00:00
John Baldwin
59f857e4ea Declare the 'witness_spin_check' properly as a per-CPU variable in the
non-SMP case.
2000-11-15 22:02:05 +00:00
John Baldwin
ecbd8e3710 Don't perform witness checks in witness_enter() during a panic. 2000-11-15 22:00:31 +00:00
John Baldwin
4b2c46fab1 Add the 'witness_spin_check' per-CPU variable. 2000-11-15 21:58:02 +00:00
John Baldwin
651c378316 - Don't acquire/release Giant during an interrupt context for machine
checks, clock interrupts, and device interrupts.
- Assert that Giant is not owned during the main loop of ithd_loop().
2000-11-15 21:56:50 +00:00
John Baldwin
22f1b34223 Make ktr_verbose a bit more useful:
- On SMP systems display the cpu number with each message
- If ktr_verbose > 1, then include the filename and line number with each
  trace message
2000-11-15 21:51:53 +00:00
Kirk McKusick
324d6bacc3 Bug fix for revision 1.14 on the replacement of CIRCLEQ with TAILQ.
Submitted by:	Warner Losh <imp@village.org>
2000-11-15 20:07:16 +00:00
John Baldwin
a436e6e696 Fix all the interrupt enabled/disabled assertions which were backwards. 2000-11-15 19:45:10 +00:00
John Baldwin
7e4b7c97de Don't perform an mi_switch() when we release Giant during cpu_exit(). We
are about to call cpu_switch() anyways.

Found by:	witness
2000-11-15 19:44:38 +00:00
Kirk McKusick
5f90cac7f1 In preparation for deprecating CIRCLEQ macros in favor of TAILQ
macros which provide the same functionality and are a bit more
efficient, convert use of CIRCLEQ's in netgraph PPP code to TAILQ's.

Reviewed by:	Archie Cobbs <archie@dellroad.org>
2000-11-15 19:40:34 +00:00
Warner Losh
c7ba419499 vx no longer uses pci compat shims and this doesn't need a count 2000-11-15 18:43:41 +00:00
Warner Losh
5c75885e24 MFGENERIC: 1.291 2000-11-15 18:42:44 +00:00
Warner Losh
e655ea71de Add pmtimer device, necessary for proper time keeping when apm or
other power management devices are enabled.
2000-11-15 18:36:24 +00:00
Ben Smithurst
c6662b8e3d remove period from SEE ALSO. 2000-11-15 17:02:54 +00:00
Nick Hibma
60295bde4c Set OPEN Flag on open.
Make set_config(1) print warning message if it fails.
2000-11-15 10:36:08 +00:00
John Baldwin
8b9d6e94af Enable all interrupts in switch_trampoline after releasing the sched_lock.
This is needed so that kernel threads created before interrupts are
enabled do not run with interrupts disabled once the system is up and
running.
2000-11-15 01:48:49 +00:00
John Baldwin
4ae465d099 Always enable interrupts during fork_trampoline() after releasing the
sched_lock.  This is needed for kernel threads that are created before
interrupts are enabled.  kthreads created by kld's that are created at
SI_SUB_KLD such as the random kthread.

Tested by:	phk
2000-11-14 23:01:24 +00:00
David E. O'Brien
f9c70d7647 Don't use the Gawkism strftime(). Pass in the date stamp on the awk
command line instead.

Approved by:	dcs
2000-11-14 21:02:49 +00:00
Kirk McKusick
a077f63555 In preparation for deprecating CIRCLEQ macros in favor of TAILQ
macros which provide the same functionality and are a bit more
efficient, convert use of CIRCLEQ's in resource manager to TAILQ's.

Approved by:	Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
2000-11-14 20:46:02 +00:00
Bill Paul
fa167b8eaa Add support for the Accton EN2242 MiniPCI adapter. This is just an
ADMtek Centaur chip, so all we need is the PCI ID.

Submitted by:	Scott Lang <scottl@FreeBSD.org>
2000-11-14 19:35:22 +00:00
John Baldwin
8204c68ecc Only hold the mutex for an eventhandler list while the list is being accessed.
Specifically, don't hold the lock while calling event handlers as a handler
may tsleep() while holding the mutex.

Found by:	witness
2000-11-14 18:22:59 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Kirk McKusick
bd4bd019fb When deleting a file, the ordering of events imposed by soft updates
is to first write the deleted directory entry to disk, second write
the zero'ed inode to disk, and finally to release the freed blocks
and the inode back to the cylinder-group map. As this ordering
requires two disk writes to occur which are normally spaced about
30 seconds apart (except when memory is under duress), it takes
about a minute from the time that a file is deleted until its inode
and data blocks show up in the cylinder-group map for reallocation.
If a file has had only a brief lifetime (less than 30 seconds from
creation to deletion), neither its inode nor its directory entry
may have been written to disk. If its directory entry has not been
written to disk, then we need not wait for that directory block to
be written as the on-disk directory block does not reference the
inode. Similarly, if the allocated inode has never been written to
disk, we do not have to wait for it to be written back either as
its on-disk representation is still zero'ed out. Thus, in the case
of a short lived file, we can simply release the blocks and inode
to the cylinder-group map immediately. As the inode and its blocks
are released immediately, they are immediately available for other
uses. If they are not released for a minute, then other inodes and
blocks must be allocated for short lived files, cluttering up the
vnode and buffer caches. The previous code was a bit too aggressive
in trying to release the blocks and inode back to the cylinder-group
map resulting in their being made available when in fact the inode
on disk had not yet been zero'ed. This patch takes a more conservative
approach to doing the release which avoids doing the release prematurely.
2000-11-14 09:00:25 +00:00
Matt Jacob
78f3dc6530 Pick up kernelname for bootinfo structure (if possible), otherwise
from environment.
2000-11-14 08:12:15 +00:00
Matt Jacob
492ecc5fbd init booted_kernel from environment kernelname (if there) 2000-11-14 08:11:03 +00:00
Matt Jacob
178e6e0fed move init of booted_kernel to bootinfo.c 2000-11-14 08:10:15 +00:00
Kirk McKusick
d6514f21d7 In preparation for deprecating CIRCLEQ macros in favor of TAILQ
macros which provide the same functionality and are a bit more
efficient, convert use of CIRCLEQ's in NFS to TAILQ's.
2000-11-14 08:00:39 +00:00
Kirk McKusick
dc029a4bd7 Missed conversion of CIRCLEQ => TAILQ for mount list. 2000-11-14 06:38:18 +00:00
Jordan K. Hubbard
4dc665b8bf Proper capitalization of PCMCIA (and avoid matching pcm) 2000-11-14 01:13:57 +00:00
Jordan K. Hubbard
68ce54fbde In the year 2000, I think it's perfectly reasonable to include audio
support by default in GENERIC.
2000-11-14 01:11:13 +00:00
Bill Paul
a614c4dc7b Close PR# 21843 and PR# 21864. This adds support for WEP and updates some
of the data structures to include new members that weren't defined in the
manual I have.

I opted to use Doug Ambrisko's WEP patches since David Cornejo's patches
did not include the necessary changes to ancontrol(8) to actually enable
and use WEP.

NOTE: I don't currently have access to an Aironet card, so I can't test
any of this. Everything compiles and close scrutiny doesn't reveal any
obvious problems, but Murphy's Law applies. This means I will probably
leave these changes in -current for a bit longer than usual until I'm
sure they work right.
2000-11-13 23:04:16 +00:00
Andrew Gallatin
2c4ab9ddfa Make linux_sendsig and linux_sigreturn use all 64 bits of a
linux_sigset_t by updating the linux_sigframe struct so as to include
linux's "extramask" field.  This field contains the upper 32-bits of
the sigset.  extramask sits behind a linux_fpstate struct, which I've
defined primarily for padding purposes.

While we're here, define LINUX_NSIG in terms of LINUX_NBPW (32) and
LINUX_NSIG_WORDS (2).

This fixes problems where threaded apps would accumulate a large
number of zombies.  This was happening because the exit signal resides
in the upper 32-bits of the sigset and was never getting unmasked by
the manager thread after the first child exited.

PR: 		misc/18530  (may be related, originator not yet contacted)
Reviewed by:	marcel
2000-11-13 20:44:05 +00:00
John Baldwin
af80d322a6 Fix a bug with handling of the saved interrupt state for spin mutexes in
the MTX_EXIT_WITH_RECURSION() assembly macro (currently unused).

Submitted by:	bde
2000-11-13 18:39:18 +00:00
Yoshihiro Takahashi
8965720482 Initialize bus_space_handle_t with zero (for PC-98). 2000-11-13 11:48:38 +00:00
Marcel Moolenaar
7cf6a3b430 Fix F_SETOWN on pipes. Linux returns EINVAL while we send a SIGIO
signal. There's at least 1 program that is known to break.
Submitted patch has been edited to match current code.

MFC: yes
Submitted by: bde
2000-11-13 04:08:56 +00:00
Justin T. Gibbs
7357f64514 Classify all EISA cards with major firmware revions '2' as 742As.
This allows us to successfully attach early Storage Dimension cards.

Allocate mailboxes for the 742A bellow the 16MB limit.  Although these
cards seem to be able to deal with all other types of data anywhere
in a 32bit address space, 24bit addresses are required for mailboxes.

bt_eisa.c:
	Add device IDs for all Storage Dimension products I could
	find from their web site.

Thanks to Ted Mittelstaed for loaning me the equipment to diagnose
and fix these problems.
2000-11-13 03:44:20 +00:00
Justin T. Gibbs
96dfd8bb97 Don't attempt to reference a NULL scb_data area during teardown events
occurring early in initialization.  This fixes attachments to the parity
engines that FreeBSD doesn't support.
2000-11-13 03:35:43 +00:00
Bosko Milekic
1edd6ddf05 Change the ext_type type from short to int, since it doesn't cost us
anything and it's likely to be faster on alphas.

Also, add EXT_MOD_TYPE for modules that want to add their own ext_type and
are not network drivers (so they don't use EXT_NET_DRV).
2000-11-13 02:59:57 +00:00
Warner Losh
f50b4dbebd Add ray driver for card (OLDCARD) and pccard (NEWCARD) entries.
Add sn driver for pccard (NEWCARD).
2000-11-12 21:47:23 +00:00
Warner Losh
3e8e7863b2 Changes necessary to make this work.
The prior version in the tree was repo-copied from Duncan Barclay's
cvs tree.

Also add $FreeBSD$

Submitted by: Duncan Barclay
Committed-via: raylan link with two webgear cards.
2000-11-12 21:43:52 +00:00
Søren Schmidt
0cdc179319 Only offset raid disks > 1 on the HPT, this should solve the
boot problems..
However this demands that dangerously dedicated disks use an
offset of at least 10 from the start to not overwrite the
raid config sector on the HPT...
2000-11-12 20:45:14 +00:00
Søren Schmidt
07296bbba1 Better handling of immediate commands, mainly to solve timeouts
in the atapi-tape code...
2000-11-12 20:41:24 +00:00
Søren Schmidt
a9c1b0e23a Hopefully fix the probing problems that caused lost slaves etc.. 2000-11-12 20:40:05 +00:00
David Greenman
866746b6a6 Fixed a certain panic on IO error in sendfile(): Page must be set PG_BUSY
before calling vm_page_free() on it.
2000-11-12 14:51:15 +00:00
Justin T. Gibbs
420bf58729 aic7xxx.c:
Shutdown the card when a catastrophic error occurs.  This quenches
	any interrupts stemming from the card.

aic7xxx_inline.h:
	Return instead of processing additional interrupt state
	after handling a catastrophic error.  We now shutdown the
	chip in this case in the hopes that the system can live
	without this controller.  The shutdown process invalidates any
	other interrupt state.

aic7xxx.seq:
	Only attempt to clear SCSIBUSL on Ultra2 controllers.  The
	clearing is workaround for a selection timeout bug on U2/U160
	controllers and happens to be illegal on aic7770 (EISA/VL)
	controllers.
2000-11-12 05:19:46 +00:00
Bosko Milekic
2424013a99 Add new M_RDONLY flag, which can be set during setup (MEXTADD, for example),
and which indicates that the ext_buf is to be marked READ-ONLY.

Also introduce M_WRITABLE() macro, which will return true if:
* M_RDONLY is _not_ set AND:
* either mbuf has no ext_buf attached OR it has an ext_buf attached but the ref
  count is NOT above 1.

sf_bufs (sendfile) are marked M_RDONLY.

Now code determining whether an mbuf's data area is "shared" or not can be
made to use this instead of doing its own (often incorrect) thing.

Submitted by: bmilekic, dwmalone, and Ian Dowse
Reviewed by: dwmalone, jlemon
2000-11-11 23:12:27 +00:00
Bosko Milekic
b7db1f9818 Change MEXTADD usage to pass the two new arguments.
Reviewed by: jlemon
2000-11-11 23:08:22 +00:00
Bosko Milekic
15072affc8 Change check from mbuf->m_ext.ext_free to use the new ext_type in order
to determine whether the given mbuf has a cluster (or some other type of
external storage) attached to it.

Note: This code should eventually be made to use M_WRITABLE() to determine
whether or not a copy should be made.

Reviewed by: jlemon
2000-11-11 23:07:38 +00:00
Bosko Milekic
0a1df235ba While I'm here, get rid of (now useless) MCLISREFERENCED and use MEXT_IS_REF
instead.
Also, fix a small set of "avail." If we're setting `avail,' we shouldn't
be re-checking whether m_flags is M_EXT, because we know that it is, as if
it wasn't, we would have already returned several lines above.

Reviewed by: jlemon
2000-11-11 23:05:59 +00:00
Bosko Milekic
e778918123 * Have m_pulldown() use the new M_WRITABLE() macro in order to determine
whether the given ext_buf is shared.

* Have the sf_bufs be setup with the mbuf subsystem using MEXTADD() with the
two new arguments.

Note: m_pulldown() is somewhat crotchy; the added comment explains the
situation.

Reviewed by: jlemon
2000-11-11 23:04:15 +00:00
Bosko Milekic
8bcbe4b7a6 Change check for existence of mbuf->m_ext.ext_free to check of new ext_type
in order to determine whether the ext_buf is a cluster, or some other type
of storage.

Reviewed by: jlemon
2000-11-11 23:01:44 +00:00
Robert Watson
7f73938e96 o Fix a mis-transcription of sef's -STABLE protection fixes--only root
could debug processes after the commit that introduced the typo.
  Security is good, but security is not always the same as turning things
  off :-).

PR:		kern/22711
Obtained from:	brooks@one-eyed-alien.net
2000-11-10 23:57:48 +00:00
Andrew Gallatin
922683e01a Enable linux thread support on the alpha. The guts of linux_clone was
mainly cut-n-pasted from the i386 port, except for the method of setting
the child's stack which is the only MD part of this function.

I've tested with the example apps shipped with the linux threads source
code (ex1-ex6) and with several binary builds of Mozilla.
2000-11-10 23:04:31 +00:00
Andrew Gallatin
f16647740e Simplify and correct OSF/1 signal handling.
- No signal translation is needed.  Our signals match the OSF/1 signals
- an OSF/1 sigset_t is 64 bits.  Make certain to use all 64-bits of it.
  We'd previously only used the lower 32 bits.   This was mostly harmless
  as I don't know of an OSF/1 apps which use any signals > 31.  However,
  the alpha Linux ABI uses the osf/1 signal routines and threaded linux
  apps tyically use signals 32 and 33 to comminicate with the manager
  thread, so it is important we preserve the upper 32-bits.

Reviewed by: marcel (at least in principal)
2000-11-10 23:00:54 +00:00
John Baldwin
20af769e69 Don't overwrite the filename for KTR_EXTEND with "../../kern/kern_ktr.c". 2000-11-10 22:30:44 +00:00
John Baldwin
9842fc8dda Axe some unused variables. 2000-11-10 21:54:19 +00:00
John Baldwin
bf619f9506 Fix SMP kernel compiles by #include'ing machine/globals.h to get the
cpuid variable.
2000-11-10 21:52:04 +00:00
Marcel Moolenaar
ebea866055 Revert auto-generation. The Alpha port is broken.
Syncing with it is wrong.
2000-11-10 21:30:19 +00:00
John Baldwin
0fe4e534b1 Minor whitespace nit in a comment. 2000-11-10 21:21:20 +00:00
John Baldwin
b5d09a79b5 Ignore the INTR_MPSAFE flag when calculating the priority of an interrupt
thread.
2000-11-10 21:19:14 +00:00
Justin T. Gibbs
72df3c5621 Sync Perforce IDs, add tranceiver state change support, and correct
numerous error recovery buglets.

Many thanks to Tor Egge for his assistance in diagnosing problems with
the error recovery code.

aic7xxx.c:
	Report missed bus free events using their own sequencer interrupt
	code to avoid confusion with other "bad phase" interrupts.

	Remove a delay used in debugging.  This delay could only be hit
	in certain, very extreme, error recovery scenarios.

	Handle transceiver state changes correctly.  You can now
	plug an SE device into a hot-plug LVD bus without hanging
	the controller.

	When stepping through a critical section, panic if we step
	more than a reasonable number of times.

	After a bus reset, disable bus reset interupts until we either
	our first attempt to (re)select another device, or another device
	attemps to select us.  This removes the need to busy wait in
	kernel for the scsi reset line to fall yet still ensures we
	see any reset events that impact the state of either our initiator
	or target roles.  Before this change, we had the potential of
	servicing a "storm" of reset interrupts if the reset line was
	held for a significant amount of time.

	Indicate the current sequencer address whenever we dump the
	card's state.

aic7xxx.reg:
	Transceiver state change register definitions.

	Add the missed bussfree sequencer interrupt code.

	Re-enable the scsi reset interrupt if it has been
	disabled before every attempt to (re)select a device
	and when we have been selected as a target.

	When being (re)selected, check to see if the selection
	dissappeared just after we enabled our bus free interrupt.
	If the bus has gone free again, go back to the idle loop
	and wait for another selection.

	Note two locations where we should change our behavior
	if ATN is still raised.  If ATN is raised during the
	presentation of a command complete or disconnect message,
	we should ignore the message and expect the target to put
	us in msgout phase.  We don't currently do this as it
	requires some code re-arrangement so that critical sections
	can be properly placed around our handling of these two
	events.  Otherwise, we cannot guarantee that the check of
	ATN is atomic relative to our acking of the message in
	byte (the kernel could assert ATN).

	Only set the IDENTIFY_SEEN flag after we have settled
	on the SCB for this transaction.  The kernel looks at
	this flag before assuming that SCB_TAG is valid.  This
	avoids confusion during certain types of error recovery.

	Add a critical section around findSCB.  We cannot allow
	the kernel to remove an entry from the disconnected
	list while we are traversing it.  Ditto for get_free_or_disc_scb.

aic7xxx_freebsd.c:
	Only assume that SCB_TAG is accurate if IDENTIFY_SEEN is
	set in SEQ_FLAGS.

	Fix a typo that caused us to execute some code for the
	non-SCB paging case when paging SCBs.  This only occurred
	during error recovery.
2000-11-10 20:13:41 +00:00