Commit Graph

47575 Commits

Author SHA1 Message Date
Marcel Moolenaar
cfdb160e31 Add type definitions for prgregset_t and psaddr_t. Both are used by
the proc services API. The prfpregset_t type already existed.
2004-06-25 23:06:20 +00:00
Maksim Yevmenkin
21da572743 Add '#include <sys/mbuf.h>' to fix the kernel build. 2004-06-25 23:03:33 +00:00
Julian Elischer
601c644f46 oops from Gleb..
This shouldn't be visible from userland.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2004-06-25 22:59:59 +00:00
Poul-Henning Kamp
ccfac9e40e Gah! commit from wrong tree.
Remove now unused variables from last commit.
2004-06-25 22:10:20 +00:00
Poul-Henning Kamp
950cce9b30 Retire the TIOC_REMOTE ioctl.
It was added 22 years ago for emacs to use, but emacs gave up on it
it 17 years ago.
2004-06-25 21:54:49 +00:00
Søren Schmidt
dfc7e0081f Add support for LSI type software RAID's.
Made possible by: John Cagle @ HP
2004-06-25 21:21:59 +00:00
Julian Elischer
1cf3fa7934 Make the frameworkl responsible for not passing the nodes a NULL mbuf pointer.
this allows the nodes to not test for this..

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2004-06-25 21:11:14 +00:00
Poul-Henning Kamp
45671a9eb6 Use generic routines for BREAK and modem control ioctls.
This eliminates the need for a local ioctl method.
2004-06-25 20:33:52 +00:00
Poul-Henning Kamp
89274131e2 Use generic modem control and BREAK ioctl handling. This eliminated
the need for a local ioctl handler.
2004-06-25 20:32:51 +00:00
Robert Watson
a5993a9778 Release UNIX domain socket subsystem lock earlier -- don't need to
hold it over free of unp_addr if we've already removed all references
to unp.
2004-06-25 20:12:06 +00:00
Julian Elischer
327b288e5c Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.
2004-06-25 19:22:05 +00:00
Lukas Ertl
865897c9f1 Mark a plex as 'newborn' when it is created. This is used to indicate
that new RAID5 plexes need to be initialized first.
2004-06-25 18:04:33 +00:00
Josef El-Rayes
ae6d3a22dc Fix uninitialized variable, that breaks the build.
Approved by: hmp
Reviewed by: chris
Pointy hat to: josef (for ignoring warning)
2004-06-25 16:34:33 +00:00
Peter Grehan
a4d9d1bc90 Catch up with sparc64 OFWCONS_POLL_HZ change 2004-06-25 13:44:34 +00:00
Peter Grehan
aa77148daf - set resid correctly so that a failed seek (e.g. end of file) returns
correctly
- included required <sys/module.h>
2004-06-25 13:43:56 +00:00
Peter Grehan
40cdee9dab Catchup to now-required <sys/module.h> for PowerPC 2004-06-25 13:42:48 +00:00
Poul-Henning Kamp
f1cd2fdf61 Make the relationship between modem control bits and their delta cousins
public.
2004-06-25 10:56:43 +00:00
Poul-Henning Kamp
4550ad5b99 Use generic support for BREAK and modem control ioctls 2004-06-25 10:54:46 +00:00
Poul-Henning Kamp
96df2b0bfb Use generic support for BREAK and modem control ioctls. 2004-06-25 10:54:05 +00:00
Poul-Henning Kamp
85bc8ea7fc Use generic support for modemcontrol and BREAK ioctls. 2004-06-25 10:51:33 +00:00
Roman Kurakin
1127aac31e Do not count loobacks as other fuilures.
As a result magic will not be rejected any more in case of loopback.

Discussed with:	joerg@
2004-06-25 10:25:33 +00:00
Poul-Henning Kamp
e77b206f0e Add two new methods to struct tty: One for manipulating BREAK condition
and one for fiddling modem-control signals.

Add generic code to deal with the relevant ioctls if these methods are
present.
2004-06-25 10:24:10 +00:00
Paul Saab
652178a12a White space & spelling fixes
Submitted by:	Xin LI <delphij@frontfree.net>
2004-06-25 04:11:26 +00:00
Bruce M Simpson
37332f049f Whitespace. 2004-06-25 02:29:58 +00:00
Brian Feldman
2a7be1b6d1 Correct the tracking of various bits of the process's vmspace and vm_map
when not propogated on fork (due to minherit(2)).  Consistency checks
otherwise fail when the vm_map is freed and it appears to have not been
emptied completely, causing an INVARIANTS panic in vm_map_zdtor().

PR:		kern/68017
Submitted by:	Mark W. Krentel <krentel@dreamscape.com>
Reviewed by:	alc
2004-06-24 22:43:46 +00:00
Robert Watson
12ec7658a4 Annotate that we don't check the returned data length from ufs_readdir()
because UFS uses fixed-size directory blocks.  When using this code with
other file systems, such as HFS+, the value of auio.uio_resid will need
to be taken into account.
2004-06-24 18:31:23 +00:00
Scott Long
c63d83f7c2 Fix a typo that made the busdma tag have a 0 highaddr. This driver heavily
abuses busdma in other ways, and those will likely be fixed another day.
2004-06-24 18:30:08 +00:00
Doug Ambrisko
c3c409c498 Add PCI Device ID for 6300ESB ICH. If allocating 16 bytes fails then try 32.
This is also require for 6300ESB.
2004-06-24 18:21:28 +00:00
Robert Watson
bb0527fdd3 Remove unnecessary setting of VV_SYSTEM on extended attribute backing
files.  When this flag is used in our port of this code to Darwin, it
caused remarkable pain, and doesn't offer a benefit in FreeBSD.
2004-06-24 18:17:41 +00:00
Josef El-Rayes
06fc89cc3a Remove the entry for configuring pcm0 mixer channels.
This is accomplished via device.hints now.
2004-06-24 17:49:18 +00:00
Robert Watson
00a460dcf4 Protect a non-text comment with a '-'. 2004-06-24 17:45:45 +00:00
Robert Watson
cd39d9b661 White space cleanup: use spaces instead of tabs in variable declarations
local to a function.  Remove a couple of blank lines in variable
declarations.

In one case, explicitly test against NULL rather than using a pointer
as a boolean directly.
2004-06-24 17:44:14 +00:00
Josef El-Rayes
8ba7f5cfee Change the possibility to configure pcm(4) via boot/loader.conf
to use boot/device.hints now

As discussed on cvs-src@

Reviewed by:	Hiten Pandya <hmp@backplane.com>
2004-06-24 17:41:20 +00:00
Robert Watson
4f3bf9b9b4 Don't cuddle else's so much as we removed additional parts of each
block.
2004-06-24 17:22:29 +00:00
Robert Watson
5e11031e05 Remove temporary API bandage that allowed applications speaking the
older API to list attributes on a file (zero-length attribute name)
to function.  extattr_list_*() are now the only available APIs to
use when listing attributes.
2004-06-24 17:14:28 +00:00
Joerg Wunsch
b46f884b80 Add a couple of #ifdef DEBUG printf()s in vlan_input() I found to be
useful when debugging the ether_demux() problem (when bridging over
VLANs).
2004-06-24 12:32:41 +00:00
Joerg Wunsch
cd0cd0149b When considering an ethernet frame that is not destined for us, do not
only allow this to be further processed when bridging is active on
that interface, but also if the current packet has a VLAN tag and
VLANs are active on our interface.  This gives the VLAN layers a
chance to also consider the packet (and perhaps drop it instead of the
main dispatcher).

This fixes a situation where bridging was only active on VLAN
interfaces but ether_demux() called on behalf of the main interface
had already thrown the packet away.

MFC after:	4 weeks
2004-06-24 12:31:44 +00:00
Dag-Erling Smørgrav
d7647d966e Make dependencies on the TCP/IP stack conditional on INET / INET6. This
makes it possible to build a kernel with NIC drivers but no TCP/IP stack.

Sponsored by:	Teleplan AS
2004-06-24 10:58:08 +00:00
Pawel Jakub Dawidek
40f798dad1 Don't force class to give a valid softc to g_slice_new(), it is not always
needed.

Approved by:	phk
2004-06-24 10:50:20 +00:00
Poul-Henning Kamp
075ef10234 #include <sys/serial.h> 2004-06-24 10:32:30 +00:00
Poul-Henning Kamp
eb02dd6892 Use the correct names for modem control signals as the primary and make
the aliases aliases.
2004-06-24 10:20:53 +00:00
Poul-Henning Kamp
28710806cb Use the new serial port definitions for modemsignals. 2004-06-24 10:07:28 +00:00
Poul-Henning Kamp
98de21b633 Use CTASSERT to enforce the relationship between the new serial port
modem definitions and the old definitions from ioctls.
2004-06-24 10:06:55 +00:00
Poul-Henning Kamp
c56bdd05fa Add a tty-independent include file for definitions pertaining to serial
ports.

Define the most commonly used modem signals, and delta-bit definitions
for them.
2004-06-24 10:05:58 +00:00
Nate Lawson
bef5734687 Update some comments and remove non-standard notation. 2004-06-24 06:37:23 +00:00
Nate Lawson
684c1c1ddb Hook acpi_quirks up to the build for kernel and modules. 2004-06-24 06:29:22 +00:00
Nate Lawson
94f529791f Add a script to parse acpi_quirks into a header file that we can compile
into ACPI.  Script written by Mark Santcroos with some edits from myself.

Submitted by:	marks
2004-06-24 06:28:05 +00:00
Nate Lawson
e008d0c51c Add a quirks array based on matching ACPI tables. The entries in this file
are currently all bad BIOS revisions that will never be able to support
ACPI.  They were derived by examining which BIOS's are blacklisted by other
operating systems.  Other types of quirks will be possible here as well.
2004-06-24 06:27:05 +00:00
John Birrell
bbfccfb3c6 Sync to usbdevs 1.183 2004-06-24 05:25:04 +00:00
John Birrell
f1912fcf16 Add Delorme Publishing Earthmate GPS 2004-06-24 05:05:56 +00:00
Robert Watson
613a4366cb Acquire the receive socket buffer lock when modifying out-of-band
data fields of the socket in SPX.
2004-06-24 04:29:53 +00:00
Robert Watson
c6b93bf29a Lock socket buffers when processing setting socket options SO_SNDLOWAT
or SO_RCVLOWAT for read-modify-write.
2004-06-24 04:28:30 +00:00
Robert Watson
63a9224f4c Annotate so_error as being used for simple assignment and reads, and
therefore not locked.

Assert the socket buffer lock in sowwakeup_locked() to match
sorwakeup_locked().
2004-06-24 04:27:10 +00:00
Alan Cox
5e609009de Call vm_pageout_page_stats() with the page queues lock held. 2004-06-24 04:08:43 +00:00
Robert Watson
2220907b6e Introduce a temporary mutex, mac_ifnet_mtx, to lock MAC labels on
network interfaces.  This global mutex will protect all ifnet labels.
Acquire the mutex across various MAC activities on interfaces, such
as security checks, propagating interface labels to mbufs generated
from the interface, retrieving and setting the interface label.

Introduce mpo_copy_ifnet_label MAC policy entry point to copy the
value of an interface label from one label to another.  Use this
to avoid performing a label externalize while holding mac_ifnet_mtx;
copy the label to a temporary ifnet label and then externalize that.

Implement mpo_copy_ifnet_label for various MAC policies that
implement interface labeling using generic label copying routines.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-06-24 03:34:46 +00:00
Alan Cox
1aab16a6b6 Remove spl calls. 2004-06-24 03:13:30 +00:00
Robert Watson
d60454e33a Annotate which SB_ constants are for sb_flags fields. 2004-06-24 03:12:46 +00:00
Robert Watson
7322ba7d8b When updating sb_flags, acquire the socket buffer lock to prevent
races.
2004-06-24 03:12:13 +00:00
Robert Watson
c17a7759af Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
Robert Watson
5905999b2f Broaden scope of the socket buffer lock when processing an ACK so that
the read and write of sb_cc are atomic.  Call sbdrop_locked() instead
of sbdrop() since we already hold the socket buffer lock.
2004-06-24 03:07:27 +00:00
Robert Watson
927c5cea3f Protect so_oobmark with with SOCKBUF_LOCK(&so->so_rcv), and broaden
locking in tcp_input() for TCP packets with urgent data pointers to
hold the socket buffer lock across testing and updating oobmark
from just protecting sb_state.

Update socket locking annotations
2004-06-24 02:57:12 +00:00
David E. O'Brien
a82b25f9b2 Better OFW console support on Sun Ultra2 machines.
Ultra2 users may want to set OFWCONS_POLL_HZ to a value of '20'.
I have left default value at '4' as higher values can consume a more
than is acceptable amount of CPU, and we don't have a consensus yet
what is an optimal value.

Submitted by:	Pyun YongHyeon <yongari@kt-is.co.kr>
2004-06-24 02:57:11 +00:00
Christian S.J. Peron
d7af790b0d Currently, if the drives specified for volume creation are
not active GEOM providers, it will result in a kernel panic.

If the GEOM provider or disk goes away before the volume
configuration data gets written to the disk, it will result
in another kernel panic.

o Make sure that the drives specified for volume creation
  are active GEOM providers.

o When writing out volume configuration data to associated drives,
  make sure that the GEOM provider is active, otherwise continue
  to the next drive in the volume.

Approved by:	le, bmilekic (mentor)
2004-06-24 02:40:34 +00:00
David E. O'Brien
13a0a973c6 Add casts so all these quantities are a constant type. 2004-06-24 02:24:39 +00:00
David E. O'Brien
328213dac1 Cast variable-sized (based on platform) quantities before printing out. 2004-06-24 02:21:17 +00:00
Robert Watson
a138d21769 In ip_ctloutput(), acquire the inpcb lock around some of the basic
inpcb flag and status updates.
2004-06-24 02:05:47 +00:00
Robert Watson
d67ec3dd48 When asserting non-Giant locks in the network stack, also assert
Giant if debug.mpsafenet=0, as any points that require synchronization
in the SMPng world also required it in the Giant-world:

- inpcb locks (including IPv6)
- inpcbinfo locks (including IPv6)
- dummynet subsystem lock
- ipfw2 subsystem lock
2004-06-24 02:01:48 +00:00
Nate Lawson
30d577a014 Attach the correct handle, not the one that was just deleted. Also,
remove some duplicated code.
2004-06-24 01:57:31 +00:00
Robert Watson
53f9c5e988 Clean up use of ng_hdhasb_mtx a little:
- Assert the mutex in NG_IDHASH_FIND() since the mutex is required to
  safely walk the node lists in the ng_ID_hash table.

- Acquire the ng_nodelist_mtx when walking ng_allnodes or ng_allhooks
  to generate state dump output from the netgraph sysctls.
2004-06-24 01:47:31 +00:00
Robert Watson
ad6b0efff5 Acquire socket lock in the "waiting for connection" loop in
kern_connect(), replacing tsleep() with msleep() with the socket
mutex.
2004-06-24 01:43:23 +00:00
Robert Watson
3f11a2f374 Introduce sbreserve_locked(), which asserts the socket buffer lock on
the socket buffer having its limits adjusted.  sbreserve() now acquires
the lock before calling sbreserve_locked().  In soreserve(), acquire
socket buffer locks across read-modify-writes of socket buffer fields,
and calls into sbreserve/sbrelease; make sure to acquire in keeping
with the socket buffer lock order.  In tcp_mss(), acquire the socket
buffer lock in the calling context so that we have atomic read-modify
-write on buffer sizes.
2004-06-24 01:37:04 +00:00
Robert Watson
adb4cf0fbc Slide socket buffer lock earlier in sopoll() to cover the call into
selrecord(), setting up select and flagging the socker buffers as SB_SEL
and setting up select under the lock.
2004-06-24 00:54:26 +00:00
Nate Lawson
80f0e4c265 Run the power off code directly instead of using indirection through
smp_rendezvous() to ensure we run on the BSP.  This reverts rev 1.128.
Add a comment indicating that MI code should be the one that runs all
shutdown functions on the BSP with the APs halted.  This should work
around problems in power off while waiting for the MI code to be improved.
2004-06-24 00:48:45 +00:00
Robert Watson
1cf30f57e1 Remove spls from portal_open(). Acquire socket lock while sleeping
waiting for the socket to connect and use msleep() on the socket
mute rather than tsleep().  Acquire socket buffer mutexes around
read-modify-write of socket buffer flags.
2004-06-24 00:47:23 +00:00
Nate Lawson
4a03551ddd Use uintmax_t for CPU statistics and add a cast to prevent truncation of
the statistics in a multiply.

Pointed out by:	YONETANI Tomokazu
2004-06-24 00:38:51 +00:00
Lukas Ertl
3a1e11b485 Add a function to clean up RAID5 packets and use it when I/O has
finished or when building the complete packet fails.
2004-06-23 23:52:55 +00:00
Lukas Ertl
c3dba6d0e0 Remove two debugging printfs that are currently rather disturbing
than helpful.
2004-06-23 22:32:01 +00:00
Bosko Milekic
cc822cb53e Make uma_mtx MTX_RECURSE. Here's why:
The general UMA lock is a recursion-allowed lock because
there is a code path where, while we're still configured
to use startup_alloc() for backend page allocations, we
may end up in uma_reclaim() which calls zone_foreach(zone_drain),
which grabs uma_mtx, only to later call into startup_alloc()
because while freeing we needed to allocate a bucket.  Since
startup_alloc() also takes uma_mtx, we need to be able to
recurse on it.

This exact explanation also added as comment above mtx_init().

Trace showing recursion reported by: Peter Holm <peter-at-holm.cc>
2004-06-23 21:59:03 +00:00
Scott Long
bf1c3ddd68 Make the udf_vnops side endian clean. 2004-06-23 21:49:03 +00:00
Paul Saab
76947e3222 Move the sack sysctl's under net.inet.tcp.sack
net.inet.tcp.do_sack -> net.inet.tcp.sack.enable
net.inet.tcp.sackhole_limit -> net.inet.tcp.sack.sackhole_limit

Requested by:	wollman
2004-06-23 21:34:07 +00:00
Lukas Ertl
b950fbe67b Accept "sd len 0" and auto-size the subdisk correctly.
Spotted by: csjp
2004-06-23 21:15:55 +00:00
Paul Saab
6d90faf3d8 Add support for TCP Selective Acknowledgements. The work for this
originated on RELENG_4 and was ported to -CURRENT.

The scoreboarding code was obtained from OpenBSD, and many
of the remaining changes were inspired by OpenBSD, but not
taken directly from there.

You can enable/disable sack using net.inet.tcp.do_sack. You can
also limit the number of sack holes that all senders can have in
the scoreboard with net.inet.tcp.sackhole_limit.

Reviewed by:	gnn
Obtained from:	Yahoo! (Mohan Srinivasan, Jayanth Vijayaraghavan)
2004-06-23 21:04:37 +00:00
Scott Long
89ec2c3c42 First half of making UDF be endian-clean. This addresses the vfsops side. 2004-06-23 19:36:09 +00:00
Roman Kurakin
de98a7eeee Use bus_dma* instead of contigmalloc()+vtophys() for RELENG_5. 2004-06-23 18:13:10 +00:00
John Baldwin
2fc3727323 Finally implement bus_config_intr() support for I/O APIC interrupt sources.
This should fix problems with older SMP systems that only have ISA/EISA
IRQs when routing virgin PCI interrupts as well as on other boxes whose
MADT does not have any interrupt override entries for ISA IRQs that are
used to route PCI interrupts even in APIC mode.
2004-06-23 18:11:33 +00:00
John Baldwin
a7cd01df0e Fetch the actual acpi0 device_t and use device_is_attached() to see if
it's alive rather than trying to fetch its softc pointer via its devclass.

Glanced at by:	imp, njl
2004-06-23 17:59:01 +00:00
Brooks Davis
14b3b2933d el(4) stopped needing to me a count device in December 2000. 2004-06-23 17:33:25 +00:00
John Baldwin
95957f6256 - Defer BUS_CONFIG_INTR() on ACPI IRQ resources until the resources are
actually used.  For most ACPI devices this means deferring the call
  until bus_alloc_resource().
  - Add a function acpi_config_intr() to call BUS_CONFIG_INTR() for an
    ACPI IRQ resource using the trigger mode and polarity information
    stored in the ACPI resource object.
  - Add a function acpi_lookup_irq_resource() to lookup the ACPI IRQ
    resource that corresponds to a specified rid and new-bus resource.
  - Have the ACPI PCI bridge driver call BUS_CONFIG_INTR() on interrupts
    that it routes through link devices.
- Remove needactivate variable from acpi_alloc_resource() by changing the
  function not modify the flags variable but just mask off RF_ACTIVE when
  calling rman_reserve_resource().

Reviewed by:	njl (1, an earlier version)
2004-06-23 17:21:02 +00:00
John Baldwin
96d3b93753 Various cleanups in support of a future ioapic_config_intr() function:
- Allow ioapic_set_{nmi,smi,extint}() to be called multiple times on the
  same pin so long as the pin's mode is the same as the mode being
  requested.
- Add a notion of bus type for the interrupt associated with interrupt pin.
  This is needed so that we can force all EISA interrupts to be active high
  in the forthcoming ioapic_config_intr().
- Fix a bug for EISA systems that didn't remap IRQs.  This would have broken
  EISA systems that tried to disable mixed mode for IRQ 0.
2004-06-23 15:29:20 +00:00
Bruce M Simpson
0e3fe6e3e6 In swap_pager_getpages(), bp->b_dev can be NULL, particularly for the
case of NFS mounted swap, so do not try to dereference it.

While we're here, brucify the printf() call which happens when we
time out on acquisition of vm_page_queue_mtx.

PR:		kern/67898
Submitted by:	bde (style)
2004-06-23 15:15:07 +00:00
John Baldwin
81bb99d26b Now that we associate a device_t with ACPI device handles, lookup the
device associated with any PCI devices that are enumerated in the ACPI
tree when adding children to an ACPI PCI bus and remove the duplicate
ACPI-only device_t and replace the device_t associated with the handle with
the ACPI and PCI aware device_t.
2004-06-23 15:08:40 +00:00
Roman Kurakin
182968e86b Clean CLEANFILES. 2004-06-23 14:22:14 +00:00
Warner Losh
b0ba9e25bc Improve the kludge assignment of sub-bus numbers a little by fixing an
off by one error.  subbus must be > than pribus, so the right test is
<= not just <.

Reported by: Peter Losher
2004-06-23 13:49:46 +00:00
Roman Kurakin
3cc90ff9d1 Make code more clean: backout support for 3.x branch. 2004-06-23 11:23:54 +00:00
Lukas Ertl
5980decb5b MFNetBSD 1.60, author: augustss
Several changes:
    * Implement read for ulpt.
    * If the device is not opened for reading, occasionally drain any
      data the printer might have (but don't hammer the printer with reads).
    * Lower the buffer size to one page.
   The driver seems to work with more printers now.

Obtained from: NetBSD
2004-06-23 11:16:12 +00:00
Poul-Henning Kamp
ee531086ca save a few redundant lines by moving the retry loop further backwards. 2004-06-23 10:28:09 +00:00
Poul-Henning Kamp
887f7ef50a Since we grew struct xtty, t_dev doesn't have to be schizofrenic anymore. 2004-06-23 08:25:23 +00:00
Alan Cox
2551e6f323 - Remove unused definitions.
- Move a definition inside the scope of a #ifdef _KERNEL.
2004-06-23 08:06:52 +00:00
Bruce M Simpson
8a32d6f08e MFamd64: Document the machdep.hlt_cpus sysctl MIB variable.
PR:		i386/65729
Submitted by:	Craig Rodrigues
2004-06-23 07:12:34 +00:00
Bruce Evans
587a4462c9 Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of
depending on namespace pollution in <sys/vnode.h> for the definition
of mutex interfaces used in SOCKBUF_*LOCK().

Sorted includes.

Removed unused includes.
2004-06-23 06:47:49 +00:00