Commit Graph

48774 Commits

Author SHA1 Message Date
philip
11953c7462 Further cleanup: merge the three led toggling functions
into a single general function to handle all leds.

Approved by:	njl
2004-08-03 22:37:09 +00:00
njl
e232f7c8d9 Bump WARNS to 2 for all other ACPI drivers and minor cleanup. 2004-08-03 21:27:43 +00:00
njl
f9477f2ed8 Use the acpi_{Get,Set}Integer functions instead of rolling custom ones.
Clean up return path of each function to have a single exit point.  This
reduces diffs against the MPSAFE tree.
2004-08-03 21:17:36 +00:00
markm
f516045149 Making a loadable null.ko for /dev/(null|zero) proved rather
unpopular, so remove this (mis)feature.

Encouragement provided by:	jhb (and others)
2004-08-03 19:24:54 +00:00
mux
35780dc21a Instead of calling ia32_pause() conditionally on __i386__ or __amd64__
being defined, define and use a new MD macro, cpu_spinwait().  It only
expands to something on i386 and amd64, so the compiled code should be
identical.

Name of the macro found by:	jhb
Reviewed by:	jhb
2004-08-03 18:44:27 +00:00
njl
3c17f077be Fix the ACPI_DEBUG case by removing a now unused variable. 2004-08-03 17:16:30 +00:00
wpaul
0c50dcdea3 Minor cleanups:
- Fix typo in comment
- Remember to free() sc->ndis_txarray on detach
- Remember to do an ifmedia_removeall() for ethernet devices
2004-08-03 17:00:39 +00:00
pjd
f381f9a205 Fix comment. 2004-08-03 15:41:33 +00:00
pjd
7a05d0a3cd Don't skip permission checks when sending signals to zombie processes.
Pointed out by:	bde
Reviewed by:	rwatson
2004-08-03 15:39:23 +00:00
obrien
21fb58ea74 Initialize variables to fix kernel build on AMD64. 2004-08-03 14:14:53 +00:00
andre
3a7a087025 o Delayed checksums are now calculated in divert_packet() for diverted packets
Remove the XXX-escaped code that did it in ip_output()'s IPHACK section.
2004-08-03 14:13:36 +00:00
andre
f1492e3a5a o Move the inflight sysctls to their own sub-tree under net.inet.tcp to be
more consistent with the other sysctls around it.
2004-08-03 13:54:11 +00:00
andre
fd96163246 o Move all parts of the IP reassembly process into the function ip_reass() to
make it fully self-contained.
o ip_reass() now returns a new mbuf with the reassembled packet and ip->ip_len
  including the IP header.
o Computation of the delayed checksum is moved into divert_packet().

Reviewed by:	silby
2004-08-03 12:31:38 +00:00
dfr
8354a9598d Add style(9) foolishness. 2004-08-03 08:21:48 +00:00
bz
5b63f751da Implement minimalistic L2TP sessions statistics and correct man page
for L2TP tunnel statistics (which do not take an argument sessionID).

Reviewed by:	archie
Approved by:	pjd (mentor)
2004-08-03 06:52:55 +00:00
njl
30d8b6d6ad Use the slot, not an otherwise unused index variable as the probe offset.
This passed testing because the variable happened to be 0 in most cases.

Compile warning found by: David Syphers <dsyphers AT u.washington.edu>
2004-08-03 06:48:36 +00:00
bz
3fbdc1b5aa add a new control message to set sequence numbers on an uninitialized node.
Reviewed by:	archie
Approved by:	pjd (mentor)
2004-08-03 06:45:38 +00:00
bz
dd64b1bf8c Correct L2TP header offset handling:
- according to RFC2661 an offset size of 0 is allowed.
- when skipping offset padding do not forget to also skip
  the 2 octets of the offset size field.

Reviewed by:	archie
Approved by:	pjd (mentor)
2004-08-03 06:37:46 +00:00
bz
17a0de77f6 Do not change link[n].conf.latency for internal usage but have
link[n].latency calculated from user supplied value.
This prevents repeated NGM_PPP_SET_CONFIG/NGM_PPP_GET_CONFIG
from failing because of link[n].conf.latency being out of range.

Reviewed by:	archie
Approved by:	pjd (mentor)
2004-08-03 06:34:55 +00:00
njl
f32985a6a5 /tmp/m 2004-08-03 05:13:56 +00:00
grehan
2f05904e18 Remove race condition between reading of MSR, setting md_savecrit,
and setting MSR. This was most evident with the idle proc running
with interrupts disabled and causing a lockup. Switch over to the
i386 style which does things in the right order.

debug assisted by:  gallatin, and the invaluable KTR option.
2004-08-03 04:14:55 +00:00
silby
e327e6bd59 Standardize pipe locking, ensuring that everything is locked via
pipelock(), not via a mixture of mutexes and pipelock().  Additionally,
add a few KASSERTS, and change some statements that should have been
KASSERTS into KASSERTS.

As a result of these cleanups, some segments of code have become
significantly shorter and/or easier to read.
2004-08-03 02:59:15 +00:00
davidxu
fd301a9fe2 Remove redundant definition. 2004-08-03 02:39:24 +00:00
davidxu
6f2afa324d s/TMDF_DONOTRUNUSER/TMDF_SUSPEND/g
Dicussed with: deischen
2004-08-03 02:23:06 +00:00
hsu
4b4df6655a Fix bug with tracking the previous element in a list.
Found by:	edrt@citiz.net
Submitted by:	pavlin@icir.org
2004-08-03 02:01:44 +00:00
julian
6121fa3e4d Repeat after me:
"Do not apply your tested patches to your commit tree by hand"
2004-08-03 01:43:29 +00:00
njl
53952beb8e Change EISA probing to be less invasive. Instead of probing all slots
unconditionally, stop after the first one (system board) if no EISA hardware
is detected.  This fixes a boot hang (i.e. Thinkpad) when ACPI is disabled.
Also, split the probe code into a separate function and do some style cleanup.

Note that the Adaptec 2842 VLB controller probe is broken by this change
and will fail to probe.  It should be fixed separately.
2004-08-03 00:41:47 +00:00
julian
f1c5d06daf Remove an argument that is never used. 2004-08-02 23:48:43 +00:00
marius
7a55a6bbcf - Set the CAM status to CAM_SCSI_STATUS_ERROR rather than CAM_REQ_CMP
in case of a CHECK CONDITION.
- Make this driver return SCSI status information.
- While here, factor out the clearing of the CAM status from every
  element of the switch statement to only once before the switch.

This fixes burning CDs with recent cdrecord 2.01 alpha versions and
burners attached to asr(4) controllers but there could have been
other applications and da(4) etc. also affected.

Reviewed by:	gibbs, scottl
MFC after:	2 weeks
2004-08-02 23:32:23 +00:00
trhodes
4cf054f847 Add some style(9) touch ups; style(9) states that new code should follow
these conventions and, well, this is a new driver.

Tested on:	i386, sparc64
Reviewed by:	scottl
2004-08-02 22:55:23 +00:00
obrien
47f728c0bc Put a cap on the auto-tuning of kern.maxvnodes.
Cap value chosen by:	scottl
2004-08-02 21:52:43 +00:00
iedowse
022dd0e2ed Reinstate a usb_transfer_complete() call that got lost in the
previous revision.
2004-08-02 20:53:31 +00:00
markm
4cc8ba8712 Add module versions. 2004-08-02 20:42:28 +00:00
markm
f2823af1c4 Diff reduction WRT i386 version. 2004-08-02 20:36:47 +00:00
markm
3ac428cadc Sort includes; minor whitespace. 2004-08-02 20:32:56 +00:00
markm
e056e8d396 Go back to the historical minor numbers. Add a module version while
I'm here.

Asked for minor numbers by:	jhb
2004-08-02 19:59:41 +00:00
obrien
9e684fc5bb Really back out rev 1.388. 2004-08-02 19:21:51 +00:00
dfr
090a3e72f1 Add definitions for TLS relocations. 2004-08-02 19:12:17 +00:00
marcel
d934973592 Remove GPT_ENT_TYPE_FREEBSD_UFS2. It was speculatively added before
UFS2 was here. It so happened that UFS2 did not need a seperate
partition type. Keep the definition as a comment for documentation
purposes. If there is a benefit for UFS2 file systems to have a
seperate partition type under GPT, then this definition should be
restored as that was the intention of the definition.
2004-08-02 18:46:52 +00:00
marcel
1459f98b9c Fix 2 typos in previous commit: both s/strct/struct/ 2004-08-02 18:37:55 +00:00
obrien
991777970f Don't build and install a mem.ko module.
Currently one cannot load the mem.ko module without panicing if mem is
compiled into the kernel and one cannot build a kernel w/o "device mem"
right now either.  Thus it is too dangerous to install mem.ko right now
because if one puts 'mem_load="YES"' in /etc/loader.conf they cannot
boot an "old" kernel (at the time that a kernel doesn't have to be built
with "device mem).
2004-08-02 18:14:06 +00:00
marcel
3dfc568f70 Add the mem and null devices now that they are optional. 2004-08-02 17:53:06 +00:00
marcel
e8f394bb69 Sort the miscellaneous devices to restore ordering after the insertion
of the mem and null devices.
2004-08-02 17:50:39 +00:00
iedowse
4d8c7e2781 Make the USB subsystem unloadable and detachable, though currently
a significant amount of memory may be leaked each time a host
controller is detached.
2004-08-02 15:37:35 +00:00
scottl
fb7f90d7ec Optimize intr_execute_handlers() by combining the pic_disable_source() and
pic_eoi_source() into one call.  This halves the number of spinlock operations
and indirect function calls in the normal case of handling a normal (ithread)
interrupt.  Optimize the atpic and ioapic drivers to use inlines where
appropriate in supporting the intr_execute_handlers() change.

This knocks 900ns, or roughly 1350 cycles, off of the time spent servicing an
interrupt in the common case on my 1.5GHz P4 uniprocessor system.  SMP systems
likely won't see as much of a gain due to the ioapic being more efficient than
the atpic.  I'll investigate porting this to amd64 soon.

Reviewed by:	jhb
2004-08-02 15:31:10 +00:00
iedowse
6d68eec474 When searching for a suitable block of memory on the free list,
skip blocks that are too big by a factor of two or greater. This
avoids some cases of extremely inefficient memory use that can occur
when large (e.g. 64k) blocks on the free list get used when allocating
a 4k chunk of 64-byte fragments. Because fragments have their own
free list, the 60k difference got lost forever every time.
2004-08-02 13:59:02 +00:00
iedowse
5b775a536b Attempt to follow the correct procedure for synchronising with the
system BIOS to disable legacy device emulation as per the "EHCI
Extended Capability: Pre-OS to OS Handoff Synchronisation" section
of the EHCI spec. BIOSes that implement legacy emulation using SMIs
are supposed to disable the emulation when this procedure is performed.
2004-08-02 12:56:01 +00:00
cognet
53db7b6142 *blush*
Fix htonl and htons.
2004-08-02 12:24:18 +00:00
cognet
ca5e850ced Fix comments.
Spotted out by:	mux
2004-08-02 12:23:53 +00:00
ssouhlal
43af5e5ee2 Remove 'device mem' from GENERIC, which markm@ mistakingly added.
We don't have mem/kmem yet.

Approved by:	grehan (mentor)
2004-08-02 11:08:48 +00:00
mlaier
9d6ef7aa69 Unbreak DEVICE_POLLING build / LINT. Sorry!
Submitted by:	roam
2004-08-02 10:08:28 +00:00
alc
afa1e8a9c9 Eliminate the acquisition and release of Giant around the call to
pmap_mincore() in mincore(2).  Either pmap locking exists (alpha, amd64,
i386, ia64) or pmap_mincore() is unimplemented (arm, powerpc, sparc64).
2004-08-02 03:31:05 +00:00
grehan
bed31da747 Add PowerPC bridge instruction flag to the assembler to help out
with test code written in the loader.
2004-08-02 03:06:21 +00:00
grehan
19020b09b6 G5 support: handle the case where the OpenFirmware memory array uses
64 bits for the phys address, but only 32 for the virtual address.
2004-08-02 03:05:09 +00:00
grehan
cdfd234759 Kernel traps were not being passed to trap_fatal in some
circumstances.

Spotted by:  gallatin
2004-08-02 02:37:29 +00:00
scottl
638b63391d Document machdep.enable_panic_key.
Submitted by: Craig Rodrigues
2004-08-02 02:07:56 +00:00
obrien
2a58f76a64 Fix the build by providing 'PHYS_TO_DMAP' and 'M_MEMDESC'. 2004-08-02 02:07:20 +00:00
green
38e7e23335 Bump __FreeBSD_version to designate uma_zone functions changing type. 2004-08-02 01:49:22 +00:00
rwatson
a21d9ff09b Add what appears to be a missing '*/' at the end of a comment. 2004-08-02 01:38:27 +00:00
pjd
889eca7e19 - Fix unloading by the same way it is done in my other classes:
set gp->softc to NULL and return ENXIO when it is NULL, so GEOM
  will not panic or hang, but unload one device on every 'unload'.
  This make 'unload' command usable, but it have to be executed
  <number of devices> + 1 times.
- Made use of 'pp' variable.
2004-08-02 00:37:40 +00:00
green
9532ab7116 * Add a "how" argument to uma_zone constructors and initialization functions
so that they know whether the allocation is supposed to be able to sleep
  or not.
* Allow uma_zone constructors and initialation functions to return either
  success or error.  Almost all of the ones in the tree currently return
  success unconditionally, but mbuf is a notable exception: the packet
  zone constructor wants to be able to fail if it cannot suballocate an
  mbuf cluster, and the mbuf allocators want to be able to fail in general
  in a MAC kernel if the MAC mbuf initializer fails.  This fixes the
  panics people are seeing when they run out of memory for mbuf clusters.
* Allow debug.nosleepwithlocks on WITNESS to be disabled, without changing
  the default.

Both bmilekic and jeff have reviewed the changes made to make failable
zone allocations work.
2004-08-02 00:18:36 +00:00
mlaier
14a50c4ac0 Second part of ALTQ driver modifications, covering:
an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4)

Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/

Tested by:	Vaidas Damosevicius (an, ath, wi)
		Roman Divacky (vr)
Submitted by:	yongari (hme)
2004-08-01 23:58:04 +00:00
julian
b0892abf37 Comment kse_create() and make a few minor code cleanups
Reviewed by:	davidxu
2004-08-01 23:02:00 +00:00
wpaul
321873698c The watchdog callout executes with the (non-sleepable) ifnet lock held
now, but it's possible for ndis_reset_nic() to sleep (sometimes the
MiniportReset() method returns NDIS_STATUS_PENDING and we have
to wait for completion). To get around this, execute the ndis_reset_nic()
routine in the NDIS_TASKQUEUE thread.
2004-08-01 22:25:12 +00:00
wpaul
6597b4e6fe In ndis_alloc_bufpool() and ndis_alloc_packetpool(), the test to see if
allocating pool memory succeeded was checking the wrong pointer (should
have been looking at *pool, not pool). Corrected this.
2004-08-01 21:15:29 +00:00
pjd
1dba5c34f9 Typo. 2004-08-01 20:41:58 +00:00
glebius
c336444cf2 Another stupid error from my side. PPPOE_NONSTANDARD was first defined
in enum {}, and then redefined with #define.
No warnings from compiler, though.

Submitted by:	bz
Pointy hat to:	glebius
2004-08-01 20:39:33 +00:00
wpaul
b9b3caf965 Big mess 'o changes:
- Give ndiscvt(8) the ability to process a .SYS file directly into
  a .o file so that we don't have to emit big messy char arrays into
  the ndis_driver_data.h file. This behavior is currently optional, but
  may become the default some day.

- Give ndiscvt(8) the ability to turn arbitrary files into .ko files
  so that they can be pre-loaded or kldloaded. (Both this and the
  previous change involve using objcopy(1)).

- Give NdisOpenFile() the ability to 'read' files out of kernel memory
  that have been kldloaded or pre-loaded, and disallow the use of
  the normal vn_open() file opening method during bootstrap (when no
  filesystems have been mounted yet). Some people have reported that
  kldloading if_ndis.ko works fine when the system is running multiuser
  but causes a panic when the modile is pre-loaded by /boot/loader. This
  happens with drivers that need to use NdisOpenFile() to access
  external files (i.e. firmware images). NdisOpenFile() won't work
  during kernel bootstrapping because no filesystems have been mounted.
  To get around this, you can now do the following:

        o Say you have a firmware file called firmware.img
        o Do: ndiscvt -f firmware.img -- this creates firmware.img.ko
        o Put the firmware.img.ko in /boot/kernel
        o add firmware.img_load="YES" in /boot/loader.conf
        o add if_ndis_load="YES" and ndis_load="YES" as well

  Now the loader will suck the additional file into memory as a .ko. The
  phony .ko has two symbols in it: filename_start and filename_end, which
  are generated by objcopy(1). ndis_open_file() will traverse each module
  in the module list looking for these symbols and, if it finds them, it'll
  use them to generate the file mapping address and length values that
  the caller of NdisOpenFile() wants.

  As a bonus, this will even work if the file has been statically linked
  into the kernel itself, since the "kernel" module is searched too.
  (ndiscvt(8) will generate both filename.o and filename.ko for you).

- Modify the mechanism used to provide make-pretend FASTCALL support.
  Rather than using inline assembly to yank the first two arguments
  out of %ecx and %edx, we now use the __regparm__(3) attribute (and
  the __stdcall__ attribute) and use some macro magic to re-order
  the arguments and provide dummy arguments as needed so that the
  arguments passed in registers end up in the right place. Change
  taken from DragonflyBSD version of the NDISulator.
2004-08-01 20:04:31 +00:00
markm
b8bae5430c Add the I/O device for those architectures that have it. 2004-08-01 19:37:34 +00:00
markm
c52da2bdac Remove extraneous ';'. 2004-08-01 18:51:44 +00:00
iedowse
dd6baeae21 Implement basic support for EHCI interrupt pipes. This is unlikely
to be particularly correct or optimal, but it seems to be enough
to allow the attachment of USB2 hubs and USB2 devices connected via
USB2 hubs. None of the split transaction support is implemented in
our USB stack, so USB1 peripherals will definitely not work when
connected via USB2 hubs.
2004-08-01 18:47:42 +00:00
markm
1a5b1bba74 YA oops. Remove code that was being tested locally. 2004-08-01 18:22:44 +00:00
markm
0d49cf05ec Remove local hack that was not supposed to be committed.
Spotted by:	Antoine Brodin - antoine dot brodin at laposte dot net
2004-08-01 18:12:25 +00:00
scottl
30cf65f35d Turn off PREEMPTION by default while it gets debugged. It's been causing
4 weeks of problems including deadlocks and instant panics.  Note that the
real bugs are likely in the scheduler.
2004-08-01 14:31:45 +00:00
nyan
e136993596 MFi386: revision 1.1167 2004-08-01 13:01:36 +00:00
nyan
06d3957012 MFi386: revision 1.501. 2004-08-01 13:00:04 +00:00
sos
12d6bd3743 Change the default to switch on DMA on ATAPI devices if they can
do UDMA2 (ATA33) mode and beyond.
2004-08-01 12:31:38 +00:00
markm
a6c822020d Break out the MI part of the /dev/[k]mem and /dev/io drivers into
their own directory and module, leaving the MD parts in the MD
area (the MD parts _are_ part of the modules). /dev/mem and /dev/io
are now loadable modules, thus taking us one step further towards
a kernel created entirely out of modules. Of course, there is nothing
preventing the kernel from having these statically compiled.
2004-08-01 11:40:54 +00:00
pjd
e628843899 - Launch main provider when there are no more disks in NEW state.
- Log syncid bump at debug level 1.
2004-08-01 09:01:50 +00:00
wpaul
6431d3dd07 Add some minor changes related to PCMCIA attribute memory mapping
(which I apparently forgot to commit earlier).

Acquire NDIS_LOCK() in ndis_linksts_done().
2004-08-01 06:42:44 +00:00
julian
4c0e13fb4e Specify the locking for some proc fields 2004-07-31 23:51:04 +00:00
pjd
578bfcb897 If there are no valid components after the timeout, just destroy device.
There is probably nothing to wait for.
2004-07-31 22:10:51 +00:00
le
e2ca49b0bc Propagate size changes upwards. 2004-07-31 21:34:21 +00:00
glebius
900350dd1b Fix a stupid error in my previous commit, which broke operation
of many nodes.

Pointy hat to:	glebius
2004-07-31 21:32:55 +00:00
pjd
e0a971d6d4 Handle spoil event in dedicated function: g_mirror_spoiled().
The different between the new function and g_mirror_orphan() (which was
used previously) is that syncid is bumped immediately, instead of on
first write, because when consumer was spoiled, it means, that its
provider was opened for writing, so we can't trust that its data
will be valid when it will be connected again.
2004-07-31 21:08:17 +00:00
fjoe
e5cc9c9fa2 Add copyright notices.
Prodded by:	imp
2004-07-31 20:47:57 +00:00
davidxu
3720a53426 Turn on PCB_FULLCTX for set_mcontext, functions like kse_switchin
needs to fully restore asynchronous context which did not come
from fast syscall.
2004-07-31 14:02:29 +00:00
pjd
e9aabe3b50 Remove unused field. 2004-07-31 13:03:38 +00:00
pjd
cd4a05fa81 Destroy synchronization geom immediately. This should fix unloading without
stopping all mirrors.
2004-07-31 11:22:03 +00:00
sos
e95ea22d81 Fix the panic (""memory modified after free") when ata_getparam() fails
and retries.

Found by:	Nate Lawson
2004-07-31 10:29:29 +00:00
alc
add997e1ff Add pmap locking to pmap_object_init_pt(). 2004-07-31 06:42:05 +00:00
alc
1a5d99c7ed Bump __FreeBSD_version to reflect the removal of kmem_alloc_pageable().
Requested by: pjd@
2004-07-31 03:44:46 +00:00
pjd
6bb53152ba Allow slice creation on providers from MIRROR class.
This should allow mounting root file system from a mirror.
2004-07-31 01:17:20 +00:00
pjd
0d74239c00 Add '-p' option for 'insert' command which allows to specify priority
of the new component.
Version number wasn't bumped (it should be), because I think there are
no geom_mirror users yet.
2004-07-31 00:54:44 +00:00
pjd
8c9f26b7ea - Check if 'slice' argument was given.
- Check if disk isn't already the mirror component.
2004-07-31 00:51:33 +00:00
pjd
ecaa6b91a6 Dump correct field. 2004-07-31 00:37:14 +00:00
le
d9c517d66a Set the access counts of a subdisk correctly when attaching it
to a plex that already has subdisks.
2004-07-30 23:40:38 +00:00
pjd
70045d465a Connect GEOM_MIRROR class to the build. 2004-07-30 23:18:53 +00:00
pjd
adaa0482b4 Add GEOM_MIRROR class which provide RAID1 functionality and has many useful
features. The gmirror(8) utility should be used for control of this class.
There is no manual page yet, but I'm working on it with keramida@.

Many useful tests provided by:	simon (thank you!)
Some ideas from:		scottl, simon, phk
2004-07-30 23:13:45 +00:00
pjd
e2709c0cfc Remove the old geom_mirror class.
Approved by:	phk
2004-07-30 22:50:21 +00:00
phk
2d868d02cf Put a version element in the VFS filesystem configuration structure
and refuse initializing filesystems with a wrong version.  This will
aid maintenance activites on the 5-stable branch.

s/vfs_mount/vfs_omount/

s/vfs_nmount/vfs_mount/

Name our filesystems mount function consistently.

Eliminate the namiedata argument to both vfs_mount and vfs_omount.
It was originally there to save stack space.  A few places abused
it to get hold of some credentials to pass around.  Effectively
it is unused.

Reorganize the root filesystem selection code.
2004-07-30 22:08:52 +00:00
alc
9b295c2fd9 - Push down the acquisition and release of Giant into pmap_protect() on
those architectures without pmap locking.
 - Eliminate the acquisition and release of Giant from vm_map_protect().

(Translation: mprotect(2) runs to completion without touching Giant on
alpha, amd64, i386 and ia64.)
2004-07-30 20:38:30 +00:00
alc
6aaed2f8ea Giant is no longer required by vm_waitproc() and vmspace_exitfree().
Eliminate it acquisition and release around vm_waitproc() in kern_wait().
2004-07-30 20:31:02 +00:00
alc
d41b071100 - Add pmap locking to ia64's pmap_enter() and pmap_enter_quick(). (This
brings ia64 to parity with alpha, amd64, and i386 in this area.)
 - Prevent a race in pmap_find_pte(): If pmap_find_pte() sleeps in
   uma_zalloc(), another thread could allocate a pte at the same address.
   Instead, sleep at a higher level and retry the lookup before retrying
   the allocation.

Reviewed and tested by:	marcel@
2004-07-30 20:25:12 +00:00
pjd
6e57ee9a4c Nuke geom_mirror class. New geom_mirror class is in the way.
Approved by:	phk
2004-07-30 19:59:36 +00:00
pjd
0560d38991 Allow to create slices on providers from class LABEL and class NOP.
This is really ugly way to do this, but there is no other way for now.
It allows to mount root file system from providers which belong to
those classes.

Approved by:	phk
2004-07-30 19:55:12 +00:00
ps
1be1b43db4 MFia64:
Fix -O builds with gcc 3.4 by defining ffs as __builtin_ffs instead
of creating an inline function that just calls __builtin_ffs.
2004-07-30 16:44:29 +00:00
sos
9ad7d89c48 Fix the reset sequence for sx4/sx4000 type controllers, it could hang the
chip in an indefinite state.
2004-07-30 13:33:09 +00:00
dfr
74842d80bc Fix a memory leak in the device pager which is exposed by the NVIDIA
OpenGL driver.

Submitted by: nvidia (possibly also tegge)
2004-07-30 11:09:18 +00:00
dfr
f4b42f3d57 Fix handling of msync(2) for character special files.
Submitted by: nvidia
2004-07-30 11:08:02 +00:00
nyan
07b5593d23 Fix new compiler error (s/bcopy/memcpy/). 2004-07-30 09:42:04 +00:00
mux
cccb9bacb0 Get rid of another lockmgr(9) consumer by using sx locks for the user
maps.  We always acquire the sx lock exclusively here, but we can't
use a mutex because we want to be able to sleep while holding the
lock.  This is completely equivalent to what we were doing with the
lockmgr(9) locks before.

Approved by:	alc
2004-07-30 09:10:28 +00:00
pjd
7a7cae7b30 - Add '-S' option, which allow to specify sector size for transparent
provider.
- Bump version number.

This allows for a quite interesting trick. One can setup a stripe with
stripe size of 512 bytes and create transparent provider on top of it
with sector size equal to <ndisks> * 512. The result will be something
like RAID3 without parity disk (every access will touch all disks).
2004-07-30 08:19:22 +00:00
marcel
21af70e083 Fix -O builds with gcc 3.4 by defining ffs as __builtin_ffs instead of
creating an inline function that just calls __builtin_ffs.
2004-07-30 07:56:53 +00:00
kan
1386d0ec02 Compile boot2 with -fno-unit-at-a-time. GCCs aggressive optimization
breaks boot in spectacular ways otherwise.
2004-07-30 04:27:20 +00:00
njl
774b91783e Minor message cleanup. 2004-07-30 01:30:05 +00:00
njl
4fe3d5e537 Add support for the Synaptics Touchpad mouse driver. I reworked the
submitted version with style cleanups and changes to comments.  I also
modified the ioctl interface.  This version only has one ioctl (to get
the Synaptics-specific config parameters) since this is the only
information a user might want.

Submitted by:	Arne Schwabe <arne -at- rfc2549.org>
2004-07-30 00:59:40 +00:00
kan
59d6b73b4b Clean up local memcpy implementation to take void * parameters. 2004-07-30 00:33:09 +00:00
pjd
809d561dd5 Syscall kill(2) called for a zombie process should return 0.
Obtained from:	Darwin
2004-07-29 20:38:19 +00:00
pjd
7e5db42c7a Fill some informations about zombie processes as well.
Before this change every zombie process were reported as an owner of PID 0 in
ps(1) output.

Reviewed by:	julian
2004-07-29 20:27:59 +00:00
ceri
4f3c9ce761 Correct a documentation bug.
Approved by:	jhb
2004-07-29 20:09:25 +00:00
ceri
461920a620 Correct typo in a comment.
Approved by:	jhb
2004-07-29 20:08:40 +00:00
alc
ff80a7c7f2 Advance the state of pmap locking on alpha, amd64, and i386.
- Enable recursion on the page queues lock.  This allows calls to
   vm_page_alloc(VM_ALLOC_NORMAL) and UMA's obj_alloc() with the page
   queues lock held.  Such calls are made to allocate page table pages
   and pv entries.
 - The previous change enables a partial reversion of vm/vm_page.c
   revision 1.216, i.e., the call to vm_page_alloc() by vm_page_cowfault()
   now specifies VM_ALLOC_NORMAL rather than VM_ALLOC_INTERRUPT.
 - Add partial locking to pmap_copy().  (As a side-effect, pmap_copy()
   should now be faster on i386 SMP because it no longer generates IPIs
   for TLB shootdown on the other processors.)
 - Complete the locking of pmap_enter() and pmap_enter_quick().  (As of now,
   all changes to a user-level pmap on alpha, amd64, and i386 are performed
   with appropriate locking.)
2004-07-29 18:56:31 +00:00
kan
c1bceab802 Use newly added __used attribute to keep static function symbol from
being eliminated.
2004-07-29 18:02:28 +00:00
bmilekic
c998cc2027 Rework the way slab header storage space is calculated in UMA.
- zone_large_init() stays pretty much the same.
- zone_small_init() will try to stash the slab header in the slab page
  being allocated if the amount of calculated wasted space is less
  than UMA_MAX_WASTE (for both the UMA_ZONE_REFCNT case and regular
  case).  If the amount of wasted space is >= UMA_MAX_WASTE, then
  UMA_ZONE_OFFPAGE will be set and the slab header will be allocated
  separately for better use of space.
- uma_startup() calculates the maximum ipers required in offpage slabs
  (so that the offpage slab header zone(s) can be sized accordingly).
  The algorithm used to calculate this replaces the old calculation
  (which only happened to work coincidentally).  We now iterate over
  possible object sizes, starting from the smallest one, until we
  determine that wastedspace calculated in zone_small_init() might
  end up being greater than UMA_MAX_WASTE, at which point we use the
  found object size to compute the maximum possible ipers.  The
  reason this works is because:
      - wastedspace versus objectsize is a see-saw function with
        local minima all equal to zero and local maxima growing
        directly proportioned to objectsize.  This implies that
        for objects up to or equal a certain objectsize, the see-saw
        remains entirely below UMA_MAX_WASTE, so for those objectsizes
        it is impossible to ever go OFFPAGE for slab headers.
      - ipers (items-per-slab) versus objectsize is an inversely
        proportional function which falls off very quickly (very large
        for small objectsizes).
      - To determine the maximum ipers we'll ever need from OFFPAGE
        slab headers we first find the largest objectsize for which
        we are guaranteed to not go offpage for and use it to compute
        ipers (as though we were offpage).  Since the only objectsizes
        allowed to go offpage are bigger than the found objectsize,
        and since ipers vs objectsize is inversely proportional (and
        monotonically decreasing), then we are guaranteed that the
        ipers computed is always >= what we will ever need in offpage
        slab headers.
- Define UMA_FRITM_SZ and UMA_FRITMREF_SZ to be the actual (possibly
  padded) size of each freelist index so that offset calculations are
  fixed.

This might fix weird data corruption problems and certainly allows
ARM to now boot to at least single-user (via simulator).

Tested on i386 UP by me.
Tested on sparc64 SMP by fenner.
Tested on ARM simulator to single-user by cognet.
2004-07-29 15:25:40 +00:00
ssouhlal
382d8a7db3 Add comment explaining struct reg and struct fpreg must match the trapframe.
Approved by:	grehan (mentor)
2004-07-29 13:39:27 +00:00
ssouhlal
eb5ea5dd29 Implement MD parts of ptrace.
Approved by:	grehan (mentor)
2004-07-29 13:34:50 +00:00
cognet
7c7f4453cf Don't use cast as lvalue. 2004-07-29 12:33:54 +00:00
le
8e620f7e71 Shut up the compiler and temporarily '#if 0' gv_destroy_geom(),
until we need it again.
2004-07-29 11:32:09 +00:00
ps
5bf78408ff Clean up structure packing. 2004-07-29 08:06:22 +00:00
glebius
9cfc8592d3 Address node in a less complex way.
Approved by:	julian (mentor)
2004-07-29 08:05:02 +00:00
njl
76938a59f7 Fix ACPI floppy enumeration for three types of divergent behavior.
* Some systems have _FDE and child floppy devices, but no _FDI.  This seems
  to be compatible with the standard.  Don't error out if there is no _FDI.
  Instead, continue on to the next device.  The normal fd probe will take
  care of this device.
* Some systems have _FDE but no child devices in AML.  For these, add a
  second pass that compares the results of _FDE to the presence of devices.
  If not present, add the missing device.
* Some BIOS authors didn't read the spec.  They use tape drive values for
  all fdc(4) devices.  Since this isn't grossly incompatible with the
  required boolean value, use them.  They also define the _FDE items as a
  package instead of buffer.  Regenerate the buffer from the package if it
  is present.

Tested by:	tjr, marcel
2004-07-28 22:35:41 +00:00
phk
98d8f3741c Move a relic to its correct location(s): Put nfs diskless initialization
calls with the code they call.  (Yet another example of mindless copy&paste).
2004-07-28 21:54:57 +00:00
phk
ec6a70cfef Remove buggy (root filesystems may not have cdev) and pointless
customization of an error message.
2004-07-28 21:06:13 +00:00
phk
075684f5fd Remove global variable rootdevs and rootvp, they are unused as such.
Add local rootvp variables as needed.

Remove checks for miniroot's in the swappartition.  We never did that
and most of the filesystems could never be used for that, but it had
still been copy&pasted all over the place.
2004-07-28 20:21:04 +00:00
alc
9507df06e3 Correct a very old error in both vm_object_madvise() (originating in
vm/vm_object.c revision 1.88) and vm_object_sync() (originating in
vm/vm_map.c revision 1.36): When descending a chain of backing objects,
both use the wrong object's backing offset.  Consequently, both may
operate on the wrong pages.

Quoting Matt, "This could be responsible for all of the sporatic madvise
oddness that has been reported over the years."

Reviewed by:	Matt Dillon
2004-07-28 18:23:08 +00:00
yar
1d71ae12e0 Disallow a particular kind of port theft described by the following scenario:
Alice is too lazy to write a server application in PF-independent
	manner.  Therefore she knocks up the server using PF_INET6 only
	and allows the IPv6 socket to accept mapped IPv4 as well.  An evil
	hacker known on IRC as cheshire_cat has an account in the same
	system.  He starts a process listening on the same port as used
	by Alice's server, but in PF_INET.  As a consequence, cheshire_cat
	will distract all IPv4 traffic supposed to go to Alice's server.

Such sort of port theft was initially enabled by copying the code that
implemented the RFC 2553 semantics on IPv4/6 sockets (see inet6(4)) for
the implied case of the same owner for both connections.  After this
change, the above scenario will be impossible.  In the same setting,
the user who attempts to start his server last will get EADDRINUSE.

Of course, using IPv4 mapped to IPv6 leads to security complications
in the first place, but there is no reason to make it even more unsafe.

This change doesn't apply to KAME since it affects a FreeBSD-specific
part of the code.  It doesn't modify the out-of-box behaviour of the
TCP/IP stack either as long as mapping IPv4 to IPv6 is off by default.

MFC after:	1 month
2004-07-28 13:03:07 +00:00
mux
1ac57efd01 Remove (at least temporarily) the check that prevents us from including
this file from userland.  Since we export struct ifnet to userland, and
that struct ifnet now contains a struct task, userland needs to know
what struct task looks like.

We need to consider having a pointer to a struct task here instead and
forward declare struct task in the !_KERNEL case.
2004-07-28 09:12:54 +00:00
kan
f630ab6cf1 Damage control. Correcly advance symtab and strtab pointers, not
table length values.

Spotted by:	iedowse
2004-07-28 08:59:08 +00:00
kan
5008b82a17 Introduce SYSCTL_CHILDREN_SET macro which can be used in place of
cast as a value.
2004-07-28 07:08:39 +00:00
kan
4427f9af51 Emply __used attribute to prevent compiler from removing unreferenced
static symbols. This wasn't a problem with previous GCC releases, but
unit-at-a-time mode of GCC 3.4.2 prevents linker set components from
being emitted at all.
2004-07-28 07:07:16 +00:00
kan
88d0e4fb93 Introduce __used attribute which serves as logical conuterpart of
preexisting __unused.
2004-07-28 07:03:42 +00:00
kan
155eb2ef69 Introduce SLOT_SET macro and use it in place of casts as lvalues. 2004-07-28 07:01:33 +00:00
kan
3140931e1f Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
kan
f70e41029a Avoid casts as lvalues. Declare local variable as u_char * instead of
declaring it as u_short * and casting it back to uchar * all over the place.
2004-07-28 06:58:23 +00:00
kan
1fc93948ca Initialize ; variable eraly to shut up GCC warning. 2004-07-28 06:48:36 +00:00
kan
48b2ea77a3 Avoid casts as lvalues. 2004-07-28 06:42:41 +00:00
kan
586367666d Avoid using casts as lvalues. Introduce DIP_SET macro which sets proper
inode field based on UFS version. Use DIP ro read values and DIP_SET
to modify them throughout FFS code base.
2004-07-28 06:41:27 +00:00
kan
7a2c503e1b Avoid casts as lvalues. While here, avoid storing 32bit quantities in
16bit locations.
2004-07-28 06:32:28 +00:00
davidxu
5610a7e068 Use P_SINGLE_EXIT to check single-threading case, P_WEXIT is not for that
purpose.
2004-07-28 06:30:52 +00:00
kan
65947d062b Avoid casts as lvalues. 2004-07-28 06:30:43 +00:00
kan
4caefcbb3e Avoid casts as lvalues. 2004-07-28 06:21:53 +00:00
kan
6cabb1fb0d Make __packed attribute apply to structs themselves, not their typedefs.
GCC 3.4.2 issues warning about that.
2004-07-28 06:19:25 +00:00
ps
6213728da1 Name non-physical devices. 2004-07-28 06:18:05 +00:00
kan
81bb3b51b0 Initialize s variable early to shut up GCC warnings.
Do not declare inline functions without body as this is useless in
general and generates a warning with GCC 3.4.x.

Glanced over by:	dhartmei
2004-07-28 06:14:44 +00:00
kan
9e6b9c5d58 Allow for aggressive function inlining. This might have to be fine-tuned
later.
2004-07-28 06:07:02 +00:00
kan
cd2bbc3fed Avoid casts as lvalues. 2004-07-28 06:05:41 +00:00
kan
908c4ab709 Define our own memcpy here instead of relying on GCC to provide one. 2004-07-28 06:03:27 +00:00
eik
fbaf45f3c2 Erroneously decreased __FreeBSD_version, which should have been increased instead:
"__FreeBSD_version should only ever increment.  It is a historial record
  of events in the system.  Decrementing it is akin to trying to go back
  in time and change history."

Reminded by:	kuriyama, scottl
2004-07-28 03:36:05 +00:00
jayanth
b754d213ab Fix a bug in the sack code that was causing data to be retransmitted
with the FIN bit set for all segments, if a FIN has already been sent before.
The fix will allow the FIN bit to be set for only the last segment, in case
it has to be retransmitted.

Fix another bug that would have caused snd_nxt to be pulled by len if
there was an error from ip_output. snd_nxt should not be touched
during sack retransmissions.
2004-07-28 02:15:14 +00:00
eik
ac2fecdcf2 back out the localkg changes until things have settled.
Discussed with:	mtm
2004-07-28 00:09:19 +00:00
rwatson
558dee61de Commit a first pass at in6pcb and pcbinfo locking for IPv6,
synchronizing IPv6 protocol control blocks and lists.  These changes
are modeled on the inpcb locking for IPv4, submitted by Jennifer Yang,
and committed by Jeffrey Hsu.  With these locking changes, IPv6 use of
inpcbs is now substantially more MPSAFE, and permits IPv4 inpcb locking
assertions to be run in the presence of IPv6 compiled into the kernel.
2004-07-27 23:44:03 +00:00
rwatson
b463bc6c33 Add a new network interface flag, IFF_NEEDSGIANT, which will allow
device drivers to declare that the ifp->if_start() method implemented
by the driver requires Giant in order to operate correctly.

Add a 'struct task' to 'struct ifnet' that can be used to execute a
deferred ifp->if_start() in the event that if_start needs to be called
in a Giant-free environment.  To do this, introduce if_start(), a
wrapper function for ifp->if_start().  If the interface can run MPSAFE,
it directly dispatches into the interface start routine.  If it can't
run MPSAFE, we're running with debug.mpsafenet != 0, and Giant isn't
currently held, the task is queued to execute in a swi holding Giant
via if_start_deferred().

Modify if_handoff() to use if_start() instead of direct dispatch.
Modify 802.11 to use if_start() instead of direct dispatch.

This is intended to provide increased compatibility for non-MPSAFE
network device drivers in the presence of Giant-free operation via
asynchronous dispatch.  However, this commit does not mark any network
interfaces as IFF_NEEDSGIANT.
2004-07-27 23:20:45 +00:00
phk
8c9258b82e Convert the vfsconf list to a TAILQ.
Introduce vfs_byname() function to find things on it.

Staticize vfs_nmount() function under the name vfs_donmount().

Various cleanups.
2004-07-27 22:32:01 +00:00
phk
7b7f2efb4b Use kernel_vmount() instead of vfs_nmount(). 2004-07-27 21:38:42 +00:00
glebius
1a302abfe1 When making a peer of unknown type framework tries to load module
using linker_load_module(). This works OK if NGM_MKPEER message came
from userland and we have process associated with thread. But when
NGM_MKPEER was queued because target node was busy, linker_load_module()
is called from netisr thread leading to panic.
To workaround that we do not load modules by framework, instead ng_socket
loads module (if this is required) before sending NGM_MKPEER.
However, the race condition between return from NgSendMsg() and actual
creation of node still exist and needs to be solved.

PR:		kern/62789
Approved by:	julian
2004-07-27 20:30:56 +00:00
glebius
1a3245e3ca When node is server serve both standard RFC2516 and non-standard 3Com
clients simultaneously. When node is client its mode is configured
with a control message.

sysctl net.graph.nonstandard_pppoe is deprecated but kept for
backward compatibility for some time.

Approved by:	julian
2004-07-27 19:47:13 +00:00
rwatson
1a23ddfc9e Correct typo in prior commit: s/cd/td/ 2004-07-27 19:44:08 +00:00
rwatson
4ab080249a Pass a thread argument into cpu_critical_{enter,exit}() rather than
dereference curthread.  It is called only from critical_{enter,exit}(),
which already dereferences curthread.  This doesn't seem to affect SMP
performance in my benchmarks, but improves MySQL transaction throughput
by about 1% on UP on my Xeon.

Head nodding:	jhb, bmilekic
2004-07-27 16:41:01 +00:00
yar
8feaacec0c Don't consider TCP connections beyond LISTEN state
(i.e. with the foreign address being not wildcard) when checking
for possible port theft since such connections cannot be stolen.

The port theft check is FreeBSD-specific and isn't in the KAME tree.

PR:		bin/65928 (in the audit trail)
Reviewed by:	-net, -hackers (silence)
Tested by:	Nick Leuta <skynick at mail.sc.ru>
MFC after:	1 month
2004-07-27 16:35:09 +00:00
rwatson
1fea905f48 Add "options ADAPTIVE_GIANT" which causes Giant to also be treated in
an adaptive fashion when adaptive mutexes are enabled.  The theory
behind non-adaptive Giant is that Giant will be held for long periods
of time, and therefore spinning waiting on it is wasteful.  However,
in MySQL benchmarks which are relatively Giant-free, running Giant
adaptive makes an observable difference on SMP (5% transaction rate
improvement).  As such, make adaptive behavior on Giant an option so
it can be more widely benchmarked.
2004-07-27 16:34:48 +00:00
grehan
94fe445e8c Properly implement kdb_cpu_{set|clear}_singlestep to allow DDB to
continue from breakpoints.
2004-07-27 07:06:20 +00:00
grehan
58b63ba248 Make sure icache is sync'd whenever memory is touched. It may
be more optimal to override the BKPT_WRITE macro, but DDB performance
isn't really a goal at this stage...
2004-07-27 07:04:58 +00:00
alc
8a38bc6b2c - Use atomic ops for updating the vmspace's refcnt and exitingcnt.
- Push down Giant into shmexit().  (Giant is acquired only if the vmspace
   contains shm segments.)
 - Eliminate the acquisition of Giant from proc_rwmem().
 - Reduce the scope of Giant in exit1(), uncovering the destruction of the
   address space.
2004-07-27 03:53:41 +00:00
grehan
a745685147 Save DAR/DSISR in DDB regsave area when stack overflow detected. It's
hard to work out where the problem was without these.
2004-07-27 03:46:34 +00:00
bmilekic
1c3958ce88 Move the schedlock owner state update following the context
switch in fork_exit() to before anything else is done (but keep
schedlock for the deadthread check).  This means one less
nasty bug if ever in the future whatever might have been called
before the update played with schedlock or critical sections.

Discussed with: tjr
2004-07-27 03:46:31 +00:00
grehan
7c33e30743 Improve boot-time debugging with DDB by extracting the ksym start/end
values from the loader.
2004-07-27 03:41:34 +00:00
tjr
b9200ab932 Use file2c instead of a combination of hexdump, sed and shell script to
generate the wakecode[] array from acpi_wakecode.bin. The old method was
not safe in multibyte locales.
2004-07-27 01:33:27 +00:00
jayanth
ef090090cb Fix for a SACK bug where the very last segment retransmitted
from the SACK scoreboard could result in the next (untransmitted)
segment to be skipped.
2004-07-26 23:41:12 +00:00
jmg
b138ddd4e5 compare pointer against NULL, not 0
when inpcb is NULL, this is no longer invalid since jlemon added the
tcp_twstart function... this prevents close "failing" w/ EINVAL when it
really was successful...

Reviewed by:	jeremy (NetBSD)
2004-07-26 21:29:56 +00:00
alc
a47887d1fd Implement the protection check required by the pmap_extract_and_hold()
specification.

Reviewed and tested by:	grehan@
2004-07-26 18:10:10 +00:00
pjd
73a684d587 Improve geom(8)'s 'list' command to show geoms and their providers and
consumers. Teach STRIPE, CONCAT and NOP classes about this improvement.
2004-07-26 17:14:47 +00:00
pjd
3a2f13d5f5 Change naming scheme from /dev/<name>.stripe to /dev/stripe/<name>. 2004-07-26 16:10:27 +00:00
pjd
badd010cc7 Change naming scheme from /dev/<name>.concat to /dev/concat/<name>. 2004-07-26 16:08:32 +00:00
pjd
dca201cdfb M_WAITOK is ok here, while I'm using M_WAITOK later in this function. 2004-07-26 15:41:28 +00:00
pjd
4a150a7afe M_WAITOK is ok here, while I'm using M_WAITOK later in this function. 2004-07-26 15:35:04 +00:00
yar
a63ad31e7f Stop tinkering with the parent's VLAN_MTU capability.
Now it is user-controlled through ifconfig(8).

The former ``automagic'' way of operation created more
trouble than good.  First, VLAN_MTU consumers other than
vlan(4) had appeared, e.g., ng_vlan(4).  Second, there was
no way to disable VLAN_MTU manually if it were causing
trouble, e.g., data corruption.

Dropping the ``automagic'' should be completely invisible
to the user since
a) all the drivers supporting VLAN_MTU
have it enabled by default, and in the first place
b) there is only one driver that can really toggle VLAN_MTU
in the hardware under its control (it's fxp(4), to which
I added VLAN_MTU controls to illustrate the principle.)
2004-07-26 14:46:04 +00:00
cperciva
c009fddfd6 In revision 1.228, I accidentally broke the "total number of processes in
the system" resource limit code: When checking if the caller has superuser
privileges, we should be checking the *real* user, not the *effective*
user.  (In general, resource limiting is done based on the real user, in
order to avoid resource-exhaustion-by-setuid-program attacks.)

Now that a SUSER_RUID flag to suser_cred exists, use it here to return
this code to its correct behaviour.

Pointed out by:	rwatson
2004-07-26 07:54:39 +00:00
le
8870a257a7 Save the vinum config back to disk after syncing two plexes. 2004-07-26 07:30:21 +00:00
cperciva
d9fecc83c8 Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This is
somewhat clearer, but more importantly allows for a consistent naming
scheme for suser_cred flags.

The old name is still defined, but will be removed in a few days (unless I
hear any complaints...)

Discussed with:	rwatson, scottl
Requested by:	jhb
2004-07-26 07:24:04 +00:00
njl
6093b4cd55 Don't force an immediate probe/attach for all devices when compiled with
ACPI_DEBUG.  This upset the ordering that acpi_probe_order() was meant to
provide, causing devices to attach before the sysresource object.  This
debugging feature has been unnecessary for a while so just remove it.

Testing by:	marcel
2004-07-26 06:04:35 +00:00
marcel
ff2ddd225f When sizing the FIFO, don't count all the way up to 1030 if any FIFO
size larger than 128 is considered an incompatible size. Stop counting
when we reach 130 in the loop.
2004-07-26 03:54:40 +00:00
rwatson
ec34d4330f Revert modification of subr_turnstile.c accidentally included in the
last commit; this assertion was provided by jhb for local debugging
and not intended for broader consumption.
2004-07-25 23:32:32 +00:00
rwatson
4c9acdbfaf In uipc_connect(), assert that the passed thread is curthread, and pass
td into unp_connect() instead of reading curthread.
2004-07-25 23:30:43 +00:00
rwatson
0e43e3b1b4 Do some initial locking on accept filter registration and attach. While
here, close some races that existed in the pre-locking world during low
memory conditions.  This locking isn't perfect, but it's closer than
before.
2004-07-25 23:29:47 +00:00
le
d360d6d42f There's a chance that the VINUMDRIVE class tastes before the
VINUM class, so let the VINUMDRIVE class parse the on-disk
configuration, too.
2004-07-25 23:01:09 +00:00
phk
5297516e02 Eliminate unused second argument to reassignbuf() and simplify it
accordingly.
2004-07-25 21:24:23 +00:00
rwatson
1fd2b90911 Add netatalk mutexes to hard-coded WITNESS lock order. 2004-07-25 20:16:51 +00:00
alc
459c13818e For years, kmem_alloc_pageable() has been misused. Now that the last of
these misuses has been corrected, remove it before new ones appear, such as
arm/arm/pmap.c revision 1.8.
2004-07-25 20:08:59 +00:00
imp
c1b56ad3df Expand the generic, but bogusly formed, copyright notice to include
the license from /usr/src/COPYRIGHT.  Since cvs annotate shows that
this was written by jasone, julian, jhb, peter, bmilekic and obrien.
cvs log shows that many others may have contributed to this file.  As
such, go ahead and use the author of 'FreeBSD Project' for this file.
If this is a problem, please notify me.

# this eliminates the last file in the kernel with an indirect reference
# to /usr/src/COPYRIGHT in the kernel.  A few more in userland remain.
2004-07-25 19:49:01 +00:00
alc
6bb1a6edcd Remove spl calls. 2004-07-25 19:28:10 +00:00
le
c5dbc6f1ad Check for a NULL pointer before dereferencing it. 2004-07-25 09:41:31 +00:00
phk
c65194c810 Neuter this warning for now, I think I know the remaining issues. 2004-07-25 08:09:21 +00:00
alc
035cd2c09d Make the code and comments for vm_object_coalesce() consistent. 2004-07-25 07:48:47 +00:00
marcel
a16c034682 Work-around a gcc code generation bug for function descriptors
references (target/16559). This fixes SMP configurations.

Obtained from: arun@
2004-07-25 07:07:09 +00:00
rwatson
a0a7ff9977 More comment frobbing: insert a missing comma, and spell permissions
as credential.
2004-07-25 00:47:11 +00:00
rwatson
9f988a5039 Spelling fix in comment: s/though/thought/. 2004-07-25 00:38:25 +00:00
njl
91e938aef3 Get the acpi softc via the devclass, not by caching the device. Replace
apm_softc with a single integer since the whole softc is not used.
2004-07-24 22:41:30 +00:00
le
9795b96112 Use a temporary geom when tasting vinumdrives and lock the 'real'
vinumdrive geom with an exclusive bit.  This should fix the problem
when underlying partitions overlap (i.e. the 'a' partition is at
the same offset as the 'c' partition).

Ideas borrowed from pjd@, quite a bit of testing by
Matthias Schuendehuette <msch@snafu.de>.
2004-07-24 22:26:40 +00:00
njl
a24969480f Whitespace cleanup and move static variables together. 2004-07-24 20:40:02 +00:00
njl
a247fc5f3a Remove unneeded parens and fix whitespace. 2004-07-24 20:39:25 +00:00
le
64d6caaef2 Disable kldunloading of geom_vinum temporarily until I figured out
how to do it correctly.
2004-07-24 19:04:24 +00:00
sos
a33b996095 Refine the wait for ATAPI_RESET.
Properly wait for not busy and introduce a timeout for devices not
setting busy (as they should).
Leave a printf in there that states how long the wait was, as I'd like
to get an idea of the variations here. The time needed seems also to be
affected by whether a medium is present or not.
2004-07-24 19:03:28 +00:00
njl
c0497f6c58 Fix a bug where an item was being removed from a list without using
FOREACH_SAFE.  Remove bad cast of retp and instead use an additional
arg to pass back the number of valid outputs.  Use the package convenience
functions for parsing packages.
2004-07-24 17:51:22 +00:00
rwatson
23fdd080dd Prefer NULL to '0' when checking a pointer value. 2004-07-24 16:58:56 +00:00
obrien
1e17828b11 Remove rev 1.50. 2004-07-24 15:30:23 +00:00
nyan
20fb34d054 Merged from sys/dev/sio/sio.c revision 1.450. 2004-07-24 15:13:42 +00:00
mtm
99fe82d8e6 Ports related rc.d cleanups:
o Separate out local (ports) scripts that use rc.d, and the old style
  startup/shutdown scripts and execute them separately. On startup the
  rc.d style scripts are executed first and then the old-style scripts.
  On shutdown, exactly the reverse happens.
o The rc.d ports scripts should now behave more like base system scripts.
  Scripts ending in .sh will be sourced into the current shell, while the
  rest will be executed in a subshell. Previously, all ports scripts,
  regardless of the .sh suffix, were executed in a subshell.
o The parent script, /etc/rc.d/localpkg, passes its command line arguments
  straight to the rc.d ports scripts. This means they should now honor
  faststop and faststart commands as well. Old style scripts, should not see
  any differences. They will still get either a start or stop command.
o The initial phrase shown during shutdown has been changed to use
  "local packages" instead of "daemon processes" to be more inline with the
  phrase used during local package startup. The phrases are also used only for
  old-style ports script startup/shutdown, whereas previously they were being
  used for both rc.d and old-style scripts. This should make startup/shutdown
  output a bit less ugly.

Discussed with:	portmgr
Has Reservations: eik
2004-07-24 14:56:21 +00:00
yar
da587e414b Bring the advertised interface capabilities into line with the reality
(in particular, bge(4) hasn't supported rxcsum since if_bge.c#1.5)

Clean up some aspects of capabilities usage, i.e. stop using
if_hwassist to see whether we are doing offload now because if_hwassist
is for TCP/IP layer and it is subordinate to if_capenable.

Thanks to:	Aled Morris for donating a nice bge(4) NIC to me
Reviewed by:	-net, -hackers (silence)
2004-07-24 13:45:38 +00:00
alc
2057234305 Simplify vmspace initialization. The bcopy() of fields from the old
vmspace to the new vmspace in vmspace_exec() is mostly wasted effort.  With
one exception, vm_swrss, the copied fields are immediately overwritten.
Instead, initialize these fields to zero in vmspace_alloc(), eliminating a
bcopy() from vmspace_exec() and a bzero() from vmspace_fork().
2004-07-24 07:40:35 +00:00
julian
1df6bf2b92 White space fix..
diff reduction for upcoming commit.
2004-07-24 04:57:41 +00:00
rwatson
42672df963 If debug.mpsafenet is non-zero, run the NFS server callout without
Giant.
2004-07-24 02:32:27 +00:00
rwatson
726eec4c97 Remove spl() use from nfsrv_timer. 2004-07-24 02:07:09 +00:00
scottl
f72aae4cb2 Clean up whitespace, increase consistency and correctness.
Submitted by: bde
2004-07-23 23:09:00 +00:00
rwatson
3184300f78 Don't include a "\n" in KTR output, it confuses automatic parsing. 2004-07-23 20:12:56 +00:00
scottl
36b2b29e6c Remove the previous hack since it doesn't make a difference and is getting
in the way of debugging.
2004-07-23 19:59:16 +00:00
alc
760c049c36 Use kmem_alloc_nofault() rather than kmem_alloc_pageable() for allocating
KVA for explicitly managed mappings, i.e., mappings created with
pmap_qenter().
2004-07-23 19:36:18 +00:00
rwatson
c1241188da Reinforce discouragement of the use of FULL_PREEMPTION. 2004-07-23 17:44:07 +00:00
rwatson
bbeea980c0 Export KTR_COMPILE as a sysctl so you can easily check from user space
what event mask has been compiled into the kernel.
2004-07-23 17:41:44 +00:00
sos
13128d7277 Dont expect interrupt from ATAPI_RESET, it doesn't deliver one. 2004-07-23 17:01:47 +00:00
gallatin
25c9673901 Let ddb know powerpc is big endian so as to make ddb output
human readable.

Obtained from: sparc64/include/db_machdep.h
2004-07-23 14:45:15 +00:00
rwatson
882656d16c Don't perform pipe endpoint locking during pipe_create(), as the pipe
can't yet be referenced by other threads.

In microbenchmarks, this appears to reduce the cost of
pipe();close();close() on UP by 10%, and SMP by 7%.  The vast majority
of the cost of allocating a pipe remains VM magic.

Suggested by:	silby
2004-07-23 14:11:04 +00:00
alc
184e715c40 Use kmem_alloc_nofault() rather than kmem_alloc_pageable() for allocating
KVA for explicitly managed mappings, i.e., mappings created with
pmap_qenter().
2004-07-23 06:49:49 +00:00
grehan
aa7eec1b49 Detect kernel stack excursion into guard pages. Drop into KDB
with a wired stack if this is found.

Mostly obtained from:  NetBSD
2004-07-23 05:33:24 +00:00
grehan
64ddaac9c3 Bring KDB stack size into line with thread stack size (4 pages). 2004-07-23 05:31:14 +00:00
grehan
33c3f47383 Allow DSI exceptions to invoke DDB. 2004-07-23 05:27:17 +00:00
rwatson
32df1647d8 In setpgid(), since td is passed in as a system call argument, use it
in preference to curthread, which costs slightly more.
2004-07-23 04:26:49 +00:00
mlaier
06a62be24a Fix the following LOR on pf module unload:
1st ifnet (ifnet) @/usr/src/sys/contrib/pf/net/pf_if.c:191
2nd pf task mtx (pf task mtx) @/usr/src/sys/contrib/pf/net/pf_if.c:197

Reported by:	Pyun YongHyeon (a long time ago)
2004-07-23 03:37:05 +00:00
mlaier
fcf16798bf Refine pf_check_proto_cksum() a bit in order to avoid additional in_pseudo()
calls further down the stack. If we find the cksum to be okay we pretend
that the hardware did all the work and hence keep the upper layers from
checking again.

Submitted by:	Pyun YongHyeon
2004-07-23 03:31:42 +00:00
rwatson
2c07de53fe Allow an effective uid of root to bypass mac_bsdextended rules; the MAC
Framework can restrict the root user, but this policy is not intended
to support that.

Stylish Swiss footwear provided for:	trhodes
2004-07-23 01:53:28 +00:00
grehan
05c0231248 The ADDR16 relocations were assuming that non-local symbols had an
addend of 0. This isn't correct, and was quite easy to break by
referring to the address of an element within a structure.

 However, fixing this exposed the fact that symbol lookups for
local variables were returning the base of the section they
were contained in. This case is detected by comparing the return
value from elf_lookup() to the relocbase+addend value: if it is
lesser, but greater than relocbase, then relocbase+addend is
taken to be the authoritative value.

bug reported by:  gallatin
2004-07-23 00:46:05 +00:00
imp
5f9a1d0878 If you insert a pccard modem and then eject it, you get a panic. This
happens because the sio device was never opened and com->tp is
therefore NULL.  ttygone can't swallow a NULL, so guard against that
possibility.  Other places in this function make similar checks, so I
believe this is correct.
2004-07-22 23:16:12 +00:00
alc
f3c3c8c6c5 MFi386 revision 1.421
- Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in
   pmap_mapdev().  See revision 1.140 of kern/sys_pipe.c for a detailed
   rationale.
2004-07-22 23:04:41 +00:00
imp
e65c9cc582 Remove redundant inclusion of bus_if.h. It isn't needed in this file, as
sys/bus.h includes it.
2004-07-22 22:59:44 +00:00
imp
24a1a0bbbf MFp4:
Improve child_detached a little and make it conform better to
style(9).  Also, improve comment about what we'll be doing in the
future about driver_added.  Soon it will be possible to kldload usb
drivers and have them attach w/o a need to disconnect/reconnect them.
2004-07-22 22:53:38 +00:00
brooks
69e2cf0e4d Actually free the unit when destroying the interface.
Reported by:	la at delfi.lt
Tested by:	la at delfi.lt
PR:		68618
2004-07-22 22:50:15 +00:00
imp
5a3e9fbaf3 Remove ahb, aha, ie, le and wl devices. They are all ISA/EISA only.
I went ahead and left in the ISA cards that also have pccard
attachments.  There's no way that these devices could attach.

OK'd by: peter
2004-07-22 22:29:45 +00:00
imp
0973e758b4 There is no pcic device on amd64. OLDCARD isn't supported, and
NEWCARD will call it something different.  and there are no ISA add-in
devices.
2004-07-22 22:28:34 +00:00
rwatson
92f30976fe Push Giant acquisition down into fo_stat() from most callers. Acquire
Giant conditional on debug.mpsafenet in the socket soo_stat() routine,
unconditionally in vn_statfile() for VFS, and otherwise don't acquire
Giant.  Accept an unlocked read in kqueue_stat(), and cryptof_stat() is
a no-op.  Don't acquire Giant in fstat() system call.

Note: in fdescfs, fo_stat() is called while holding Giant due to the VFS
stack sitting on top, and therefore there will still be Giant recursion
in this case.
2004-07-22 20:40:23 +00:00
imp
3a6160ae6a Add IDs from TI's web site. Reports from the field and inspection of
the data sheets leads me to believe these will just work.  Those parts
with the various media readers on them may not have the required
FreeBSD drivers that will attach to the subdevices that will be seen
on some of these parts.

PCI 1515, 1530, 1620, 4520, 6411, 6420, 7410, 7510, 7610

Prompted by: Havard Eidnes
2004-07-22 20:19:57 +00:00