Commit Graph

22990 Commits

Author SHA1 Message Date
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