Commit Graph

46799 Commits

Author SHA1 Message Date
Ruslan Ermilov
9573c7e9cf Whitespace nit. 2004-05-19 11:35:03 +00:00
Ruslan Ermilov
171e08dc7f Maintain statistics about the received frames. 2004-05-19 11:26:33 +00:00
Peter Grehan
e6bd8ae1e9 trap_pfault() shouldn't be acquiring Giant. Found to blow up
with MUTEX_PROFILING.

Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-05-19 06:05:42 +00:00
Eric Anholt
f4078c527f Add explicit list of SiS AGP chipsets based on Linux kernel's list.
Prompted by:	i386/59503
2004-05-19 05:25:31 +00:00
Warner Losh
092d0b6b38 Replace the lame big endian crc with wpaul's standard big endian crc
algorithm, supplied by wpaul himself.  The lame one has an origin
that's been called into question, so rather than argue about that (one
could make an excellent fair use argument), replace it with better
code since that's what FreeBSD is about.

Submitted by: wpaul[1], Klaus Klein

[1] Bill called this a silly bikeshed.  Maybe his is not incorrect.
2004-05-19 02:16:46 +00:00
Peter Wemm
eba9b48b10 Unbreak builds without DDB. Bad Bruce! No cookie! :-) 2004-05-19 01:23:48 +00:00
Paul Saab
c2696aaf51 syncache broke rev 1.23 which was done to fix the "thundering herd"
problem in Apache.  Fix it.

Reviewed by:	peter
2004-05-19 00:22:10 +00:00
Peter Wemm
2079cde964 The 'call mcount' hooks that gcc inserts when profiling are in a place that
cannot handle the scratch registers being trashed.  So we have to preserve
them ourselves.
2004-05-18 22:52:32 +00:00
Nate Lawson
14e2b11f18 Use the simpler __BUS_ACCESSOR macros for ivars instead of defining them
ourselves.
2004-05-18 16:53:29 +00:00
Stefan Farfeleder
b1aa0ba527 <stdint.h> should define WINT_M{AX,IN} independent from whether WCHAR_MIN is
defined.  Otherwise first including <wchar.h> and then <stdint.h> leads to no
WINT_M{AX,IN} at all.

PR:		64956
Approved by:	das (mentor)
2004-05-18 16:04:57 +00:00
Maxim Konovalov
0a258c19b1 o Fix comments: s/m_tag_allocate/m_tag_alloc/.
Spotted by:	Gleb Smirnoff
MFC after:	1 week
2004-05-18 14:13:23 +00:00
Yoshihiro Takahashi
438bbad62b MFi386: revision 1.1160. 2004-05-18 11:56:56 +00:00
Yoshihiro Takahashi
307cddc187 MFi386: Add NETGRAPH_CRONYX. 2004-05-18 11:56:24 +00:00
Yoshihiro Takahashi
9f7d798692 MFi386: revision 1.492. 2004-05-18 11:34:04 +00:00
Pawel Jakub Dawidek
6a40892929 Fix panic which occurs when given sector size for memory-backed device
is less than DEV_BSIZE (512) bytes.

Reported by:	Mike Bristow <mike@urgle.com>
Approved by:	phk
2004-05-18 07:30:04 +00:00
Bruce Evans
130ff9c31a Fixed DDB_NOKLDSYM on amd64's:
machdep.c:
Initialize the symbol table pointers, not quite like for other arches.

db_elf.c:
Don't claim to be an i486 in the fake ELF header.
2004-05-18 05:30:06 +00:00
Peter Wemm
4cec6f5d02 If a symbol has section+offset definitions provided, always use instead
of doing a name lookup for global symbols.  This fixes the snd_pcm module.
2004-05-18 05:15:43 +00:00
Peter Wemm
82d0d1a01b Remove leftover padding variables.
Convert some silent 'ignore programmer error' cases into panics
Remove 'align' field from section table (no longer needed)
2004-05-18 05:14:19 +00:00
Peter Wemm
31f1cfb7e9 Oops, I left a duplicate 'relocbase' declaration.
Submitted by:  Koop Mast <kwm@rainbow-runner.nl>
2004-05-17 22:26:17 +00:00
Peter Wemm
922013a665 Turn on modules for amd64. Fear. 2004-05-17 22:13:14 +00:00
Peter Wemm
23eb3eb66e Since we go to the trouble of compiling the kobj ops table for each class,
and cannot handle it going away, add an explicit reference to the kobj
class inside each linker class.  Without this, a class with no modules
loaded will sit with an idle refcount of 0.  Loading and unloading
a module with it causes a 0->1->0 transition which frees the ops table
and causes subsequent loads using that class to explode.  Normally, the
"kernel" module will remain forever loaded and prevent this happening, but
if you have more than one linker class active, only one owns the "kernel".

This finishes making modules work for kldload(8) on amd64.
2004-05-17 21:24:39 +00:00
Peter Wemm
2094780104 Clean up the code some more. Unify the text/data (progbits) and bss
(nobits) tables to simplify some code.  Try and shorten some of the very
wide lines.  Somewhere along the way, I think I fixed the memory
corruption that caused panics after going multiuser.
2004-05-17 21:20:23 +00:00
Peter Wemm
910bb7dbe9 Deal with REL records that have the addend embedded variable sized targets
rather than the RELA table.  I dont know if bintutils will ever generate
REL records, but just in case.....
2004-05-17 21:16:49 +00:00
Don Lewis
2526dc2b61 Switch from using the vnode interlock to a private mutex in fifo_open()
to avoid lock order problems when manipulating the sockets associated
with the fifo.

Minor optimization of a couple of calls to fifo_cleanup() from
fifo_open().
2004-05-17 20:16:40 +00:00
Joerg Wunsch
b3dd2b7bfc Fix various style(9) bugs. This includes the removal of wrong
reimplementations of enodev() (for the smbread() and smbwrite()
functions), as well as fixing various errno values to conform to
errno(3).

Bruce also points out that a number of the pointer == NULL tests
are probably nonsense because the respective checks are already
done at upper layers.

(Mostly) submitted by:	bde
2004-05-17 18:55:45 +00:00
Marcel Moolenaar
875bcd3528 Fix typo in comment. While here, end the sentence with a period and
remove the empty line between the fdc and sio devices. The empty
line suggests that the comment applies to fdc only while it applies
to all following devices and options.

Typo spotted by: ru@
2004-05-17 18:36:14 +00:00
Søren Schmidt
263b4cdea3 Rip out the too verbose "spurious interrupt" printf's, they dont serve
a purpose any longer.
2004-05-17 17:53:12 +00:00
Paul Saab
a891a3bf7c Turn SCSI pre-fetch ON. This is mainly for 64XX and 64X based
controllers and allows the controller to prefetch 1-2k on certain
PCI memory reads to the host.  The spec says this should only be
used for IA32 based systems.

Informed of feature by:	John Cagle <first.last@hp.com>
2004-05-17 17:27:38 +00:00
Vinod Kashyap
5bc4169411 Undid scottl's recent changes. 2004-05-17 17:16:58 +00:00
Roman Kurakin
7d092c8fab Add Cronyx Tau-PCI sync WAN adapters family entry. 2004-05-17 14:42:59 +00:00
Roman Kurakin
0f71e346a1 Spell Cronyx Tau and Sigma families correctly.
MFC after:	3 days
2004-05-17 14:35:32 +00:00
Roman Kurakin
4dba35d192 Connect Cronyx Tau-PCI to the system. 2004-05-17 14:24:52 +00:00
Roman Kurakin
b25d0ae0cb Add description of Cronyx Omega2-PCI (8x port serial adapter). 2004-05-17 12:57:30 +00:00
Peter Pentchev
a6af156093 Unbreak the fdc module build after the repocopy of sys/isa/fd.c to
sys/dev/fdc/fdc.c.
2004-05-17 10:48:42 +00:00
Roman Kurakin
a18da9112d Connect Cronyx Tau-PCI to the system. 2004-05-17 08:15:59 +00:00
Marcel Moolenaar
ef1eb2f330 Unbreak build due to previous commit: now that elf_reloc_internal()
gets the relocation base passed in relocbase, we cannot declare a
local variable with the same name. Assume the argument holds the
same value as the local variable did...
2004-05-17 07:11:37 +00:00
Marcel Moolenaar
f2ab7b8bb0 filter out the fdc(4) and sio(4) devices and corresponding options.
Note that cy(4) uses COM_MULTIPORT, so we need to keep that option.
2004-05-17 07:03:01 +00:00
Marcel Moolenaar
985b853f84 o De-support fdc(4). No ia64 has ever been made with PC floppy and
the likelyhood of one ever being made is nil.
o  While here, de-support sio(4).
2004-05-17 06:51:19 +00:00
Warner Losh
6cd91141eb Move fdc from isa/fd.c to dev/fdc/fdc.c. The old files were
repocopied.  Soon there will be additional bus attachments and
specialization for isa, acpi and pccard (and maybe pc98's cbus).

This was approved by nate, joerg and myself.  bde dissented on the new
location, but appeared to be OK after some discussion.
2004-05-17 05:46:16 +00:00
Warner Losh
734e3cc5fd Update to reflect new location in the tree. This has been repo copied
from sys/isa/fd.c in preparation for specialization of attachments for
different busses.
2004-05-17 05:42:04 +00:00
Peter Wemm
872e9216d0 Oops, use the generic ELF_ST_BIND() macro instead of ELF64_ST_BIND.
Submitted by:  marks
2004-05-17 00:51:34 +00:00
Ruslan Ermilov
f8aa392b11 Markup fixes. 2004-05-16 22:51:36 +00:00
Peter Wemm
df4fd27737 Checkpoint some of what I was starting to tinker with for having some
different context support for 32 vs 64 bit processes.  This simply omits
the save/restore of the segment selector registers for non 32 bit
processes.  This avoids the rdmsr/rwmsr juggling when restoring %gs
clobbers the kernel msr that holds the gsbase.

However, I suspect it might be better to conditionally do this at
user<->kernel transition where we wouldn't need to do the juggling in the
first place.  Or have per-thread extended context save/restore hooks.
2004-05-16 22:43:57 +00:00
Peter Wemm
1c4a1c34b7 Disable ndis module on amd64. It doesn't compile. For example,
hal_raise_irql(void) doesn't take an argument, but it is called with one.
eg: irql = FASTCALL1(hal_raise_irql, DISPATCH_LEVEL);
This is hidden by the macros on i386, but becomes a compile error on amd64
since the arguments are actually checked.
2004-05-16 22:24:57 +00:00
Peter Wemm
12c1418ccf Kill the LAZYPMAP ifdefs. While they worked, they didn't do anything
to help the AMD cpus (which have a hardware tlb flush filter).  I held
off to see what the 64 bit Intel cpus did, but it doesn't seem to help
much there either.  Oh well, store it in the Attic.
2004-05-16 22:11:50 +00:00
Peter Wemm
7be2e3e26d Converge some more with i386. 2004-05-16 21:27:29 +00:00
Peter Wemm
dbfcb6b2db Remove "register_t eflags; eflags = read_eflags();" because 1) it wasn't
subsequently used in the code, and 2) it doesn't compile on !i386.
2004-05-16 21:22:45 +00:00
Joerg Wunsch
69271da461 Another candidate that didn't use copyin/copyout for user<->kernel
transfers.

MFC after:	1 month
2004-05-16 21:19:59 +00:00
Joerg Wunsch
add37e1e86 You wouldn't believe a driver could survive doing userland IO without
properly using copyin/copyout for more than 5 years?  This one did. :-)

Properly encapsulate all user<->kernel data transfers using copy{in,out}.

MFC after:	1 month
2004-05-16 21:18:45 +00:00
Joerg Wunsch
c2d85eaa93 After successfully attaching an iicbus instance, instead of using a
NULL name in device_add_child(), explicitly name all of our known
child drivers in order to give them a chance to attach to us.
Otherwise, only the first one present would be probed and attached.

Reviewed by:	nsouch
MFC after:	1 month
2004-05-16 21:11:46 +00:00
Peter Wemm
2a779082bb MFi386: add rue and twa 2004-05-16 20:57:01 +00:00
Peter Wemm
5119532b56 MFi386: avoid partial register references, for what its worth. 2004-05-16 20:46:13 +00:00
Peter Wemm
792e29ba26 For consistency with i386, have pmap_kenter_temporary() take a vm_paddr_t
argument.  It is actually the same type on amd64 (vm_paddr_t = vm_offset_t)
but this reduces the i386<->amd64 diffs a little.
2004-05-16 20:44:41 +00:00
Peter Wemm
463e5aa66e MFi386: numerous interrupt and acpi updates 2004-05-16 20:30:47 +00:00
Peter Wemm
4d6bcc8306 Enable first part of kld's on amd64. This is known to not work right
yet, but building kld's is OK now and they can be loaded by kldload(2).
(but the machine will likely crash soon afterwards, a "minor" problem :-)

Brought to you by:  my injured knee (from moving)
2004-05-16 20:11:38 +00:00
Peter Wemm
e8855d4f97 Make a small revision to the api between the elf linker core and the
elf_reloc() backends for two reasons.  First, to support the possibility
of there being two elf linkers in the kernel (eg: amd64), and second, to
pass the relocbase explicitly (for relocating .o format kld files).
2004-05-16 20:00:28 +00:00
Archie Cobbs
1a292b8015 Allow ng_ether "lower" and "orphans" hooks to be connected at the same time.
Reviewed by:	julian
PR:		kern/63317
2004-05-16 19:31:35 +00:00
Yoshihiro Takahashi
d385ba7313 - Initialize uart_bus_space_io and uart_bus_space_mem.
- Fix wrong comment.
2004-05-16 14:12:05 +00:00
Ruslan Ermilov
278d864be2 Fixed the disordering from rev. 1.371. 2004-05-16 13:58:27 +00:00
Doug Rabson
c59285296e Don't use the node id as an index into the topology map. This breaks
if a node on the bus has more than three ports (like my cheapo six
port hub).
2004-05-16 11:26:39 +00:00
Olivier Houchard
9049715ff9 Try harder not to compile anything in sys/boot for arm.
I wonder how buildworld ever worked for me...
2004-05-16 00:19:12 +00:00
Colin Percival
2b8b4f37be Remove dead code. (This loop counted the number of rules, but the count
was never used.)

Reported by:	pjd
Approved by:	rwatson
2004-05-15 20:55:19 +00:00
Scott Long
f3a537ca3f Remove twa_intrhook prototype.
Submitted by:	cperciva
2004-05-15 15:41:59 +00:00
Scott Long
e25b7fccd4 Set the cpi.hba_inquiry field to something useful. 2004-05-15 05:18:05 +00:00
Scott Long
bd4c922777 Remove the config_intrhook as it is not needed. 2004-05-15 05:17:42 +00:00
Dag-Erling Smørgrav
0f126ea09f Remove some debugging printf()s and a pointless device_set_desc() call. 2004-05-15 00:07:23 +00:00
Olivier Houchard
045ec6ce2f Remove libkern/mem* 2004-05-14 23:42:54 +00:00
Olivier Houchard
46bed5089f Implement bcopy, memcpy and memcmp in support.S. 2004-05-14 23:42:30 +00:00
Olivier Houchard
8c412454dd Remove libkern/bzero.S and libkern/memset.S. 2004-05-14 23:31:36 +00:00
Olivier Houchard
c8d8367098 Implement bzero et memset in support.S 2004-05-14 23:31:10 +00:00
Ken Smith
f7dd67d801 Change ffs_realloccg() to set the valid bits for the extended part of the
fragment to zero the valid parts of a VM_IO buffer.

RE would like this to be part of 4.10-RC3 so this will be MFC-ed immediately.

Reviewed by:	alc, tegge
2004-05-14 22:00:08 +00:00
Bruce Evans
a13ec35b05 Fixed some common printf format errors. Don't assume that "struct foo *"
is "void *" (it isn't) or that the default promotion of pid_t is int.
Instead, assume that casting "struct foo *" to "void *" and printing the
result with %p is useful, and that all pid_t's are representable as longs.

Fixed some minor style bugs (mainly spelling errors in comments).
2004-05-14 20:51:42 +00:00
Ruslan Ermilov
237266b2e6 Back out last revision that unnecessarily changed valid assembler
line comments and damaged the CVS history.

Prompted by:	bde, jhb
2004-05-14 20:29:30 +00:00
Ruslan Ermilov
b09ce52594 Partly back out last revision that unnecessarily changed valid
assembler line comments and damaged the CVS history.

Prompted by:	bde, jhb
2004-05-14 20:28:31 +00:00
MIHIRA Sanpei Yoshiro
e68f2db9a3 MFNetBSD (umodem.c 1.46):
URL updates
2004-05-14 15:16:09 +00:00
Olivier Houchard
a43fa5c730 This is FreeBSD/arm, not FreeBSD/i386
Submitted by:	ru
2004-05-14 14:52:32 +00:00
Olivier Houchard
fffcd6531e Define uart_sa1110_ops and uart_sa1110_classe in .c files instead of spamming
uart_cpu.h
2004-05-14 13:42:50 +00:00
Olivier Houchard
d6301dcdbb Define INLINE_LIMIT for arm. 2004-05-14 13:35:46 +00:00
Olivier Houchard
b791f3fb91 Do not attempt to build anything in sys/boot for arm. 2004-05-14 13:34:53 +00:00
Olivier Houchard
dfc9776e84 Implement enough of an uart driver to get serial console working. 2004-05-14 13:26:52 +00:00
Olivier Houchard
03f110294b Import libkern arm specific bits. 2004-05-14 12:28:31 +00:00
Olivier Houchard
78b36e3ca5 Add config magic for arm. 2004-05-14 11:49:40 +00:00
Olivier Houchard
6fc729af63 Import FreeBSD/arm kernel bits.
It only supports sa1110 (on simics) right now, but xscale support should come
soon.
Some of the initial work has been provided by :
Stephane Potvin <sepotvin at videotron.ca>
Most of this comes from NetBSD.
2004-05-14 11:46:45 +00:00
Nate Lawson
0025fb0f4f Add support for GPE being a package of { reference, gpe bit }.
Rework the ECDT probe to pass all the parameters in a temporary struct.
Note why we are mostly ok evaluating _GLK so early.
2004-05-14 04:17:56 +00:00
Bill Paul
6f8aee2268 Fix a bug which I discovered recently while doing IPv6 testing at
Wind River. In the IPv4 output path, one of the tests in ip_output()
checks how many slots are actually available in the interface output
queue before attempting to send a packet. If, for example, we need
to transmit a packet of 32K bytes over an interface with an MTU of
1500, we know it's going to take about 21 fragments to do it. If
there's less than 21 slots left in the output queue, there's no point
in transmitting anything at all: IP does not do retransmission, so
sending only some of the fragments would just be a waste of bandwidth.
(In an extreme case, if you're sending a heavy stream of fragmented
packets, you might find yourself sending nothing by the first fragment
of all your packets.) So if ip_output() notices there's not enough
room in the output queue to send the frame, it just dumps the packet
and returns ENOBUFS to the app.

It turns out ip6_output() lacks this code. Consequently, this caused
the netperf UDPIPV6_STREAM test to produce very poor results with large
write sizes. This commit adds code to check the remaining space in the
output queue and junk fragmented packets if they're too big to be
sent, just like with IPv4. (I can't imagine anyone's running an NFS
server using UDP over IPv6, but if they are, this will likely make them
a lot happier. :)
2004-05-14 03:57:17 +00:00
John Polstra
15a3ddef19 Fix a potential stack buffer overflow on systems whose ACPI OEMID
fills its field (6 characters).  In that case the OEMID is not
null-terminated, and the sprintf that was used would copy up to the
next null byte, which could be pretty far away.
2004-05-14 01:29:21 +00:00
John Baldwin
92cb9c9b67 Different VIA host bridges use different offsets to their AGP config
registers, so add a register offset array to the softc.  We key off the
device ID to determine which set of register offsets.  Currently the 8385
host bridge used on amd64 is the only bridge to use the AGP3_VIA_*
register offsets and all other bridges use the AGP_VIA_* offsets.  It is
currently unclear if the AGP3_VIA_* offsets are for VIA bridges that
implement AGP 3.0 bridges or just for amd64 bridges.

Submitted by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-13 20:05:42 +00:00
John Baldwin
3335671ddd Split sleepq_wakeup_thread() into two functions. sleepq_remove_thread()
removes a specific thread from a sleep queue.  sleepq_resume_thread()
resumes scheduling of a thread that has been previously removed from a
sleep queue.
- sleepq_catch_signals() just removes a thread from the queue it was just
  added to when a pending signal is found.
- sleepq_signal() and sleepq_broadcast() remove threads from a queue,
  drop the queue lock, and then resume all the previously removed threads.
  This doesn't completely fix the sched_lock <-> sleepq chain LOR, but it
  makes it a little better as we no longer call setrunnble() with a sleep
  queue lock held meaning if setrunnable() tries to wakeup the swapper we
  don't try to lock two sleep queue chains at the same time.
2004-05-13 20:00:43 +00:00
Dag-Erling Smørgrav
7cec30e791 Unbreak the build. 2004-05-13 19:15:21 +00:00
Scott Long
d7f2f66e08 Enable INTR_ENTROPY if the interrupt is not set to INTR_FAST. Remove the
testing and setting of the INTR_ENTROPY macro as it is not needed in
FreeBSD 5.x.

Submitted by:	Alex Vasylenko
2004-05-13 16:02:18 +00:00
Don Lewis
63625ec31e Remove extraneous spaces. 2004-05-13 11:33:44 +00:00
Don Lewis
9d2820eaac Implement sbc_lockassert() and sb_lockassert() functions to allow
proper locking to be checked at runtime.

Remove sb_lock() and sb_unlock() calls from sb_reset_dsp() because the
latter is called from sb_setup() with the lock already held.  Add a
call to sb_lockassert().

Surround the call to sb_reset_dsp() in sb16_attach() with sb_lock()
and sb_unlock() calls.

Tested by:	Bartek Marcinkiewicz <junior AT p233.if.pwr.wroc.pl>
2004-05-13 11:32:54 +00:00
Yoshihiro Takahashi
33e48d06ba MFi386: revision 1.489 2004-05-13 11:17:07 +00:00
Yoshihiro Takahashi
2621fd00aa Move the ichwd to i386 only. 2004-05-13 11:13:55 +00:00
Nate Lawson
c868ac7d12 Add support for retrieving _GLK in the ECDT probe. Now we no longer always
use the global lock at the beginning of the ECDT probe.  Instead, we use
the handle from the ECDT to call _GLK.  Also, unify the device description.
2004-05-13 03:17:08 +00:00
Warner Losh
560c97db54 Expose USBVERBOSE as a first-class option. It will be needed soon as
an option.  Note that this option doesn't follow the normal USB_ or
Uxxx_ convention.  That's because it is this way in the upstream
provider and I didn't want to change that.
2004-05-13 03:15:04 +00:00
Warner Losh
4cec015da7 Sync to pccarddevs 1.84 2004-05-13 01:24:48 +00:00
Warner Losh
4fa82af570 Add Intel EtherExpress PRO/100 LAN Modem. This will eventually be
added to xe once the pccard issues are resolved...
2004-05-13 01:24:26 +00:00
Bill Paul
dc9d837079 Restore source code compatibility with 5.2-RELEASE. 2004-05-12 15:58:42 +00:00
Joerg Wunsch
0233123076 Convert the #if 0 magic to #if SCAN_IICBUS, and make it actually compile
again.  While it's not generally recommended anymore, it might still prove
useful for debugging purposes.
2004-05-12 13:43:41 +00:00
Alan Cox
1bb816d3d1 Restructure vm_page_select_cache() so that adding assertions is easy.
Some of the conditions that caused vm_page_select_cache() to deactivate a
page were wrong.  For example, deactivating an unmanaged or wired page is a
nop.  Thus, if vm_page_select_cache() had ever encountered an unmanaged or
wired page, it would have looped forever.  Now, we assert that the page is
neither unmanaged nor wired.
2004-05-12 04:27:18 +00:00
Vinod Kashyap
088113ed0b 1. Fixed potential problem that would cause out-of-order requests in twe_startio.
2. Changed version.

Submitted by: scottl
Reviewed by: vkashyap
Approved by: re
2004-05-12 04:10:37 +00:00
Alan Cox
f651b12907 Cache queue pages are not mapped. Thus, the pmap_remove_all() by
vm_pageout_scan()'s loop for freeing cache queue pages is unnecessary.
2004-05-12 04:10:35 +00:00
Justin T. Gibbs
22dbd4c64c aic79xx.c:
Allow 500us between pauses in ahd_pause_and_flushwork().
	The maximum we will wait is now 500ms.

	In the same routine, remove any attempt to clear ENSELO.
	Let the firmware do it once the current selection has
	completed.  This avoids some race conditions having to
	do with non-packetized completions and the auto-clearing
	of ENSELO on packetized completions.

	Also avoid attempts to clear critical sections when
	interrups are pending.  We are going to loop again
	anyway, so clearing critical sections is a waste of
	time.  It also may not be possible to clear a critical
	section if the source of the interrupt was a SEQINT.

aic79xx_pci.c:
	Use the Generic 9005 mask when looking for generic 7901B
	parts.  This allows the driver to attach to 7901B parts
	on motherboards using a non-Adaptec subvendor ID.

aic79xx_inline.h:
	Test for the SCBRAM_RD_BUG against the bugs
	field, not the flags field in the softc.

aic79xx.c:
	Cancel pending transactions on devices that
	respond with a selection timeout.  This decreases
	the duration of timeout recovery when a device
	disappears.

aic79xx.c:
	Don't bother forcing renegotiation on a selection
	timeout now that we use the device reset handler
	to abort any pending commands on the target.
	The device reset handler already takes us down
	to async narrow and forces a renegotiation.

	In the device reset handlers, only send a
	BDR sent async event if the status is not
	CAM_SEL_TIMEOUT.  This avoids sending this
	event in the selection timeout case

aic79xx.c:
	Modify the Core timeout handler to verify that another
	command has the potential to timeout before passing off
	a command timeout as due to some other command.  This
	safety measure is added in response to a timeout recovery
	failure on H2B where it appears that incoming reselection
	status was lost during a drive pull test.  In that case,
	the recovery handler continued to wait for the command
	that was active on the bus indefinetly.  While the root
	cause of the above issue is still being determined seems
	a prudent safeguard.

aic79xx_pci.c:
	Add a specific probe entry for the Dell OEM 39320(B).

aic79xx.c:
aic79xx.h:
aic79xx.reg:
aic79xx.seq:
	Modify the aic79xx firmware to never cross a cacheline or
	ADB boundary when DMA'ing completion entries to the host.
	In PCI mode, at least in 32/33 configurations, the SCB
	DMA engine may lose its place in the data-stream should
	the target force a retry on something other than an
	8byte aligned boundary. In PCI-X mode, we do this to
	avoid split transactions since many chipsets seem to be
	unable to format proper split completions to continue
	the data transfer.

	The above change allows us to drop our completion entries
	from 8 bytes to 4.  We were using 8 byte entries to ensure
	that PCI retries could only occur on an 8byte aligned
	boundary.  Now that the sequencer guarantees this by splitting
	up completions, we can safely drop the size to 4 bytes (2
	byte tag, one byte SG_RESID, one byte pad).

	Both the split-completion and PCI retry problems only show
	up under high tag load when interrupt coalescing is being
	especially effective.  The switch from a 2byte completion
	entry to an 8 byte entry to solve the PCI problem increased
	the chance of incurring a split in PCI-X mode when multiple
	transactions were completed at once.  Dropping the completion
	size to 4 bytes also means that we can complete more commands
	in a single DMA (128byte FIFO -> 32 commands instead of 16).

aic79xx.c:
	Modify the SCSIINT handler to defer clearing
	sequencer critical sections to the individual
	interrupt handlers.  This allows us to
	immediately disable any outgoing selections in
	the case of an unexpected busfree so we don't
	inadvertantly clear ENSELO *after* a new selection
	has started.  Doing so may cause the sequencer
	to miss a successful selection.

	In ahd_update_pending_scbs(), only clear ENSELO if
	the bus is currently busy and a selection is not
	already in progress or the sequencer has yet to
	handle a pending selection.  While we want to ensure
	that the selection for the SCB at the head of the
	selection queue is restarted so that any change in
	negotiation request can take effect, we can't clobber
	pending selection state without confusing the sequencer
	into missing a selection.
2004-05-11 20:46:05 +00:00
Justin T. Gibbs
f49574218d o When restarting the sequencer, clear any pending
sequencer interrupt codes.  These codes are only
  relevant to the code that was last being executed
  and that context is cleared when we reset the
  program counter.  This addresses a race condition
  between a sequencer interrupt and any SCSI event
  that causes us to restart the sequencer.

o When running the untagged-Q, we must start the
  timer for any transaction we queue.

o Give the firmware half a millisecond between
  pauses to flush work out.  This should give us
  around half a second of total delay before flagging
  an issue with pausing and flushing controller work.

  Only attempt to clear critical sections if there
  are no pending interrupts in the pause and flush
  loop.  If the sequencer has issued an INTSTAT, we
  may not be able to step out of the critical section.

o Cancel pending transactions on devices that
  respond with a selection timeout.  This decreases
  the duration of timeout recovery when a device
  disappears.

  Don't bother forcing renegotiation on a selection
  timeout now that we use the device reset handler
  to abort any pending commands on the target.
  The device reset handler already takes us down
  to async narrow and forces a renegotiation.

o In the device reset handlers, only send a
  BDR sent async event if the status is not
  CAM_SEL_TIMEOUT.  This avoids sending this
  event in the selection timeout case.

o Modify the Core timeout handler to verify that another
  command has the potential to timeout before passing off
  a command timeout as due to some other command.
2004-05-11 20:39:46 +00:00
Justin T. Gibbs
9fe88a385d Add aic_scb_timer_start() which will be used in the aic7xxx driver to
start the timer on SCBs queued in the untagged SCB queue.

The core treats timeouts in usecs to satisfy Linux requirements.  Multiply
accordingly.
2004-05-11 20:33:42 +00:00
John Baldwin
a894993de1 - Move some macros from icu.h into atpic.c as that is the only place they
are used.
- Reduce duplication of a couple of macros removing the duplicates from
  ich.h.
- Remove unused macros from icu.h as well as locore protection as this
  header is no longer included in assembly sources.
2004-05-11 20:23:24 +00:00
John Baldwin
d4d4ece72d Trim unused includes. 2004-05-11 20:14:53 +00:00
John Baldwin
96025496cf - Remove a spurious blank line.
- Add a missing static keyword.
2004-05-11 20:06:55 +00:00
John Baldwin
175af5d978 Fixup a few bogons in a comment. 2004-05-11 20:06:32 +00:00
John Baldwin
d3b3af7599 Remove unused WL_IRQS macro. 2004-05-11 20:06:12 +00:00
Maxim Konovalov
a49b21371a o Calculate a number of bytes to copy (cnt) correctly:
+----+-+-+-+-+----+----+- - - - - - - - - - - -  -+----+
  |    | |C| | |    |    |                          |    |
  | IP |N|O|L|P|    | IP |                          | IP |
  | #1 |O|D|E|T|    | #2 |                          | #n |
  |    |P|E|N|R|    |    |                          |    |
  +----+-+-+-+-+----+----+- - - - - - - - - - - -  -+----+
               ^    ^<---- cnt - (IPOPT_MINOFF - 1) ---->|
               |    |
src            |    +-- cp[IPOPT_OFF + 1] + sizeof(struct in_addr)
               |
dst            +-- cp[IPOPT_OFF + 1]

PR:		kern/66386
Submitted by:	Andrei Iltchenko
MFC after:	3 weeks
2004-05-11 19:14:44 +00:00
Dag-Erling Smørgrav
cae8da6164 Add a driver for the watchdog timer function present on the LPC interface
bridge in Intel ICH-series chipsets.

The original implementation was by W. Daryl Hawkins of Texas A&M, but I
have made substantial modifications.
2004-05-11 18:21:38 +00:00
Søren Schmidt
bbf15239ed Dont try to finish devstat's if the disk pointer is NULL, this can happen
when a disk has been destroyed but still has outstanding bio's.

Reviewed by:	phk
2004-05-11 13:17:40 +00:00
Tim J. Robbins
f52e2ef29f Eliminate a memory leak in kern_symlink() that could occur if
vn_start_write() failed.
2004-05-11 10:42:02 +00:00
Tim J. Robbins
8eec77b09e To handle orphaned character device vnodes properly in mmap(), check that
v_mount is non-null before dereferencing it. If it's null, behave as if
MNT_NOEXEC was not set on the mount that originally containined it.
2004-05-11 10:26:37 +00:00
Søren Schmidt
45bf968a10 Fix Sii3114 support. 2004-05-10 20:23:25 +00:00
John Baldwin
eb8943b13e Rework the APIC mixed mode support a bit:
- Require the APIC enumerators to explicitly enable mixed mode by calling
  ioapic_enable_mixed_mode().  Calling this function tells the apic driver
  that the PC-AT 8259A PICs are present and routable through the first I/O
  APIC via an ExtINT pin.  The mptable enumerator always calls this
  function for now.  The MADT enumerator only enables mixed mode if the
  PC-AT compatability flag is set in the MADT header.
- Allow mixed mode to be enabled or disabled via a 'hw.apic.mixed_mode'
  tunable.  By default this tunable is set to 1 (true).  The kernel option
  NO_MIXED_MODE changes the default to 0 to preserve existing behavior, but
  adding 'hw.apic.mixed_mode=0' to loader.conf achieves the same effect.
- Only use mixed mode to route IRQ 0 if it is both enabled by the APIC
  enumerator and activated by the loader tunable.  Note that both
  conditions must be true, so if the APIC enumerator does not enable mixed
  mode, then you can't set the tunable to try to override the enumerator.
2004-05-10 18:49:58 +00:00
Robert Watson
02ebd2bcb5 Improve consistency of include file guards in src/sys/sys by terminating
them with '_', as well as beginning with '_'.

Observed by:	bde
2004-05-10 18:38:07 +00:00
John Baldwin
ffe2232b31 - Simplify the sizeof expression in the CTASSERT() for NUM_ISA_IRQS.
- Fixup grammar in a comment.

Submitted by:	bde (1)
2004-05-10 18:33:52 +00:00
John Baldwin
0fd166d7da - Change madt_map_table() to verify the checksum of any table it is asked
to map.  If the checksum fails, the table is unmapped and a NULL pointer
  returned.
- For ACPI version >= 2.0, check the extended checksum of the RSDP.
  AcpiOsGetRootPointer() already checks the version 1.0 checksum.
- Remap the full MADT table at the end of madt_probe() so that we verify
  its checksum before saying it is really there.

Requested by:	njl
2004-05-10 18:33:08 +00:00
John Baldwin
fb0ac5433b If an ACPI PCI-PCI bridge doesn't have a _PRT object, fall back to using
the swizzle method for routing PCI interrupts across the bridge.  This
fixes problems with motherboards (typically laptops) whose BIOS doesn't
provide a PRT for the AGP bridge even though there is a device entry for
the bridge in the ACPI namespace.

Tested by:	Kenneth Culver culverk at sweetdreamsracing dot biz
2004-05-10 18:26:22 +00:00
Christian S.J. Peron
3581cc66bb Zero the un-used portions of the struct sockaddr data before sending
it back to userspace, so it does not break bind(2) on raw sockets in jails.

Currently some processes, like traceroute(8) construct a routing request
to determine its source address based on the destination. This sockaddr
data is fed directly to bind(2). When bind calls ifa_ifwithaddr(9) to
make sure the address exists on the interface, the comparison will
fail causing bind(2) to return EADDRNOTAVAIL if the data wasnt zero'ed
before initialization.

Approved by:	bmilekic (mentor)
2004-05-10 15:07:23 +00:00
David E. O'Brien
9c4b841b67 We don't support USB devices in PAE mode, so catch up with GENERIC rev 1.402. 2004-05-10 14:23:36 +00:00
Maxime Henrion
c5c09c282b - Remove the __FBSDID and put the $FreeBSD$ tag in the comment above,
so that including this file more than once works.
- Fix some style bugs while I'm here.
2004-05-10 11:50:21 +00:00
Maxime Henrion
d170b1ebab Prefer explicit ints to implicit ints in the prototype as well as in
the function definition.
2004-05-10 11:17:20 +00:00
Maxime Henrion
406e2f168e - Fix a typo in a printf(). [1]
- Fix some other style bugs while I'm here.

Submitted by:	Koop Mast <kwm@rainbow-runner.nl> [1]
Fixes PR:	sparc64/66448 [1]
2004-05-10 11:07:21 +00:00
Maksim Yevmenkin
92f4dabf30 Resync 2004-05-10 02:26:49 +00:00
Maksim Yevmenkin
73a4a9a759 Mode few Bluetooth defines into system include files
Reviewed by:	imp
2004-05-10 02:24:56 +00:00
Olivier Houchard
5090c98711 Change required config(8) version. 2004-05-09 22:29:38 +00:00
Julian Elischer
b324899838 Remove misplaced duplicate comment and slightly reformat the
version that was in the right place.
2004-05-09 22:29:14 +00:00
Alan Cox
6b95d60a7f Correct the implementation of pmap_page_is_mapped(): It should return TRUE
only if the page has one or more managed mappings.
2004-05-09 19:09:14 +00:00
Warner Losh
62e40b13fe This file has never been used, nor will it ever be used in FreeBSD, so
remove it.
2004-05-09 07:09:30 +00:00
Sam Leffler
335b8d7e89 set m_len to reflect mbuf contents on return from m_dup1; fixes an obscure
m_pullup case that contributed to breaking ipcomp in tunnel mode for kame

Submitted by:	itojun
Obtained from:	kame
2004-05-09 05:57:58 +00:00
Marcel Moolenaar
203bd0c3e7 This commit was generated by cvs2svn to compensate for changes in r129059,
which included commits to RCS files with non-trunk default branches.
2004-05-09 03:06:25 +00:00
Marcel Moolenaar
9cc6463a07 Update to BETA 7. Besides C++ support, which is irrelevant to us,
this version mostly has bugs fixes.
2004-05-09 03:06:25 +00:00
Alan Cox
3f39cca96b Cache queue pages are not mapped. Thus, the pmap_remove_all() by
vm_page_alloc() is unnecessary.
2004-05-09 01:00:15 +00:00
Alan Cox
ff8ea5e396 Since revision 1.280 of vm/vm_page.c, vm_page_grab() always returns a
zeroed page when passed VM_ALLOC_ZERO.  Thus, we can eliminate the check
against PG_ZERO from pmap_pinit().
2004-05-08 23:26:11 +00:00
Marius Strobl
66a79ac95d - Remove the old sparc64 OFW PCI code (as opposed to the former
"options OFW_NEWPCI").
  This is a bit overdue, the new sparc64 OFW PCI code which is
  meant to replace the old one is in place for 10 months and
  enabled by default in GENERIC for 8 months. FreeBSD 5.2 and
  5.2.1 also shipped with the new code enabled by default.
- Some minor clean-up, e.g. remove functions that encapsulated
  the #ifdefs for OFW_NEWPCI, remove unused resp. no longer
  required includes, etc.

Approved by:	tmm, no objections on freebsd-sparc64
2004-05-08 13:53:47 +00:00
Julian Elischer
60f798c1c8 Fix rtprio() to do sensible things when called from threaded processes.
It's not quite correct from a posix Point Of view, but it is a lot better
than what was there before. This will be revisited later
when we decide what form our priority extensions will take. Posix doesn't
specify  how a system scope thread can change its priority so you need to
add non-standard extensions to be able to do it..
For now make this slightly non standard to allow it to be done.

Submitted by:	Dan Eischen originally, changed by myself.
2004-05-08 08:56:05 +00:00
Alan Cox
ec1100fc6e Avoid pointless zeroing of the bogus page in vfs_bio_clrbuf().
Suggested by:	tegge@	(from October of last year)
2004-05-08 06:46:40 +00:00
Warner Losh
c7a0a4c076 We don't need the dependency on the pccard module here. 2004-05-08 06:06:13 +00:00
Warner Losh
fbfb97942e It turns out that the module dependency on pccard is in error. Since
there's not dependencies on pccard symboles, such a dependency is not
necessary.  This means that drivers that have multiple attachments can
not drag bogus devices into the kernel at load time.

We can't (yet) do this with pci and isa.  Drivers written for them
actually do seem to have symbols that depend on these busses'
implementation code.

ndis not touched until other things can be tested.
2004-05-08 06:04:06 +00:00
MIHIRA Sanpei Yoshiro
e5728f83a0 Add support CS4294
PR:		kern/66280
Submitted by:	Christian Brueffer <chris@unixpages.org>
2004-05-08 03:41:40 +00:00
Robert Watson
f7250466a8 Unconditionally lock Giant in do_sendfile(), rather than locking it
conditional on debug.mpsafenet.  We can try pushing down Giant here
later, but we don't want to enter VFS without holding Giant.

Bumped into by:	kris
2004-05-08 02:24:21 +00:00
Olivier Houchard
818f833a02 Define KINFO_PROC_SIZE for arm. 2004-05-07 15:37:56 +00:00
Olivier Houchard
a77c37b649 Compare t_brkc against (char)_POSIX_VDISABLE, not against -1.
Discussed with:	bde
2004-05-07 15:35:38 +00:00
Roman Kurakin
8ad3557f05 Use better way of closing fr support before current sppp get it. 2004-05-07 11:59:54 +00:00
Roman Kurakin
e97da3ff02 Sync with RELENG_4 2004-05-07 11:56:07 +00:00
Roman Kurakin
ff05239c88 Use better way of closing fr support before current sppp doesn't have it. 2004-05-07 11:45:25 +00:00