Commit Graph

118350 Commits

Author SHA1 Message Date
Pyun YongHyeon
005a5d42fa Fix module unload panic which was caused by missing sx lock release.
While I'm here add KASSERT(9) to notify failure of SYSUNINIT handler.

Reported by:	Ben Kaduk < minimarmot AT gmail DOT com >
Tested by:	Ben Kaduk < minimarmot AT gmail DOT com >
2005-09-14 01:34:13 +00:00
Christian S.J. Peron
6f798df578 Print a warning if we fail to retrieve the process name for any reason. 2005-09-13 23:11:16 +00:00
Christian S.J. Peron
15f3d81f9c If there are'nt any bpf descriptors to process than dont bother attempting to
retrieve statistic information for them.

Pointed out by:	Pawel Worach < pawel.worach at gmail.com >
2005-09-13 22:13:01 +00:00
Warner Losh
60d47f2c0a MFp4: Migrate from CARD_CIS_SCAN to pccard_cis_scan 2005-09-13 19:56:07 +00:00
Warner Losh
c7dc9b92a5 MFp4:
o Use pccard_cis_scan
o use pccard_attr_write_1
o Update comments
2005-09-13 19:54:14 +00:00
Warner Losh
d21d33847c MFp4: Omnibus ed changes
o Attach AX88x90's MII bus to system, and require its presence.
o Reorg the mii code a little, and move more of it into pccard attachment.
o Eliminate ed_pccard_{read,write}_attrmem in favor of a more appropriate
  function in the pccard layer.
o Update comments to reflect knowledge gained.
o Update how re recognize a NE-2000 ROM.  I found a couple of different
  datasheets that define the structure of the PROM data, so the code's
  old heuristics have been removed, and comments updated to reflect the
  structure.
o Eliminate work around for EC2T.  It is no longer needed, and was wrong
  headed since the EC2T has a Winbound 82C926C in it, not a AX88x90.
o Add copyright to if_ed_pccard.c, since I believe I've re-written more than
  3/4 of it.

# With these changes, all of my 20-odd ed based cards work, except for the
# NetGear FA-410, and I'm pretty sure that's a MII/PHY problem.
2005-09-13 19:47:44 +00:00
Warner Losh
ff1de32e3b MFp4:
o Move to new pccard_cis_scan convenience function.
o Remove compat layer goo.
2005-09-13 19:28:03 +00:00
Warner Losh
14ea0b7d32 Use new convenience function to read CIS rather than the older, harder to
use version.
2005-09-13 19:25:30 +00:00
Robert Watson
d32e7ba722 Don't consider being unable to open the bounds file worthy of printing
at LOG_WARNING by default; instead, consider it something to be printed
to the tty when 'verbose' mode is set.  This avoids printing out extra
lines at every boot on a system with crash dumps enabled, but that has
not yet had to generate a crashdump.

MFC after:	1 week
2005-09-13 19:15:28 +00:00
Warner Losh
5098c3916e MFp4: Minor formatting nits in pccard table. 2005-09-13 19:09:57 +00:00
Robert Watson
218fe3f1b0 Use kenv -q to extract dumpdev rather than kenv, in order to avoid
spamming the console in the event that a loader tunable 'dumpdev'
isn't defined, which is not a relevant failure to report.

MFC after:	1 week
2005-09-13 19:07:02 +00:00
Warner Losh
c3ee3aa526 Use smaller names. The "NE2000 PCI Ethernet" is largerly redundant
with edX at pciY.  This removes 8*22 bytes from the strings. Not a
huge win, but a cheap one.
2005-09-13 19:07:00 +00:00
Robert Watson
af2b8e58cc Add a "-q" quiet flag to kenv so that warnings can be suppressed.
MFC after:	1 week
2005-09-13 19:01:53 +00:00
Warner Losh
e88c48fefc Add the olicom OC2231 and OC2232 to the list of cards that we should
attach to.  These cards are combo cards (in that they have a modem
inside of them), but not true MFC cards.  Full support of these cards
will have to wait until we can pick the config to use and for the PFC
support that I have brewing.
2005-09-13 18:55:28 +00:00
Warner Losh
fe364ce963 Add a few new functions interfaces to allow reading/writing attribute
memory, the CCR and a tweak to cis_scan.
2005-09-13 17:56:36 +00:00
Warner Losh
395fee2331 Define and use PCCARD_MEM_PAGE_SIZE. 2005-09-13 17:49:47 +00:00
Robert Watson
447bbaa2cf Trim down now (believed to be) unused fifo_ioctl() and
fifo_kqfilter() VOP implementations, since they in theory are used
only on open file descriptors, in which case the ioctls are via
fifo_ioctl_f() and kqueue requests are via fifo_kqfilter_f().
Generate warnings if they are entered for now.  These printf()
calls should become panic() calls.

Annotate and re-implement fifo_ioctl_f(): don't arbitrarily
forward ioctls to the socket layer, only forward the ones we
explicitly support for fifos.  In the case of FIONREAD, don't
forward the request to the write socket on a read-write fifo, or
the read result is overwritten.  Annotate a nasty case for the
undefined POSIX O_RDWR on fifos, in which failure of the second
ioctl will result in the socket pair being in an inconsistent
state.

Assert copyright as I find myself rewriting non-trivial parts of
fifofs.

MFC after:	3 days
2005-09-13 17:46:48 +00:00
Warner Losh
8d4f90a457 MFp4: Remove stale functions. 2005-09-13 17:41:48 +00:00
Robert Watson
660f25118c Add two small tests to set and clear two file I/O flags using ioctl on
a fifo: FIONBIO, FIOASYNC.
2005-09-13 17:25:35 +00:00
Robert Watson
1c3c40d4c0 Restructure fifo_io event-related tests in order to support test cases
relating to O_RDWR file descriptors, which while not defined in POSIX,
are in fact used:

(1) Revise assumption that we have two file descriptors when testing I/O
    operations on a fifo.  Provide cleanup routines that handle either
    two or three file descriptors (including a kqueue descriptor).

(2) Add an openfifo_rw() routine to supplement openfifo().

(3) kqueue_setup() now configures an existing kqueue to monitor a new
    file descriptor, rather than allocating a new kqueue to monitor two
    existing file descriptors.

(4) Wrap all direct poll/select/kqueue/FIONREAD interactions in a single
    function, assert_status(), which takes a file descriptor, kqueue
    descriptor, assertion of read/writable/exception states, and
    test description, then tests the assertion.  This reduces the bulk
    of calls in many of the tests, making them shorter, more readable,
    and easier to determine correct.

(5) Add a new test_events_rdwr() function, which performs a basic create/
    write/read event test on a O_RDWR fifo file descriptor.  This is
    currently failed by our fifo code in HEAD due to a bug in FIONREAD
    handling.  Fix to be merged shortly.
2005-09-13 17:15:05 +00:00
Christian S.J. Peron
544b9dfe25 Garbage collect bpfstat. This is handled by netstat now.
Requested by:	rwatson
2005-09-13 16:04:56 +00:00
Robert Watson
f8f8772ade Teach fifo_io how to use ioctl(FIONREAD) to determine if a fifo is
readable, and use that in addition to poll+select+kqueue to verify
appropriate readability.
2005-09-13 15:49:12 +00:00
John Baldwin
a30c1e0a0b Various and sundry improvements:
- Replace 'process' with 'thread' everywhere.
- Update several places to note that that the fact that default mutexes
  may adaptively spin isn't necessarily MD, but is just part of the
  implementation as a whole.
- Clarify the text about MTX_SPIN mutexes only being appropriate for
  INTR_FAST interrupts or other low level scheduler code to make the
  jargon more FreeBSD-ish rather than BSD/OS-ish.
- Also, note that it is possible that interrupts aren't blocked but just
  deferred when a spin lock is held (the whole blocked vs. deferred bit is
  an MD implementation detail).
- Remove statements saying that spin locks must be released in the exact
  opposite order that they were acquired.  This stopped being true several
  years ago when we first added critical sections that stored their state
  in the current thread rather than in struct mtx.
- Note that a mutex must be initialized before it is passed to any other
  mutex function, not just mtx_lock.
- Clarify that mtx_trylock() only operates on MTX_DEF mutexes.
- Simplify the text about possible preemption during a mtx_unlock().
- Use complete English sentences in place of phrases in a few places.
- Clarify that it isn't ever safe to sleep with a mutex held.  The kernel
  tends to panic when you do that.

Requested by:	scottl (7)
MFC after:	3 days
2005-09-13 15:16:50 +00:00
Yoshihiro Takahashi
74a91701b2 Remove unused functions. 2005-09-13 11:34:07 +00:00
Yoshihiro Takahashi
e3dd1d33b2 Remove EPSON_NRDISK support. 2005-09-13 11:33:25 +00:00
Robert Watson
8a22e151be As a result of kqueue locking work, socket buffer locks will always
be held when entering a kqueue filter for fifos via a socket buffer
event: as such, assert the lock unconditionally rather than acquiring
it conditionall.

MFC after:	3 days
2005-09-13 10:39:24 +00:00
Robert Watson
51c1fa5c31 Remove a debugging printf. 2005-09-13 10:33:32 +00:00
Pyun YongHyeon
7535accf91 Unlock driver lock before calling resource_int_value(9).
This should fix LOR(in fact it's not LOR) in device attach.
2005-09-13 10:12:28 +00:00
Robert Watson
db7a6c2f43 Annotate two issues:
1) fifo_kqfilter() is not actually ever used, it likely should be GC'd.

2) fifo_kqfilter_f() doesn't implement EVFILT_VNODE, so detecting events
   on the underlying vnode for a fifo no longer works (it did in 4.x).
   Likely, fifo_kqfilter_f() should forward the request to the VFS using
   fp->f_vnode, which would work once fifo_kqfilter() was detached from
   the vnode operation vector (removing the fifo override).

Discussed with:	phk
2005-09-13 09:23:22 +00:00
Yoshihiro Takahashi
abf04270da MFi386: revision 1.11. 2005-09-13 08:29:03 +00:00
Yoshihiro Takahashi
090559c76e MFi386: revisions 1.10 and 1.11.
- Add '-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3' to CFLAGS.
2005-09-13 08:27:38 +00:00
Joseph Koshy
a566429af3 Fix a bug that caused generated gmon.out profiles to be out of
whack.  Use saturating arithmetic when incrementing a bucket.
Improve a few comments.

MFC after:	3 days
2005-09-13 02:23:25 +00:00
David Schultz
26bd283f2a Add a missing ldexpf() alias for amd64.
Noticed by:	bz@, tjr@
2005-09-12 20:54:00 +00:00
Robert Watson
88f39e8e95 Introduce no-op nosup fifo kqueue filter and detach routine, which are
used when a read filter is requested on a write-only fifo descriptor, or
a write filter is requested on a read-only fifo descriptor.  This
permits the filters to be registered, but never raises the event, which
causes kqueue behavior for fifos to more closely match similar semantics
for poll and select, which permit testing for the condition even though
the condition will never be raised, and is consistent with POSIX's notion
that a fifo has identical semantics to a one-way IPC channel created
using pipe() on most operating systems.

The fifo regression test suite can now run to completion on HEAD without
errors.

MFC after:	3 days
2005-09-12 19:59:12 +00:00
Stefan Farfeleder
613100918d Include a couple of headers to ensure consistency between the prototype and
the function definition.
2005-09-12 19:52:42 +00:00
Robert Watson
456068c703 Comment test_lseek().
Add test_kqueue(), which registers and unregisters various kqueue filter
types on a fifo in order to make sure that EVFILT_READ, EVFILT_WRITE can
be registered, and that EVFILT_NETDEV can't be registered.  For now, we
don't test that EVFILT_VNODE can be registered on fifos, as that has been
broken at some point.
2005-09-12 19:31:16 +00:00
Robert Watson
0a53be4671 In netkqfilter(), return EINVAL instead of 1 (EPERM) when a filter type
is requested on a network interface file descriptor that is non-applicable.

MFC after:	3 days
2005-09-12 19:26:03 +00:00
Robert Watson
fd1a469ba5 In vfs_kqfilter(), return EINVAL instead of 1 (EPERM) when an unsupported
kqueue filter type is requested on a vnode.

MFC after:	3 days
2005-09-12 19:22:37 +00:00
Alexander Leidinger
831a62e7e5 - Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).
- Remove an assertion in sound.c, it's not needed (and causes a panic now).
  From the conversation via mail between glebius and Ariff:
  ---snip---
  > Well, but which mutex protects now? Do we own anything else
  > in pcm_chnalloc()? I see some queue(4) macros in pcm_chnalloc(),
  > they should be protected, shouldn't they?
  Queue insertion/removal occur during
     1) driver loading (which is pretty much single thread /
        sequential) or unloading (mutex protected, bail out if there is
        any channel with refcount > 0 or busy).
     2) vchan_create()/destroy(), (which is *sigh* quite complicated), but
        somehow protected by 'master'/parent channel mutex. Other
        thread cannot add/remove vchan (or even continue traversing
        that queue) unless it can acquire parent channel mutex.
---snip---

Fix the locking in dsp.c to prevent a LOR (AFAIK not on the LOR page).

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
Tested with:	INVARIANTS[1] and DIAGNOSTICS[2]
Tested by:	netchild [1,2], David Reid <david@jetnet.co.uk> [1]
2005-09-12 18:33:33 +00:00
Robert Watson
48afebb83d When a request is made to register a filter on a fifo that doesn't
apply to the fifo (i.e., not EVFILT_READ or EVFILT_WRITE), reject
it as EINVAL, not by returning 1 (EPERM).

MFC after:	3 days
2005-09-12 18:07:49 +00:00
Robert Watson
1423f2f54c Further updates to fifo_io regression test:
- Teach fifo_io about kqueue monitoring of fifo file descriptor status,
  and add test cases for kqueue to match existing case for poll and
  select.  Add a new cleanup routine, cleanfifokq(), for use in tests that
  use kqueues.  kqueue_setup() sets up kqueue sessions, and kqueue_status()
  returns file descriptor status.

- Correct a bug in select handling relating to the nfds argument, which
  was incorrect so resulted in select occuring on the wrong file descriptor,
  and possible false positive/negative results.

- Clarify error reporting in one byte write+read tests to distinguish
  errors in the after case from the before case.
2005-09-12 17:05:48 +00:00
Stefan Farfeleder
a3b5200e71 - Add prototypes for __cmpdi2() and __ucmpdi2().
- Remove GCC 1 stuff.
2005-09-12 16:16:12 +00:00
Stefan Farfeleder
e0970cbd7f Put a getosreldate() prototype into <osreldate.h>, getosreldate(3) implies
there is one.
2005-09-12 16:11:48 +00:00
Stefan Farfeleder
c790330fe3 Include <osreldate.h> at the top of the file. 2005-09-12 16:06:15 +00:00
Stefan Farfeleder
69053d669e Use prototypes for CHIN1() and CHIN(). 2005-09-12 16:02:54 +00:00
Stefan Farfeleder
9d301680d6 Fix the prototypes for devname() and devname_r(), the first two argument
types are supposed to be dev_t and mode_t (prefixed with __ due to
namespace reasons).
2005-09-12 15:58:15 +00:00
Joseph Koshy
bebaef4a3d Process one NMI interrupt per handler invocation as the processor
'buffers' pending NMIs from multiple interrupting PMCs and delivers
them serially.

Reported by:	 Olivier Crameri <olivier.crameri@epfl.ch>
MFC after:	3 days
2005-09-12 15:55:44 +00:00
Stefan Farfeleder
533dcdacf1 Don't declare ___res_ext() twice. 2005-09-12 15:53:28 +00:00
Jung-uk Kim
9ed448b20c use monotonic time_uptime' instead of time_second'
Approved by:	anholt (mentor)
Discussed on:	arch
2005-09-12 15:31:28 +00:00
Lukas Ertl
a48c2af028 Clean up.
Remove unused functions.

Reduce indentation level by reverting the logic of the enclosing
conditional statement.
2005-09-12 14:31:49 +00:00