Commit graph

27282 commits

Author SHA1 Message Date
Jonathan Chen 472ce770c4 Fix the hack that allocates memory when the bios haven't already done so.
We can't rely on rman to give us a useable memory window if we tell it to
do auto-allocation.  This should probably be fixed on the pci bus/rman side.
2001-08-27 11:23:05 +00:00
Peter Wemm 5d8600f9d5 Correctly #ifdef COMPAT_43 around osendsig() prototype. 2001-08-27 06:19:18 +00:00
Peter Wemm 0f7289022b If a file has been completely unlinked, stop automatically syncing the
file.  ffs will discard any pending dirty pages when it is closed,
so we may as well not waste time trying to clean them.  This doesn't
stop other things from writing it out, eg: pageout, fsync(2) etc.
2001-08-27 06:09:56 +00:00
Peter Wemm 9d170964e4 There is nothing more embarresing than having three goes at correcting
typos in the same paragraph.  s/in in/in/

Submitted by:	iedowse
2001-08-27 05:18:12 +00:00
Peter Wemm 76cb0cadf1 Enable hardwiring of things like tunables from embedded enironments
that do not start from loader(8).
2001-08-27 05:11:53 +00:00
Warner Losh fb141a4c6c CL-PD6729 and CLPD-6730 chips (the only ones with I/O bars in the pci
config space that I'm aware of) work.  I'm committing this from such
a machine.

Remove warning about I/O based bridges.  Warn users that the PCI routing
of interrupts still doesn't work for these cards.
2001-08-27 01:59:57 +00:00
Warner Losh db3e31829d Note difficulties we had in OLDCARD using NEWCARD's methods of debouncing card event interrupts. 2001-08-27 01:30:46 +00:00
Kelly Yancey b530a320f8 Add interfaces for SCSI LOG SELECT and LOG SENSE commands.
Reviewed by:	ken
2001-08-27 01:29:30 +00:00
Warner Losh 533dc59976 More notes to the reader about issues in pccard code here. 2001-08-27 01:24:33 +00:00
Warner Losh fe63bdcc6a Merge notes, but not code, from my latest tree on pccard_function_init and pccard_function_free 2001-08-27 01:18:21 +00:00
Cameron Grant 4f4449e01c now we have the rate feeder, we don't need to constrain the default channel
speed.  however, continue to do so for record channels until the feederchain
builder is fixed.
2001-08-27 01:02:13 +00:00
Warner Losh afd9750bfd A number of fixes for the TI-1130 and ISA interrupt routing cases:
o For TI PCI-1130, you need to set bit 5 of register 91 if you want
  ANY pci interrupts.  Then set bits 3 and/or 4 as appropriate.  This
  will fix those people with 1030, 1130 and 1131 in their machines
  trying to do PCI interrupts.
o Fix case where we were trying to automatically fail back to ISA
  interrupt routing.  We were dereferencing a NULL pointer.  This
  was true of ANY chipset.
o The bus_setup_intr method needs to be pcic_setup_intr so that "FAST"
  interrupts fail on PCI case (modems act flakey if we don't force
  them to fall back to normal interrupts).  Also needed so that the
  proper ISA IRQ can be set in the ExCA register.  This fixes the
  people whose ISA routing was failing[*].
o When we find a generic yenta/pccard bridge, go ahead and print its
  vendor ID in boot verbose.

Machine with theses symptoms and a serial console by: jedgar

[*] Looks like my pc98 machine has some interrupt source on IRQ 15
that gave about 30 interrupts per second, which masked this problem on
my PC-9821Nr15.
2001-08-27 01:00:27 +00:00
Cameron Grant 52eb6afd0c MFS rev 1.8.2.8:
release resources on detach

Submitted by:	"Christopher N . Harrell" <cnh@netvmg.com>
2001-08-27 00:54:26 +00:00
Jonathan Chen 63fa9f4c0d Part two of this NEWCARD update:
Briefly, the significant changes include:
 * Way better resource management in pccbb, pccard and cardbus.
 * pccard hot-removal now appears to work.
 * support pre-fetchable memory in cardbus.
 * update cardbus to support new pci bus interface functions.
 * Fix CIS reading to no longer use rman_get_virtual().

What's not there, but in the works:
 * pccard needs to do interrupt properly and not read the ISR on single
   function cards.
 * real resource management for pccard
 * a complete implementation of CIS parsing
 * need to look into how to correctly use mutex in pccbb
2001-08-27 00:09:42 +00:00
Jonathan Chen c83acdc307 Non-functional changes to NEWCARD stuff.
This is the first part of a two-part update to NEWCARD.  Changes in this
commit are non-functional, and includes the following:
 * indentation and other changes to meet style(9).
 * other minor style consistancy changes
 * addition of comments
 * renaming of device_t variables to be consistant across all of NEWCARD.

(note that not all style violations are fixed in this commit -- those that
 aren't will be clobbered by the next commit.)
2001-08-26 23:56:49 +00:00
Jonathan Chen 255b159f5f Non-functional changes to NEWCARD stuff.
This is the first part of a two-part update to NEWCARD.  Changes in this
commit are non-functional, and includes the following:
 * indentation and other changes to meet style(9).
 * other minor style consistancy changes
 * addition of comments
 * renaming of device_t variables to be consistant across all of NEWCARD.

(note that not all style violations are fixed in this commit -- those that
 aren't will be clobbered by the next commit.)
2001-08-26 23:55:34 +00:00
Mike Smith 4c1cdee628 Updates to match the ACPI CA 20010816 import:
- New debug macro (ACPI_DEBUG_PRINT), reducing debug-case code size.
 - New debug level/subsystem codes.
2001-08-26 22:50:15 +00:00
Mike Smith 2780a616d6 Nuke the Windows platform defines; we don't need them. 2001-08-26 22:46:28 +00:00
Mike Smith 9d7b18c207 Merge local changes. 2001-08-26 22:45:42 +00:00
Mike Smith d142fbb1b8 This commit was generated by cvs2svn to compensate for changes in r82367,
which included commits to RCS files with non-trunk default branches.
2001-08-26 22:28:18 +00:00
Mike Smith 2ee2f9cb74 Vendor import of the Intel ACPI CA 20010816 update. 2001-08-26 22:28:18 +00:00
Peter Wemm d675a0adcc I missed a typo in the last commit: s/whach/which/
Submitted by:	bde
2001-08-26 21:55:54 +00:00
Peter Wemm 4ea059e15f The EXTENDED_GEOMETRY flag is really bit 7. This affects >2GB drives.
PR:		29454
Submitted by:	Rob Manchester <rmanches@vmware.com>
2001-08-26 21:51:35 +00:00
Ian Dowse be70fc04ce Stop using dirhash when a directory is removed, and ensure that we
never attempt to hash directories once they are deleted. This fixes
a problem where operations on a deleted directory could trigger
dirhash sanity panics.
2001-08-26 20:47:19 +00:00
George C A Reid 874f2e78b4 Add support for the SiS 7018
PR:		30100
Submitted by:	Ada Lim <adal@cse.unsw.edu.au>
2001-08-26 19:15:28 +00:00
Andrey A. Chernov fcbe9614ef Cosmetique & style fixes from bde 2001-08-26 10:28:58 +00:00
Andrey A. Chernov c4778eed9f Cosmetique & style fixes from bde 2001-08-26 10:23:49 +00:00
Bill Fumerola 52cf11d8a1 the IP_FW_GET code in ip_fw_ctl() sizes a buffer to hold information
about rules and dynamic rules. it later fills this buffer with these
rules.

it also takes the opporunity to compare the expiration of the dynamic
rules with the current time and either marks them for deletion or simply
charges the countdown.

unfortunatly it does this all (the sizing, the buffer copying, and the
expiration GC) with no spl protection whatsoever. it was possible for
the dynamic rule(s) to be ripped out from under the request before it
had completed, resulting in corrupt memory dereferencing.

Reviewed by:	ps
MFC before:	4.4-RELEASE, hopefully.
2001-08-26 10:09:47 +00:00
Benno Rice 035dbc3cb5 Pass NULL instead of MAXPHYS to the DMA allocation method. Be a bit more
verbose if we fail to allocate the DMA buffer.
2001-08-26 07:07:47 +00:00
Warner Losh f711f84740 Stop dereferencing 'r' unconditionally. Maybe it is NULL when ISA
mode and using polling mode.
2001-08-26 04:05:07 +00:00
Ian Dowse 2ed42812bd When compacting directories, ufs_direnter() always trusted DIRSIZ()
to supply the number of bytes to be bcopy()'d to move an entry. If
d_ino == 0 however, DIRSIZ() is not guaranteed to return a sensible
length, so ufs_direnter could end up corrupting a directory during
compaction. In practice I believe this can only happen after fsck_ffs
has fixed a previously-corrupted directory.

We now deal with any mid-block unused entries specially to avoid
using DIRSIZ() or bcopy() on such entries. We also ensure that the
variables 'dsize' and 'spacefree' contain meaningful values at all
times. Add a few comments to describe better this intricate piece
of code.

The special handling of mid-block unused entries makes the dirhash-
specific bugfix in the previous revision (1.53) now uncecessary,
so this change removes it.

Reviewed by:	mckusick
2001-08-26 01:25:12 +00:00
Warner Losh 826fac3f15 Fix last second typo 2001-08-25 22:53:47 +00:00
Warner Losh 1fa93154aa Back out the isa/pci string reporting. It may cause panics. 2001-08-25 22:45:45 +00:00
Warner Losh c98c9548b1 The tunable is hw.pcic.irq, but the hw.pcic.override_irq was how it was
reported in sysctl.
2001-08-25 22:39:44 +00:00
Warner Losh 5cb1fce026 Fix cut-and-paste-o that Nate found. We were setting csc_route twice,
rather than setting it once and setting func_route when we can't route
PCI interrupts.
2001-08-25 22:04:00 +00:00
Brian Somers 86b2fc4de5 TUNSIFINFO now expects IFF_MULTICAST to be OR'd with either IFF_POINTOPOINT
or IFF_BROADCAST.  If it's not, the IFF_MULTICAST is removed.

This is in line with how NetBSD & OpenBSD do it.
2001-08-25 09:12:57 +00:00
Peter Wemm 359ebc389c Argh! Revert accidental commit. 2001-08-25 07:42:27 +00:00
Warner Losh 0b370908b2 First cut at getting the ISA routing working. If we can't route a PCI
interrupt for the CSC interrupt, then we revert to ISA.  If we didn't
have an interrupt set up with hw.pcic.irq, then do polling.

Also, don't complain about ignoring function 1 for any devices except
pcic devices.  This would normally only show up if someone set
hw.pcic.ignore_function_1=1.

MFC: as soon as I can test it on some troublesome laptops.
2001-08-25 06:40:00 +00:00
Peter Wemm 3516c025ff Implement idle zeroing of pages. I've been tinkering with this
on and off since John Dyson left his work-in-progress.

It is off by default for now.  sysctl vm.zeroidle_enable=1 to turn it on.

There are some hacks here to deal with the present lack of preemption - we
yield after doing a small number of pages since we wont preempt otherwise.

This is basically Matt's algorithm [with hysteresis] with an idle process
to call it in a similar way it used to be called from the idle loop.

I cleaned up the includes a fair bit here too.
2001-08-25 05:00:44 +00:00
Peter Wemm 547a9e66fd vm_page_zero_idle() is no longer MD. 2001-08-25 04:54:25 +00:00
Peter Wemm e220a92985 Remove a reference to MAP_INHERIT. 2001-08-25 04:27:40 +00:00
Julian Elischer 15dac10b05 Add another comment.
check for 'teh's this time..
2001-08-25 02:44:38 +00:00
Peter Wemm 268bdb43f9 Optionize UPAGES for the i386. As part of this I split some of the low
level implementation stuff out of machine/globaldata.h to avoid exposing
UPAGES to lots more places.  The end result is that we can double
the kernel stack size with 'options UPAGES=4' etc.

This is mainly being done for the benefit of a MFC to RELENG_4 at some
point.  -current doesn't really need this so much since each interrupt
runs on its own kstack.
2001-08-25 02:20:02 +00:00
Peter Wemm 61af199168 s/teh/the/ 2001-08-25 02:06:59 +00:00
Julian Elischer 6a9344d45a Add an explanatory note that would have saved me an hour or two
of confusion had it been there when I started reading the code..
2001-08-25 01:16:47 +00:00
Matt Jacob 38db9454de John Polstra
bogus additional write to WXREG_IMASK that enabled *all* interrupt causes
while I was trying to disable the chip. Oops.
2001-08-24 23:08:13 +00:00
Bosko Milekic 76dcbd6f9f Force a commit on kern_mutex.c to explain reason for last commit but while
I'm at it also add a comment in mtx_validate() explaining the purpose
of the last change.

Basically, this fixes booting kernels compiled with MUTEX_DEBUG. What used
to happen is before we setidt from init386() [still using BTX idt], we
called mtx_init() on several mutex locks, notably Giant and some others.
This is a problem for MUTEX_DEBUG because it enables mtx_validate() which
calls kernacc(), some of which in turn requires Giant.
Fix by calling kernacc() from mtx_validate() only if (!cold).
2001-08-24 23:00:59 +00:00
Bosko Milekic ab07087e16 *** empty log message *** 2001-08-24 22:53:45 +00:00
Matthew Dillon 2ee4dc6565 Add INHERIT_XXX defines for minherit() system call.
Remove MAP_INHERIT - it is no longer supported.
2001-08-24 19:48:07 +00:00
Matthew Dillon 676274db9b Remove support for the badly broken MAP_INHERIT (from -current only). 2001-08-24 19:29:56 +00:00
Matthew Dillon c45da89917 Remove MAP_NOEXTEND. It came from 4.4-lite and not only was never
implemented, but mmap()'s default behavior is *already* to not extend
files.  Only write() or ftruncate() can extend a file.
2001-08-24 18:22:46 +00:00
John Baldwin 6385dec00e Style nits:
- Don't use punctuation or newlines in panic messages.
- Remove excess blank lines.

Requested and partially submitted by:	bde
2001-08-24 17:46:58 +00:00
Warner Losh d625c99d74 Explain what we're doing in pcic_pci_shutdown a little better. Try to
explain the subtle side effects that are going to happen and why we go
ahead and ack the interrupt source.  This stuff is tricky to get
right.

Also, emperical tests have shown that doing a shutdown in attach to be
ineffectual, so remove it from there.  Analysis of the code paths
shows that nearly identical writes to these registers happen in later
parts of the code.  The hanging problem on thinkpads when we change
the interrupt routing type is something else.
2001-08-24 17:29:42 +00:00
John Baldwin e5dfa86a70 Axe a commented, unused #define related to the old giant lock. 2001-08-24 16:52:31 +00:00
John Baldwin 134b29765c INTREN() and INTRDIS() have been MP safe for a while. Don't say that they
are "soon to be" MP safe in the comments.
2001-08-24 16:51:47 +00:00
John Baldwin a0f831f573 Remove references to the old giant kernel lock in various comments. 2001-08-24 16:46:15 +00:00
Peter Pentchev ccdbd10cb7 Prevent passing a null pointer as a filename to vn_open(),
if for some reason expand_name() failed to build a core file name.

PR:		29931
Submitted by:	Foldi Tamas <crow@kapu.hu>
Reviewed by:	dd, -arch
MFC after:	1 month
2001-08-24 15:49:30 +00:00
Andrey A. Chernov 5215e1ea12 Copy from kern_lockf.c: remove extra check 2001-08-24 10:22:16 +00:00
Andrey A. Chernov dc6e1079e6 Remove extra check unneded now 2001-08-24 10:20:26 +00:00
Peter Wemm c1c2006ca7 Export the actual KERNBASE to the symbol table. We can use nlist() to get
this without having to second guess it in userland.
2001-08-24 08:29:54 +00:00
Peter Wemm 5897d41109 Move cpu_fxsr definition to C code (so debug info is generated) and where
it is easily #ifdef'ed so that we dont miss unintentional references to it.
2001-08-24 08:27:24 +00:00
Warner Losh 662460d3d5 Move code to shutdown the pcic_pci_shutdown. Call it on system
shutdown and also before we get going with the device initialization.
This may fix the hangs some people are seeing on warmboot.  It appears
that some machines will reset the cardbus bridge on boot, while others
don't.  So we turn off the card, and ack the interrupts (which likely
is a nop in the shutdown case since we're still fielding interrupts).
This should turn off the interrupts.

Since I don't have hardware that hangs on reboot, I'm committing this
without testing that aspect of the patch (it causes no harm on my
Dell).
2001-08-24 07:43:35 +00:00
Warner Losh 9bec31a4c0 Two fixes. First, put into place a more generic chipset specific
initialization structure.  Warn the user for those chipsets that
aren't yet customized that they might not work.  Second, try to power
off the slot on attach and ack the interrupts.  I don't know, but this
might solve the hangs that people will see on Thinkpads if they set
hw.pcic.init_routing=1.
2001-08-24 07:30:18 +00:00
Nick Sayer 2afcd749c7 Get rid of redundant device_set_desc. Both the PCI and PCCARD versions
do this in the probe routine now.
2001-08-24 05:47:50 +00:00
Nick Sayer fa081a357e In order for the MA301 to pass interrupts from the PCCard, you must
go into the PLX 9052's interrupt control register and turn on the magic
interrupt enable bit.

Partial thanks are due to OpenBSD for pointing out that the chip is a
PLX 9052 and pointing me to the datasheet PDF.
2001-08-24 02:14:26 +00:00
Robert Watson 670f6b2fc6 o Clarify comments in vaccess_acl_posix1e() ACL evaluation routine so
as to improve readability and accuracy.

Obtained from:	TrustedBSD Project
2001-08-24 01:41:42 +00:00
Nick Sayer 15d2a7c783 if_wi can be either pci (without pccard) or pccard 2001-08-23 23:58:49 +00:00
John Baldwin b0b7cb508c Use witness_upgrade/downgrade for sx_try_upgrade/downgrade. 2001-08-23 22:51:22 +00:00
John Baldwin 8df70cb7a9 Whitespace nit. 2001-08-23 22:47:51 +00:00
John Baldwin c19fe5e261 Add witness_upgrade() and witness_downgrade() for handling upgrades and
downgrades of shared/exclusive locks.
2001-08-23 22:47:05 +00:00
John Baldwin d7c4536a55 Convert some KASSERT()'s into if (foo) panic() because they are testing
how locks are managed by the rest of the kernel, not verifying the internal
integrity of witness itself.
2001-08-23 22:44:47 +00:00
Dima Dorfman 98ec4706ee Correct the comment about bpfattach() to match reality.
PR:		29967
Submitted by:	Joseph Mallett <jmallett@xMach.org>
2001-08-23 22:38:08 +00:00
Dima Dorfman 745bab7f84 Correct a typo in a comment: FIN_WAIT2 -> FIN_WAIT_2
PR:		29970
Submitted by:	Joseph Mallett <jmallett@xMach.org>
2001-08-23 22:34:29 +00:00
John Baldwin 1432aa0c5e Add a new kernel option RESTARTABLE_PANICS. If this option is present,
then one can restart from a panic by resetting the panicstr variable to
NULL.  This commit conditionalizes the previously committed functionality
on this variable.  It also removes the __dead2 attribute from the panic()
function so that when one continues from a panic() the behavior will
be predictable.
2001-08-23 20:32:21 +00:00
Bill Paul 645ed1a78b Fix a bug in the ste_setmulti() routine. The NIC has 4 16-bit multicast
hash registers, not 2 32-bit ones. This would prevent the multicasr filter
from being programmed correctly in some cases.
2001-08-23 18:22:55 +00:00
Andrey A. Chernov f6bf1abc1b Stupid error from my side in prev. commit: || -> && 2001-08-23 18:02:29 +00:00
John Baldwin e2870579fa Clear the sx_xholder pointer when downgrading an exclusive lock. 2001-08-23 17:57:37 +00:00
Andrey A. Chernov 5d97bedb22 vn_stat(): if va_size (u_quad_t) > OFF_MAX, return EOVERFLOW, don't copy it
blindly to st_size
2001-08-23 17:56:48 +00:00
Andrey A. Chernov 2a31175b6e Copy yet one check for SEEK_END overflow 2001-08-23 17:12:42 +00:00
Andrey A. Chernov 6fb9fbceab Add yet one check for SEEK_END overflow 2001-08-23 17:09:23 +00:00
Andrey A. Chernov db106eff39 lseek: fix check for vattr.va_size overflow. Check suggested by bde simple not
works with unsigned types.
2001-08-23 17:01:25 +00:00
Andrey A. Chernov e02faad5ca Implement l_len<0 per POSIX check.
Check for valid l_whence too.
2001-08-23 16:13:59 +00:00
Andrey A. Chernov ea4313e351 Copy my newly introduced l_len<0 'oops' fix from kern_lockf.c 2001-08-23 16:06:14 +00:00
Andrey A. Chernov 62be011ebd Oops, fix my broken handling of new l_len<0 case 2001-08-23 16:00:27 +00:00
Andrey A. Chernov e3e2c03de3 Copy POSIX l_len<0 handling from kern_lockf.c 2001-08-23 15:44:24 +00:00
Andrey A. Chernov f510e1c2ec Originally BSD return EINVAL for l_len < 0, but now POSIX wants it too,
so implement POSIX l_len < 0 handling.
2001-08-23 15:40:30 +00:00
Andrey A. Chernov bbf6984cec Cosmetique: correct English in comments
non-cosmetique: add missing break; - original code was broken here
2001-08-23 14:45:31 +00:00
Andrey A. Chernov 6d24c65d96 Cosmetique: correct English in comments
Pointed by:	bde
2001-08-23 14:41:39 +00:00
Andrey A. Chernov 6c3f4fef64 Even better move: suppose that server is able to handle SEEK_END,
so check arguments for all but not SEEK_END case, leaving SEEK_END
handling for server
2001-08-23 14:21:26 +00:00
Andrey A. Chernov e018907ed4 Apparently SEEK_END locking not supported by NFS. Previous variant
returns EINVAL in that case, change it to EOPNOTSUPP.
2001-08-23 14:09:16 +00:00
Andrey A. Chernov b82f5b624c Cosmetique: more <sys/*> into one group, separate include families by
blank line
2001-08-23 13:51:17 +00:00
Andrey A. Chernov fb2f187058 Move <machine/*> after <sys/*>
Pointed by:	bde
2001-08-23 13:27:58 +00:00
Andrey A. Chernov b44af710d3 Move <machine/*> after <sys/*>
Pointed by:	bde
2001-08-23 13:21:17 +00:00
Andrey A. Chernov 4b207d9868 Move <machine/*> after <sys/*>
Add missing fdrop() before EOVERFLOW

Pointed by:	bde
2001-08-23 13:19:32 +00:00
Cameron Grant 4132a3b206 the feederchain builder is currently broken for recording channels. disable
it until it is fixed.  this limits recording to native formats and speeds
only.
2001-08-23 12:27:27 +00:00
Cameron Grant 334326a17f handle bogus values passed to SOUND_PCM_WRITE_CHANNELS/SNDCTL_DSP_CHANNELS
ioctls better- if 0 is passed, return the current setting.  if 1 or 2 are
passed, behave accordingly.  treat values >2 as 2.

PR:		kern/29964
2001-08-23 12:21:12 +00:00
Cameron Grant 48875621e1 make the 4dwave nx chip work
Submitted by:	Philippe Anel <xigh@noos.fr>
2001-08-23 12:02:29 +00:00
Cameron Grant 92f39b2c05 MFS: make SNDCTL_DSP_SETTRIGGER work 2001-08-23 11:58:38 +00:00
Cameron Grant 1662598f0c MFS: allow multiple opens of mixer devices 2001-08-23 11:56:07 +00:00
Cameron Grant 67b1dce3bc many changes:
* add new channels to the end of the list so channels used in order of
addition

* de-globalise definition of struct snddev_info and provide accessor
functions where necessary.

* move the $FreeBSD$ tag in each .c file into a macro and allow the
/dev/sndstat handler to display these when set to maximum verbosity to aid
debugging.

* allow each device to register its own sndstat handler to reduce the amount
of groping sndstat must do in foreign structs.
2001-08-23 11:30:52 +00:00