Commit graph

55664 commits

Author SHA1 Message Date
Warner Losh 33521176c6 Go ahead and detach our children in our detach routine. I'm undecided
if we should delete them also or not, but have decided not to do so
for the moment.
2005-09-26 18:22:24 +00:00
Robert Watson 9b7915859d Add "show allpcpu" to DDB, which prints the current CPU id followed by
the per-cpu data for all CPUs.  This is easier to ask users to do than
"figure out how many CPUs you have, now run show pcpu, then run it
once for each CPU you have".

MFC after:	3 days
2005-09-26 16:55:11 +00:00
David Xu 2b7182c6b7 Reorder statements to avoid accessing unknown memory.
In theory, invoking kenv with very long string can panic
kernel.
2005-09-26 14:14:55 +00:00
Robert Watson 454c3d13be Assert v_fifoinfo is non-NULL in fifo_close() in order to catch
non-conforming cases sooner.

MFC after:	3 days
Reported by:	Peter Holm <peter at holm dot cc>
2005-09-26 08:17:03 +00:00
Robert Watson 329c75a730 Acquire Giant in uprintf() and tprintf() rather than asserting it. In
the vast majority of cases, these functions are called without mutexes
held, meaning that in all but two cases, there will be no ordering
issues with doing this, and it will eliminate the need for changes in
the caller.  In two cases, mutexes are held, so Giant must be acquired
before those mutexes such that uprintf() and tprintf() recurse Giant
rather than generating a lock order reversal.

Suggested by:	bde
2005-09-26 08:02:24 +00:00
Nate Lawson 3d8d9f8f2d Fix order and style(9) to match surrounding defs. 2005-09-26 07:45:35 +00:00
Maxim Sobolev b4a98d309e Add dummy support for ifmedia subsystem. This allows devd to see cdce as an
ethernet device and configure IP etc.

Submitted by:	Craig Boston <craig@tobuj.gank.org>
2005-09-26 05:29:46 +00:00
Warner Losh 9f8aaf685b Remove the kernel portion of OLDCARD. I'm working on a replacement
for pccardc dumpcis, but until I'm done with that, I'm leaving pccardc
in place.  As such, I'm leaving the .h files in place for the moment.
2005-09-25 21:29:32 +00:00
Warner Losh f31f999d7d Remove references to OLDCARD. 2005-09-25 21:26:09 +00:00
Warner Losh f60053d1bc OLDCARD is being removed from the tree, so remove it from here.
# the snc pccard entry might be able to be moved to files
2005-09-25 21:24:06 +00:00
Olivier Houchard 0cc67e3dd6 Fix multiple abuses of __RMAN_RESOURCE_VISIBLE in the arm code.
Spotted out by:	phk
2005-09-25 21:06:50 +00:00
Poul-Henning Kamp 5d3ea8713c __RMAN_RESOURCE_VISIBLE not necessary. 2005-09-25 20:21:48 +00:00
Poul-Henning Kamp 11480c10de __RMAN_RESOURCE_VISIBLE not needed. 2005-09-25 20:21:14 +00:00
Poul-Henning Kamp 39f718f3ca Replace __RMAN_RESOURCE_VISIBLE with calls to public entry points
in rman module.
2005-09-25 20:12:30 +00:00
Poul-Henning Kamp 2b35175c8a Add rman_is_region_manager() for the benefit of an alpha hack. 2005-09-25 20:10:10 +00:00
Poul-Henning Kamp 57489b8657 __RMAN_RESOURCE_VISIBLE is not actually needed. 2005-09-25 20:03:41 +00:00
Robert Watson ee47648770 Lock the read socket receive buffer when frobbing the sb_state flag on
that socket during open, not the write socket receive buffer.  This
might explain clearing of the sb_state SB_LOCK flag seen occasionally
in soreceive() on fifos.

MFC after:	3 days
Spotted by:	ups
2005-09-25 19:52:09 +00:00
Poul-Henning Kamp c8e3d92a3a Substitute rman_get_start() for __RMAN_RESOURCE_VISIBLE 2005-09-25 19:48:51 +00:00
Poul-Henning Kamp fcfbabd1d6 This file never needed to see what is in the internal struct resource,
all it needed was a call to rman_get_start().
2005-09-25 19:34:54 +00:00
Scott Long 2eea70515c Overhaul error handling in the IPS driver. Don't use a magic value for
driver-induced errors, instead be better about propagating error status
upwards.  Add more error definitions, courtesy of the linux driver.  Fix
a command leak in the ioctl handler.  Re-arrange some of the command handlers
to localize error handling.

MFC After: 3 days
2005-09-25 17:12:41 +00:00
Warner Losh f8a935ff17 Remove OLDCARD vestiges from here 2005-09-25 01:39:04 +00:00
Warner Losh 50acd0b852 Fix comment 2005-09-25 01:38:02 +00:00
Christian S.J. Peron c47a4d1c9f Implement new world order in VFS locking for extended attributes. This will
remove the unconditional acquisition of Giant for extended attribute related
operations. If the file system is set as being MP safe and debug.mpsafevfs is
1, do not pickup Giant.

Mark the following system calls as being MP safe so we no longer pickup Giant
in the system call handler:

o extattrctl
o extattr_set_file
o extattr_get_file
o extattr_delete_file
o extattr_set_fd
o extattr_get_fd
o extattr_delete_fd
o extattr_set_link
o extattr_get_link
o extattr_delete_link
o extattr_list_file
o extattr_list_link
o extattr_list_fd

-Pass MPSAFE flags to namei(9) lookup and introduce vfslocked variable which
 will keep track of any Giant acquisitions.
-Wrap any fd operations which manipulate vnodes in VFS_{UN}LOCK_GIANT
-Drop VFS_ASSERT_GIANT into function which operate on vnodes to ensure that
 we are sufficiently protected.

I've tested these changes with various TrustedBSD MAC policies which use
extended attribute a lot on SMP and UP systems (thanks to Scott Long for
making some SMP hardware available to me for testing).

Discussed with:	jeff
Requested by:	jhb, rwatson
2005-09-24 23:47:04 +00:00
Poul-Henning Kamp ca72f67d70 Use the new bus_space/resource convenience functions. 2005-09-24 20:46:02 +00:00
Poul-Henning Kamp 6b4a241211 Use new bus_space/resource convenience functions.
Pretend the 10-bit I/O ISA addressing is not our problem.
2005-09-24 20:44:55 +00:00
Poul-Henning Kamp 6db1c434a4 Add convenience macros for bus_space usage that doesn't require specification
of bus tag+handle.

Instead of
	bus_space_write_1(sc->tag, sc->handle, ...)
this macros offer
	bus_write_1(sc->resource, ...)

The name+argument transformation is constant and the the macros are
generated (by hand) by the script in tools/bus_macro.sh.
2005-09-24 20:11:07 +00:00
Poul-Henning Kamp ae7ff71f63 Split struct resource in an external and internal part.
The external part is still called 'struct resource' but the contents
is now visible to drivers etc.  This makes it part of the device
driver ABI so it not be changed lightly.  A comment to this effect
is in place.

The internal part is called 'struct resource_i' and contain its external
counterpart as one field.

Move the bus_space tag+handle into the external struct resource, this
removes the need for device drivers to even know about these fields
in order to use bus_space to access hardware. (More in following commit).
2005-09-24 20:07:03 +00:00
Poul-Henning Kamp a778923149 Add two convenience functions for device drivers: bus_alloc_resources()
and bus_free_resources().  These functions take a list of resources
and handle them all in one go.  A flag makes it possible to mark
a resource as optional.

A typical device driver can save 10-30 lines of code by using these.

Usage examples will follow RSN.

MFC:	A good idea, eventually.
2005-09-24 19:31:10 +00:00
Warner Losh c4a4b66d17 I have confirmed with my Epson EEN10B that it needs to look at the
attribute memory at 0xff0 to find its MAC address.  This is another
instance of the IBM ethercard II from all apperances (short of popping
the lid).  Update the entry to document which cards we support
actually need this functionality.
2005-09-24 17:36:43 +00:00
Warner Losh 52fb9ab35e Remove unnecessary Dlink de650 entry 2005-09-24 17:32:57 +00:00
Warner Losh c1a8a7110a The DLink DE650 has the same ID as Linksys EthernetCard, so we don't
need a sperate entry for it.
2005-09-24 17:32:20 +00:00
Wilko Bulte d7ed4e7b79 Try to avoid crashes during kernel startup by limiting the # of EISA
slots to probe.  Problems have been reported in this area, lets hope this
bandaid helps.

!! Owners of EISA-equipped Alpha machines are requested to at least
!! boot-test a 6-BETA build and report back to the Alpha list. Thanks!

Approved by: re (scottl)
Suggested by: ticso
2005-09-24 16:47:34 +00:00
Alexander Leidinger 16f309f0e2 This part of the struct isn't needed on FreeBSD:
---snip---
FYI this bit isn't needed for FreeBSD - I think it came from either
OpenBSD or NetBSD where arc4random() wasn't available during cold
boot.
---snip---

Explained by:	iedowse
2005-09-24 14:49:36 +00:00
Poul-Henning Kamp e515ee7832 Make rule zero really magical, that way we don't have to do anything
when we mount and get zero cost if no rules are used in a mountpoint.

Add code to deref rules on unmount.

Switch from SLIST to TAILQ.

Drop SYSINIT, use SX_SYSINIT and static initializer of TAILQ instead.

Drop goto, a break will do.

Reduce double pointers to single pointers.

Combine reaping and destroying rulesets.

Avoid memory leaks in a some error cases.
2005-09-24 07:03:09 +00:00
Warner Losh 829681b6aa Remove obsolete include 2005-09-23 21:59:11 +00:00
Xin LI 0e4f6eecd7 Restore a historical ufs_inactive behavior that has been changed
in rev. 1.40 of ufs_inode.c, which allows an inode being truncated
even when the filesystem itself is marked RDONLY.  A subsequent
call of UFS_TRUNCATE (ffs_truncate) would panic the system as it
asserts that it can only be called when the filesystem is mounted
read-write (same changeset, rev. 1.74 of sys/ufs/ffs/ffs_inode.c).

Because ffs_mount() already takes care of sync'ing the filesystem
to disk before being downgraded to readonly, it appears to be more
desirable that we should not permit this sort of writes to disk.

This change would fix a panic that occours when read-only mounted
a corrupted filesystem and doing some file operations.

MT6/5/4 candidate

Reviewed by:	mckusick
2005-09-23 20:49:57 +00:00
Robert Watson e1ac28e239 Canonicalize the UNIX domain socket copyright layout: original holders
before more recent holders.

MFC after:	3 days
2005-09-23 12:41:06 +00:00
Robert Watson 5d3df5cc1b For reasons of consistency (and necessity), assert an exclusive vnode
lock on the fifo vnode in fifo_open(): we rely on the vnode lock to
serialize access to v_fifoinfo.

MFC after:	3 days
2005-09-23 12:39:51 +00:00
Maksim Yevmenkin a4cb050617 Fix comment 2005-09-22 19:15:33 +00:00
Warner Losh b7a9396a75 Forgot to commit ata-card fixes last night. Fix gleb's attempt to do
the right thing by merging in the changes I neglected to commit last
night.
2005-09-22 18:46:29 +00:00
Gleb Smirnoff e21d20fc4c Fix build. 2005-09-22 18:41:56 +00:00
Stephan Uphoff 2a988f7cb5 Fix the "fpudna: fpcurthread == curthread XXX times" problem.
Tested by: kris@
Reviewed by:	peter@
MFC after:	3 days
2005-09-22 15:46:21 +00:00
Stephan Uphoff 3fafa27b27 Don't pretend to be thread0 when calling sync().
It confuses the lock manager since in some places thread0 is
then used for vnode locking while curthread is used for vnode unlocking.

Found by:	Yahoo!
Reviewed by:	ps@,jhb@
MFC after:	3 days
2005-09-22 15:34:15 +00:00
Ruslan Ermilov fddd9c1d2f Cause all flags passed by boot2 to set the respective loader(8)
boot_* variable.  The end effect is that all flags from boot2
are now passed to the kernel.
2005-09-22 15:14:13 +00:00
Ruslan Ermilov 4750e08f7b Add loader(8) variables for RB_DFLTROOT, RB_MUTE, and RB_PAUSE:
"boot_dfltroot", "boot_mute", and "boot_pause" respectively.
2005-09-22 15:06:58 +00:00
Warner Losh 6242d774d9 Remove compat layer for OLDCARD compatibility. All instances of it
are now gone from the tree.
2005-09-22 14:51:11 +00:00
Ruslan Ermilov 5272ce4796 - RBX_MASK wasn't updated when RB_PAUSE was changed from 0x40000
to 0x100000 in rev. 1.67.

- NOPT wasn't updated (decremented) in previous revision.
2005-09-22 11:20:33 +00:00
Robert Watson 7028887eac Add fi_sx, an sx lock to serialize I/O operations on the socket pair
underlying the POSIX fifo implementation.  In 6.x/7.x, fifo access is
moved from the VFS layer, where it was serialized using the vnode
lock, to the file descriptor layer, where access is protected by a
reference count but not serialized.  This exposed socket buffer
locking to high levels of parallelism in specific fifo workloads, such
as make -j 32, which expose as yet unresolved socket buffer bugs.

fi_sx re-adds serialization about the read and write routines,
although not paths that simply test socket buffer mbuf queue state,
such as the poll and kqueue methods.  This restores the extra locking
cost previously present in some cases, but is an effective workaround
for the instability that has been experienced.  This workaround should
be removed once the bug in socket buffer handling has been fixed.

Reported by:	kris, jhb, Julien Gabel <jpeg at thilelli dot net>,
		Peter Holm <peter at holm dot cc>, others
MFC after:	3 days
2005-09-22 10:51:12 +00:00
Warner Losh c82f53f61d 'PC Card' instead of other variants 2005-09-22 06:01:44 +00:00
Warner Losh ca7ea03837 Eliminate dead code 2005-09-22 05:56:32 +00:00