Commit Graph

49375 Commits

Author SHA1 Message Date
Julian Elischer
6222ded017 Don't ask for this for modules. no modules need to know about preemption at the moment 2004-09-01 18:29:57 +00:00
Brooks Davis
9e734b4468 Use a spare byte in struct if_data to store the structure size without
increasing it.  Add code to ifconfig to use this size to find the
sockaddr_dl after the struct if_data in the routing message.  This
allows struct if_data to grow (up to 255 bytes) without breaking
ifconfig.

Submitted by:	peter
2004-09-01 18:22:14 +00:00
Julian Elischer
7e37fb1729 *Blush* forgot to test non SMP builds.. oddly enough some UP code (particularly
in the acpi code) seems to want this in a UP build. (I guess so you can have
a sigle kernel module that works for both)
2004-09-01 18:05:43 +00:00
Alan Cox
e33353b52b Modify pmap_pte() to support its use on non-current, non-kernel pmaps
without holding Giant.
2004-09-01 18:04:22 +00:00
Nate Lawson
0c601400a3 Disable links after getting the possible resources. Even though _DIS
should only affect current resources, it seems best to wait until all
configuration is done before disabling it.  If this fixes any problems, it
is a MT5 candidate.
2004-09-01 17:59:29 +00:00
Søren Schmidt
8ea3547a15 Cleanup the storing and printing of the device transfermode for SATA. 2004-09-01 12:15:44 +00:00
Scott Long
f164d4148e Protect the PREEMPTION logic with #ifdef _KERNEL to fix the build. 2004-09-01 10:12:08 +00:00
Julian Elischer
02ea3bcab9 Only turn preemption for 4bsd.
it's still poison for ULE.
2004-09-01 09:01:32 +00:00
Alfred Perlstein
20dc1b47c1 Cleanup paths.
Submitted by: ru
2004-09-01 07:53:04 +00:00
Ruslan Ermilov
5eadd7403e Removed -Wall from CFLAGS. 2004-09-01 07:39:12 +00:00
Ruslan Ermilov
7206243f04 Mechanically tidy up the contents of CLEANFILES:M*.h: kmod.mk
automatically removes opt_*.h and if_*.h found in SRCS.
2004-09-01 07:12:24 +00:00
Ruslan Ermilov
5355cfee73 bsd.kmod.mk knows how to clean up opt_*.h files automatically,
and has the necessary magic to create empty opt_*.h files.
2004-09-01 06:51:43 +00:00
Julian Elischer
6804a3ab6d Give the 4bsd scheduler the ability to wake up idle processors
when there is new work to be done.

MFC after:	5 days
2004-09-01 06:42:02 +00:00
Dag-Erling Smørgrav
037fc73d96 Add PCI ID for the BCM4401-B0.
Submitted by:	krion
MFC after:	3 days
2004-09-01 06:10:11 +00:00
Julian Elischer
2630e4c90c Give setrunqueue() and sched_add() more of a clue as to
where they are coming from and what is expected from them.

MFC after:	2 days
2004-09-01 02:11:28 +00:00
Brooks Davis
b443062227 General modernization of coda:
- Ditch NVCODA
 - Don't use a static major
 - Don't declare functions extern

Reviewed by:	peter
2004-09-01 01:19:52 +00:00
Julian Elischer
3e0158cff6 Note free bit.. as per the flags word.
MFC after:	2 days
2004-08-31 23:28:23 +00:00
Matthew N. Dodd
c15033ef44 Clarify SDT feature word bits.
Obtained from:	 NetBSD
2004-08-31 21:51:51 +00:00
Matthew N. Dodd
320be82c0f Fix checksum calculation.
Submitted by:	 Jean Delvare <khali@linux-fr.org>
2004-08-31 21:45:30 +00:00
Warner Losh
389bdd096c When ISA_PNP_PROBE is called, it will return 0 when it finds a device,
ENOENT when there's no PNP ID for this device node, or ENXIO when there
is one, but it doesn't match.

In the nonPNP case (as most Alpha systems appear to be), we were
treating the error return as an error, when it should be have ignored
it.  Version 1.9 properly ignored it, but the attach re-write of 1.10
introduced this logic error.

Pointy Hat to: phk (for breaking it then asking me to fix it :-)
Sponsored by: The Voices in Bill Paul's Head, LLC
2004-08-31 20:37:10 +00:00
Alfred Perlstein
4d1183c13e Wrong makefile in the wrong place.
Pointed out by: scottl
2004-08-31 17:16:53 +00:00
Scott Long
2c098cd60f Make coda5 compile. 2004-08-31 13:37:51 +00:00
Ruslan Ermilov
8bd82895df Fixed the module build. 2004-08-31 12:17:47 +00:00
David Xu
cf1867f932 Remove TDP_USTATCLOCK, we no longer need it because we now always
update tick count for userland in thread_userret. This change
also removes a "no upcall owned" panic because fuword() schedules
an upcall under heavily loaded, and code assumes there is no upcall
can occur.

Reported and Tested by: Peter Holm <peter@holm.cc>
2004-08-31 11:52:05 +00:00
Julian Elischer
5995adc206 Remove an unneeded argument..
The removed argument could trivially be derived from the remaining one.
That in turn should be the same as curthread, but it is possible that curthread could be expensive to derive on some syste,s so leave it as an argument.
Having both proc and thread as an argumen tjust gives an opportunity for
them to get out sync.

MFC after:	3 days
2004-08-31 07:34:54 +00:00
Julian Elischer
99e9dcb817 Remove sched_free_thread() which was only used
in diagnostics. It has outlived its usefulness and has started
causing panics for people who turn on DIAGNOSTIC, in what is otherwise
good code.

MFC after:	2 days
2004-08-31 06:12:13 +00:00
Peter Wemm
5fe155d0fd Add the mp_watchdog hooks, although it locks up my SMP test box. It might
be useable to somebody.
2004-08-30 23:33:33 +00:00
Peter Wemm
f37a929ca1 Kill count device support from config. I've changed the last few
remaining consumers to have the count passed as an option.  This is
i4b, pc98/wdc, and coda.

Bump configvers.h from 500013 to 600000.

Remove heuristics that tried to parse "device ed5" as 5 units of the ed
device.  This broke things like the snd_emu10k1 device, which required
quotes to make it parse right.  The no-longer-needed quotes have been
removed from NOTES, GENERIC etc.  eg, I've removed the quotes from:
   device  snd_maestro
   device  "snd_maestro3"
   device  snd_mss

I believe everything will still compile and work after this.
2004-08-30 23:03:58 +00:00
Peter Wemm
c591d41f7c Add a suffix descriptor for the acpi thermal values as a hint for the userland
sysctl tool to print a more readable value for temperatures.
2004-08-30 22:42:10 +00:00
Alan Cox
f489bf21ec - Introduce a lock for synchronizing access to the pvo and pteg tables.
- In pmap_enter(), only the acquisition and release of the page queues
   lock needs to check the bootstrap flag.

Tested by: gallatin@
2004-08-30 21:39:22 +00:00
Nate Lawson
885128efdc Fix _FDI drive type probing. The new fd child is not an ACPI device while
the old one is.  Hence we need to evaluate the old one for _FDI since it
has a valid ACPI_HANDLE ivar.  This is a minimal fix.  Make a note that a
more complete one is to make fdc support the ACPI_HANDLE ivar for its
children.

This and the previous change are MT5 candidates.
2004-08-30 21:35:34 +00:00
Nate Lawson
f40c77a223 Fix _FDE probing by using the buffer contents instead of the buffer
object itself.  ACPI-CA returns an ACPI_OBJECT of type Buffer rather than
the buffer contents itself.
2004-08-30 21:13:03 +00:00
Justin T. Gibbs
08bbe9ff04 Correct a typo in a comment: alloated->allocated
Reported by: Jens Schweikhardt <schweikh@schweikhardt.net>
2004-08-30 20:15:42 +00:00
Justin T. Gibbs
74c91ec564 Correct a typo in a comment: alloation->allocation
Reported by: Jens Schweikhardt <schweikh@schweikhardt.net>
2004-08-30 20:14:21 +00:00
Pawel Jakub Dawidek
6d7b8aecd3 Allow to configure debug level from /boot/loader.conf. 2004-08-30 18:50:06 +00:00
Wilko Bulte
0d86d31bba Add em(4) to Alpha. I had a couple running recently on Alpha and it
appeared to work fine.

Submitted by:	Konstantin Saurbier saurbier at mathematik uni-bielefeld de
2004-08-30 18:40:00 +00:00
Robert Watson
c6bfdc5d32 Acquire Giant arounds calls into the linker from Netgraph sockets.
We now no longer hold Giant in send(), so it isn't inheritted by the
linker, which calls into VFS.

Reported by:	glebius
Discussed with:	glebius, bz
2004-08-30 14:41:25 +00:00
Poul-Henning Kamp
dcbd0fe5aa Add more KASSERTS and checks. 2004-08-30 09:33:06 +00:00
Colin Percival
972be79add Don't g_waitidle() when initializing a preloaded md. This fixes a
deadlock which otherwise occurs during the boot process.

Reported by:	kensmith
MFC after:	3 days
		(assuming that re@ approves)
2004-08-30 08:38:30 +00:00
Brooks Davis
1fc4519b1d Add a new variable, ifi_epoch, to struct if_data. It is set to the last
time the interface counters were zeroed, currently the time if_attach()
was called.  It is indentended to be a valid value for RFC2233's
ifCounterDiscontinuityTime and to make it easier for applications to
verify that the interface they find at a given index is the one that was
there last time they looked.

An if_epoch "compatability" macro has not been created as ifi_epoch has
never been a member of struct ifnet.

Approved by:	andre, bms, wollman
2004-08-30 06:29:26 +00:00
Warner Losh
2063e05140 Fix BUS_DEBUG case 2004-08-30 05:48:49 +00:00
Yaroslav Tykhiy
b9803f29dd Use an ANSI-style definition for slstart()
in accord with the rest of the file.
2004-08-30 04:48:52 +00:00
Yaroslav Tykhiy
ecfb8f3f7b Grant the poor old SLIP driver with an if_start handler
so that it becomes happy and no longer panics the system
upon getting the very first packet to transmit.

Reported and tested by:	Igor Timkin <ivt@gamma.ru>
Reviewed by:		rwatson
MFC after:		5 days
2004-08-30 04:32:52 +00:00
Alan Cox
bfa15df9ba Remove unnecessary check for curthread == NULL. 2004-08-30 03:52:05 +00:00
Scott Long
fffdbac7c4 Enable aac(4) module build for amd64 2004-08-30 03:37:36 +00:00
Scott Long
7aabd9220d Only compile aac_linux.ko for i386 2004-08-30 03:35:17 +00:00
Marcel Moolenaar
224407d6a8 s/ENTRY/ENTRY_NOPROFILE/g for particular functions that do not follow
the C calling convention or are otherwise not regular functions. This
allows us to boot a profiling kernel.
2004-08-30 01:32:28 +00:00
Pawel Jakub Dawidek
2e4db7cfd7 Add a missing '\n'. 2004-08-30 01:10:20 +00:00
David Xu
45a4bfa17d Only test return_instead if P_SINGLE_EXIT is set, otherwise a fork()
syscall can interrupt other thread's syscall in sleepq_catch_signals().
Current, all callers know thread_suspend_check may suspend thread
itself, so we need't to check return_instead for normal suspension
flags (no P_SINGLE_EXIT set).

Tested by: deischen
Reported by: Maarten L. Hekkelman <m.hekkelman@cmbi.kun.nl>
2004-08-29 23:10:02 +00:00
Alan Cox
9b98b79683 Move the acquisition and release of the lock on the object at the head of
the shadow chain outside of the loop in vm_object_madvise(), reducing the
number of times that this lock is acquired and released.
2004-08-29 20:14:10 +00:00
Dag-Erling Smørgrav
bed2969d74 Remove the last remnants of HW_WDOG (no, really!) 2004-08-29 19:19:38 +00:00
Marcel Moolenaar
d4da990081 In alpha_pci_alloc_resource(), when allocating a memory resource,
do not set the virtual address to the bus address when the bus
doesn't have either of the PCI_RF_DENSE or PCI_RF_BWX flags set.
The TGA driver uses the virtual address to access the registers,
which on some machines can cause a memory management fault.  Map
the bus address as K0SEG virtual memory instead. Note that with
some hardware combinations involving the TGA2 adapter this change
merely results that the memory management fault is replaced by a
machine check.
2004-08-29 19:07:14 +00:00
Warner Losh
f52c5866ea Initial support (disabled) for rebidding devices. I've been running
this in my tree for a while and in its disabled state there are no
issues.  It isn't enabled yet because some drivers (in acpi) have side
effects in their probe routines that need to be resolved in some
manner before this can be turned on.  The consensus at the last
developer's summit was to provide a static method for each driver
class that will return characteristics of the driver, one of which is
if can be reprobed idempotently.
2004-08-29 18:25:21 +00:00
Warner Losh
3cdf2a3f20 MFp4: Merge in the patches, submitted long ago by someone whose email
address I've lost, that move the location information to the atttach
routine as well.  While one could use devinfo to get this data, that
is difficult and error prone and subject to races for short lived
devices.

Would make a good MT5 candidate.
2004-08-29 18:11:10 +00:00
Ruslan Ermilov
03fd8674c1 Finish the removal of the HW_WDOG option.
Hopefully, we'll finally have the compilable LINT kernels again.  ;)
2004-08-29 15:03:06 +00:00
Pawel Jakub Dawidek
45d5e85a40 GCC, ehh. 2004-08-29 14:29:30 +00:00
Hidetoshi Shimokawa
ce7bda463c Remove an unused variable. 2004-08-29 13:45:55 +00:00
Dag-Erling Smørgrav
b8e543f9f1 Back out previous commit, ichwd is i386-only. 2004-08-29 11:26:36 +00:00
Dag-Erling Smørgrav
aa8f5987e0 Add a section for hardware watchdog timers, initially populated by ichwd.
MFC after:	3 days
2004-08-29 11:11:31 +00:00
Dag-Erling Smørgrav
0eac4495db Remove the HW_WDOG option; it serves no purpose.
MFC after:	3 days
2004-08-29 11:10:09 +00:00
Dag-Erling Smørgrav
6c420ed90e Back out the two previous commits; ichwd is i386-only. 2004-08-29 10:52:39 +00:00
David E. O'Brien
6d272d3c07 Enable more modules on AMD64:
ciss em ext2fs i2c ida iir ips lnc mly safe scsi_low smbfs sppp twa
2004-08-29 10:05:00 +00:00
David E. O'Brien
231cd70bbe Enable sound modules. 2004-08-29 09:14:18 +00:00
Ruslan Ermilov
7bad922a88 Fixed the module name (macros don't work here). 2004-08-29 07:49:53 +00:00
Ian Dowse
776981d545 Add an entry for ichwd to hopefully unbreak the LINT build. 2004-08-29 03:59:49 +00:00
Marcel Moolenaar
cf96390dc6 Do not match TGA2 adapters. They are not compatible with TGA adapters,
nor are they 3D accelarators as the description would like us to
believe. Since the TGA2 adapter has a VGA mode (unlike the TGA adapter),
one can use the VGA driver instead.

This fixes GENERIC kernels on alpha with TGA2 adapters.
2004-08-29 02:53:07 +00:00
Ian Dowse
efe26acda8 Fix two cases where a successful return from usbd_transfer() would
be treated as an error and cause a transfer to be freed twice. This
can probably only happen at boot time when transfers are processed
synchronously.
2004-08-29 02:35:59 +00:00
Ian Dowse
83c457dc27 Unconditionally add `-fno-omit-frame-pointer' to CFLAGS when building
modules on the amd64 platform. Without this, ddb stack traces cannot
follow module function calls, which makes debugging very difficult.
2004-08-29 02:00:50 +00:00
Ian Dowse
70b7ffee1b Add support for completing the installation of ELF relocatable
object format modules that were read in by the loader. Loading
modules via the loader should now work on the amd64 platform.
2004-08-29 01:21:51 +00:00
Ian Dowse
632ca524c3 Prevent vm_page_zero_idle_wakeup() from attempting to wake up the
page zeroing thread before it has been created. It was possible for
calls to free() very early in the boot process to panic here because
the sleep queues were not yet initialised. Specifically, sysinit_add()
running at SI_SUB_KLD would trigger this if the array of pointers
became big enough to require uma_large_alloc() allocations.

Submitted by:	peter
2004-08-29 01:02:33 +00:00
Ian Dowse
941fdb393b Add the loader side of support for preloading ELF relocatable object
format modules, which are currently only used on the amd64 platform.
This initial implementation just parses enough of the module to
allow it to extract dependencies and load all the bits into the
right place in memory, so the kernel must still do the full relocation
and linking. The details of the loaded sections are passed to the
kernel by supplying a copy of the ELF section header table as module
metadata with the MODINFOMD_SHDR tag.
2004-08-29 00:48:42 +00:00
Ian Dowse
45b8d7c46e Separate out the ELF relocation code from the ELF loader, and add
better relocation support for the amd64 and i386 platforms. This
should not result in any change in functionality, but moves a step
towards supporting the relocatable object file modules on amd64.

The same hack/trick as load_elf*.c uses is used here to simultaneously
support both elf32 and elf64 on amd64 and i386.
2004-08-28 23:03:05 +00:00
Wilko Bulte
11e9b7ef70 Stop pretending: TurboLaser support is really broken
MFC after:	2 days
2004-08-28 21:47:24 +00:00
Wilko Bulte
c8d51c4c0d Stop pretending: TurboLaser support is really broken.
MFC after:	2 days
2004-08-28 21:42:15 +00:00
Alan Cox
c3d11d22be Eliminate unnecessary indirection. 2004-08-28 20:27:12 +00:00
Ruslan Ermilov
cd0bd20d63 Fixed untested change. 2004-08-28 19:40:03 +00:00
Robert Watson
ace437c3c6 Correct typo in printf() warning.
Submitted by:	Pawel Worach <pawel.worach at telia.com>
2004-08-28 19:27:25 +00:00
Alexander Leidinger
3e41e813b7 Add the Intel ICH watchdog timer driver.
Approved by:	des
2004-08-28 15:41:31 +00:00
Robert Watson
98f6a62499 Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correct
operation using NET_NEEDS_GIANT().  This will result in a boot-time
restoration of Giant-enabled network operation, or run-time warning on
dynamic load (applicable only to the Netgraph component).  Additional
components will likely need to be marked with this in the future.
2004-08-28 15:24:53 +00:00
Robert Watson
1d8cd39e71 Change the default disposition of debug.mpsafenet from 0 to 1, which
will cause the network stack to operate without the Giant lock by
default.  This change has the potential to improve performance by
increasing parallelism and decreasing latency in network processing.

Due to the potential exposure of existing or new bugs, the following
compatibility functionality is maintained:

- It is still possible to disable Giant-free operation by setting
  debug.mpsafenet to 0 in loader.conf.

- Add "options NET_WITH_GIANT", which will restore the default value of
  debug.mpsafenet to 0, and is intended for use on systems compiled with
  known unsafe components, or where a more conservative configuration is
  desired.

- Add a new declaration, NET_NEEDS_GIANT("componentname"), which permits
  kernel components to declare dependence on Giant over the network
  stack.  If the declaration is made by a preloaded module or a compiled
  in component, the disposition of debug.mpsafenet will be set to 0 and
  a warning concerning performance degraded operation printed to the
  console.  If it is declared by a loadable kernel module after boot, a
  warning is displayed but the disposition cannot be changed.  This is
  implemented by defining a new SYSINIT() value, SI_SUB_SETTINGS, which
  is intended for the processing of configuration choices after tunables
  are read in and the console is available to generate errors, but
  before much else gets going.

This compatibility behavior will go away when we've finished the last
of the locking work and are confident that operation is correct.
2004-08-28 15:11:13 +00:00
Robert Watson
2a567ae5ec Tag a last set of PCI network interfaces as IFF_NEEDSGIANT until they
are either locked down or demonstrated MPSAFE.
2004-08-28 15:10:35 +00:00
Ian Dowse
c0b43624d5 Add a few helper functions for zeroing kernel space and reading
from specified file offsets. Make use of these in load_elf.c.
2004-08-28 14:57:34 +00:00
MIHIRA Sanpei Yoshiro
ea263191fd Add support Corega CG-LAPCIGT Gigabit Ethernet(8169S)
PR:		[FreeBSD-users-jp 80667]
Submitted by:	FUJIMOTO Kou <fujimoto@j.dendai.ac.jp>
MFC after:	1 week
2004-08-28 10:59:02 +00:00
Yaroslav Tykhiy
a30e1135b4 Don't be too smart, just try packet mode of INT13 first.
This way of operation is more robust than the "AI" used
before.

Add flags to mbr accessible from make.conf as BOOT_MBR_FLAGS.
Only one flag is defined now, "allow using packet mode", which
is 0x80 in accord with the rest of i386 boot code.  The "packet"
flag is on by default.

PR:             i386/70241
Submitted by:   Valentin Nechayev <netch <@> netch.kiev.ua> (inital version)
Discussed with: jhb (by Valentin Nechayev)
Tested on:      bochs (with EDD turned on or off by patching the BIOS), PCs
2004-08-28 08:39:35 +00:00
Yaroslav Tykhiy
57888b4c83 Try packet mode of INT13 on a hard disk first if not prohibited by
the flag, fall back to the old INT13/AH=02 function if that fails.
This way of operation is less likely to fail with modern BIOSes and
large disks of strange geometries.

PR:		i386/70241
Submitted by:	Valentin Nechayev <netch <@> netch.kiev.ua> (inital version)
Discussed with:	jhb (by Valentin Nechayev)
Tested on:	bochs (with EDD turned on or off by patching the BIOS), PCs
2004-08-28 08:32:23 +00:00
David Xu
5897f840f0 1. try to use existing mailbox address in thread_update_usr_ticks.
2. remove '\n' in KASSERT.
2004-08-28 04:16:32 +00:00
David Xu
ad1280b593 Move TDF_CAN_UNBIND to thread private flags td_pflags, this eliminates
need of sched_lock in some places. Also in thread_userret, remove
spare thread allocation code, it is already done in thread_user_enter.

Reviewed by: julian
2004-08-28 04:08:05 +00:00
Pawel Jakub Dawidek
c0d68b6ef2 Use sc->sc_mediasize instead of sc->sc_provider->mediasize which contains
exactly the same value, but is shorter.
2004-08-28 02:35:43 +00:00
Pawel Jakub Dawidek
08249e9e6e Warn the user if we are not going to use whole provider space.
Requested by:	Michael Handler <handler@grendel.net>
2004-08-28 02:34:10 +00:00
Pawel Jakub Dawidek
16ebaa0793 Don't allow to insert providers, which are too small.
Reported by:	Michael Handler <handler@grendel.net>
2004-08-28 02:02:48 +00:00
Peter Wemm
6f96710c60 Backout the previous backout (with scott's ok). sched_ule.c:1.122 is
believed to fix the problem with ULE that this change triggered.
2004-08-28 01:04:44 +00:00
David E. O'Brien
dd68efd05b s/smp_rv_mtx/smp_ipi_mtx/g
Requested by:	jhb
2004-08-28 00:49:55 +00:00
Peter Wemm
91c1172a5a Commit Jeff's suggested changes for avoiding a bug that is exposed by
preemption and/or the rev 1.79 kern_switch.c change that was backed out.

The thread was being assigned to a runq without adding in the load, which
would cause the counter to hit -1.
2004-08-28 00:49:22 +00:00
Søren Schmidt
d3ef327c8d remove unused prototype 2004-08-27 22:14:45 +00:00
Roman Kurakin
6b1cbdfc68 Make code ready to switch debug.mpsafenet to 1 since I've not able to
commit MPSAFE code for now it is just IFF_NEEDSGIANT.
2004-08-27 22:14:26 +00:00
Marcel Moolenaar
82ecff453f Catch up with the drive-by renaming of IA32 to COMPAT_IA32. Missed
11 days ago when all the other places were fixed and finally caught
by the tinderbox run...
2004-08-27 21:57:00 +00:00
Lukas Ertl
5bad268cdc Move config_new_drive() to the correct place and rename it to
gv_config_new_drive().
2004-08-27 21:32:18 +00:00
Tilman Keskinoz
0039290c1f Fix a comment, IA32 was renamed to COMPAT_IA32
Approved by:	marcel
2004-08-27 21:29:20 +00:00
Justin T. Gibbs
5fb0f52712 Improve sync recovery algorithm:
o Remove PSM_SYNCERR_THRESHOLD1.  This value specified how many sync
   errors were required before the mouse is re-initialised.
   Re-initialisation is now done after (packetsize * 2) sync errors as
   things aren't likely to improve after that.

 o Reset lastinputerror when re-initialisation occurs.  We don't want
   to continue to drop data after re-initialisation.

 o Count the number of failed packets independently of the syncerrors
   statistic.  syncerrors is useful for recovering sync within a single
   packet.  pkterrors allows us to detect when the mouse changes its
   packet mode due to some external event (e.g. KVM switch).

 o Reinitialize the mouse if we see more than psmpkterrthresh errors
   during the validation period.  The validation period begins as soon
   as a sync error is detected and continues until psmerrsecs/msecs
   time has elapsed.  The defaults for these two values force a reset
   if we see two packet errors in a 2 second period.  This allows rapid
   detection of packet framing errors caused by the mouse changing packet
   modes.

 o Export psmpkterrthresh as a sysctl

 o Export psmloglevel as a sysctl.

 o Enable more debugging code to be enabled at runtime via psmloglevel.

 o Simplify verbose conditioned loging by using a VLOG macro.

 o Add several comments describing the sync recovery algorithm of
   this driver.

Large Portions by: Brian Somers <brian@Awfulhak.org>
Inspired and Frustrated by: Belkin KVMs
Reviewed by: njl, philip
2004-08-27 21:25:16 +00:00
Andre Oppermann
2580f4e584 Poll() uses the array smallbits that is big enough to hold 32 struct
pollfd's to avoid calling malloc() on small numbers of fd's.  Because
smalltype's members have type char, its address might be misaligned
for a struct pollfd.  Change the array of char to an array of struct
pollfd.

PR:		kern/58214
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
Reviewed by:	bde (a long time ago)
MFC after:	3 days
2004-08-27 21:23:50 +00:00
Andre Oppermann
5f56967319 From __FreeBSD_version 600001 on PFIL_HOOKS is permanently in the kernel and
doesn't require to include opt_pfil_hooks.h.
2004-08-27 20:01:08 +00:00
Andre Oppermann
3bc84e8a5c opt_pfil_hooks.h is no longer required. 2004-08-27 19:57:33 +00:00
Brooks Davis
b9907cd45b When detaching an interface, don't leave an obsolete pointer to the
soon to be deleted struct ifnet around.

PR:		kern/52260
MFC After:	3 days
2004-08-27 19:42:40 +00:00
Marcel Moolenaar
0f2fe153bc Move the kernel-specific logic to adjust frompc from MI to MD. For
these two reasons:
1. On ia64 a function pointer does not hold the address of the first
   instruction of a functions implementation. It holds the address
   of a function descriptor. Hence the user(), btrap(), eintr() and
   bintr() prototypes are wrong for getting the actual code address.
2. The logic forces interrupt, trap and exception entry points to
   be layed-out contiguously. This can not be achieved on ia64 and is
   generally just bad programming.

The MCOUNT_FROMPC_USER macro is used to set the frompc argument to
some kernel address which represents any frompc that falls outside
the kernel text range. The macro can expand to ~0U to bail out in
that case.
The MCOUNT_FROMPC_INTR macro is used to set the frompc argument to
some kernel address to represent a call to a trap or interrupt
handler. This to avoid that the trap or interrupt handler appear to
be called from everywhere in the call graph. The macro can expand
to ~0U to prevent adjusting frompc. Note that the argument is selfpc,
not frompc.

This commit defines the macros on all architectures equivalently to
the original code in sys/libkern/mcount.c. People can take it from
here...

Compile-tested on: alpha, amd64, i386, ia64 and sparc64
Boot-tested on: i386
2004-08-27 19:42:35 +00:00
Andre Oppermann
3d618b9443 Bump __FreeBSD_version to indicate permanent PFIL_HOOKS. 2004-08-27 19:23:24 +00:00
Marcel Moolenaar
e50cb9b07f Provide extern declarations for btext and etext when GPROF is defined.
These are referenced in subr_prof.c when building a profiling kernel.
2004-08-27 19:20:42 +00:00
Marcel Moolenaar
f697dffaa4 Have the linker provide the btext symbol when referenced. This is needed
for profiling kernels. Apparently, nobody has ever tried to build one on
alpha...
2004-08-27 19:13:35 +00:00
Alan Cox
8991a235cb The machine-independent parts of the virtual memory system always pass a
valid pmap to the pmap functions that require one.  Remove the checks for
NULL.  (These checks have their origins in the Mach pmap.c that was
integrated into BSD.  None of the new code written specifically for
FreeBSD included them.)
2004-08-27 19:06:17 +00:00
Robert Watson
24114d445c Semi-gratuitous white space synchronization with KAME tree: to reduce
diffs against #ifdef'd version of IPSEC, use "struct thread *p"
rather than "struct proc *p", fix some white space, and make some
already inconsistent white space inconsiste differently.
2004-08-27 18:41:41 +00:00
Andre Oppermann
3161f583ca Apply error and success logic consistently to the function netisr_queue() and
its users.

netisr_queue() now returns (0) on success and ERRNO on failure.  At the
moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full)
are supported.

Previously it would return (1) on success but the return value of IF_HANDOFF()
was interpreted wrongly and (0) was actually returned on success.  Due to this
schednetisr() was never called to kick the scheduling of the isr.  However this
was masked by other normal packets coming through netisr_dispatch() causing the
dequeueing of waiting packets.

PR:		kern/70988
Found by:	MOROHOSHI Akihiko <moro@remus.dti.ne.jp>
MFC after:	3 days
2004-08-27 18:33:08 +00:00
Robert Watson
3713458b99 Diff reduce against KAME: minor white space synchronization to KAME
tree.
2004-08-27 18:24:59 +00:00
Poul-Henning Kamp
1d4b1bb78d Hide a printf under bootverbose. 2004-08-27 17:08:24 +00:00
Andre Oppermann
4429922511 Properly document and enable the IPFIREWALL_FORWARD option. 2004-08-27 15:46:16 +00:00
Andre Oppermann
a9c92b54a9 In the case the destination of a packet was changed by the packet filter
to point to a local IP address; and the packet was sourced from this host
we fill in the m_pkthdr.rcvif with a pointer to the loopback interface.

Before the function ifunit("lo0") was used to obtain the ifp.  However
this is sub-optimal from a performance point of view and might be dangerous
if the loopback interface has been renamed.  Use the global variable 'loif'
instead which always points to the loopback interface.

Submitted by:	brooks
2004-08-27 15:39:34 +00:00
Andre Oppermann
319c4c256a Remove a junk line left over from the recent IPFW to PFIL_HOOKS conversion. 2004-08-27 15:32:28 +00:00
Andre Oppermann
c21fd23260 Always compile PFIL_HOOKS into the kernel and remove the associated kernel
compile option.  All FreeBSD packet filters now use the PFIL_HOOKS API and
thus it becomes a standard part of the network stack.

If no hooks are connected the entire packet filter hooks section and related
activities are jumped over.  This removes any performance impact if no hooks
are active.

Both OpenBSD and DragonFlyBSD have integrated PFIL_HOOKS permanently as well.
2004-08-27 15:16:24 +00:00
Yaroslav Tykhiy
9e4211a1b8 B1FLAGS -> BOOT_BOOT1_FLAGS, which is consistent with
naming of other boot-related make vars.
2004-08-27 15:01:56 +00:00
Søren Schmidt
dc26948b0c Fix the handling of "inflight" requests when doing reinit's.
Add missing untimeout that would get lost in handling of some
error situations, and caused what looked like random timeouts
afterwards when the timeout fired.
2004-08-27 14:48:32 +00:00
Poul-Henning Kamp
a2033c9615 Introduce g_alloc_bio() as a waiting variant of g_new_bio().
Use in places where we can sleep and where we previously failed to check
for a NULL pointer.

MT5 candidate.
2004-08-27 14:43:11 +00:00
Søren Schmidt
33203bee0c Set and reset the right bit for UDMA enable/disable on the ICH* chips. 2004-08-27 12:54:58 +00:00
Søren Schmidt
71d7101fac Rearrange the call to disk_destroy.
Suggested by:	phk
2004-08-27 12:03:18 +00:00
Tim J. Robbins
db575a8507 Remove bogus vrele() call added in previous. 2004-08-27 11:24:31 +00:00
Alexander Kabaev
4cef6d5a53 Reintroduce slightly modified patch from kern/69964. Check for
LK_HAVE_EXL in both acquire invocations.

MFC after:	5 days
2004-08-27 01:41:28 +00:00
Ian Dowse
0ca311f6a1 When trying each linker class in turn with a preloaded module, exit
the loop if the preload was successful. Previously a successful
preload was ignored if the linker class was not the last in the
list.
2004-08-27 01:20:26 +00:00
Ian Dowse
6f2e86455b Add a new module information type MODINFOMD_SHDR that will be used
by the loader to pass the section header table from preloaded ELF
relocatable modules into the kernel.
2004-08-27 01:10:16 +00:00
Nate Lawson
85cdc19d00 Always set the status and move a printf under bootverbose.
Tested by:	gj
2004-08-27 00:53:11 +00:00
David E. O'Brien
8ae136ae71 In conjunction with having boot0cfg(8) default boot0 to packet mode.
Submitted by:	Tor.Egge@cvsup.no.freebsd.org
2004-08-27 00:18:03 +00:00
Lukas Ertl
4328802ce9 When attaching a consumer from a volume to a plex, check if the
volume already has a plex attached and adjust the access counts
of the new consumer accordingly.
2004-08-26 21:04:41 +00:00
Nate Lawson
59506cd39a If getting the current setting after modifying the link failed, we assume
it succeeded.  However, we also need to set the status to AE_OK.
2004-08-26 17:14:36 +00:00
Dag-Erling Smørgrav
461af901ed Correct capitalization of DeLorme Publishing. 2004-08-26 16:59:50 +00:00
Ruslan Ermilov
f2b9afaef9 Document how a standalone module can be built with divert(4) support. 2004-08-26 14:35:05 +00:00
Ruslan Ermilov
9bfe6d472a Revert the last change to sys/modules/ipfw/Makefile and fix a
standalone module build in a better way.

Silence from:	andre
MFC after:	3 days
2004-08-26 14:18:30 +00:00
Tim J. Robbins
1a9415af17 Improve the robustness of MSDOSFSMNT_KICONV handling:
- Use copyinstr() to read cs_win, cs_dos, cs_local strings from the
  mount argument structure instead of reading through user-space pointers(!).
- When mounting a filesystem, or updating an existing mount, only try to
  update the iconv handles from the information in the mount argument
  structure if the structure itself has the MSDOSFSMNT_KICONV flag set.
- Attempt to handle failure of update_mp() in the MNT_UPDATE case.
2004-08-26 13:16:44 +00:00
Pawel Jakub Dawidek
29c78ab315 Skip providers with not defined sector size.
Reported by:	kuriyama
2004-08-26 12:42:47 +00:00
Alan Cox
7fde238f04 Remove unnecessary check for curthread == NULL. 2004-08-26 04:34:39 +00:00
Alan Cox
48d0b1a0dc Add pmap locking to many of the functions.
Many thanks to Andrew Gallatin for resolving a powerpc-specific
initialization problem in my original patch.

Tested by: gallatin@
2004-08-26 04:15:36 +00:00
Marius Strobl
8f0882f544 Don't call uart_bus_probe() for non-matching PnP-devices. Trying to probe
the keyboard controller with uart_bus_probe() caused a hang here on an i386
machine.

Approved by:	marcel
2004-08-25 22:15:33 +00:00
Robert Watson
161a0c7cff Don't hold the UNIX domain socket subsystem lock over the body of the
UNIX domain socket garbage collection implementation, as that risks
holding the mutex over potentially sleeping operations (as well as
introducing some nasty lock order issues, etc).  unp_gc() will hold
the lock long enough to do necessary deferal checks and set that it's
running, but then release it until it needs to reset the gc state.

RELENG_5 candidate.

Discussed with:	alfred
2004-08-25 21:24:36 +00:00
Nate Lawson
b0e7e61135 Remove code to initialize the lid state at boot. It interfered with lid
operation for some users with pure GPE lid switches (vs. embedded
controller.)

Tested by:	Anish Mistry <mistry.7_at_osu.edu>
MFC after:	3 days
2004-08-25 20:09:15 +00:00
Pawel Jakub Dawidek
4cf67afe37 Log verification errors at level 1. 2004-08-25 19:18:07 +00:00
David E. O'Brien
2e262ac39b Fix a bug in in_cksum_hdr w/o -O.
The C code assumes that the carry bit is always kept from the previous
operation. However, the pointer indexing requires another add operation.
Thus, the carry bit from the first operation is tromped over by the
"addl" operation that ends up following it, so the "adcl" that follows
that has no effect because the carry bit is cleared before it.
The result is checksum failure on received packets.

The larger issue is that there isn't any other way of preventing the compiler
inserting arbitrary instructions between different __asm statements (and
that the commit message in revision 1.13 of in_cksum.h is wrong on
this point).  From
http://developer.apple.com/documentation/DeveloperTools/gcc-3.3/gcc/Extended-Asm.html
	---8<---8<---8<---
	You can't expect a sequence of volatile asm instructions to remain
	perfectly consecutive. If you want consecutive output, use a single
	asm.  Also, GCC will perform some optimizations across a volatile
	asm instruction; GCC does not "forget everything" when it encounters
	a volatile asm instruction the way some other compilers do.
	---8<---8<---8<---

Also, this change also makes the ASM code much easier to read.

PR:		69257
Submitted by:	Mike Bristow <mike@urgle.com>, Qing Li <qing.li@bluecoat.com>
2004-08-25 18:28:15 +00:00
David E. O'Brien
016bdcb36a Correct style nit in rev 1.17. 2004-08-25 17:54:19 +00:00
Robert Watson
e2d2098653 Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to
prevent leakage of Giant.  With INVARIANTS, this results in an
assertion failure following execution of the RPC.  Without INVARIANTS,
it could result in problems if the NFS server is killed causing nfsd
to return to user space holding Giant.

Feet provided by:	brueffer
2004-08-25 16:52:59 +00:00
Pawel Jakub Dawidek
f0c8658d4e Dump disk number. 2004-08-25 12:14:44 +00:00
Pawel Jakub Dawidek
a7f3feff1b Allocate memory when dumping pipes with M_WAITOK flag.
On a system with huge number of pipes, M_NOWAIT failes almost always,
because of memory fragmentation.
My fix is different than the patch proposed by Pawel Malachowski,
because in FreeBSD 5.x we cannot sleep while holding dummynet mutex
(in 4.x there is no such lock).
My fix is also ugly, but there is no easy way to prepare nice and clean fix.

PR:		kern/46557
Submitted by:	Eugene Grosbein <eugen@grosbein.pp.ru>
Reviewed by:	mlaier
2004-08-25 09:31:30 +00:00
Marcel Moolenaar
04f093dde7 Get a step closer to profiling the kernel by fixing the definitions
of the MCOUNT_ENTER, MCOUNT_EXIT and MCOUNT_DECL defines. Also make
sure there's a prototype of _MCOUNT_DECL(). This allows us to build
a kernel. There are still unresolved symbols, so linking fails.
2004-08-25 08:03:48 +00:00
Marcel Moolenaar
09814dd676 Have the linker provide btext. It's used for profiling. 2004-08-25 07:43:28 +00:00
Marcel Moolenaar
f0556e70bb Make profiling actually work. The gcc compiler emits a call to the
_mcount() stub when profiling is enabled. Emit this code sequence
for assembly routines as welli (MCOUNT definition in <machine/asm.h>.
We do not pass the GOT entry however as the 4th argument, because it's
not used. The _mcount() stub calls __mcount(), which does the actual
work. Define _MCOUNT_DECL to define __mcount. We do not have an
implementation of mcount(), so we define MCOUNT as empty, but have a
weak alias to _mcount() in _mcount.S.
Note that the _mcount() stub in the kernel is slightly different from
the stub in userland. This is because we do not have to worry about
nested routines in the kernel.
2004-08-25 07:42:34 +00:00
Robert Watson
5162f7de6f if_dc includes locking, but that locking is disabled by a #ifdef
by default.  As such, mark if_dc as IFF_NEEDSGIANT until such
time as appropriate locking review and testing can take place,
and the locking can be enabled by default.

RELENG_5 candidate.
2004-08-25 03:37:25 +00:00
Robert Watson
640c9dcf69 In nfs_timer(), pass curthread rather than &thread0 into the protocol
send routine.  In IPv6 UDP, the thread will be passed to suser(), which
asserts that if a thread is used for a super user check, it be
curthread.  Many of these protocol entry points probably need to
accept credentials instead of threads.

MT5 candidate.

Noticed/tested by:	kuriyama
2004-08-25 01:23:38 +00:00
John Baldwin
ef36ad6921 Correct the arguments to kern_sigaltstack() as they were reversed.
PR:		kern/68079
Submitted by:	Georg-W. Koltermann gwk at rahn-koltermann dot de
2004-08-24 20:52:52 +00:00
John Baldwin
8a7aa72dec Regenerate after fcntl() wrappers were marked MP safe. 2004-08-24 20:24:34 +00:00
John Baldwin
2ca25ab53e Fix the ABI wrappers to use kern_fcntl() rather than calling fcntl()
directly.  This removes a few more users of the stackgap and also marks
the syscalls using these wrappers MP safe where appropriate.

Tested on:	i386 with linux acroread5
Compiled on:	i386, alpha LINT
2004-08-24 20:21:21 +00:00
Søren Schmidt
1c01d05f9c Sii_reset needs to wait up to 1 second to get slow disks with it so
use tsleep instead of DELAY.
2004-08-24 20:11:26 +00:00
Nate Lawson
dc6851d588 Catch up with i386 nexus.c rev 1.59: add bus_get_resource_list(). 2004-08-24 19:22:54 +00:00
David E. O'Brien
6cda6c4a35 sr(4) definately won't work on IA64. 2004-08-24 18:31:27 +00:00
Nate Lawson
9f65aa0340 Be sure to always unlock the sx lock when exiting the sysctl function.
MFC after:	3 days
2004-08-24 17:53:25 +00:00
Søren Schmidt
741d64783e Always pick up giant before returning from an ioctl call. 2004-08-24 15:09:05 +00:00
Robert Watson
d4e02af583 Revert previous revision, 1.7, as removal of GIANT_REQUIRED was made
in the wrong branch (and hence to the wrong function).
2004-08-24 14:17:58 +00:00
Robert Watson
b84209fbec MT4 if_fwsubr.c:1.6:
date: 2004/08/22 14:48:55;  author: rwatson;  state: Exp;  lines: +0 -2
  Don't need to assert Giant in fw_output(), only in the firewire start
  routine.

Approved by:	re (scottl)
2004-08-24 14:16:08 +00:00
Søren Schmidt
5a8f8e353e Properly check malloc returns. 2004-08-24 10:39:00 +00:00
Peter Pentchev
18aee723a3 Fix a typo (attacked -> attached).
Approved by:	sam
2004-08-24 08:47:15 +00:00
Robert Watson
fe0f2d4e11 Conditional acquisition of socket buffer mutexes when testing socket
buffers with kqueue filters is no longer required: the kqueue framework
will guarantee that the mutex is held on entering the filter, either
due to a call from the socket code already holding the mutex, or by
explicitly acquiring it.  This removes the last of the conditional
socket locking.
2004-08-24 05:28:18 +00:00
Warner Losh
0160658e84 Set the description to NULL in the right detach routine. This should
keep dangling pointers to strings in loaded modules from hanging
around after the drivers are unloaded.
2004-08-24 05:19:15 +00:00
Doug White
b3f1e85ab9 Pick up changes in rev 1.8 of src/sys/dev/ic/mpt_netbsd.c from NetBSD.
Set the DMA SGL length correctly if the DMA request must be chained because
it is too large to fit in one SGL.

This should fix this driver for some Dell Precision systems.
RELENG_5 candidate.

PR:		kern/66479
Submitted by:	HITOSHI Osada <qfh02545@nifty.com>
2004-08-24 03:47:41 +00:00
Peter Wemm
648bfe0b75 It is now an error to call pmap_unuse_pt without the paddr of the pde
that contained the pte.
2004-08-24 00:17:52 +00:00
Peter Wemm
a32f55d629 Oops, I forgot to have the idle loop call mp_grab_cpu_hlt() on the amd64
SMP case.
2004-08-24 00:16:43 +00:00
David Xu
d30412a8db Remove checking of single exit flag in thread_user_enter(), this is
generic code for threaded process, should not be here.
2004-08-23 22:54:37 +00:00
Peter Wemm
f1009e1e1f Commit Doug White and Alan Cox's fix for the cross-ipi smp deadlock.
We were obtaining different spin mutexes (which disable interrupts after
aquisition) and spin waiting for delivery.  For example, KSE processes
do LDT operations which use smp_rendezvous, while other parts of the
system are doing things like tlb shootdowns with a different mutex.

This patch uses the common smp_rendezvous mutex for all MD home-grown
IPIs that spinwait for delivery.  Having the single mutex means that
the spinloop to aquire it will enable interrupts periodically, thus
avoiding the cross-ipi deadlock.

Obtained from: dwhite, alc
Reviewed by:   jhb
2004-08-23 21:39:29 +00:00
Pawel Jakub Dawidek
c8b906bcbe Allow to set kern.geom.mirror.timeout from /boot/loader.conf. 2004-08-23 20:42:34 +00:00
Matt Jacob
e3e49f7e32 Until I can get a clearer architecture from PHK about why he wants
the geometry code to grab a mutex that prohibits any driver on the
stack below it from sleeping, it's not safe to allow anything in
the top half of isp to sleep (excepting the thread that Fibre Channel
instances use to re-scan loops/fabrics).
2004-08-23 19:04:19 +00:00
Lukas Ertl
a3423d4c6f Compare the addresses of two RAID5 work packets directly instead
of the addresses of their related bios when locking one out, since
they could share a bio and this could lead to parity corruption.
2004-08-23 17:50:18 +00:00
Nate Lawson
adad474471 Rework sysresource management. Instead of having each sysresource object
hold its own values, pass them up to the parent (acpi0) and merge/uniq them
on the way.  After the namespace evaluation, acpi will reserve these
resources and manage them via rman before bus_generic_probe() and
bus_generic_attach().  This is necessary because some systems specify
conflicting resources in separate sysresource objects.  It's also cleaner
in that the interface between sysresource and acpi is now merely the parent's
resource list.  This code handles the following cases:

1. Unique resource:  add it to the parent via bus_set_resource().
2. New wholly contained in old:  discard new.
3. New tail overlaps old head:  grow old head downward.
   AND/OR
4. New head overlaps old tail:  grow old tail upward.

Tested by:	Pawel Worach <sajd_at_telia.com>
Tested by:	Radek Kozlowski <radek_at_raadradd.com>
MFC after:	5 days
2004-08-23 16:28:42 +00:00
Nate Lawson
59d039ecc6 Add a BUS_GET_RESOURCE_LIST method for nexus.
MFC after:	3 days
2004-08-23 16:26:16 +00:00
Maxim Sobolev
c1466d61d9 My recent measurement shows that CPU_DISABLE_CMPXCHG is no longer necessary
with VmWare 4.x. At least with VmWare version 4.5.2, i386 version of
atomic_cmpset_int() is about 30 times slower than non-i386 version. It
makes this delta a good 5.3 MFC candidate, since otherwise it will
mislead users who run FreeBSD under modern VmWare otherwise.
2004-08-23 15:55:03 +00:00
Dag-Erling Smørgrav
72261b9f61 Don't try to translate the control message unless we're certain it's
valid; otherwise a caller could trick us into changing any 32-bit word
in kernel memory to LINUX_SOL_SOCKET (0x00000001) if its previous value
is SOL_SOCKET (0x0000ffff).

MFC after:	3 days
2004-08-23 12:41:29 +00:00
Yoshihiro Takahashi
f0d0ca8c3d Restore FD_DEBUG for pc98. 2004-08-23 11:59:32 +00:00
Maxim Sobolev
ae2f5301c8 o Fix whitespace bug introduced in the previous commit.
Submitted by:	ru

o Simplify p4tcc_power_profile().

Submitted by:	maxim
2004-08-23 10:09:29 +00:00
Maxim Sobolev
acac9ce485 o Extend boot output: print out mimimum/maximum performance value and number
of performance steps available;

o similarly to Enhanced SpeedStep driver, export list of all available steps
  via hw.p4tcc.cpuperf_levels sysctl.
2004-08-23 09:47:56 +00:00
Warner Losh
e412451de3 Make this compile again in the standalone and the MODULES_WITH_WORLD
environments.  Chances are good that this doesn't produce a good
module, but I leave the proper defaults to the dummy opt_* files to
the author.
2004-08-23 03:38:21 +00:00
Robert Watson
c415679d71 Remove in6_prefix.[ch] and the contained router renumbering capability.
The prefix management code currently resides in nd6, leaving only the
unused router renumbering capability in the in6_prefix files.  Removing
it will make it easier for us to provide locking for the remainder of
IPv6 by reducing the number of objects requiring synchronized access.

This functionality has also been removed from NetBSD and OpenBSD.

Submitted by:	George Neville-Neil <gnn at neville-neil.com>
Discussed with/approved by:	suz, keiichi at kame.net, core at kame.net
2004-08-23 03:00:27 +00:00
Alexander Kabaev
cffdaf2dce Temporarily back out r1.74 as it seems to cause a number of regressions
accordimg to numerous reports. It  might get reintroduced some time later
when an exact failure mode is understood better.
2004-08-23 02:39:45 +00:00
Maxime Henrion
c480dc188f Pass a correct lowaddr to bus_dma_tag_create(), lnc(4) cards can only
deal with 24-bit addresses.  While the two other attachments, namely
isa and cbus, do it properly, the PCI attachment was passing
BUS_SPACE_MAXADDR instead of BUS_SPACE_MAXADDR_24BIT.  This bug
became apparent with the new contigmalloc() code.

This fixes the problem reported with lnc(4) interfaces inside VMWare,
and should theoritically also fix any user of a PCI lnc(4) card.  It
is a RELENG_5 MFC candidate.

Tested by:	Florian Le Goff <madflo@beertech.org>
2004-08-22 23:01:13 +00:00
Robert Watson
6063b5f0ad Style update: use newer style function prototypes in if_sl.c in
prep for merging locking.
2004-08-22 21:32:52 +00:00
Marcel Moolenaar
2bbb534b56 Move the cow field between wire_count and hold_count. This is the
position that is 64-bit aligned and makes sure that the valid and
dirty fields are also 64-bit aligned. This means that if PAGE_SIZE
is 32K, the size of the vm_page structure is only increased by 8
bytes instead of 16 bytes. More importantly, the vm_page structure
is either 120 or 128 bytes on ia64. These are "interesting" sizes.
2004-08-22 20:52:23 +00:00
Colin Percival
2b004a226d When creating a new md, wait for geom's event queue to become empty
before returning.  Device nodes are created via the "taste" mechanism,
so this is necessary in order to make sure that devfs entries are
created before mdconfig(8) returns.

This may be a MFC candidate for 5.3.

Suggested by:	phk
2004-08-22 19:44:24 +00:00
Brian Feldman
bf5ab950e3 The new contigmalloc code is exposing a lot of misuses of busdma memory
allocation. Notably, in this case, the driver tries to allocate several
pieces of memory and then fails if the pieces allocated after the first
do not come after it physically, and within a specific range (8MB I
believe).  Of course, this could just as easily fail for any number of
reasons, but it almost always fails now that contiguous allocations start
at the end of possible specified memory locations rather than the beginning.

Allocate all the possibly-needed memory up front, even though it's a waste,
to get around this.  The least bogus solution would be to take the physical
address from the first allocation and create a new tag that specified that
further allocations must follow it within that 8MB window, then use that
when allocating new channels, but that's left for anyone else that really
feels like doing it.

Tested by:	Erwin Lansing <erwin@lansing.dk>
2004-08-22 18:57:40 +00:00
Lukas Ertl
c4bdc6fc32 Implement the possibility to remove drives. 2004-08-22 17:07:55 +00:00
Max Laier
ca7a789aa6 Allow early drop for non-ALTQ enabled queues in an ALTQ-enabled kernel.
Previously the early drop was disabled unconditionally for ALTQ-enabled
kernels.

This should give some benefit for the normal gateway + LAN-server case with
a busy LAN leg and an ALTQ managed uplink.

Reviewed and style help from:	cperciva, pjd
2004-08-22 16:42:28 +00:00
Pawel Jakub Dawidek
dba915cfee Implementation of 'verify reading' algorithm, which uses parity data for
verification of regular data when device is in complete state.
On verification error, EIO error is returned for the bio and sysctl
kern.geom.raid3.stat.parity_mismatch is increased.

Suggested by:	phk
2004-08-22 16:21:12 +00:00
Søren Schmidt
d607fde675 Workaround devices that responds with registers as *both* master & slave,
but fail utterly when we try to talk to the "fake" device.
2004-08-22 15:54:08 +00:00
Max Laier
7fff37fc15 Use securelevel_gt instead of reading global securelevel unprotected.
Submitted by:	yongari
MFC after:	3 days
2004-08-22 15:23:48 +00:00
Yoshihiro Takahashi
cd6eccf9b8 opt_agp.h is not required anymore. 2004-08-22 15:14:44 +00:00
Yoshihiro Takahashi
3cabe66353 MFi386: revision 1.215. 2004-08-22 15:13:08 +00:00
Yoshihiro Takahashi
6d0e236ade Merged from sys/dev/fdc/fdc.c revision 1.283. 2004-08-22 15:10:53 +00:00
Robert Watson
d963815baf Make debug.kdb.stop_cpus also a TUNABLE() so it can be set prior to boot
to help debug early nasty hangs.
2004-08-22 15:10:52 +00:00
Robert Watson
201a36deca Don't need to assert Giant in fw_output(), only in the firewire start
routine.
2004-08-22 14:48:55 +00:00
Justin T. Gibbs
25edba1e56 In the PCI error interrupt handler, specify the width of the PCI configuration
cycle using the correct argument.  The location and width were reversed.

MFC in: 2 days
2004-08-22 14:02:43 +00:00
Justin T. Gibbs
4ddea3e2d4 Set AHD_BUSFREEREV_BUG in the bug field for Rev B chips, not the
feature field.

Reported by: Ken Westerback <krw@openbsd.org>
MFC in: 2 days
2004-08-22 13:54:27 +00:00
Lukas Ertl
45d0fdcda9 Add forgotten format specifier in a KASSERT and shut up the compiler.
Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2004-08-22 13:34:24 +00:00