Commit Graph

39264 Commits

Author SHA1 Message Date
Warner Losh
bf1f89d49c Create new _ND versions to allow one to not specify the description be
stored in the table.
2003-04-08 15:28:58 +00:00
Warner Losh
c3805dd0ad Don't set the decription, since the pccard layer does that for us now.
Remove the duplicate entries that were there to disambiguate different
cards that were the same, yet people wanted to have different dmesg.
2003-04-08 15:26:02 +00:00
Dag-Erling Smørgrav
fe58453891 Introduce an M_ASSERTPKTHDR() macro which performs the very common task
of asserting that an mbuf has a packet header.  Use it instead of hand-
rolled versions wherever applicable.

Submitted by:	Hiten Pandya <hiten@unixdaemons.com>
2003-04-08 14:25:47 +00:00
Maxime Henrion
50d81222d8 Fix the hangs people have been seeing. For some reason, the
atomic operation change caused this, so backout it until I
can figure out what's wrong with it.
2003-04-08 13:05:11 +00:00
Marcel Moolenaar
302d51fcb2 Remove COMPAT_FREEBSD4. It's impossible because FreeBSD 4 does not
run on ia64 at all.
2003-04-08 08:32:00 +00:00
Jake Burkholder
a12efae1ea Merged from kern_thread.c 1.113, avoid a panic in cpu_throw when the first
thread of a multithreaded process exits.

This unrelated and possibly wrong change was not mentioned in the commit
message for kern_thread.c 1.113.
2003-04-08 08:13:47 +00:00
Søren Schmidt
08312d8f48 Fix a long standing bug in handling the last part of a stripe
on "odd" size disks.

Add printout of the RAID structure on verbose boot.
2003-04-08 07:48:52 +00:00
David Xu
36f7b36f8a Inherit blocked thread's context for upcall thread. 2003-04-08 07:45:56 +00:00
Warner Losh
6d9fcd03be MFp4: when you can't allocate a resource, print a message, don't panic. 2003-04-08 07:05:16 +00:00
Warner Losh
6586fa7c43 MFP4:
o don't access struct resource members directly.
o Set a default device description based on the CIS name.
2003-04-08 07:02:03 +00:00
Warner Losh
0540e305b6 u_int*_t -> uint*_t
-1 -> 0xffffffff
2003-04-08 06:59:20 +00:00
Warner Losh
307def65f1 Don't need to read this config register if we're just going to
overwrite it in the next line.
2003-04-08 06:54:10 +00:00
Warner Losh
9713a7922e MFp4: Massively unbreak module loading/unloading:
o Only complain about detached children that aren't pccard/cardbus.
o Don't NULL out the pccarddev and cbdev devices.  detach just
  disassociates the device and driver.  It doesn't delete the child.
o on driver added, just probe_and_attach the children.  If there's
  any children attached, wakeup the device add/delete thread.
o wakeup the add/delete thread with the correct cv_signal() rather
  than the bogus wakeup(sc).  It used to be that we did a tsleep on
  sc in this thread, but switched to the more reliable cv stuff a while
  ago w/o changing this.
o Remove bogus checks when reallocating memory for the registers.  They
  weren't needed and turned out to be completely bogus.

This lets me load/unload pccard with a pccard in a slot and have the
child correctly detach/attach.  This should help people that have wi
in their kernel, but that kldload cbb and pccard, for example.
2003-04-08 06:52:16 +00:00
Jake Burkholder
58d7ebfa7c Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
Mike Silbersack
2590e88477 Quick fix so that the watchdog timer is not set unless packets are
actually queued for transmission.  Without this, a low memory situation
would trigger false watchdog timeouts.

MFC after:	1 week
2003-04-08 03:32:52 +00:00
Mike Silbersack
ee9ad95f0e Fix up callers of xl_encap so that they handle a failure response
properly (likely due to mbuf exhaustion.)  Previously, the driver
got somewhat wedged.

Also, remove the annoying messages printed every time xl_encap
couldn't allocate a mbuf; they served no useful purpose, and just made
an mbuf exhaustion situation more annoying.

MFC after:	1 week
2003-04-08 01:05:54 +00:00
Maxime Henrion
d73e2e5593 Correct the maxsize and maxsegsz parameters for the
bus_dma_tag_create() calls.  Without this, fxp(4) + PAE
would consume insane amounts of bounce pages.
2003-04-07 17:02:44 +00:00
Jake Burkholder
a3b3689ff3 Add a PAE kernel config. This includes GENERIC through the config include
mechanism, and then excludes device drivers which have not been tested or
are known to not work with more than 4G of ram.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 16:23:14 +00:00
Jake Burkholder
fce2287796 Add support for bounce buffers to _bus_dmamap_load_buffer, which is the
backend for bus_dmamap_load_mbuf and bus_dmamap_load_uio.

- Increaes MAX_BPAGES to 512.  Less than this causes fxp to quickly runs out
  of bounce pages.
- Add an argument to reserve_bounce_pages indicating wether this operation
  should fail or be queued for later processing if we run out of memory.
  The EINPROGRESS return value is not handled properly by consumers of
  bus_dmamap_load_mbuf.
- If bounce buffers are required allocate minimum 1 bounce page at map
  creation time.  If maxsize was small previously this could get truncated
  to 0 and the drivers would quickly run out of bounce pages.
- Fix a bug handling the return value of alloc_bounce_pages at map creation
  time.  It returns the number of pages allocated, not 0 on success.
- Use bus_addr_t for physical addresses to avoid truncation.
- Assert that the map is non-null and not the no bounce map in
  add_bounce_pages.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 16:08:32 +00:00
Warner Losh
0b269efc05 resync 2003-04-07 15:36:46 +00:00
Maxime Henrion
2c6c094714 Remove an erroneous htole16(). The byte_count field in the
struct fxp_cb_config is a 6-bit field, not a 16-bit integer
as in struct fxp_cb_tx.
2003-04-07 14:53:30 +00:00
Jake Burkholder
46ea68dd10 Better fix for previous previous which still allows the 4megs of kva at
the top of the address space to be reclaimed.  The problem is that with
the APTD gone the mapable kernel address space runs right to the end of
the 32 bit address space.  As a max this is 0x100000000, which can't be
represented in 32 bits, so we have to use ptd entry n-1 and pte offset
n-1, instead of ptd entry n and pte offset 0.  There's still 1 page we
can't use, but we gain just under 4 megs of kva (8 megs with PAE).

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 14:27:19 +00:00
Søren Schmidt
b5855cd133 Minor cleanup of the ATA RAID code. 2003-04-07 14:14:29 +00:00
Søren Schmidt
1b39bd2412 Third round of updates to the ATA driver.
More DMA cleanups, including fix for breakage on older Promise controllers.

Add more ways of getting to the ATA registers.
2003-04-07 14:12:12 +00:00
Murray Stokely
65793abdff Add ID for Kawasaki LSI Inc. USB-Ethernet, rev 1.00/2.02 adapter.
PR:		kern/50064
Submitted by:	Scott Renfro <scott@renfro.org>
MFC after:	3 days
2003-04-07 10:26:59 +00:00
Matthew N. Dodd
efc5f672bd - Add PCI support (Adaptec AHA-2920/A,Future Domain TMC-18XX/3260).
- Reduce duplicated code.

PR:             50427
Submitted by:   Bob Bishop <rb@gid.co.uk>
2003-04-07 10:13:25 +00:00
Murray Stokely
887938c12f Fix typo.
PR:		kern/50504
Submitted by:	Alex Semenyaka <alexs@snark.ratmir.ru>
MFC after:	3 days
2003-04-07 10:06:48 +00:00
Murray Stokely
13b051bb51 Correct typos.
PR:		kern/50619
Submitted by:	Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
MFC after:	3 days
2003-04-07 09:42:45 +00:00
Matthew N. Dodd
acdf797d1a Retire these files. 2003-04-07 01:25:40 +00:00
Maxime Henrion
5f361cbe0e Move a bus_dmamap_sync() to the correct place. 2003-04-06 23:16:00 +00:00
Maxime Henrion
ec6b76b760 Because alpha can't access memory in 16-bit granularity,
we're using an atomic operation to clear the suspend flag
in fxp_start().  Since other architectures may need the
same thing, we want to do it all the time and not only
in the __alpha__ case.  However, we don't want to use
atomic operations on 16-bit integers, because those may
not be available on any architecture.  We're thus faking
a 32-bit atomic operation here.  This patch also deals
with endianness here.
2003-04-06 23:09:57 +00:00
Alan Cox
270086ec64 Sufficient access checks are performed by vmapbuf() that calling useracc()
is pointless.  Remove the calls to useracc().
2003-04-06 22:21:03 +00:00
Maxime Henrion
d45d97d1fc Revert the s/u_int/u_int8_t/ changes, we can't really use other
integer types than int with bit-fields in a portable way.

Prodded by:	bde
2003-04-06 21:35:45 +00:00
Marcel Moolenaar
ca13bfade5 Remove the 32KB VHPT section from the kernel image. We don't really
use it because we allocate a VHPT based on the size of the physical
memory and even if the allocated VHPT is 32KB, we don't use the in-
image section for it. Since the VHPT must be naturally aligned, we
save 48K on average (due to alignment).
Consequently, we start off with the VHPT disabled (it is assumed
the VHPT is disabled because the EFI loader runs without memory
address translation and thus has no need to setup the VHPT). It's
probably a good idea to explicitly disable the VHPT if we make the
use of the VHPT optional.
2003-04-06 21:31:26 +00:00
Alan Cox
6134838f99 Sufficient access checks are performed by vmapbuf() that calling useracc()
is pointless.  Remove the call to useracc().

Don't reinitialize fields that are already initialized by getpbuf().

Reviewed by:	tegge
2003-04-06 19:26:30 +00:00
Dag-Erling Smørgrav
093395d3d5 Initialize the PIIX timecounter in piix_attach(), which is called only
once, instead of doing it in piix_probe(), which is called every time
the PCI bus is rescanned.
2003-04-06 18:42:22 +00:00
Jake Burkholder
b5250c9f8d Remove a largely useless statistic (its kept elsewhere too). 2003-04-06 18:18:17 +00:00
Jake Burkholder
c81c0cf196 Make the pmap stats writeable. It can be useful to clear them. 2003-04-06 18:17:31 +00:00
Scott Long
e48fff82ef Add support for the CLIE 5.0 series of PDAs 2003-04-06 17:34:50 +00:00
Scott Long
2a33b44247 Regen from usbdevs v.116 2003-04-06 17:34:08 +00:00
Scott Long
4ba81f4602 Regen 2003-04-06 17:32:39 +00:00
Scott Long
e220a08537 Add ID's for the CLIE 5.0 series and the Belkin F5U109 usb->serial adapter. 2003-04-06 17:32:12 +00:00
Jake Burkholder
92fed30a07 Use the vis block copy/zero functions for pmap_copy_page and pmap_zero_page.
These are called through function pointers so that different implementations
can be provided for cheetah, where the block load instructions may or may
not be a win, and so they can be disabled with the machdep.use_vis tunable.
In terms of raw bandwidth the integer versions are faster, but not allocating
lines in the L2 cache for useless data gives a measurable improvement in user
time for the benchmarks I tested (mostly buildworld with -j8).

As far as I can tell the instructions used are implemented on everything
back to UltraSPARC I, so there should not be a problem with different cpu
types.
2003-04-06 17:05:26 +00:00
Jake Burkholder
3e9a6ab3a1 Ignore attempts to pmap_kremove or pmap_qremove pages which do not have
a valid mapping.  This is bug for bug compatible with other platforms.
2003-04-06 15:14:24 +00:00
Peter Wemm
30f445e056 Zap some a.out leftovers 2003-04-06 06:28:08 +00:00
Marcel Moolenaar
9fac9065b5 Also set the access bit in the PTE when we get a data dirty bit fault.
This avoids an immediate access bit fault when we serviced the dirty
bit fault in case the access bit is unset. This typically happens for
newly allocated memory that's being zeroed and thus very common.
2003-04-06 05:55:36 +00:00
Peter Wemm
67db8b23c3 Search for "elf32 kernel" (and elf64) and "elf32 module" (and elf64)
as well as "elf kernel" and "elf module".  This is a precursor to
x86-64 support in the i386 loader so it can load an elf64 x86-64 kernel.
2003-04-06 05:20:00 +00:00
Maxime Henrion
01c516b02a Use __FBSDID. 2003-04-06 01:27:12 +00:00
Maxime Henrion
6835a8accc Correct the definition of the link_addr and rbd_addr fields
in struct fxp_rfa.  This should have been committed with my
last endianness fixes.
2003-04-06 01:11:38 +00:00
Maxime Henrion
83e6547df1 - Instead of rolling our own alignment-safe function, use le32enc()
which deals with both endianness and alignment issues.
- Collect low-hanging fruits for endianness safety.
- Use 0xffffffff instead of -1 where appropriate.
2003-04-06 01:04:17 +00:00
Alan Cox
0b556837a9 Remove an unnecessary trunc_page() from vmapbuf().
Reviewed by:	tegge
2003-04-06 00:40:54 +00:00
Maxime Henrion
467295e056 - Use __FXP_BITFIELDX macros to make the configuration bitfield
endian safe.
- Change some u_int to u_int8_t which make more sense here since
  we're really defining bytes.  That produces the same code due to
  how bitfields work.
- Add the definition of the vlan_drop_en bit (not used yet).
- Add some useful comments.

Obtained from:	NetBSD
2003-04-05 23:46:58 +00:00
Maxime Henrion
cc9beb7b77 Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() for the
RX part of this driver too.  It's better since the code wasn't
dealing with bus_dmamap_load() returning EINPROGRESS, and this
can't happen with bus_dmamap_load_mbuf().

Submitted by:	jake
2003-04-05 23:24:23 +00:00
Alan Cox
ef38cda165 Don't reinitialize fields that are already initialized by getpbuf(). 2003-04-05 23:02:58 +00:00
Peter Wemm
c81e825f6c Unbreak the !LAZY_SWITCH case. I #ifdef'ed too much when I added
the ifdefs prior to commit and killed the same-address-space test.

Submitted by:	bde
2003-04-05 22:18:14 +00:00
Alan Cox
cdb06eda66 Sufficient access checks are performed by vmapbuf() that calling
useracc() is pointless.  Remove the call to useracc() from physio().

Reviewed by:	tegge
2003-04-05 21:19:58 +00:00
Marcel Moolenaar
2206cb596f Include <geom/geom_disk.h> and stop including <sys/disk.h>. The
former gives us 'struct disk'.
2003-04-05 21:14:05 +00:00
Alan Cox
2ac8b16089 Remove GIANT_REQUIRED from getpbuf(). Reviewed by: tegge
Reduce pbuf_mtx's scope in relpbuf().  Submitted by: tegge
2003-04-05 21:01:16 +00:00
Olivier Houchard
0a65bc0775 Fix ed compilation with PAE by using %jx instead of %x. 2003-04-05 18:12:36 +00:00
Olivier Houchard
18a6505b16 Use vm_paddr_t instead of vm_offset_t for the paddr parameter of vesa_mmap. 2003-04-05 18:08:22 +00:00
Maxime Henrion
4cec16537d - Change a FXP_NRFABUFS which would have been a FXP_NTXCB.
- Correct some bus_dmamap_sync() calls.

Submitted by:	jake
2003-04-05 12:43:21 +00:00
Maxime Henrion
201afb0e56 Setup our interrupt only at the end of fxp_attach(), when all
other allocations/initializations have been successful.  I kinda
doubt it will fix the recent breakage that some people are seeing,
but this could have caused problems for sure.
2003-04-05 01:27:17 +00:00
Tor Egge
fd6d48b8e8 Add SMP_TSC option, which can be used on SMP systems where the TSCs
are synchronized to reduce context switch cost.
2003-04-04 23:54:46 +00:00
Poul-Henning Kamp
fb89eb1ed7 Add a rudimentary but working driver for the Adlink "NuDaq PCI-9812".
This is a 4 channel 20 msps 12 bit ADC card.

Anyone wanting to play with GNUradio or similar can start here.
2003-04-04 18:53:04 +00:00
Dag-Erling Smørgrav
9f45b2da8f Define ovbcopy() as a macro which expands to the equivalent bcopy() call,
to take care of the KAME IPv6 code which needs ovbcopy() because NetBSD's
bcopy() doesn't handle overlap like ours.

Remove all implementations of ovbcopy().

Previously, bzero was a function pointer on i386, to save a jmp to
bzero_vector.  Get rid of this microoptimization as it only confuses
things, adds machine-dependent code to an MD header, and doesn't really
save all that much.

This commit does not add my pagezero() / pagecopy() code.
2003-04-04 17:29:55 +00:00
Poul-Henning Kamp
f54a02fb2b Retire <sys/diskslice.h> 2003-04-04 16:57:51 +00:00
Poul-Henning Kamp
197e5e73ef Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
2003-04-04 16:35:16 +00:00
MIHIRA Sanpei Yoshiro
e0926f607f Add NE2000DVF_AX88190 flag to Corega FEther PCC-TXD
(see also /etc/defaults/pccard.conf rev.1.172)
2003-04-04 14:46:50 +00:00
MIHIRA Sanpei Yoshiro
e21115ab06 fix typo 2003-04-04 14:40:01 +00:00
Dag-Erling Smørgrav
e1fec84a4a ovbcopy -> bcopy 2003-04-04 12:56:20 +00:00
Dag-Erling Smørgrav
2aebee88f3 Replace ovbcopy() with bcopy(). 2003-04-04 12:15:20 +00:00
Dag-Erling Smørgrav
212059bd83 Replace memcpy() and ovbcopy() with bcopy(); ditch some caddr_t usage. 2003-04-04 12:14:00 +00:00
Dag-Erling Smørgrav
f7854568f5 Don't use ovbcopy(). 2003-04-04 12:12:34 +00:00
Dag-Erling Smørgrav
7283c97574 Don't use ovbcopy(); use void * instead of char *. 2003-04-04 12:11:46 +00:00
Dag-Erling Smørgrav
8543efae60 The kernel bcopy() is safe for overlapping regions (and always has), so
there is no use for a separate ovbcopy().
2003-04-04 12:10:04 +00:00
Dag-Erling Smørgrav
e8c7f48855 Rename a static variable to avoid future conflicts. 2003-04-04 12:08:42 +00:00
Jake Burkholder
d1d03c2b72 Bandaid fix for previous commit while I figure out why it broke. This
caused crashes early in boot on i386 UP machines.

Reported by:	phk
Pointy hat to:	jake
2003-04-04 10:09:44 +00:00
Orion Hodson
ba548c643a Additional codec ids. 2003-04-04 07:37:25 +00:00
Orion Hodson
538b04e4ad Fix mismatch between bus address stored for buffer descriptors and
actual address of buffer descriptor.  This should fix the reported
calibration failures and subsequent speed problems with ich chipsets.

Minor calibration comment updates.
2003-04-04 07:15:19 +00:00
Alan Cox
06363906bc o Remove useracc() calls from aio_qphysio(); they are redundant
given the checks performed by vmapbuf().

Reviewed by:	tegge
2003-04-04 06:26:28 +00:00
Alan Cox
08468b6ad7 o Check the b_bufsize passed to vmapbuf() returning an error
if it is invalid.
 o Remove a debugging printf() from vmapbuf().

Suggested by:   tegge
2003-04-04 06:14:54 +00:00
Marcel Moolenaar
117f919160 Remove `#ifndef lint' left behind after previous change. 2003-04-04 02:12:56 +00:00
Jake Burkholder
163529c2b3 - Removed APTD and associated macros, it is no longer used.
BANG BANG BANG etc.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-03 23:44:35 +00:00
David E. O'Brien
8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Maxime Henrion
5353c9b6ba Remove useless initialization. 2003-04-03 20:39:43 +00:00
Paul Saab
9e7313bba7 Add support for the HP Smart Array 6400 EM
Change the interrupt mask for the Smart Array 6xxx controllers after
discussions w/ HP.
2003-04-03 20:09:27 +00:00
Poul-Henning Kamp
63f253709f Retire the DIOCGMBR ioctl before anybody starts to use it. 2003-04-03 19:37:40 +00:00
Poul-Henning Kamp
b0fc6220b8 Remove BIO_SETATTR from non-GEOM part of kernel as well. 2003-04-03 19:22:32 +00:00
Poul-Henning Kamp
4eba52a2d2 Remove all references to BIO_SETATTR. We will not be using it. 2003-04-03 19:19:36 +00:00
Poul-Henning Kamp
ab0ff32ea1 Update the initializer for GEOM_MBREXT, I overlooked it previously. 2003-04-03 19:05:03 +00:00
Poul-Henning Kamp
4c763c77dc Add #define for DOSPTYP_PMBR, and use it. 2003-04-03 18:55:16 +00:00
Jake Burkholder
6412c65cf0 Add optimized block copy and zero functions using vis instructions, which
can do 64 bytes at a time and don't allocate lines in the L2 cache.  These
assume that everything is 64 byte aligned, and that there's more than 128
bytes of data (best for whole pages).  The block load and store instructions
don't follow normal memory ordering rules and require either a memory barrier
or move between registers before the data can actually be used.  This
implementation correctly shuffles around 3 out of the 4 sets of registers
in order to avoid memory barriers expect for the last 2 blocks.
2003-04-03 18:43:40 +00:00
Maxime Henrion
c2a2b443e2 Fix fxp(4), this changed shouldn't have crept in.
Pointy hat to:	mux
Reported by:	Pawel Worach <pawel.worach@nordea.com>
2003-04-03 18:39:48 +00:00
Jake Burkholder
937e05327e Add support for saving and restoring kernel floating point state. The state
will be saved if we context switch as a result of an interrupt which occured
while using the floating point registers in the kernel (which actually can't
happen right now).  This allows fp disabled traps in the kernel, which
normally shouldn't happen, so make sure the trapping code is what we expect
it is.
2003-04-03 18:34:05 +00:00
Jake Burkholder
7dafcb6914 - Add space for kernel floating point registers to the pcb. These will be
used to support block copy and zero operations in the kernel which use the
  floating point registers.
- While I'm changing the size, improve the layout of struct pcb, sort by size,
  then alphabetical etc.
- Add some assertions to validate assumptions made about how the pcb is
  allocated.
2003-04-03 18:28:03 +00:00
Jake Burkholder
8e4f1e2b8a - Generally improve register usage in cpu_switch. Use the 'in' registers
for temporaries relating to the state of the new process instead of the
  outs, so that functions can be called without fear of clobbering them.
- Use savefpctx instead of rolling our own.
2003-04-03 16:36:01 +00:00
Dag-Erling Smørgrav
91b928c950 <sys/disk.h> -> <geom/geom_disk.h> 2003-04-03 16:28:57 +00:00
Jake Burkholder
02798ad7e0 Don't assume the fp state is at offset 0 in the pcb. 2003-04-03 16:04:18 +00:00
Jake Burkholder
1db34e9d43 Fix typos (don't use * when taking the size of an array). 2003-04-03 15:50:17 +00:00
Maxime Henrion
e609b4d7db Remove all the bogus volatile qualifiers from the structs definitions
and associated evil casts to discard them.
2003-04-03 14:08:35 +00:00
Yoshihiro Takahashi
335ac29ccd MFi386: revision 1.188 2003-04-03 12:39:51 +00:00
Yoshihiro Takahashi
514301992a MFi386: revision 1.561 2003-04-03 12:39:18 +00:00
Poul-Henning Kamp
76c4109ebb #include <sys/endian.h> as needed. 2003-04-03 11:56:10 +00:00
Poul-Henning Kamp
4d3651f456 Remove geom_enc.c, a superset of these functions are now available in
<sys/endian.h>
2003-04-03 11:40:06 +00:00
Poul-Henning Kamp
d8cb8a5137 Use <sys/endian.h> instead of geom_enc.c for endianess-agnostification. 2003-04-03 11:36:53 +00:00
Poul-Henning Kamp
82db45a5af Use sys/endian.h instead of geom_enc.c for endian-agnostfication. 2003-04-03 11:33:51 +00:00
Poul-Henning Kamp
4a36c1fdf3 Pointy hat commit:
Don't Cut&Paste from big endian to little endian function without subsequent
adjustments.
2003-04-03 11:32:01 +00:00
Poul-Henning Kamp
68f156409e Make sure we don't ignore error codes. 2003-04-03 11:19:24 +00:00
Poul-Henning Kamp
43e7e03ae6 Use "unsigned char" instead of "u_char" to avoid trouble. 2003-04-03 10:21:58 +00:00
Poul-Henning Kamp
8f24aac6b9 Add support for Moxa Technologies Co., Ltd. PCI I/O Card 4S RS232
Submitted by:	sst@cybercity.dk
2003-04-03 09:47:15 +00:00
Poul-Henning Kamp
21ee4ab688 Add inline functions {be,le}{16,32,64}{enc,dec}() for encoding decoding
into byte strings of unknown alignment.
2003-04-03 08:58:04 +00:00
Poul-Henning Kamp
9f88fdfb88 NO_GEOM cleanup: Remove dkmakeminor(). 2003-04-03 08:51:22 +00:00
Poul-Henning Kamp
3ad3653c7a Don't use dkmakeminor(), create our own minor encoding instead. 2003-04-03 08:50:35 +00:00
Poul-Henning Kamp
70f7e53da1 Don't use dkmakeminor(), it has nothing to do with CDroms. 2003-04-03 08:49:49 +00:00
Jeff Roberson
a8949de20e - Keep seperate statistics and run queues for different scheduling classes.
- Treat each class specially in kseq_{choose,add,rem}.  Let the rest of the
   code be less aware of scheduling classes.
 - Skip the interactivity calculation for non TIMESHARE ksegrps.
 - Move slice and runq selection into kseq_add().  Uninline it now that it's
   big.
2003-04-03 00:29:28 +00:00
Peter Wemm
cc66ebe2a9 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy
as it could be and can do with some more cleanup.  Currently its under
options LAZY_SWITCH.  What this does is avoid %cr3 reloads for short
context switches that do not involve another user process.  ie: we can
take an interrupt, switch to a kthread and return to the user without
explicitly flushing the tlb.  However, this isn't as exciting as it could
be, the interrupt overhead is still high and too much blocks on Giant
still.  There are some debug sysctls, for stats and for an on/off switch.

The main problem with doing this has been "what if the process that you're
running on exits while we're borrowing its address space?" - in this case
we use an IPI to give it a kick when we're about to reclaim the pmap.

Its not compiled in unless you add the LAZY_SWITCH option.  I want to fix a
few more things and get some more feedback before turning it on by default.

This is NOT a replacement for Bosko's lazy interrupt stuff.  This was more
meant for the kthread case, while his was for interrupts.  Mine helps a
little for interrupts, but his helps a lot more.

The stats are enabled with options SWTCH_OPTIM_STATS - this has been a
pseudo-option for years, I just added a bunch of stuff to it.

One non-trivial change was to select a new thread before calling
cpu_switch() in the first place.  This allows us to catch the silly
case of doing a cpu_switch() to the current process.  This happens
uncomfortably often.  This simplifies a bit of the asm code in cpu_switch
(no longer have to call choosethread() in the middle).  This has been
implemented on i386 and (thanks to jake) sparc64.  The others will come
soon.  This is actually seperate to the lazy switch stuff.

Glanced at by:  jake, jhb
2003-04-02 23:53:30 +00:00
John Baldwin
6751370f6f Lock the process before sending it a SIGIO. Not doing so is a panic(2)
implementation with INVARIANTS.
2003-04-02 21:54:51 +00:00
Poul-Henning Kamp
316aed030e Add handling for cancelled events in the g_call_me() methods. 2003-04-02 21:10:04 +00:00
Poul-Henning Kamp
afcbcfaed0 Change events to have an array of "void *" references, and give the
event posting functions varargs to fill these.

Attribute g_call_me() to appropriate g_geom's where necessary.

Add a flag argument to g_call_me() methods which will be used to signal
cancellation of events in the future.

This commit should be a no-op.
2003-04-02 20:41:18 +00:00
Matthew N. Dodd
2c56e246fa Back out support for RFC3514.
RFC3514 poses an unacceptale risk to compliant systems.
2003-04-02 20:14:44 +00:00
Matthew N. Dodd
4f6425f7ae - Use the correct constant define.
- Add a missing break.
2003-04-02 18:02:58 +00:00
Maxime Henrion
b2badf0214 Convert the fxp(4) driver to the busdma API.
This patch is rather big because I had to significantly redesign
the driver to make the busdma conversion possible.  Most notably,
hardware and software structures were carefully splitted to get
rid of all the structs overlapping evilness.

Special thanks to phk and Richard Puga <puga@mauibuilt.com> for
providing me with fxp(4) hardware to do this work.

Thanks to marcel for testing this on ia64, and to Fred Clift
<fclift@verio.net> for testing this on alpha.

Tested on:	i386, ia64, alpha
2003-04-02 16:47:16 +00:00
Jeffrey Hsu
c31548c820 Need to hold the same SMP lock for (knote) list traversal as for
list manipulation.  This lock also protects read-modify-write operations
on the pipe_state field.
2003-04-02 15:24:50 +00:00
Poul-Henning Kamp
8f6da0e4ac Only orphan things if the open/close actually succeeded. 2003-04-02 13:10:40 +00:00
Poul-Henning Kamp
c7e1925c7c Properly handle races between open/close and orphan.
KASSERT the race between close and strategy, it is an error in the upper
echelons if this happens,

Add XXX: comment explaining why the ioctl/orphan race is not closed.
2003-04-02 13:09:50 +00:00
Søren Schmidt
b539f9d523 Instead of not grapping a request binfinish(ENOMEM) it if malloc fails. 2003-04-02 11:36:43 +00:00
Yoshihiro Takahashi
cffa957106 MFi386: revisions 1.556 and 1.557.
Backout revision 1.312.
2003-04-02 10:51:06 +00:00
Yoshihiro Takahashi
ca30868b63 Merged from sys/dev/syscons/syscons.c revision 1.400. 2003-04-02 10:49:48 +00:00
Matthew N. Dodd
8faf6df9b3 Sync constant define with NetBSD.
Requested by:	 Tom Spindler <dogcow@babymeat.com>
2003-04-02 10:28:47 +00:00
Jeff Roberson
5053d272c2 - Make the interactivity calculator decay faster.
- Make the pcpu estimator update faster.
2003-04-02 08:22:33 +00:00
Jeff Roberson
98c9b132d1 - I meant divide by two and not shift by two in SCHED_PRI_NHALF. 2003-04-02 08:21:24 +00:00
Jake Burkholder
c2b117e7db Implement cpu_thread_setup. Fix cpu_set_upcall. 2003-04-02 08:03:42 +00:00
Jake Burkholder
cef57e7624 - Make casuptr return the old value of the location we're trying to update,
and change the umtx code to expect this.

Reviewed by:	jeff
2003-04-02 08:02:27 +00:00
Jeff Roberson
245f3abfd5 - Add in support for KSEs with 0 slice values on the run queue. If we try
to select a KSE with a slice of 0 we will update its slice and insert it
   onto the next queue.
 - Pass the KSE instead of the ksegrp into sched_slice().  This more
   accurately reflects the behavior of the code.  Slices are granted to kses.
 - Add a function kseq_nice_min() which finds the smallest nice value
   assigned to the kseg of any KSE on the queue.
 - Rewrite the logic in sched_slice().  Add a large comment describing the
   new slice selection scheme.  To summarize, slices are assigned based on
   the nice value.  Priorities are still calculated based on the nice and
   interactivity of a process.  Slice sizes of 0 may be granted for KSEs
   whos nice is 20 or futher away from the lowest nice on the run queue.
   Other nice values are scaled across the range [min, min+20].  This fixes
   ULEs bad behavior with positively niced processes.
2003-04-02 06:46:43 +00:00
Jake Burkholder
fc2fca74d8 - Fix UC_COPY_SIZE. Adding up the size of structure fields doesn't take
alignment into account.
- Return EJUSTRETURN from set_context on success to avoid clobbering the
  first 2 out registers with td_retval on sparc64.
2003-04-01 23:25:18 +00:00
Jake Burkholder
6e1e13b5e0 - Set the version number in the mcontext in get_mcontext and check it in
set_mcontext.
- Don't make assumptions about the alignment of the mcontext inside of the
  ucontext; we have to save the floating point registers to the pcb and then
  copy to the mcontext.
2003-04-01 23:18:13 +00:00
Jeffrey Hsu
48d2549c3e Observe conservation of packets when entering Fast Recovery while
doing Limited Transmit.  Only artificially inflate the congestion
window by 1 segment instead of the usual 3 to take into account
the 2 already sent by Limited Transmit.

Approved in principle by:	Mark Allman <mallman@grc.nasa.gov>,
Hari Balakrishnan <hari@nms.lcs.mit.edu>, Sally Floyd <floyd@icir.org>
2003-04-01 21:16:46 +00:00
Poul-Henning Kamp
817509273e #include <geom/geom_disk.h> 2003-04-01 19:00:38 +00:00
Poul-Henning Kamp
4752f7570a Include <geom/geom_disk.h> not <sys/disk.h> 2003-04-01 18:57:14 +00:00
Poul-Henning Kamp
332a2bf07b Remove the #define for bioqdisksort(), it's no longer needed. 2003-04-01 18:55:46 +00:00
Poul-Henning Kamp
812de2ed5c I think the divorce successed, so stop #including <geom/geom_disk.h> 2003-04-01 18:55:04 +00:00
Andrew Gallatin
9ef024f7b7 Add a crutch so that direct-mapped DMA works on alpha. This is a step
toward preventing this driver from crashing an alpha at boot.

Tested by: Oliver Lehmann <lehmann@ans-netz.de>
2003-04-01 16:31:12 +00:00
Poul-Henning Kamp
891619a66d Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.
2003-04-01 15:06:26 +00:00
Poul-Henning Kamp
51a5b7f1ba Don't include <sys/disk.h>. 2003-04-01 13:33:28 +00:00
Poul-Henning Kamp
7c79beb3ce Start to split the GEOM/diskdriver specific bits into geom/geom_disk.h 2003-04-01 13:19:14 +00:00
Poul-Henning Kamp
af6ca7f4a9 Introduce bioq_flush() function. 2003-04-01 12:49:40 +00:00
Poul-Henning Kamp
a4d7a3c069 Include <sys/conf.h> rather than trusting <sys/disk.h> to do so. 2003-04-01 12:35:17 +00:00
Poul-Henning Kamp
95082542bb Add #include <sys/conf.h> so we don't rely on <sys/disk.h> doing it. 2003-04-01 12:34:47 +00:00
Jeff Roberson
120d1b9e32 - smb_td_intr takes a thread as an argument not a proc. 2003-04-01 09:24:12 +00:00
Jeff Roberson
6f39c1a1fe - smb_proc_intr is now spelled smb_td_intr.
Noticed by:	phk
Pointy hat to:	jeffr
2003-04-01 09:23:24 +00:00
Jeff Roberson
c9dfa2e08b - p will be unused in cursig() if INVARIANTS is not defined. Access it
through td->td_proc to avoid the unused variable.

Spotted by:	Maxim Konovalov <maxim@macomnet.ru>
2003-04-01 09:07:36 +00:00
Poul-Henning Kamp
09bf42f50f Don't include <sys/buf.h> needlessly. 2003-04-01 09:02:58 +00:00
Poul-Henning Kamp
6f46bf604d Fix KASSERT syntax error. 2003-04-01 08:57:28 +00:00
Matthew N. Dodd
09139a4537 Implement support for RFC 3514 (The Security Flag in the IPv4 Header).
(See: ftp://ftp.rfc-editor.org/in-notes/rfc3514.txt)

This fulfills the host requirements for userland support by
way of the setsockopt() IP_EVIL_INTENT message.

There are three sysctl tunables provided to govern system behavior.

	net.inet.ip.rfc3514:

		Enables support for rfc3514.  As this is an
		Informational RFC and support is not yet widespread
		this option is disabled by default.

	net.inet.ip.hear_no_evil

		 If set the host will discard all received evil packets.

	net.inet.ip.speak_no_evil

		If set the host will discard all transmitted evil packets.

The IP statistics counter 'ips_evil' (available via 'netstat') provides
information on the number of 'evil' packets recieved.

For reference, the '-E' option to 'ping' has been provided to demonstrate
and test the implementation.
2003-04-01 08:21:44 +00:00
Poul-Henning Kamp
c8d01707ba Fix KASSERT syntax errors.
Please compile LINT before commiting.
2003-04-01 08:10:21 +00:00
Poul-Henning Kamp
4a1e273c48 Remove the old config interface, the new OAM is sufficiently functional
now.
2003-04-01 07:33:56 +00:00
Poul-Henning Kamp
dfb99a70d8 Remove the old config interface now that the new OAM is functional. 2003-04-01 07:33:17 +00:00
Jake Burkholder
73adf5691f - Add a flags field to struct pcb. Use this to keep track of wether or
not the pcb has floating point registers saved in it.
- Implement get_mcontext and set_mcontext.
2003-04-01 04:58:50 +00:00
Jake Burkholder
404221fe55 - Don't allow tf_wstate to be set in set_regs.
- Clear FPRS_FEF in set_fpregs so the new registers will be reloaded.
2003-04-01 04:29:03 +00:00
Jake Burkholder
8fe20fdafa Implement cpu_set_upcall. 2003-04-01 04:19:29 +00:00
Jake Burkholder
f217a77ce4 - Rename pcb_fpstate to pcb_ufp (user floating point), and change it to
a simple array of 64 ints.
- Use a critical section when saving floating point state in cpu_fork
  instead of sched_lock.
2003-04-01 04:02:45 +00:00
Jake Burkholder
e50173aeaa Rename pcb_fp to pcb_sp, so as to not be confused with floating point
state.
2003-04-01 03:05:46 +00:00
Tim J. Robbins
a968deece9 Specify the M_WAITOK flag explicitly in the MALLOC call to silence a
runtime warning ("Bad malloc flags: 0").
2003-04-01 02:47:09 +00:00
Tim J. Robbins
788fc48e32 Give the M_WAITOK flag explicitly to the MALLOC call to silence a runtime
warning ("Bad malloc flags: 0").
2003-04-01 02:42:02 +00:00
Jake Burkholder
a31794d553 Implement casuptr. 2003-04-01 02:37:04 +00:00
Jeff Roberson
4518589564 - Regen. 2003-04-01 02:34:21 +00:00
Jeff Roberson
8446303e01 - thr_exit() should no longer be called with Giant held. 2003-04-01 02:32:53 +00:00
Jeff Roberson
f27bf63b8a - Mark the various thr syscalls as MP safe. Previously there was a bug if
this was not done since thr_exit() unwinds giant.
2003-04-01 02:32:07 +00:00
Jeff Roberson
2c10d16a4b - Borrow the KSE single threading code for exec and exit. We use the check
if (p->p_numthreads > 1) and not a flag because action is only necessary
   if there are other threads.  The rest of the system has no need to
   identify thr threaded processes.
 - In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED
   is not set.
2003-04-01 01:26:20 +00:00
Jeff Roberson
8af830c374 - Regen for umtx. 2003-04-01 01:22:18 +00:00
Jeff Roberson
a0704f9de9 - Add thr and umtx system calls. 2003-04-01 01:15:56 +00:00
Jeff Roberson
404c3ad471 - Add the kern_umtx.c file to the build. 2003-04-01 01:13:29 +00:00
Jeff Roberson
6eeb9653aa - Include umtx.h in files generated by makesyscalls.sh
- Add system calls for umtx.
2003-04-01 01:12:24 +00:00
Jeff Roberson
7f49f8e05b - Add an entry and a head for the queue of threads blocked on a umtx.
- Add a prototype for thr_exit1().
2003-04-01 01:11:22 +00:00
Jeff Roberson
69404b5090 - Add an api for doing smp safe locks in userland.
- umtx_lock() is defined as an inline in umtx.h.  It tries to do an
   uncontested acquire of a lock which falls back to the _umtx_lock()
   system-call if that fails.
 - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
   uncontested unlock fails.
 - Locks are keyed off of the thr_id_t of the currently running thread which
   is currently just the pointer to the 'struct thread' in kernel.
 - _umtx_lock() uses the proc pointer to synchronize access to blocked thread
   queues which are stored in the first blocked thread.
2003-04-01 01:10:42 +00:00
Jeff Roberson
90e38817b7 - We now have to include umtx.h and ucontext.h in the system call related
headers.
2003-04-01 00:35:12 +00:00
Jeff Roberson
d4a63cb9c8 - Regen for thr related system calls. 2003-04-01 00:34:29 +00:00
Jeff Roberson
8d5377e538 - Add the four thr related system calls. 2003-04-01 00:31:37 +00:00
Jeff Roberson
f00fea89ca - Add kern_thr.c 2003-04-01 00:30:54 +00:00
Jeff Roberson
89bb1cef1d - Add two files to support the thr threading interface.
- sys/thr.h contains the user space visible api that is intended only for
   use in threading library packages.
 - kern/kern_thr.c contains thr system calls and other thr specific code.
2003-04-01 00:30:30 +00:00
Jeff Roberson
b8db34d280 - Define a new md function 'casuptr'. This atomically compares and sets
a pointer that is in user space.  It will be used as the basic primitive
   for a kernel supported user space lock implementation.
 - Implement this function in x86's support.s
 - Provide stubs that return -1 in all other architectures.  Implementations
   will follow along shortly.

Reviewed by:	jake
2003-04-01 00:18:55 +00:00
Jeff Roberson
fb8aaa76c7 - In npxgetregs() use the td argument to save the fpu state from and not
curthread.  Nothing currently depends on this behavior.
 - Clean up an extra newline.

Obtained from:	bde
2003-04-01 00:16:32 +00:00
Jeff Roberson
a9b34138dc - Add a placeholder for sigwait 2003-03-31 23:36:40 +00:00
Jeff Roberson
722547925e - Regen for the sig*wait* system calls. 2003-03-31 23:33:45 +00:00
Jeff Roberson
55d9ba3eac - According to mike@FreeBSD.org SIGTHR should be hiden by
#ifdef __BSD_VISIBLE
2003-03-31 23:31:50 +00:00
Jeff Roberson
a447cd8b28 - Define sigwait, sigtimedwait, and sigwaitinfo in terms of
kern_sigtimedwait() which is capable of supporting all of their semantics.
 - These should be POSIX compliant but more careful review is needed before
   we announce this.
2003-03-31 23:30:41 +00:00
Thomas Quinot
da4898b1d7 Revert change 1.201 (removing mapping of VAPPEND to VWRITE).
Instead, use the generic vaccess() operation to determine whether
an operation is permitted. This avoids embedding knowledge on
vnode permission bits such as VAPPEND in the NFS client.

PR:		kern/46515
vaccess() patch submitted by:	"Peter Edwards" <pmedwards@eircom.net>
Approved by:	tjr, roberto (mentor)
2003-03-31 23:26:10 +00:00
Jeff Roberson
c5c34c0a76 - Move the NEEDSIGCHK and OLDMASK flags from proc to thread.
- Move the signal mask to the thread.
 - Adjust a few comments.
2003-03-31 22:51:19 +00:00
Jeff Roberson
4093529dee - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c
 - signotify() now operates on a thread since unmasked pending signals are
   stored in the thread.
 - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
2003-03-31 22:49:17 +00:00
Julian Elischer
0d49bb4b30 Do NOT return from an non-interruptable cv_wait, falsely
claiming to have timed out. I don't know what I was thinking..
2003-03-31 22:41:47 +00:00
Jeff Roberson
a35394bd84 - Fix two calls to trapsignal() that were still passing in 'struct proc'.
These were missed in my last commit.
2003-03-31 22:41:32 +00:00
Jeff Roberson
90176341c3 - Add a signal for thread synchronization. Add an XXX so that maybe
someone more knowledgeable on standards defined namespaces may ifdef
   this out.
2003-03-31 22:30:08 +00:00
Jeff Roberson
da33176f39 - Mark signals which may be delivered to any thread in the process with
SA_PROC.  Signals without this flag should be directed to a particular
   thread if this is possible.
2003-03-31 22:12:09 +00:00
Jeff Roberson
1bf4700bff - Change trapsignal() to accept a thread and not a proc.
- Change all consumers to pass in a thread.

Right now this does not cause any functional changes but it will be important
later when signals can be delivered to specific threads.
2003-03-31 22:02:38 +00:00
Jeff Roberson
772e5d8d88 - Use sigexit() instead of twiddling the signal mask, catch, ignore, and
action bits to allow SIGILL to work as expected.  This brings this file in
   line with other architectures.
2003-03-31 21:40:47 +00:00
Wes Peters
f4cf2141f6 Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.

Reviewed by:	arch@
Sponsored by:	St. Bernard Software
2003-03-31 21:09:57 +00:00
John Baldwin
59f47d29b7 Add missing ()'s so that these drivers all compile again.
Noticed by:	jake
Tested on:	i386 (compile)
2003-03-31 20:22:00 +00:00
Jake Burkholder
c82feacd9b - Allow the physical memory size that will be actually used by the kernel to
be overridden by setting hw.physmem.
- Fix a vm_map_find arg, we don't want to find space.
- Add tracing and statistics for off colored pages.
- Detect "stupid" pmap_kenters (same virtual and physical as existing
  mapping), and do nothing in that case.
2003-03-31 19:56:55 +00:00
John Baldwin
726f07979c If we fail to find our PCI ID in attach (this should never happen), then
just return ENXIO directly instead of calling tl_detach() since that would
panic since the softc mutex isn't initialized until after this check.
2003-03-31 19:24:37 +00:00
Poul-Henning Kamp
afa2a5aab7 Remove some debugging in the new OAM[*] and add a debug flag for other
parts of it.

[*] I've been asked what "OAM" means:  It's an acronym used in the
telecom industry, "Operations And Maintenance", and there it covers
anything from a single unlabeled led on the frontpanel the the full
nightmare of CMIP for SS7.
2003-03-31 18:35:37 +00:00
Jake Burkholder
a11d7214fd Match "serial" as well as "se". 2003-03-31 18:21:52 +00:00
Nate Lawson
54f1f1d1e6 Clean up locking and resource management for pci/if_*
- Remove locking of the softc in the attach method, instead depending on
  bus_setup_intr being at the end of attach (delaying interrupt enable until
  after ether_ifattach is called)
- Call *_detach directly in the error case of attach, depending on checking
  in detach to only free resources that were allocated.  This puts all
  resource freeing in one place, avoiding thinkos that lead to memory leaks.
- Add bus_child_present check to calls to *_stop in the detach method to
  be sure hw is present before touching its registers.
- Remove bzero softc calls since device_t should do this for us.
- dc: move interrupt allocation back where it was before.  It was unnecessary
  to move it.  This reverts part of 1.88
- rl: move irq allocation before ether_ifattach.  Problems might have been
  caused by allocating the irq after enabling interrupts on the card.
- rl: call rl_stop before ether_ifdetach
- sf: call sf_stop before ether_ifdetach
- sis: add missed free of sis_tag
- sis: check errors from tag creation
- sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- sk: remove duplicate initialization of sk_dev
- ste: add missed bus_generic_detach
- ti: call ti_stop before ether_ifdetach
- ti: add missed error setting in ti_rdata alloc failure
- vr: add missed error setting in I/O, memory mapping cases
- xl: add missed error setting in I/O, memory mapping cases
- xl: remove multi-level goto on attach failure
- xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation
- Calls to free(9) are unconditional because it is valid to call free with a
  null pointer.

Reviewed by:	imp, mdodd
2003-03-31 17:29:43 +00:00
Alan Cox
7be80f55ba Recent changes to uipc_cow.c have eliminated the need for some sf_buf-
related variables to be global.  Make them either local to sf_buf_init() or
static.
2003-03-31 06:25:42 +00:00
Jeff Roberson
4c8a7679d0 - In npxsetregs don't set the floating point if td == fpcurthread not if
curthread == fpcurthread.  This is important when we're saving the fp
   state for a thread other than curthread as in from set_mcontext.
2003-03-31 00:32:43 +00:00
Scott Long
b85f5808f8 Add the ability to send 64-bit scatter/gather elements to aac cards. This
is enabled when both the size of bus_addr_t > 4 and the card claims support.

Don't wake up the kthread to allocate more commands if we know that we've
already allocated the max number of commands.
2003-03-30 21:47:16 +00:00
Poul-Henning Kamp
d2a0822e9d retire the "busy" field in bioqueues, it's served it's purpose. 2003-03-30 10:16:31 +00:00
Søren Schmidt
0c4b980607 Fix ATA_DEBUG case breakage. 2003-03-30 09:27:59 +00:00
Poul-Henning Kamp
d086f85ac4 Preparation commit before I start on the bioqueue lockdown:
Collect all the bits of bioqueue handing in subr_disk.c, vfs_bio.c is big
enough as it is and disksort already lives in subr_disk.c.
2003-03-30 08:51:23 +00:00
Matthew N. Dodd
d938c3689d Revert 1.21; this was local code that should not have been
committed.
2003-03-30 08:13:47 +00:00
Jake Burkholder
a271c2ed7f - Temporary fix so this compiles with 64 bit bus_addr_t.
Sponsored by:	DARPA, Network Associates Laboratories
Approved by:	scottl
2003-03-30 05:26:01 +00:00
Jake Burkholder
7ab9b220d9 - Add support for PAE and more than 4 gigs of ram on x86, dependent on the
kernel opition 'options PAE'.  This will only work with device drivers which
  either use busdma, or are able to handle 64 bit physical addresses.

Thanks to Lanny Baron from FreeBSD Systems for the loan of a test machine
with 6 gigs of ram.

Sponsored by:	DARPA, Network Associates Laboratories, FreeBSD Systems
2003-03-30 05:24:52 +00:00
Matthew N. Dodd
7caef8d92c Catch up with recent changes. 2003-03-30 05:06:15 +00:00
Mike Silbersack
709b85c372 Switch rl_encap over to using m_defrag.
No functional change, the previous rl_encap was correct wrt long
mbuf chains; this just reduces code duplication.

MFC after:	2 weeks
2003-03-30 03:45:28 +00:00
Jeff Roberson
abb0e6da6b - We are not guaranteed that read ahead blocks are not in memory already.
Check for B_DELWRI as well as B_CACHED before issuing io on a buffer.  This
   is especially important since we are changing the b_iocmd.
2003-03-30 02:57:32 +00:00
Jake Burkholder
de54353fb8 - Remove invalid casts.
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-30 01:44:16 +00:00
Jake Burkholder
aea57872f0 - Convert all uses of pmap_pte and get_ptbase to pmap_pte_quick. When
accessing an alternate address space this causes 1 page table page at
  a time to be mapped in, rather than using the recursive mapping technique
  to map in an entire alternate address space.  The recursive mapping
  technique changes large portions of the address space and requires global
  tlb flushes, which seem to cause problems when PAE is enabled.  This will
  also allow IPIs to be avoided when mapping in new page table pages using
  the same technique as is used for pmap_copy_page and pmap_zero_page.

Sponsored by:	DARPA, Network Associates Laboratories
2003-03-30 01:16:19 +00:00
Maxime Henrion
6900a17c75 The object type can't be OBJT_PHYS in vm_mmap().
Reviewed by:	peter
2003-03-30 00:56:20 +00:00
Poul-Henning Kamp
376ceb799f Fix a bug in the ENOMEM pacing code which probably made it panic systems
after a lot of ENOMEM errors.
2003-03-29 22:34:37 +00:00
Matthew N. Dodd
672fc9ebf6 - Free interrupt handler in ep_free().
- Move ep_pccard_detach() to if_ep.c and rename to ep_detach()
- Specify detach methods for all bus frontends.
2003-03-29 22:27:41 +00:00
Poul-Henning Kamp
29c331bfaa Add create_geom and destroy_geom methods. 2003-03-29 22:14:21 +00:00
Poul-Henning Kamp
67ffbc63f3 remove a blank line. 2003-03-29 22:13:32 +00:00
Matthew N. Dodd
18e03d5e08 Checksum the configuration EEPROM. 2003-03-29 21:57:32 +00:00
Matthew N. Dodd
bb25efadc4 - Return error status instead of value in get_e().
- Modify ep_get_macaddr() to return an error status.
- Reverse the return value logic of eeprom_rdy().
2003-03-29 21:44:46 +00:00
Mike Silbersack
63b9b38eb8 Switch vr_encap over to using m_defrag instead of its own version
of the function.

No functional change, this driver already handled long mbuf chains
correctly.

MFC after:	2 weeks
2003-03-29 21:39:49 +00:00
Mike Silbersack
cda97c506e Update if_dc to use m_defrag, removing the semi-duplicate dc_coal
function.

Also, use m_defrag where appropriate to defrag long mbuf chains
in the same fashion as was done in if_sis.c.  Before this change,
if_dc would blow up and take down the interface if fed a really long
mbuf chain.

MFC after:	2 weeks
2003-03-29 21:27:07 +00:00
Andrew Gallatin
62f456b315 Fix the osf1 abi module on SMP systems by making the size of
a struct pmap be the same on both SMP and UP kernels.

It turns out that the size of a struct pmap is much larger on alpha
SMP systems due to the number of pm_asn's being dependant on MAX_CPU.
Since modules are supposed to be SMP agnostic, this has the affect of
moving around the "interesting bits" of the vmspace (daddr, dsize)
that the osf1 module wants to frob.  So the module ends up scribbling in a
pmap struct, and the user either sees a panic, or an application failure.

While here, I've also shrunk MAXCPU to 8 now that it affects the size
of pmap structs on UP systesm.  This should be plenty, as I'm
unware of any hardware we currently run in which supports more than 8
CPUs.
2003-03-29 18:22:29 +00:00
Mike Silbersack
58b2ce3bee Have sis_encap use m_defrag if:
1.  The chain passed in is > 31 fragments long
or
2.  The chain will not fit in the remaining descriptors without
    defragmentation.

This is slightly less clear than other network drivers because the sis
chips share one descriptor list for all packets, it seems.

Before this change, a > 127 fragment chain would get stuck in the IFQUEUE
permanently, bringing all network traffic to a halt.

MFC after:	2 weeks
2003-03-29 17:50:37 +00:00
Matthew N. Dodd
e3a2085326 opt_geom.h is no longer required for this module. 2003-03-29 16:13:11 +00:00
Matthew N. Dodd
991aa7bf9a Add 'idt' driver to module build. 2003-03-29 15:56:13 +00:00
Matthew N. Dodd
370f7f7c05 - Deal with netisr changes.
- Wrap idt_atm_harpconn() in conditional define T_ATM_BUFQUEUE
2003-03-29 15:55:04 +00:00
Matthew N. Dodd
56376071e3 Add module infrastructure for 'dpt' driver. 2003-03-29 15:47:13 +00:00
Matthew N. Dodd
79ac92f83c Add module infrastructure for 'if_ex'. 2003-03-29 15:41:44 +00:00
Matthew N. Dodd
20fae1ba5b - Declare ex_devclass in if_ex.c
- Rename module datastructures in if_ex_isa.c to be more standard.
2003-03-29 15:38:53 +00:00
Matthew N. Dodd
c0a71ab74a - Move ex_pccard_detach() to if_ex.c and rename it to ex_detach().
- Add detach method to ISA front end.
2003-03-29 15:34:26 +00:00
Matthew N. Dodd
ece0c30b62 Reformat for readability. 2003-03-29 15:33:04 +00:00
Matthew N. Dodd
81d9009a65 Add module infrastructure for 'vpd' and 'smbios' and move 'smbios'
to new home.
2003-03-29 15:20:45 +00:00
Matthew N. Dodd
dfcf25920b Remove useless code. 2003-03-29 14:51:50 +00:00
Matthew N. Dodd
21e2098cc9 Don't compile the identify method yet. 2003-03-29 14:50:14 +00:00
Matthew N. Dodd
b26809608c Register dependency on the elink module. 2003-03-29 13:45:17 +00:00
Matthew N. Dodd
187e120cbe Add module infrastructure for elink. 2003-03-29 13:42:20 +00:00
Matthew N. Dodd
dd4cb1b8b8 Add module infrastructure for if_ie. 2003-03-29 13:40:41 +00:00
Søren Schmidt
566cf07a7c Second round of updates to the ATA driver.
Clean up the DMA interface too much unneeded stuff crept in with
the busdma code back when.

Modify the ATA_IN* / ATA_OUT* macros so that resource and offset
are gotten from a table. That allows for new chipsets that doesn't
nessesarily have things ordered the good old way. This also removes
the need for the wierd PC98 resource functions.

Tested on: i386, PC98, Alpha, Sparc64
2003-03-29 13:37:09 +00:00
Matthew N. Dodd
50e960d918 - Move driver to newbus.
- Provide identify methods for EtherExpress and 3c507 cards; this
  means these cards no longer need wired configs.
- Provide a detach method.
2003-03-29 13:36:41 +00:00
Matthew N. Dodd
3330d5fb09 - Change ELINK_ID_PORT; the 3c507 likes 0x100 better.
- Add module metadata.
2003-03-29 13:18:20 +00:00
Matthew N. Dodd
d0859c8567 Clear the IFF_OACTIVE flag at the end of ieinit(). This prevents
the adapter from becoming wedged when when the interface is
is brought up by ether_ioctl() (when you set an IP address for example.)

Confirmed this "fix" from NetBSD's i82586 backend.  It seems hackish
to me but whatever.
2003-03-29 12:42:01 +00:00
Matthew N. Dodd
be8e35bebd 'speaker' not 'atspeaker' 2003-03-29 10:01:03 +00:00
Matthew N. Dodd
a71a307383 Retire 'atspeaker' and 'pcspeaker'. We'll use 'speaker' which
is the same as the config device directive.

Reminded by:	 Takahashi Yoshihiro <nyan@jp.FreeBSD.org>
2003-03-29 09:59:49 +00:00
Matthew N. Dodd
14b2046d29 Adjust shared memory allocation to work on cards with only 8 KB of RAM. 2003-03-29 09:49:22 +00:00
Matthew N. Dodd
563d4d8656 Clean up argument comments for bus_dma_tag_create() calls. 2003-03-29 09:46:10 +00:00
SUZUKI Shinsuke
db06e8a0dd fixed a mbuf leak when an IP packet from ESP tunnel is redirected
obtained from:	KAME
2003-03-29 08:31:28 +00:00