Commit Graph

53310 Commits

Author SHA1 Message Date
Ian Dowse
e2b66de827 Use usbd_get_string() instead of calling usbd_get_string_desc()
with the wrong language parameter when retrieving the device serial
number. This invalid request caused some devices not to work at
all.

PR:		usb/79190
Submitted by:	Hans Petter Selasky <hselasky@c2i.net>
2005-03-25 01:44:38 +00:00
Maxim Sobolev
8a9cf808e6 Move xxx_newbuf() function, which was the same in all drivers into central
location.
2005-03-25 00:44:21 +00:00
Ian Dowse
70a18c2253 Use M_NOWAIT when allocating from a callout routine.
PR:	kern/73295
2005-03-25 00:38:46 +00:00
Jeff Roberson
6c759f3558 - Add information about the buf lock to db_show_buffer.
- Add a 'show lockedbufs' command that is similar to show lockedvnods.

Sponsored by:	Isilon Systems, Inc.
2005-03-25 00:20:37 +00:00
Jeff Roberson
f158df07ab - Restore COUNT() in all of its original glory. Don't make it dependent
on DEBUG as ufs will soon grow a dependency on this count.

Discussed with:	bde
Sponsored by:	Isilon Systems, Inc.
2005-03-25 00:00:44 +00:00
John Baldwin
fc972f4cc4 Merge from i386:
- Add a i8254_pending variable to save some indirections in clkintr().
- Don't bother setting up an IRQ0 handler if we are using the lapic timer.
2005-03-24 21:36:15 +00:00
John Baldwin
d336ab43c6 - Don't enable periodic interrupts from the RTC by default in rtc_statusb.
Instead, explicitly enable them when we setup the interrupt handler.
  Also, move the setting of stathz and profhz down to the same place so
  that the code flow is simpler and easier to follow.
- Don't setup an interrupt handler for IRQ0 if we are using the lapic timer
  as it doesn't do anything productive in that case.
2005-03-24 21:34:16 +00:00
John Baldwin
85c36f3d25 Don't set ret_namelen and ret_resnamelen in res_find() unless both the
corresponding pointer to the buffer (ret_name and ret_resname) is non-NULL
to avoid possible NULL pointer derefs.

Reported by:	Coverity via sam
2005-03-24 21:20:25 +00:00
Pawel Jakub Dawidek
0440fc940a Use device_set_desc_copy() for non-constant strings.
Approved by:	njl
2005-03-24 21:07:55 +00:00
Brooks Davis
044ba81b85 Use the CTASSERT() macro instead of rolling my own, non-portable one
using #error.

Suggested by:	jhb
2005-03-24 19:26:50 +00:00
John Baldwin
3da063baf7 Add another HID for the Toshiba SPA40 laptop.
Submitted by:	Chris Reece car at crank dot org dot uk
MFC after:	1 week
2005-03-24 19:02:13 +00:00
David E. O'Brien
53b1897c62 Support MCP versions 4-11. 2005-03-24 18:55:07 +00:00
Poul-Henning Kamp
eb0d6cde00 Move implementation of hw.bus.rman sysctl to subr_rman.c so that
subr_bus.c doesn't need to peek inside struct resource.

OK from:	imp
2005-03-24 18:13:11 +00:00
Brooks Davis
fe753c29f7 Compile errors are way more useful then panics later.
Replace a KASSERT of LINUX_IFNAMSIZ == IFNAMSIZ with a preprocessor
check and #error message.  This will prevent nasty suprises if users
change IFNAMSIZ without updating the linux code appropriatly.
2005-03-24 17:51:15 +00:00
Jeff Roberson
61ef09d118 - Fail an assert if we attempt to return with any lockmgr locks held in
userret().

Sponsored by:	Isilon Systems, Inc.
2005-03-24 09:35:38 +00:00
Jeff Roberson
92e251caf7 - Complete the implementation of td_locks. Track the number of outstanding
lockmgr locks that this thread owns.  This is complicated due to
   LK_KERNPROC and because lockmgr tolerates unlocking an unlocked lock.

Sponsored by:	Isilon Systes, Inc.
2005-03-24 09:35:06 +00:00
Jeff Roberson
a176ceb322 - Update vfs_root implementations to match the new prototype. None of
these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by:   Isilon Systems, Inc.
2005-03-24 07:39:03 +00:00
Jeff Roberson
d9b2d9f7a2 - Update vfs_root implementations to match the new prototype. None of
these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:36:16 +00:00
Jeff Roberson
080c061ad0 - Call VFS_ROOT() with LK_EXCLUSIVE.
Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:33:45 +00:00
Jeff Roberson
469ec10c1e - Update the ufs_root() prototype.
- Pass the ufs_root() flags argument to VFS_VGET() to allow callers to
   specify shared locks.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:32:50 +00:00
Jeff Roberson
d830f82824 - Pass LK_EXCLUSIVE to VFS_ROOT() to satisfy the new flags argument. For
now, all calls to VFS_ROOT() should still acquire exclusive locks.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:31:38 +00:00
Jeff Roberson
aabb175391 - Fixup the default vfs_root function to match the new prototype.
Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:30:00 +00:00
Jeff Roberson
35f19cdc6c - Add a 'flags' parameter to VFS_ROOT(). This is intended to allow
lookup to do shared locks on the root.  Filesystems are free to ignore
   flags and instead acquire an exclusive lock if they do not support
   shared locks.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:29:23 +00:00
Jeff Roberson
5d14d29912 - Grab the lock type that the caller requests in vfs_hash_insert().
Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:16:27 +00:00
Jeff Roberson
c167961e27 - If vput() is called with a shared lock it must upgrade to an exclusive
before it can call VOP_INACTIVE().  This must use the EXCLUPGRADE path
   because we may violate some lock order with another locked vnode if
   we drop and reacquire the lock.  If EXCLUPGRADE fails, we mark the
   vnode with VI_OWEINACT.  This case should be very rare.
 - Clear VI_OWEINACT in vinactive() and vbusy().
 - If VI_OWEINACT is set in vgone() do the VOP_INACTIVE call here as well.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:08:58 +00:00
Jeff Roberson
3e6bcad375 - Remove some long dead LOOKUP_SHARED code that tracked the lock state.
- Always pass LOCKSHARED and rely on namei() to ignore it when
   LOOKUP_SHARED is not set.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:04:35 +00:00
Jeff Roberson
ae88db8a72 - Remove the #ifdef LOOKUP_SHARED from some calls to NDINIT. The
LOCKSHARED flag is simply ignored in namei() if LOOKUP_SHARED is not
   enabled.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:03:31 +00:00
Jeff Roberson
ad09e57f41 - Clear LOCKSHARED if LOOKUP_SHARED is not enabled. This is not strictly
necessary since we disable the shared locks in vfs_cache, but it is
   prefered that the option not leak out into filesystems when it is
   disabled.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:02:37 +00:00
Jeff Roberson
fdd6a3ff3c - All of the bugs which lead to the complication of the LOOKUP_SHARED
config option have now been fixed.  All filesystems are properly locked
   and checked via DEBUG_VFS_LOCKS.  Remove the workaround code.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 06:00:45 +00:00
Matthew N. Dodd
96a205962e - Break after nested switch.
- Default returns an error.
2005-03-24 02:08:22 +00:00
Matthew N. Dodd
5b9c896ccd Offer unhandled IOCTLS to fddi_ioctl(). 2005-03-24 01:58:20 +00:00
Paul Saab
cae2d2c61f - The NFS client was incorrectly masking SIGSTOP (which is
non-maskable).
- The NFS client needs to guard against spurious wakeups
  while waiting for the response. ltrace causes the process
  under question to wakeup (possibly from ptrace()), which
  causes NFS to wakeup from tsleep without the response being
  delivered.

Submitted by:	Mohan Srinivasan
2005-03-23 22:10:10 +00:00
John-Mark Gurney
244f64d007 relocate the power state transition statements to the
pci_set_powerstate_method function...

Reviewed by:	imp
MFC after:	1 week
2005-03-23 21:24:29 +00:00
John-Mark Gurney
f7f47552ef fix kldloading of pci driver modules after boot on sparc64... since
we weren't using the pci module, we weren't restoring the pci state...

Submitted by:	imp
MFC after:	5 days
2005-03-23 18:16:26 +00:00
Olivier Houchard
73267c1118 Unbreak buildworld on i386 when MODULES_WITH_WORLD is defined. 2005-03-23 17:13:08 +00:00
Justin T. Gibbs
df8f908079 Restore queue depth settings across tag disable events. The system often
disables tag queuing temporarily in order to allow controllers a window
to safely perform transfer negotiation with non-compliant devices.  Before
this change, CAM would restore the queue depth to the controller specified
maximum or device quirk level rather than any depth determined by reactions
to QUEUE FULL/BUSY events or an explicit user setting.

During device probe, initialize the flags field for XPT_SCAN_BUS.
The uninitialized value often confused CAM into not bothering to
issue an AC_FOUND_DEVICE async event for new devices.  The reason
this bug wasn't reported earlier is that CAM manually announces
devices after the initial system bus scans.

MFC: 3 days
2005-03-23 16:43:29 +00:00
Maxim Konovalov
6ee79c59d2 o Document net.inet.ip.portrange.random* sysctls.
o Correct a comment about random port allocation threshold
implementation.

Reviewed by:	silby, ru
MFC after:	3 days
2005-03-23 09:26:38 +00:00
David Schultz
a3e1ec194d Bounds check the user-supplied length used in a copyout() in
svr4_do_getmsg().  In principle this bug could disclose data from
kernel memory, but in practice, the SVR4 emulation layer is probably
not functional enough to cause the relevant code path to be executed.
In any case, the emulator has been disconnected from the build since
5.0-RELEASE.

Found by:	Coverity Prevent analysis tool
2005-03-23 08:28:06 +00:00
David Schultz
8a4d2b06c7 Bounds check the length parameter to i386_set_ldt() before passing it
to kmem_alloc().  Failure to do this made it possible for user
processes to cause a hard lock on i386 kernels.  I believe this only
affects 6-CURRENT on or after 2005-01-26.

Found by:	Coverity Prevent analysis tool
Security:	Local DOS
2005-03-23 08:28:03 +00:00
David Schultz
aa675b572f Reject packets larger than IP_MAXPACKET in linux_sendto() for sockets
with the IP_HDRINCL option set.  Without this change, a Linux process
with access to a raw socket could cause a kernel panic.  Raw sockets
must be created by root, and are generally not consigned to untrusted
applications; hence, the security implications of this bug are
minimal.  I believe this only affects 6-CURRENT on or after 2005-01-30.

Found by:	Coverity Prevent analysis tool
Security:	Local DOS
2005-03-23 08:28:00 +00:00
David Schultz
f2c7668eb1 Make ps_nargvstr and ps_nenvstr unsigned. This fixes an input
validation error in procfs/linprocfs that can be exploited by local
users to cause a kernel panic.  All versions of FreeBSD with the patch
referenced in SA-04:17.procfs have this bug, but versions without that
patch have a more serious bug instead.  This problem only affects
systems on which procfs or linprocfs is mounted.

Found by:	Coverity Prevent analysis tool
Security:	Local DOS
2005-03-23 08:27:59 +00:00
Nate Lawson
8b28b622f7 Add support for bus_delete_resource() and make acpi_bus_alloc_gas() do
this before setting a new resource.
2005-03-22 20:00:57 +00:00
Maxim Sobolev
4562351ad0 Zaurus expecrs CRC to be in little-endian order, so that convert it into LE
on BE arches.

Obtained from:	OpenBSD
2005-03-22 16:35:15 +00:00
Gleb Smirnoff
9818b82ff3 Add a possibility to bypass unmodified accounted data to special
hook(s). Data received on these hook(s) is sent back to ifaceX hook(s).
2005-03-22 15:49:22 +00:00
Maxim Sobolev
6bcf003260 Add USB Communication Device Class Ethernet driver. Originally written for
FreeBSD based on aue(4) it was picked by OpenBSD, then from OpenBSD ported
to NetBSD and finally NetBSD version merged with original one goes into
FreeBSD.

Obtained from:  http://www.gank.org/freebsd/cdce/
                NetBSD
                OpenBSD
2005-03-22 14:52:40 +00:00
David Schultz
3eea66586b - Declare mknod in stat.h (in addition to unistd.h), as per XSI.
- Use blksize_t and blkcnt_t in struct stat.
- Hide non-standard fields in stat.h when !__BSD_VISIBLE.
- Add restrict qualifiers in stat.h.
2005-03-22 01:19:18 +00:00
Julian Elischer
b75b03116f Fix code freeing wrong cred pointer.
Submitted by:	das
Noticed by: Coverity tool
MFC after:	3 days

Note: usually the two pointers point to the same
thing but it was still a bug.
2005-03-21 22:55:38 +00:00
Philip Paeps
4b0eb6a716 Make sure status variable is always initialized. Why didn't this show up in
my testing?  *grmbl*
2005-03-21 18:11:50 +00:00
Gleb Smirnoff
2b38b68736 Refactor node so that it does not modify mbuf contents. Next step would
be pass-thru mode, when traffic is not copied by ng_tee, but passed thru
ng_netflow.

Changes made:

- In ng_netflow_rcvdata() do all necessary pulluping: Ethernet header,
  IP header, and TCP/UDP header.
- Pass only pointer to struct ip to ng_netflow_flow_add(). Any TCP/UDP
  headers are guaranteed to by after it.
- Merge make_flow_rec() function into ng_netflow_flow_add().
2005-03-21 15:40:25 +00:00
Gleb Smirnoff
1d03bd1684 Refactor node so that it does not modify mbuf contents. Next step would
be pass-thru mode, when traffic is not copied by ng_tee, but passed thru
ng_netflow.

Changes made:

- In ng_netflow_rcvdata() do all necessary pulluping: Ethernet header,
  IP header, and TCP/UDP header.
- Pass only pointer to struct ip to ng_netflow_flow_add(). Any TCP/UDP
  headers are guaranteed to by after it.
- Merge make_flow_rec() function into ng_netflow_flow_add().
2005-03-21 15:34:03 +00:00
Gleb Smirnoff
0e406d0f63 Plug item leak, which occured when m_pullup() failed. 2005-03-21 11:48:54 +00:00
Maxim Sobolev
c159c9d8bb Add the following products in preparation for addition of CDCE driver:
- G.Mate, Inc's YP3X00 PDA;

 - Prolific's PL2501 Host-Host interface;

 - Numver of Sharp's Zaurus PDAs.
2005-03-21 08:43:54 +00:00
Scott Long
586cfbb265 Start the process of modernizing the Tigon driver by using busdma for the
descriptor and configuration data.  Thanks to Martin Nilsson for providing
hardware.
2005-03-21 07:17:27 +00:00
Nate Lawson
b6604696b6 Add support for probing EST settings from ACPI. This should handle more
modern CPUs that have multiple VID#s that aren't detectable via public
methods.  We use the control value from acpi_perf as the id16 for setting
a given frequency.
2005-03-21 06:43:25 +00:00
Tim Kientzle
602778ab8e Stop building gtar. Bump __FreeBSD_version to reflect this change. 2005-03-21 05:30:58 +00:00
Ian Dowse
20289f7920 Root hubs don't have transaction translators, so skip printing the
message about them if the hub depth is zero.
2005-03-20 23:45:00 +00:00
Ian Dowse
0b07d58eb3 Don't display the redundant `ehci_pci_attach: companion usbX'
messages unless EHCI debugging is enabled.

Suggested by:	scottl
2005-03-20 23:42:54 +00:00
Philip Paeps
d8e0b9e1c0 Simplify sysctl handling by consolidating various get/set functions into
generic functions, use a table for hooking up sysctls nodes rather than doing
it manually.  While here, clean up some style bugs.

Glanced at by:	njl
2005-03-20 23:36:36 +00:00
Ian Dowse
a3a574f503 Remove trailing whitespace as per NetBSD's revision 1.91. Also
update the TODO comments to more closely match current reality.
2005-03-20 22:22:18 +00:00
Gleb Smirnoff
c1249c6338 - Don't lose TCP flags of the first packet in a flow.
- Don't account length of the first packet in a flow twice.
2005-03-20 21:03:43 +00:00
Murray Stokely
ddc5ac8b73 Return BUS_PROBE_DEFAULT in preference to 0.
Pointed out by:	Nate Lawson <nate@root.org>
2005-03-20 20:13:21 +00:00
Robert Watson
6220dcba84 Add a read-only kern.sched.preemption sysctl so that user space can tell
if "options PREEMPTION" is compiled into the kernel.
2005-03-20 17:05:12 +00:00
Gleb Smirnoff
d4d2297060 ifma_protospec is a pointer. Use NULL when assigning or compating it. 2005-03-20 14:31:45 +00:00
Pawel Jakub Dawidek
c78941e69e Add ki_jid field to the kinfo_proc structure and store jail ID there.
Reviewed by:	gad
MFC after:	3 days
2005-03-20 10:35:23 +00:00
Pawel Jakub Dawidek
e69f1fa2ef Make prison structure visible from userland if _WANT_PRISON is defined
(simlar to _WANT_UCRED).

Reviewed by:	gad
MFC after:	3 days
2005-03-20 10:33:27 +00:00
Gleb Smirnoff
50bb170471 Remove a workaround from previos revision. It proved to be incorrect.
Add two another workarounds for carp(4) interfaces:
- do not add connected route when address is assigned to carp(4) interface
- do not add connected route when other interface goes down

Embrace workarounds with #ifdef DEV_CARP
2005-03-20 10:27:17 +00:00
Nate Lawson
ac5f2dab74 s/SLIST/STAILQ to catch up with changes to resource lists.
Missed by:	imp
2005-03-20 06:55:49 +00:00
Yoshihiro Takahashi
f227591555 s/SLIST/STAILQ/ 2005-03-20 05:22:57 +00:00
Nate Lawson
6638c61aa6 Attach acpi_perf early. Especially when it is being used to provide info
to other devices, it needs to be attached first.  (Multi-pass newbus
probes would be a better solution.)
2005-03-20 03:51:18 +00:00
Sam Leffler
eb9883565a fix braino introduced when converting from madwifi 2005-03-20 01:55:02 +00:00
Sam Leffler
57a4a75853 eliminate mid-block variable decls 2005-03-20 01:27:33 +00:00
Nate Lawson
e33bea8d9e Add the acpi_ec_read and write methods. This allows an external driver
(like an EC/SMbus controller) to access the EC address space.  Access
is synchronized by the EcLock/Unlock routines in EcSpaceHandler().

Tested by:	Hans Petter Selasky
2005-03-20 01:27:27 +00:00
Nate Lawson
823d404a6d Only activate ICH speedstep if we're going to use it. No bugs were observed
due to this but it's cleaner this way.
2005-03-20 01:25:21 +00:00
Olivier Houchard
7fc53c7b12 Bring in a version of float.h more correct for softfloat. 2005-03-20 00:34:24 +00:00
Sam Leffler
b276305606 version 1.1 (with cleanups)
Submitted by:	John Bicket
2005-03-19 21:04:53 +00:00
Ian Dowse
4c11f583a3 Now that all architectures allow hooks to be inserted before
configure_final(), assert that "cold" is true in usb_cold_explore()
when there are busses to explore. When USB is kldloaded after boot,
usb_cold_explore() will still get invoked but the list of busses
to explore in that case should always be empty.
2005-03-19 19:27:38 +00:00
Maxim Konovalov
c017b3b664 s/SLIST/STAILQ/
Spotted by:	clive
2005-03-19 19:17:17 +00:00
Ian Dowse
a3d327674a It was possible to have two threads concurrently aborting the same
transfer, which lead to panics or page faults. For example if a
transfer timed out, another thread could come along and attempt to
abort the same transfer while the timeout task was sleeping in
the *_abort_xfer() function.

Add an "aborting" flag to the private transfer state in each host
controller driver and use this to ensure that the abort is only
executed once. Also prioritise normal abort requests over timeouts
so that the callback is always given a status of USB_CANCELLED even
if the timeout-initiated abort began first.

The crashes caused by this bug were mainly reported in connection
with lpd printing to a USB printer.

PR:	usb/78208, usb/78986
2005-03-19 19:08:46 +00:00
Poul-Henning Kamp
9ca3d6d5b7 Instead of a rather useless generation number, use a sample number to
keep track of things.
2005-03-19 12:55:46 +00:00
Poul-Henning Kamp
7f661c6ba1 Use subr_unit 2005-03-19 08:22:36 +00:00
Poul-Henning Kamp
773eff9d97 Sleeping is not allowed in uma->fini 2005-03-19 08:22:13 +00:00
Scott Long
e3f3b2ed9f Don't free the SIM object twice.
Submitted by: Coverity Prevent analysis tool
2005-03-19 06:32:57 +00:00
Scott Long
b5f516cdaf Handle failures better in the passthrough bus creation code.
Submitted by: Coverity Prevent analysis tool
2005-03-19 06:29:32 +00:00
Sam Leffler
b53d6ac575 check copyin return value
Noticed by:	Coverity Prevent analysis tool
2005-03-19 04:34:23 +00:00
Murray Stokely
ff8a893b9f Add device ID for Planet IA 128P-STD card.
PR:		kern/71923
Submitted by:	Vassily Kiryanov <admin@assist.berezniki.ru>
MFC after:	1 week
2005-03-19 03:00:22 +00:00
Peter Grehan
eb1c12f028 Optimize putc routine to write 2 ints instead of 8 chars to uncached
framebuffer memory. Speeds up system time of large ascii file cat
by 4x.

Inspired by:  Linux scrolling so damned fast.
2005-03-19 01:43:29 +00:00
Murray Stokely
a52010a036 Add device id for nForce 4 audio controller.
PR:		kern/78482
Submitted by:	Markus Niemistö <markus.niemisto@iki.fi>
MFC after:	1 week
2005-03-19 01:39:13 +00:00
David Schultz
c0a3c58e99 - Don't call rpcclnt_realign() if we don't have any mbufs to realign.
- Remove a bogus and unneeded null pointer check.

Found by:	Coverity Prevent analysis tool
Approved by:	alfred
2005-03-19 01:16:25 +00:00
Marius Strobl
be7a88bd72 Add a driver for the 'clock-board' device (the clock board is an
inevitable component in Sun Exx00 machines and provides serial ports,
NVRAM and TOD amongst others which are handled by uart(4) and eeprom(4)
respectively). This driver currently only prints out information about
the chassis on attach and allows to blink the 'Cycling' LED (which is
duplicated on the front panel) of the clock board just like fhc(4) does
for the other boards. The device name for the LED is /dev/led/clockboard.

Obtained from:	OpenBSD
Tested by:	joerg
2005-03-19 01:04:48 +00:00
Marius Strobl
771997501f - Add a device interface method for bus_get_resource_list() and use
bus_generic_rl_release_resource() for the bus_release_resource() method
  instead of a local copy.
- Correctly handle pass-through allocations in fhc_alloc_resource().
- In case the board model can't be determined just print "unknown model"
  so the physical slot number is reported in any case.
- Add support for blinking the 'Cycling' LED of boards on a fhc(4) hanging
  of off the nexus (i.e. all boards except the clock board) via led(4).
  All boards have at least 3 controllable status LEDs, 'Power', 'Failure'
  and 'Cycling'. While the 'Cycling' LED is suitable for signaling from
  the OS the others are better off being controlled by the firmware.
  The device name for the 'Cycling' LED of each board is /dev/led/boardX
  where X is the physical slot number of the board. [1]

Obtained from:	OpenBSD [1]
Tested by:	joerg [1]
2005-03-19 00:50:28 +00:00
Marius Strobl
4d9d925bbc Enrich with some register descriptions and additional register macros.
Obtained from:	OpenBSD
2005-03-19 00:48:34 +00:00
Marius Strobl
7e51ba980a - Add a device interface method for bus_get_resource_list() and use
bus_generic_rl_release_resource() for the bus_release_resource() method
  instead of a local copy.
- Correctly handle pass-through allocations in central_alloc_resource().
2005-03-19 00:47:02 +00:00
David Schultz
ab3ac78792 Remove dead code.
Found by:	Coverity Prevent analysis tool
2005-03-18 22:33:10 +00:00
David Schultz
938838feb1 Don't brelse(bp) if bp is null. Also, eliminate some redundancy
and dead code.

Found by:	Coverity Prevent analysis tool
2005-03-18 21:23:32 +00:00
David Schultz
010b1ca16e Move the swap_zone == NULL check earlier (i.e. before we dereference
the pointer.)

Found by:	Coverity Prevent analysis tool
2005-03-18 21:22:48 +00:00
David Schultz
f7fdcd45f0 Add missing cases for PT_SYSCALL.
Found by:	Coverity Prevent analysis tool
2005-03-18 21:22:28 +00:00
Warner Losh
3eafe746ab Need to initialize the resource list that we keep for our children.
STAILQ's require this, while it is optional for SLIST (well, as long
as the memory is bzeroed).

Noticed by: phk's crash
2005-03-18 16:37:51 +00:00
Murray Stokely
991f5121f0 Add a comment to note that pseudo-device bpf is required for DHCP.
This is mentioned in the Handbook but it is not as obvious to new
users why bpf is needed compared to the other largely self-explanatory
items in GENERIC.

PR:		conf/40855
MFC after:	1 week
2005-03-18 15:24:00 +00:00
Gleb Smirnoff
ee6f227017 If vhid exists return more informative EEXIST instead of EINVAL. While here
remove redundant brackets.
2005-03-18 13:41:38 +00:00
Maxim Sobolev
2322a0a77d Impose the upper limit on signals that are allowed between kernel threads
in set[ug]id program for compatibility with Linux. Linuxthreads uses
4 signals from SIGRTMIN to SIGRTMIN+3.

Pointed out by:		rwatson
2005-03-18 13:33:18 +00:00
Gleb Smirnoff
9860bab349 Fix a potential crash that could occur when CARP_LOG is being used.
Obtained from:	OpenBSD (pat)
2005-03-18 13:18:34 +00:00
Poul-Henning Kamp
1ea7a6f806 Use subr_unit to allocate thread ID's with.
Tested by:	davidxu
2005-03-18 12:34:14 +00:00
Poul-Henning Kamp
be1bf4d2b8 s/SLIST/STAILQ/
/imp/a\
pointy hat
.
2005-03-18 11:57:44 +00:00
Maxim Sobolev
f9cd63d436 Linuxthreads uses not only signal 32 but several signals >= 32.
PR:		kern/72922
Submitted by:	Andriy Gapon <avg@icyb.net.ua>
2005-03-18 11:08:55 +00:00
Poul-Henning Kamp
60c5621a8d makebdev() is long gone. 2005-03-18 10:57:11 +00:00
Ian Dowse
60719a1a44 Split configure() into 3 separate steps like we do on other
architectures. This makes it possible to insert hooks before and
after the device attachment step.

Tested thanks to:	marcel
2005-03-18 09:45:43 +00:00
Philip Paeps
a7b1b2b6ca Hook acpi_fujitsu up to the build.
Forgotten by:	philip
2005-03-18 09:34:52 +00:00
Philip Paeps
9a8b554fc2 Add acpi_fujitsu for handling acpi-controlled buttons on Fujitsu laptops.
Submitted by:	Anish Mistry <mistry.7 -at- osu.edu>
Reviewed by:	njl
X-MFC after:	5.4-RELEASE
2005-03-18 08:48:10 +00:00
Poul-Henning Kamp
f7e6cbd933 Fix off-by-one (too little!) array size problem.
Detected by:	Coverity (ID#661)
2005-03-18 07:13:35 +00:00
Poul-Henning Kamp
cb7ff8b71d g_read_data() can return NULL, check for it.
Found by:	Coverity (ID#258)
2005-03-18 07:03:56 +00:00
Poul-Henning Kamp
b3fd9b46bb After rejecting the bio request early, return instead of panicing.
Found by:	Coverity (ID#450)
2005-03-18 07:01:31 +00:00
Poul-Henning Kamp
b3b21113a5 Avoid null pointer dereference. 2005-03-18 06:57:58 +00:00
Poul-Henning Kamp
a1e1d551d8 Fix a bad copy&paste mistake I made.
Spotted by:	truckman
2005-03-18 06:01:21 +00:00
David Schultz
730eb84011 If mlx_attach() returns an error, don't free sc again.
Spotted by:	Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by:	scottl
2005-03-18 05:43:37 +00:00
David Schultz
14f1a8cc08 Don't read past the end of pVDevice[]. (Previously, we would iterate
twice as many times as there were entries in the array.)

Spotted by:	Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by:	scottl
2005-03-18 05:43:34 +00:00
David Schultz
844b51308e Don't write past the end of the VendorId field (and into the ProductId
field).

Spotted by:	Ted Unangst using the Coverity Prevent static analysis tool
Reviewed by:	scottl
2005-03-18 05:43:31 +00:00
Warner Losh
36fed96550 Use STAILQ in preference to SLIST for the resources. Insert new resources
last in the list rather than first.

This makes the resouces print in the 4.x order rather than the 5.x order
(eg fdc0 at 0x3f0-0x3f5,0x3f7 is 4.x, but 0x3f7,0x3f0-0x3f5 is 5.x).  This
also means that the pci code will once again print the resources in BAR
ascending order.
2005-03-18 05:19:50 +00:00
Peter Grehan
b1fab0ffc0 Split configure into 3 steps ala sparc64
Obtained from:  iedowse, sparc64
2005-03-18 03:29:39 +00:00
John-Mark Gurney
c4c44d2935 fix aio+kq... I've been running ambrisko's test program for much longer
w/o problems than I was before...  This simply brings back the knote_delete
as knlist_delete which will also drop the knote's, instead of just clearing
the list and seeing _ONESHOT...

Fix a race where if a note was _INFLUX and _DETACHED, it could end up being
modified... whoopse..

MFC after:	1 week
Prodded by:	ambrisko and dwhite
2005-03-18 01:11:39 +00:00
Olivier Houchard
3ea9d07445 Bring back some of the cleanups and fixes jmg did in the TS7200 port. 2005-03-17 23:01:15 +00:00
Bernd Walter
65a5e4be3d initialize pp->p_sc so it can be referenced later.
dynamicaly allocate the per port array.
allow up to 32 serials per USB device.
ask the device for correct pipe sizes.
2005-03-17 22:47:18 +00:00
Nate Lawson
8f76495941 Introduce a general name for the previously cmbat-only ioctls. It has the
same value as the previous ioctls so no binary change.  Also, make a few
style changes to reduce diffs to my tree.

Loosely based on code from:	Hans Petter Selasky
2005-03-17 22:42:49 +00:00
David Schultz
c513b0c567 Initialize the mxcsr properly, so the initial value in a process isn't
just the value that was left over from some other application.
2005-03-17 22:21:36 +00:00
Warner Losh
092cb1258f When locking a MTX_SPIN, one needs to use mtx_lock_spin.
Lock the timeout routine as well.

Submitted by: bde
2005-03-17 20:45:24 +00:00
Ian Dowse
54070562ef Split configure() into 3 separate steps like we do on other
architectures. This makes it possible to insert hooks before and
after the device attachment step.
2005-03-17 20:31:36 +00:00
Ian Dowse
a7b66eb1ae Defer boot-time exploration of USB busses until all devices in the
system have been attached, but no later. This ensures that we do
not explore ohci or uhci busses before the companion echi controller
has been initialised, so it should fix the problem of multi-speed
USB devices getting attached as USB 1 devices first and then
re-attached as USB 2.

Some further changes are needed on architectures that do not currently
allow hooks to be inserted before configure_final() - alpha, ia64,
powerpc and sparc64. On these architectures the exploration will
now be delayed until the usb kthread runs.
2005-03-17 19:41:19 +00:00
John-Mark Gurney
7ac139a904 add m_copyup function.. This can be used to help make our ip stack less
alignment restrictive, and help performance on some ethernet cards which
currently copy the entire packet a couple bytes to get the packet aligned
properly...

Wordsmithing by:	dwhite
Obtained from:	NetBSD (code only)
I'll clean it up later:	rwatson
2005-03-17 19:34:57 +00:00
Warner Losh
7378822d3c eisa attachment is safe to be in this module, both on eisa and
non-eisa configured kernels.
2005-03-17 18:40:37 +00:00
Warner Losh
3c964602bd Now that the Adaptec 2842 has its own probe routine, no need to have
a comment saying its probe routine needs to be fixed.
2005-03-17 17:36:07 +00:00
Warner Losh
f9f5f61140 Style(9) pass before some planned larger changes.
o return (foo);
o if (a == NULL) in preference to if (!a)
o () and {} reduction
o minor indentation fixes
2005-03-17 17:33:52 +00:00
Robert Watson
bc60830675 A further step on the journey of meaking panics and debugging more reliable:
in the window between the beginning of panic() and entering the debugger,
it's possible to receive interrupts.  If we receive an interrupt, don't
preempt if panicstr != NULL, as the system is in the process of failing, and
the preempting thread is likely to stumble over the failure.  The typical
scenario is during the printf() in panic() prior to entering the debugger,
but when running with a slower console type such as serial console.

It could be that the panic string should be passed to the debugger to print,
so that it can run from the debugger's environment rather than a regular
kernel printf.

Glanced at by:	jhb
2005-03-17 15:18:01 +00:00
Poul-Henning Kamp
c049546e16 Also remember to set the fsid here. 2005-03-17 15:15:29 +00:00
Poul-Henning Kamp
e3b803b148 Forgot to replace code to set fsid in vop_getattr. 2005-03-17 14:43:40 +00:00
Bjoern A. Zeeb
e7f8ebb45e Do not try to free non allocated memory in error case.
Do our best to plug some memory leaks (VPD data, jumbo memory buffer,...).
Log if we cannot free because memory still in use[1].
Change locking to avoid ''acquiring duplicate lock of same
  type: "network driver"'' and potential deadlock. Also seems to fix LOR #063.

[1] This change does not solve problems if buffers are still in use when
    unloading if_sk.ko. There is ongoing work which will address jumbogram
    allocations in a more general way.

PR:		kern/75677 (with changes, no mii fixes in here)
Tested by:	net, Antoine Brodin (slightly different version)
Approved by:	rwatson (mentor)
MFC after:	5 days
2005-03-17 14:27:22 +00:00
Bjoern A. Zeeb
9f0877efe3 * Lower interrupt moderation timer 200->100.
Obtained from:	NetBSD if_sk.c rev. 1.11

* Make interrupt moderation configurable via sysctl/tuneable.
PR:		kern/41220
Approved by:	rwatson (mentor)
2005-03-17 14:23:13 +00:00
Bjoern A. Zeeb
2dfd4c0a21 * Improve chip identification.
Obtained from:	NetBSD if_sk.c rev. 1.11

* Take PHY out of reset for Yukon Lite Rev. A3.
Submitted by:	postings on net@ in thread "skc0: no PHY found", 2005-02-22

Tested by:	net
Approved by:	rwatson (mentor)
MFC after:	5 days
2005-03-17 14:21:51 +00:00
Bjoern A. Zeeb
d34019b31e * When adding/deleting multicast addresses, only whack the address filter
if the interface is marked RUNNING.
Obtained from:	NetBSD if_sk.c rev. 1.12

* Don't initialize the card (and start an autonegotiation) every time the IP
  address changes. Makes 'dhclient sk0' invocations way faster and more
  consistant. i.e. one DHCPREQUEST elicits the DHCPACK.
Obtained from:	OpenBSD if_sk.c rev. 1.56

* Additional locking changes in sk_ioctl.

PR:		kern/61296 should see improvements by the last two.
Approved by:	rwatson (mentor)
MFC after:	5 days
2005-03-17 14:18:58 +00:00
Tai-hwa Liang
60c38bde75 Releasing TX/RX descriptor dmamaps during device detachment instead of
doing that in bfe_stop().

This should fix a panic recently reported on -current occuring when taking
device down then up.  In the original implementation, an "ifconfig bfe0 down"
triggers bfe_stop(), which also destroys all TX/RX descriptor dmamaps. Hence
the subsequent "ifconfig bfe0 up" would force the device to use those
already-released dmamap and thus panic the kernel.

PR:		kern/77804
Submitted by:	Frank Mayhar <frank at exit dot com>
Reviewed by:	dmlb, sam (mentor)
Tested by:	Phil <pcasidy at casidy dot com>, myself
MFC after:	1 week
2005-03-17 13:59:30 +00:00
Poul-Henning Kamp
bde1a9c98b Kill MAJOR_AUTO 2005-03-17 13:37:28 +00:00
Poul-Henning Kamp
800b42bde0 Prepare for the final onslaught on devices:
Move uid/gid/mode from cdev to cdevsw.

Add kind field to use for devd(8) later.

Bump both D_VERSION and __FreeBSD_version
2005-03-17 12:07:00 +00:00
Jeff Roberson
ee39666a76 - Don't lock the vnode interlock in vm_object_set_writeable_dirty() if
we've already set the object flags.

Reviewed by:	alc
2005-03-17 12:03:42 +00:00
Jeff Roberson
ba73105324 - Lock the clearing of v_data so it is safe to inspect it with the
interlock.

Sponsored by:	Isilon Systems, Inc.
2005-03-17 12:00:05 +00:00
Jeff Roberson
23d15e852d - Lock the clearing of v_data in ufs_reclaim() to prevent a pagefault
in ffs_lock() when it acesses v_data without the vnlock.

Sponsored by:	Isilon Systems, Inc.
2005-03-17 11:58:43 +00:00
Poul-Henning Kamp
cac283487f Remove unused variable.
Detected by:	Coverity (ID#704)
2005-03-17 09:32:37 +00:00
Poul-Henning Kamp
572b4402d1 In stange circumstances we may end up being the last reference to a
session in tprintf().   SESSRELE() needs to properly dispose of the
sessions mutex.

Add sessrele() which does the proper cleanup and have SESSRELE() call it.

Use SESSRELE also in pgdelete().

Found by:	Coverity (ID:526)
2005-03-17 08:44:41 +00:00
Olivier Houchard
641a67bed4 Bring back some of the ioctl junk that was removed in rev 1.59 as a
i386-only kernel option, ASR_COMPAT, and under BURN_BRIDGES.
It is really ugly, but raidutils depends on it.

Discussed with:	scottl
2005-03-17 01:20:49 +00:00
Olivier Houchard
4290208c24 Use PCIR_BARS instead of PCIR_MAPS. 2005-03-17 00:43:57 +00:00
Olivier Houchard
2eeafe13a6 Introduce a new function, pmap_wb_page(), which check all userland mappings for
a given page and, if the pmap is the current pmap, write back the associated
cache line.
Use pmap_wb_page in pmap_qenter() instead of inconditionally
write back/invalidating the data cache.
2005-03-16 23:56:29 +00:00
Warner Losh
bdb111b85c Remove comments relevant only to pc98 as there are no amd64 pc98 machines. 2005-03-16 20:55:15 +00:00
Warner Losh
d564c8537d Customize this for the alpha by removing pc98 defines (unused on alpha)
as well as saying that the alpha is wired up in a certain way.
2005-03-16 20:54:48 +00:00
Pawel Jakub Dawidek
42cfb5bada Plug memory leak.
Submitted by:	Ted Unangst
Found by:	Coverity Prevent analysis tool
Approved by:	phk
MFC after:	3 days
2005-03-16 20:48:13 +00:00
Warner Losh
402f124a2b Eleminate 3 PC98 ifdefs:
o Use IP_NPX in preference to hard coded value to write 0 to clear busy#
o Use md macro for a full reset of the npx
o Use IRQ_NPX in preference to hard coded value for each platform.

# The other two ifdefs in this file are hard to remove
2005-03-16 20:46:16 +00:00
Warner Losh
8afd8dde0c Define IRQ_NPX for the irq used for the npx. Define macro for a full
reset of of npx, as appropriate for the platform.
2005-03-16 20:44:19 +00:00
Sam Leffler
bd40429e3d correct comparison for null ptr
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:42:00 +00:00
Sam Leffler
6edf09a6e9 avoid potential array index by -1
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:40:48 +00:00
Sam Leffler
20098591be eliminate use after free in debug code
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:39:05 +00:00
Sam Leffler
0796482dd1 kill dead code
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:35:23 +00:00
Warner Losh
c276d9545b bus_alloc_resource must obey the same rules as
rman_resource_resournce_bound wrt end parameter.  The end parameter
here was the same as the start.  However, it should be start + count -
1, so make it that instead.
2005-03-16 20:31:46 +00:00
David E. O'Brien
bf6fabdd60 Make it clear nve needs mii, and shorten long comment line. 2005-03-16 20:23:31 +00:00
Maxime Henrion
c4bf1e9092 Unload and destroy the TX DMA maps before destroying the DMA tag
they're attached to, not after.

Spotted by:	Coverity via sam
2005-03-16 16:39:04 +00:00
Poul-Henning Kamp
8b5505c013 Use vfs_hash. 2005-03-16 11:28:19 +00:00
Poul-Henning Kamp
51f5ce0c8c Add two arguments to the vfs_hash() KPI so that filesystems which do
not have unique hashes (NFS) can also use it.
2005-03-16 11:20:51 +00:00
Poul-Henning Kamp
9ed94841d9 Remove unused file 2005-03-16 11:10:38 +00:00
Poul-Henning Kamp
9068e77689 Fix a memoryleak in case of failed root filesystem mount.
Spotted by:     Coverity via sam
2005-03-16 11:06:49 +00:00
John-Mark Gurney
7f76b06b35 MFp4: use the function to fix the packet header length instead of rolling
our own...
2005-03-16 08:13:08 +00:00
Poul-Henning Kamp
fd475cc19d Remove inode fields previously used for private inode hash tables. 2005-03-16 08:09:52 +00:00
John-Mark Gurney
2a77000b75 MFp4: print a more useful error when we don't have a /dev to mount devfs
on..
2005-03-16 08:04:39 +00:00
John-Mark Gurney
98c8f18cf0 MFp4: add in making fiq's work by coping to the correct page incase we have
the vectors relocated high..
2005-03-16 07:56:21 +00:00
John-Mark Gurney
c28a40615d fix up white space, I had a simple comment fix, but I might as well do the
rest while I'm here...
2005-03-16 07:53:02 +00:00
Poul-Henning Kamp
78bb3c21ed Add mnt_hashseed to struct mount and initialize it witn PRNG bits, use
it to get better hashing in vfs_hash.

In case of an insert collision in vfs_hash_insert(), put the loosing vnode
on a special list so that vfs_hash_remove() can just assume that it is on
a list.

Drop the VI_HASHED flag.
2005-03-16 07:35:06 +00:00
Poul-Henning Kamp
beddd41467 XXX: unnecessary pointer in inode. 2005-03-16 07:21:38 +00:00
Poul-Henning Kamp
7e1dd21ccf Don't store the disk cdev in all inodes. 2005-03-16 07:17:39 +00:00
Poul-Henning Kamp
6992367999 Don't hold a reference to the disk vnode for each inode.
Don't store the disk cdev in all inodes, it's only used for debugging
printfs.
2005-03-16 07:13:09 +00:00
Sam Leffler
6a9909b5e6 plug resource leak
Noticed by:	Coverity Prevent analysis tool
2005-03-16 05:27:19 +00:00
Sam Leffler
6c011e4dc3 correct bounds check
Noticed by:	Coverity Prevent analysis tool
2005-03-16 05:11:11 +00:00
Ian Dowse
7fe25a5726 Enable ehci by default on i386 and amd64. It had got to the stage
where having this disabled was actually hurting us, since so many
BIOSes include legacy USB emulation that takes control of all usb
ports and only the ehci driver knows how to disable it.
2005-03-16 02:34:50 +00:00
John-Mark Gurney
de71467ca7 make bus_dmamem_alloc always allocate a new map like we are suppose to..
This was found when I tried to run the usb code on my arm board...

Approved by:	cognet
2005-03-16 00:35:59 +00:00
Warner Losh
463ec0ac87 If bus_generic_susped returns an error, devlist is not freed. Free it.
Submitted by: Ted Unangst (using the Coverity Prevent analysis tool)
2005-03-15 22:53:31 +00:00
Poul-Henning Kamp
e0251bbbe7 Don't hold a reference to the disk vnode for each inode.
Eliminate cdev and vnode pointer to the disk from the inodes,
the mount holds everything we need.
2005-03-15 21:09:52 +00:00
Poul-Henning Kamp
3b97f388d8 Eliminate cdev pointer in inodes, they're not used or needed.
The cdev could have been pulled out of the mountpoint cheaper back
when it was used anyway.
2005-03-15 20:57:25 +00:00
Poul-Henning Kamp
de68347b1b Don't hold a reference on the disk vnode for each inode. 2005-03-15 20:50:58 +00:00
Warner Losh
358fef538f Sometimes, when asked to return region A..C, we'd return A+N..C+N
instead of failing.

When looking for a region to allocate, we used to check to see if the
start address was < end.  In the case where A..B is allocated already,
and one wants to allocate A..C (B < C), then this test would
improperly fail (which means we'd examine that region as a possible
one), and we'd return the region B+1..C+(B-A+1) rather than NULL.
Since C+(B-A+1) is necessarily larger than C (end argument), this is
incorrect behavior for rman_reserve_resource_bound().

The fix is to exclude those regions where r->r_start + count - 1 > end
rather than r->r_start > end.  This bug has been in this code for a
very long time.  I believe that all other tests against end are
correctly done.

This is why sio0 generated a message about interrupts not being
enabled properly for the device.  When fdc had a bug that allocated
from 0x3f7 to 0x3fb, sio0 was then given 0x3fc-0x404 rather than the
0x3f8-0x3ff that it wanted.  Now when fdc has the same bug, sio0 fails
to allocate its ports, which is the proper behavior.  Since the probe
failed, we never saw the messed up resources reported.

I suspect that there are other places in the tree that have weird
looping or other odd work arounds to try to cope with the observed
weirdness this bug can introduce.  These workarounds should be located
and eliminated.

Minor debug write fix to match the above test done as well.

'nice' by: mdodd
Sponsored by: timing solutions (http://www.timing.com/)
2005-03-15 20:28:51 +00:00
Warner Losh
a33ab77447 Fix a debugging printf. The order of start/end was inconsistant with
all the other start/end debugs, causing momentary confusion when the
output was examined.
2005-03-15 20:15:15 +00:00
Poul-Henning Kamp
45c26fa2b6 Improve the vfs_hash() API: vput() the unneeded vnode centrally to
avoid replicating the vput in all the filesystems.
2005-03-15 20:00:03 +00:00
David E. O'Brien
0c3a1acbbb Remove OBE comment about AMD64 memory model. 2005-03-15 18:44:51 +00:00
David E. O'Brien
0ed36875f4 Ensure GCC does not use FP registers in integer code.
I think all we really need is -fno-sse2.
I really don't like cluttering up the compiler invocation,
but this bigger hammer will fix reported problems for now.
2005-03-15 18:43:36 +00:00
David Schultz
7b74e4a759 Remove fpsetsticky(). This was added for SysV compatibility, but due
to mistakes from day 1, it has always had semantics inconsistent with
SVR4 and its successors.  In particular, given argument M:

- On Solaris and FreeBSD/{alpha,sparc64}, it clobbers the old flags
  and *sets* the new flag word to M.  (NetBSD, too?)
- On FreeBSD/{amd64,i386}, it *clears* the flags that are specified in M
  and leaves the remaining flags unchanged (modulo a small bug on amd64.)
- On FreeBSD/ia64, it is not implemented.

There is no way to fix fpsetsticky() to DTRT for both old FreeBSD apps
and apps ported from other operating systems, so the best approach
seems to be to kill the function and fix any apps that break.  I
couldn't find any ports that use it, and any such ports would already
be broken on FreeBSD/ia64 and Linux anyway.

By the way, the routine has always been undocumented in FreeBSD,
except for an MLINK to a manpage that doesn't describe it.  This
manpage has stated since 5.3-RELEASE that the functions it describes
are deprecated, so that must mean that functions that it is *supposed*
to describe but doesn't are even *more* deprecated.  ;-)

Note that fpresetsticky() has been retained on FreeBSD/i386.  As far
as I can tell, no other operating systems or ports of FreeBSD
implement it, so there's nothing for it to be inconsistent with.

PR:		75862
Suggested by:	bde
2005-03-15 15:53:39 +00:00
John-Mark Gurney
19015c15ed fix arm wrt to busdma...
also wrap the two macros that have bare if's w/ do {} while(0) so that
my epe driver doesn't get a warning about braces around confused else...
2005-03-15 14:57:30 +00:00
Jeff Roberson
b172f6c5f9 - Now that there are no external users of vfree() make it static.
- Move VSHOULDBUSY, VSHOULDFREE, and VTRYRECYCLE into vfs_subr.c so
   no one else attempts to grow a dependency on them.
 - Now that objects with pages hold the vnode we don't have to do unlocked
   checks for the page count in the vm object in VSHOULDFREE.  These three
   macros could simply check for holdcnt state transitions to determine
   whether the vnode is on the free list already, but the extra safety
   the flag affords us is probably worth the minimal cost.
 - The leafonly sysctl and code have been dead for several years now,
   remove the sysctl and the code that employed it from vtryrecycle().
 - vtryrecycle() also no longer has to check the object's page count as
   the object holds the vnode until it reaches 0.

Sponsored by:	Isilon Systems, Inc.
2005-03-15 14:38:16 +00:00
Jeff Roberson
761dbeb66f - In vm_page_insert() hold the backing vnode when the first page
is inserted.
 - In vm_page_remove() drop the backing vnode when the last page
   is removed.
 - Don't check the vnode to see if it must be reclaimed on every
   call to vm_page_free_toq() as we only check it now when it is
   actually required.  This saves us two lock operations per call.

Sponsored by:	Isilon Systems, Inc.
2005-03-15 14:14:09 +00:00
Jeff Roberson
1bf9ee92ff - Remove the now unused LK_THISLAYER. 2005-03-15 14:12:10 +00:00
Poul-Henning Kamp
7933351a28 Fix a debug message to print a usable device name rather than useless
major+minor tupple.
2005-03-15 14:08:10 +00:00
Jeff Roberson
bc855512c8 - Assume that all lower filesystems now support proper locking. Assert
that they set v->v_vnlock.  This is true for all filesystems in the
   tree.
 - Remove all uses of LK_THISLAYER.  If the lower layer is locked, the
   null layer is locked.  We only use vget() to get a reference now.
   null essentially does no locking.  This fixes LOOKUP_SHARED with
   nullfs.
 - Remove the special LK_DRAIN considerations, I do not believe this is
   needed now as LK_DRAIN doesn't destroy the lower vnode's lock, and
   it's hardly used anymore.
 - Add one well commented hack to prevent the lowervp from going away
   while we're in it's VOP_LOCK routine.  This can only happen if we're
   forcibly unmounted while some callers are waiting in the lock.  In
   this case the lowervp could be recycled after we drop our last ref
   in null_reclaim().  Prevent this with a vhold().
2005-03-15 13:49:33 +00:00
Jeff Roberson
c178628d6e - Expose vholdl() so it may be used outside of vfs_subr.c 2005-03-15 13:43:10 +00:00
Poul-Henning Kamp
4ba679d6d0 Remove findcdev(). 2005-03-15 12:58:08 +00:00
Poul-Henning Kamp
d39ae27c16 Polish. 2005-03-15 12:47:59 +00:00
Poul-Henning Kamp
7649bbb0b0 Disable two users of findcdev. They do the wrong thing now and will
need to be fixed.  In both cases the API should be reengineered to do
something (more) sensible.
2005-03-15 12:39:30 +00:00
Poul-Henning Kamp
bbbc2d967e Neuter the duplicated disk-device magic code for now. Somebody with
serious linux-clue is necessary to fix this properly.
2005-03-15 11:58:40 +00:00
Peter Grehan
01b7183fdd Prepend underscore to bus_dmamap_{unload|sync} in line with
recent busdma changes.
2005-03-15 11:43:05 +00:00
Peter Grehan
bc54a0234a Include <sys/signalvar.h> for trapsignal prototype. 2005-03-15 11:41:55 +00:00
Peter Grehan
c10763d40c Long overdue sync-up with ATA code 2005-03-15 11:41:05 +00:00
Poul-Henning Kamp
0a2e49f1f8 Rename cdev->si_udev to cdev->si_drv0 to reflect the new nature of
the field.
2005-03-15 11:33:28 +00:00
Jeff Roberson
9feb7408f8 - We have to transfer lockers after reseting our vnlock pointer.
Sponsored by:	Isilon Systems, Inc.
2005-03-15 11:28:45 +00:00
Poul-Henning Kamp
46d7d4a332 Don't export major,minor, instead export tty name. 2005-03-15 11:05:11 +00:00
Poul-Henning Kamp
8cca74f2db Clean up forward struct decls. 2005-03-15 10:52:17 +00:00
Poul-Henning Kamp
20b3501394 forward declare struct disk. 2005-03-15 10:47:38 +00:00
Poul-Henning Kamp
6bc6a87cc9 Print devtoname() instead of minor(). 2005-03-15 10:01:31 +00:00
Poul-Henning Kamp
40d04a26a0 Fix typo: pointers are not boolean in style(9). 2005-03-15 10:01:14 +00:00
Poul-Henning Kamp
0f64ffc025 Move devtoname() prototype to systm.h to reduce #include pollution,
it is (or should be) used in many printf() calls.
2005-03-15 09:30:17 +00:00
Jeff Roberson
f5f0da0a0e - transferlockers() requires the interlock to be SMP safe.
Sponsored by:	Isilon Systems, Inc.
2005-03-15 09:27:45 +00:00
Poul-Henning Kamp
e82ef95c11 Simplify the vfs_hash calling convention. 2005-03-15 08:07:07 +00:00
Warner Losh
356eadcdd6 If we fail a sanity check for the resources just allocated, make sure
that we free that resource.  All the other resources are freed in
their own routine, but since we haven't saved a pointer to this one,
it is leaked.  This is the failure case that lead to the sio ports
that weren't working, I think.
2005-03-15 08:02:47 +00:00
Jeff Roberson
4483fe9227 - Destroy the vnode object earlier in VOP_RECLAIM as we need more of
the vnode valid before the vm flushes pages.
 - Get rid of some extraneous uses of the vnode interlock.

Sponsored by:	Isilon Systems, Inc.
2005-03-15 01:42:58 +00:00
Robert Watson
d2bc35ab29 In tcp_usr_send(), broaden coverage of the socket buffer lock in the
non-OOB case so that the sbspace() check is performed under the same
lock instance as the append to the send socket buffer.

MFC after:	1 week
2005-03-14 22:15:14 +00:00
Gleb Smirnoff
30afbe338b Remove ng_connect_t where it is unused. Probably it remained from ng_source.c. 2005-03-14 20:49:48 +00:00
Gleb Smirnoff
8633e59c17 Use subr_unit allocator instead of own functions. 2005-03-14 20:11:29 +00:00
Gleb Smirnoff
933fedbacc Use subr_unit allocator instead of own functions. 2005-03-14 19:25:24 +00:00
Warner Losh
d90aafb50d Only allocate 1 port for non-zero rids. Either we'll get the proper
length form the enumeration mechanism, or we're dealing with the FDCTL
register, which is only 1 port long.
2005-03-14 19:09:29 +00:00
Scott Long
5974e5c71c Refactor the bus_dma header files so that the interface is described in
sys/bus_dma.h instead of being copied in every single arch.  This slightly
reorders a flag that was specific to AXP and thus changes the ABI there.
The interface still relies on bus_space definitions found in <machine/bus.h>
so it cannot be included on its own yet, but that will be fixed at a later
date.  Add an MD <machine/bus_dma.h> for ever arch for consistency and to
allow for future MD augmentation of the API.  sparc64 makes heavy use of
this right now due to its different bus_dma implemenation.
2005-03-14 16:46:28 +00:00
Dag-Erling Smørgrav
0e3b5c73b2 Hook pfs_lookup() up to vfs_cachedlookup_desc instead of vfs_lookup_desc,
as suggested by Matt's comment.  Also fix some style and paranoia issues.

The entire function could benefit from review by a VFS guru.

MFC after:	6 weeks
2005-03-14 16:24:50 +00:00
Dag-Erling Smørgrav
bc593ccd83 Fix two long-standing bugs in pfs_readdir():
Since we used an sbuf of size resid to accumulate dirents, we would end
up returning one byte short when we had enough dirents to fill or exceed
the size of the sbuf (the last byte being lost to bogus NUL termination)
causing the next call to return EINVAL due to an unaligned offset.  This
went undetected for a long time because I did most of my testing in
single-user mode, where there are rarely enough processes to fill the
4096-byte buffer ls(1) uses.  The most common symptom of this bug is that
tab completion of /proc or /compat/linux/proc does not work properly when
many processes are running.

Also, a check near the top would return EINVAL if resid was smaller than
PFS_DELEN, even if it was 0, which is frequently the case and perfectly
allowable.  Change the test so that it returns 0 if resid is 0.

MFC after:	2 weeks
2005-03-14 16:21:32 +00:00
Dag-Erling Smørgrav
cb5abc7d2d If PSEUDOFS_TRACE is defined, create a sysctl knob to enable / disable
pseudofs call tracing.
2005-03-14 16:06:47 +00:00
Dag-Erling Smørgrav
bcc1205c89 Add PSEUDOFS_TRACE option. 2005-03-14 16:04:27 +00:00
Gleb Smirnoff
5cdd064d8a o Use subr_unit allocator. This simplifies code much:
- Remove get_free_unit().
  - Remove SLIST of nodes.
  - Remove global mutex.

o Increase NGD_MAX to 999.
o Move ngd_mod_event() up to netgraph methods.
2005-03-14 16:02:53 +00:00
Dag-Erling Smørgrav
de52d21a02 fbsdidize. 2005-03-14 15:54:11 +00:00
Poul-Henning Kamp
03c02e5cb1 Do not attach MBR on top of an MBR. This removes some confusing
slice names on disks with extended partitions.

Spotted on:	Mother-in-laws computer.
2005-03-14 15:22:18 +00:00
Poul-Henning Kamp
2f00593534 Use vfs_hash instead of home-rolled. 2005-03-14 14:41:37 +00:00
Poul-Henning Kamp
57dafdf543 Forgot cvs rm in last file. 2005-03-14 13:30:45 +00:00
Poul-Henning Kamp
9236b51d40 Use vfs_hash() instead of home-rolled 2005-03-14 13:30:06 +00:00
Poul-Henning Kamp
dfb9f846e9 Use vfs_hash instead of home-rolled. 2005-03-14 13:22:41 +00:00
Poul-Henning Kamp
4e94fafc4f Use vfs_hash instead of home-rolled.
Correct locking around g_vfs_close()
2005-03-14 12:29:39 +00:00
Poul-Henning Kamp
a30fc63b19 Use vfs_hash instead of home-rolling. 2005-03-14 12:24:35 +00:00
Poul-Henning Kamp
ee148e2606 Cleanup accidentally include #if 0 section. 2005-03-14 10:25:09 +00:00
Poul-Henning Kamp
da44811ef6 Remove ufs_ihash.c here as well. 2005-03-14 10:23:34 +00:00
Poul-Henning Kamp
14bc0685ac Use vfs_hash instead of home-rolled. 2005-03-14 10:21:16 +00:00
Poul-Henning Kamp
6c325a2a21 Currently (almost) all filesystems maintain a local inode hash table
to get from (mount + inode) to vnode.  These tables are mostly
copy&pasted from UFS, sized based on desiredvnodes and therefore
quite large (128K-512K).  Several filesystems are buggy enough that
they allocate the hash table even before they know if they will
ever be used or not.

Add "vfs_hash", a system wide hash table, which will replace all
the per-filesystem hash-tables.

The fields we add to struct vnode will more or less be saved in
the respective filesystems inodes.

Having one central implementation will save code and will allow us
to justify the complexity of code to dynamically (re)size the hash
at a later point.
2005-03-14 10:01:29 +00:00
Jeff Roberson
8045557f2b - Increment the holdcnt once for each usecount reference. This allows us
to use only the holdcnt to determine whether a vnode may be recycled,
   simplifying the V* macros as well as vtryrecycle(), etc.

Sponsored by:	Isilon Systems, Inc.
2005-03-14 09:25:19 +00:00
Jeff Roberson
7747c03884 - Don't directly adjust v_usecount, use vref() instead.
Sponsored by:	Isilon Systems, Inc.
2005-03-14 09:03:19 +00:00
Jeff Roberson
159b454819 - We do not have to check the object's ref_count in VSHOULDFREE or
vtryrecycle().  All obj refs also ref the vnode.
 - Consistently use v_incr_usecount() to increment the usecount.  This will
   be more important later.

Sponsored by:	Isilon Systems, Inc.
2005-03-14 08:30:31 +00:00
Jeff Roberson
1d39df3fe9 - Retire OLOCK and OWANT. All callers hold the vnode lock when creating
a vnode object.  There has been an assert to prove this for some time.

Sponsored by:	Isilon Systems, Inc.
2005-03-14 07:29:40 +00:00
Jeff Roberson
8f13a540ed - Slightly rearrange vrele() to move the common case in one indentation
level.

Sponsored by:	Isilon Systems, Inc.
2005-03-14 07:16:55 +00:00
Jeff Roberson
6fc16a838c - Rework vget() so we drop the usecount in two failure cases that were
missed by my last commit.

Sponsored by:	Isilon Systems, Inc.
2005-03-14 07:11:19 +00:00
Poul-Henning Kamp
93f6c81e25 Remove debugging printfs. 2005-03-14 06:51:29 +00:00
Ian Dowse
7515d96b78 Add support for the ethernet port in the JVC MP-PRX1 port replicator. 2005-03-14 01:49:00 +00:00
Ian Dowse
bc7744545d Set the split transaction interrupt C-mask correctly. This is the
final piece needed to make split transaction interrupt pipes work,
which I thought I had already committed.
2005-03-14 01:03:50 +00:00
Ian Dowse
f4b4a6b096 The EHCI qTD token has a number of error status bits that are not
cleared if the host controller retries the transfer and is successful,
but we were interpreting these bits as indicating a fatal error.
Ignore these error bits, and instead use the HALTED bit to determine
if the transfer failed. Also update the USBD_STALLED detection to
ignore these bits.

Obtained from: OpenBSD
2005-03-13 23:48:17 +00:00
Scott Long
a07cb0d8a2 The NVE driver doesn't cleanly compile on PAE. 2005-03-13 17:39:19 +00:00
Jeff Roberson
c1e7e9ba9b - VOP_INACTIVE should no longer drop the vnode lock.
Sponsored by:   Isilon Systems, Inc.
2005-03-13 12:18:47 +00:00
Jeff Roberson
8da0046596 - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.
 - VOP_INACTIVE should no longer drop the vnode lock.
 - The vnode lock is required around calls to vrecycle() and vgone().

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:18:25 +00:00
Jeff Roberson
dcc18814ba - It is no longer necessary to lock and unlock the vnode in nfs4_close()
as the top level does this for us now.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:16:45 +00:00
Jeff Roberson
8d8d331063 - VOP_INACTIVE should no longer drop the vnode lock.
Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:15:36 +00:00
Jeff Roberson
c0f681c21d - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:14:56 +00:00
Jeff Roberson
d10f4f44f8 - Catch up with ufs_inode 1.59, ffs_vfsops.c 1.280, and ufs_vnops.c 1.267.
Various changes to support new vgone() locking protocol.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:13:55 +00:00
Jeff Roberson
30144f05f0 - It is no longer necessary to lock and unlock the vnode in nfs_close() as
the top level does this for us now.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:11:23 +00:00
Jeff Roberson
172ffe319a - The c_lock in the coda node does not offer any features over the standard
vnode lock.  Remove the c_lock and use the vn lock in its place.
 - Keep the coda lock functions so that the debugging information is
   preserved, but call directly to the vop_std*lock routines for the real
   functionality.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:09:34 +00:00
Jeff Roberson
3100b70037 - Deadfs may now use the standard vop lock, get rid of dead_lock().
- We no longer have to take the XLOCK state into consideration in any
   routines.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:06:20 +00:00
Jeff Roberson
493d78b3bd - Don't acquire the vnode lock in destroy_vobject, assert that it has
already been acquired by the caller.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:05:05 +00:00
Jeff Roberson
9cbe5da9d5 - It is not legal to access v_data without the vnode lock or interlock
held.  Grab the vnode interlock if LK_INTERLOCK has not been passed in
   so that we can inspect v_data in ffs_lock().

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:04:12 +00:00
Jeff Roberson
fe68abe291 - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.
 - Shorten ffs_reload by one step.  The old check for an inactive vnode
   was slightly racey, and the code which deals with still active vnodes
   is not much more expensive.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:03:14 +00:00
Jeff Roberson
fdcc82276e - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:01:50 +00:00
Jeff Roberson
b5411d4fcb - Fix an assert now that the XLOCK no longer exists.
Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:00:41 +00:00
Jeff Roberson
b6ee8476d3 - In ufs_mknod(), hold the lock across the call to vgone() as that is now
required.
 - In ufs_close(), don't do the EAGAIN vrele hack, the top layer now calls
   vn_start_write before the lock is acquired as it should.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:59:14 +00:00
Jeff Roberson
38d504db44 - Don't drop the lock in ufs_inactive().
- Also in ufs_inactive, don't acquire the vnode interlock where it isn't
   strictly needed.  Also owning the vnode interlock while calling vprint()
   will cause locking assertions to trip.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:57:39 +00:00
Jeff Roberson
0463dc9ef1 - Do a vn_start_write in vn_close, we may write if this is the last ref
on an unlinked file.  We can't know if this is the case until after we
   have the lock.
 - Lock the vnode in vn_close, many filesystems had code which was unsafe
   without the lock held, and holding it greatly simplifies vgone().
 - Adjust vn_lock() to check for the VI_DOOMED flag where appropriate.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:56:28 +00:00
Jeff Roberson
6703c30bb5 - Remove vx_lock, vx_unlock, vx_wait, etc.
- Add a vn_start_write/vn_finished_write around vlrureclaim so we don't do
   writing ops without suspending.  This could suspend the vlruproc which
   should not be a problem under normal circumstances.
 - Manually implement VMIGHTFREE in vlrureclaim as this was the only instance
   where it was used.
 - Acquire a lock before calling vgone() as it now requires it.
 - Move the acquisition of the vnode interlock from vtryrecycle() to
   getnewvnode() so that if it fails we don't drop and reacquire the
   vnode_free_list_mtx.
 - Check for a usecount or holdcount at the end of vtryrecycle() in case
   someone grabbed a ref while we were recycling.  Abort the recycle, and
   on the final ref drop this vnode will be placed on the head of the free
   list.
 - Move the redundant VOP_INACTIVE protection code into the local
   vinactive() routine to avoid code bloat.
 - Keep the vnode lock held across calls to vgone() in several places.
 - vgonel() no longer uses XLOCK, instead callers must hold an exclusive
   vnode lock.  The VI_DOOMED flag is set to allow other threads to detect
   a vnode which is no longer valid.  This flag is set until the last
   reference is gone, and there are no chances for a new ref.  vgonel()
   holds this lock across the entire function, which greatly simplifies
   logic.
 _ Only vfree() in one place in vgone() not three.
 - Adjust vget() to check the VI_DOOMED flag prior to waiting on the lock
   in the LK_NOWAIT case.  In other cases, check after we have slept and
   acquired an exlusive lock.  This will simulate the old vx_wait()
   behavior.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:54:28 +00:00
Jeff Roberson
2b3183a8b7 - A lock is required before calling VOP_REVOKE. Our reference protects us
from accessing another vnode so a naked VOP_LOCK is sufficient.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:47:04 +00:00
Jeff Roberson
9331fd135b - Don't VOP_UNLOCK prior to VOP_REVOKE. The lock is required now.
Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:45:51 +00:00
Jeff Roberson
23f2513a4e - Don't drop the lock in the default inactive handler anymore, VOP_NULL
will do for vop_stdinactive now.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:45:01 +00:00
Jeff Roberson
5e7475a329 - Get rid of VXLOCK, VXWANT, and vx_*. The vnode lock now protects us
against recycling.
 - Modify VSHOULDFREE, VCANRECYCLE, etc. now that certain flags are no
   longer important.  Remove VMIGHTFREE as it is only used in one place.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:44:02 +00:00
Jeff Roberson
4e6746965e - CLOSE, REVOKE, INACTIVE, and RECLAIM are not L L L, that's a locked vnode
on enter, exit, error.  This allows for the removal of the XLOCK.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 11:42:16 +00:00
Gleb Smirnoff
422a115a4a Embrace with #ifdef DEV_CARP carp-related code. 2005-03-13 11:23:22 +00:00
Scott Long
e8447f7027 Fix a null pointer de-ref when passthrough ioctls are issued. This
involves some code shuffle to avoid locking problems.

MFC After: 3 days
2005-03-13 06:25:53 +00:00
Ian Dowse
76d8aa3efe Fix the arrangement of periodic QH tree to give the correct interval
between passes over a QH. Previously the accesses to a QH were
bunched together in time, so the interval was often much longer
than intended. This now appears to match the diagrams in the EHCI
spec, so remove the XXX comment.
2005-03-13 04:07:40 +00:00
Max Laier
37652939bc Unbreak build with POLLING. I should really listen and test with NOTES
instead of the module build.
2005-03-13 01:54:41 +00:00
Alexander Kabaev
721d5bfe2e Allow kernels loaded by pxeboot, which was compiled with LOADER_TFTP_SUPPORT,
to stll be able to mount NFS root as prescribed by DCHP configuration. Since
pxeboot is using TFTP to get to the files, pxeboot can not rely on NFS to
provide it a root directory hande as a side effect. pxeboot has to  make RPC
mount call itself.
2005-03-12 21:26:53 +00:00
Max Laier
52732175c3 ALTQ support for re(4).
Submitted by:	Chris Dionissopoulos, Theo Schlossnagle
PR:		kern/78681
MFC after:	2 weeks
2005-03-12 17:35:37 +00:00
Marius Strobl
082c434426 In uart_cpu_getdev_console() when determinig whether we should use
a serial console anyway because input-device is set to keyboard and
output-device is set to screen but no keyboard is plugged in don't
assume that a device node for the input-device alias exists. While
this is true for RS232 keyboards (the node of the SCC and UART
respectively which controls the keyboard doesn't disappear when no
keyboard is plugged in) this assumption breaks for USB keyboards.
It's most likely also not true for PS/2 keyboards but OFW doesn't
reliably switch to a serial console when the potential keyboard is
a PS/2 one which isn't plugged in so this couldn't be verified
properly.

Reported by:	Will Andrews <will@csociety.org>, obrien
MFC after:	1 week
2005-03-12 17:06:03 +00:00
Pawel Jakub Dawidek
cefcecbefd Function jailed() looks into ucred strcture, so be sure ucred is not NULL.
Reviewed by:	rwatson
MFC after:	1 week
2005-03-12 14:31:04 +00:00
Pawel Jakub Dawidek
d079d0a0d2 Clean up a bit.
Reviewed by:	rwatson
MFC after:	1 week
2005-03-12 14:28:34 +00:00
Robert Watson
59f21d5ab1 Extend the coverage of the accept and socket mutexes in soisconnected()
so that the socket lock is held over the test-and-set removal of the
accept filter option during connect, and the two socket mutex regions
(transition to connected, perform accept filter) are combined.
2005-03-12 13:39:39 +00:00
Gleb Smirnoff
5515c2e793 Add a sysctl net.link.log_link_state_change, which allows to
suppress logging of interface link state changes.

Requested by:	sam, kan
2005-03-12 12:58:03 +00:00
Robert Watson
a59f81d263 Move the logic implementing retrieval of the SO_ACCEPTFILTER socket option
from uipc_socket.c to uipc_accf.c in do_getopt_accept_filter(), so that it
now matches do_setopt_accept_filter().  Slightly reformulate the logic to
match the optimistic allocation of storage for the argument in advance,
and slightly expand the coverage of the socket lock.
2005-03-12 12:57:18 +00:00
Robert Watson
92081a8344 Part two of post-SMPng cleanup of accept filter registration: perform all
allocation up front before grabbing the socket mutex and doing the
registration work.  The result is a lot cleaner.
2005-03-12 12:27:47 +00:00
Yoshihiro Takahashi
0b07d9aaa6 Don't build the nve on pc98. 2005-03-12 10:41:58 +00:00
Yoshihiro Takahashi
f7fdacf1fa MFi386: revision 1.217. 2005-03-12 10:30:06 +00:00
David E. O'Brien
60554c2749 Due to a CVS misfire, I ended up committing the wrong version of this. 2005-03-12 08:02:06 +00:00
Scott Long
46ac170425 MFCi386: Prevent integer underflow that could result in all memory being
consumed.
2005-03-12 07:05:59 +00:00
Scott Long
ba74ba674f Guard against an integer underflow that could cause busdma to eat up all
available RAM.  This also results in the global bounce page limit being
applied to zones instead of globally.

Submitted by: Petr Lampa (in part)
2005-03-12 07:01:53 +00:00
Tai-hwa Liang
d2014b3079 Adding new device ID for BCM5751M support.
Submitted by:	FUJITA Kazutoshi <fujita at soum dot co dot jp>
Reviewed by:	sam (mentor)
2005-03-12 06:51:25 +00:00
David E. O'Brien
bdc172ab8f Used unsigned version.
Submitted by:	jmallett
2005-03-12 06:06:04 +00:00
David E. O'Brien
fb2eece6d2 Fix kernel build on 64-bit machines. 2005-03-12 03:50:39 +00:00
Maxime Henrion
56a4dfb981 Fix a long-standing bug in alpha's implementation of busdma. We need to
OR the physical address with alpha_XXX_dmamap_or to get the DMA address,
like the name of the variable suggests.  However, while we were doing
this correctly in the alpha_XXX_dmamap() macro, the busdma code added
the variable to the physical address instead of or'ing it.  Fortunately
and if my math is not entirely wrong, you would need more than 128GB of
RAM and a device able to do DMA in 64bits to experience the bug.

Spotted by:	cognet
2005-03-12 02:43:50 +00:00
David E. O'Brien
1b1a07ad8b FreeBSD consumer bits of the nForce MCP NIC binary blob.
Demanded by:	DES
Encouraged by:	scottl
Obtained from:	q@onthenet.com.au (partially)
KNF'ed by:	obrien
2005-03-12 00:29:30 +00:00
David E. O'Brien
0587a1ea34 This commit was generated by cvs2svn to compensate for changes in r143439,
which included commits to RCS files with non-trunk default branches.
2005-03-12 00:17:37 +00:00
David E. O'Brien
1e5fec6b15 Import the nForce MCP NIC bits. This is version 1.0-0301.
Demanded by:	DES
Encouraged by:	scottl
2005-03-12 00:17:37 +00:00
Peter Wemm
f71692e9be Replace my previous change for 32 bit systems with hz > 169 with Bruce's
simpler one.
2005-03-12 00:13:45 +00:00
Peter Wemm
2afec87508 Make the tty vmin/vtime timeouts work for hz > 169 on 32 bit machines. 2005-03-12 00:10:23 +00:00
Nate Lawson
d81812be67 Correct a last-minute thinko. Instead of copying the nul with the string,
nul-terminate the dp->d_name directly and only copy the string.
2005-03-11 23:35:23 +00:00
Nate Lawson
4cdb148352 The mbnambuf routines combine multiple substrings into a single
long filename.  Each substring is indexed by the windows ID, a
sequential one-based value.  The previous code was extremely slow,
doing a malloc/strcpy/free for each substring.

This code optimizes these routines with this in mind, using the ID
to index into a single array and concatenating each WIN_CHARS chunk
at once.  (The last chunk is variable-length.)

This code has been tested as working on an FS with difficult filename
sizes (255, 13, 26, etc.)  It gives a 77.1% decrease in profiled
time (total across all functions) and a 73.7% decrease in wall time.
Test was "ls -laR > /dev/null".

Per-function time savings:
mbnambuf_init:  -90.7%
mbnambuf_write: -18.7%
mbnambuf_flush: -67.1%

MFC after:	1 month
2005-03-11 23:27:45 +00:00
Peter Wemm
cf4e1c4613 Remove diffs to i386 version that came in via the compiler support ifdefs.
This changes things like whitespace, inconsistent use of #ifndef vs
#if !defined(), different macro argument orders, mismatched comments, etc.
2005-03-11 22:16:09 +00:00