Commit Graph

118749 Commits

Author SHA1 Message Date
jhb
03582b6378 Use the refcount API to implement reference counts on process argument
structures rather than using a global mutex to protect the reference
counts.

Tested on:	i386, alpha, sparc64
2005-09-27 18:03:15 +00:00
jhb
9824060b9c Add a simple reference count API that is simply a thin wrapper API around
atomic operations on ints.

Reviewed by:	arch@
MFC after:	1 week
2005-09-27 18:01:33 +00:00
jhb
c95731aa8e - Document atomic_fetchadd(9) and add a MLINK.
- Add arm and ppc to the list of archs not supporting operations on 64-bit
  integers.
- Update the sample code for acquiring a mutex to be more recent and to
  take into account the recent atomic_foo_ptr() changes.

MFC after:	1 week
2005-09-27 17:59:29 +00:00
jhb
89caa56972 Add a new atomic_fetchadd() primitive that atomically adds a value to a
variable and returns the previous value of the variable.

Tested on:	i386, alpha, sparc64, arm (cognet)
Reviewed by:	arch@
Submitted by:	cognet (arm)
MFC after:	1 week
2005-09-27 17:39:11 +00:00
rik
aa790ae870 Restore if_cp.c 1.27
----------------------------
	revision 1.27
	date: 2005/09/19 03:10:16;  author: imp;  state: Exp;  lines: +3 -2
	Make sure that we call if_free(ifp) after bus_teardown_intr.  Since we
	could get an interrupt after we free the ifp, and the interrupt
	handler depended on the ifp being still alive, this could, in theory,
	cause a crash.  Eliminate this possibility by moving the if_free to
	after the bus_teardown_intr() call.

In fact, this change do nothing for this driver. It is protected from
this by cp_destroy variable. This variable also protects driver from initiation
of any activity from network stack with disabled intr handler with this change
applied.
2005-09-27 16:57:44 +00:00
rwatson
332a994af0 Back out fifo_vnops.c:1.127, which introduced an sx lock around I/O on
a fifo.  While this did indeed close the race, confirming suspicions
about the nature of the problem, it causes difficulties with blocking
I/O on fifos.

Discussed with:		ups
Also spotted by:	Peter Holm <peter at holm dot cc>
2005-09-27 16:45:22 +00:00
rik
fe4bf0ce46 Backout if_cp 1.26, if_ct 1.27, if_cx 1.47 by obrien:
----------------------------
	revision 1.26
	date: 2005/09/07 09:53:35;  author: obrien;  state: Exp;  lines: +1452 -1453
	Reorder code to not depend on an ISO-C illegal forward extern declaration.
	----------------------------

Reason: do not move large functions location without serious reason. The same
could be done by forward function declaration. Please do not enlarge diff
without a reason any more.

Backout if_cp 1.27
----------------------------
	revision 1.27
	date: 2005/09/19 03:10:16;  author: imp;  state: Exp;  lines: +3 -2
	Make sure that we call if_free(ifp) after bus_teardown_intr.  Since we
	could get an interrupt after we free the ifp, and the interrupt
	handler depended on the ifp being still alive, this could, in theory,
	cause a crash.  Eliminate this possibility by moving the if_free to
	after the bus_teardown_intr() call.

Reason: bad previous commit. Would be restored by next commit.
2005-09-27 16:12:49 +00:00
csjp
dfb93b65df Update the "created from" section to reflect the most recent version of
syscalls.master

Requested by:	jhb
2005-09-27 14:36:59 +00:00
csjp
261344bc40 Mark the extended attribute syscalls as being MP safe.
Requested by:	jhb
2005-09-27 14:32:04 +00:00
ru
3b3d11cbd3 Calling rman_get_start() after bus_release_resource() is evil.
It became fatal after a recent "struct resource" split change.
2005-09-27 13:33:46 +00:00
nyan
ebac7c30db Switch from OLDCARD to NEWCARD on pc98. 2005-09-27 13:10:24 +00:00
glebius
00692854b3 - Print space character in show_stat(). Remove a lot of priuntf(" ").
- Utilize show_stat() in sidewaysintpr() loop. This makes periodic
  statistics to honor -h flag.
2005-09-27 10:42:02 +00:00
glebius
a2d671a6a2 Fix build. 2005-09-27 09:11:44 +00:00
mux
f338c80be8 Convert fxp(4) to use the new bus_alloc_resources() API, it simplifies
the resource allocation code significantly.
2005-09-27 09:01:11 +00:00
ru
79870ba40b Remove redundant `\&' escapes. 2005-09-27 08:06:21 +00:00
ru
2b049edf7a Fixup previous commit. 2005-09-27 08:02:03 +00:00
brooks
436b84c750 Don't print anything if we can't do any localpkg shutdown (start already
does this).

Submitted by:	Andre Albsmeier <Andre dot Albsmeier at siemens dot com>
PR:		conf/86606
2005-09-27 02:05:55 +00:00
scottl
797c1bd1dd Report status in hex, not decimal. 2005-09-27 01:59:32 +00:00
phk
a9facbe833 Please ship the pointy hat to its home position. 2005-09-26 22:07:59 +00:00
andre
9e496bb419 Document the IP_DONTFRAG IP socket option.
Sponsored by:   TCP/IP Optimization Fundraise 2005
2005-09-26 20:58:49 +00:00
andre
41f17dbd3a Replace custom mbuf writeability test with generic M_WRITABLE() test
covering all edge cases too.

Sponsored by:	TCP/IP Optimization Fundraise 2005
2005-09-26 20:35:45 +00:00
phk
9eec5a615f Update coordinates for "mph" hash generator now that it lives in ports. 2005-09-26 20:34:21 +00:00
des
95277118f4 Increase WARNS. 2005-09-26 20:34:09 +00:00
des
343777dab2 Correct the logic for determining whether the user has already entered
a password.  Also, work around some harmless type pun warnings.

MFC after:	3 days
2005-09-26 20:33:53 +00:00
phk
87620dae75 Add a .sinclude directive which does the exact same as .include, except
whine when the file cannot be found and opened.
2005-09-26 20:31:00 +00:00
andre
bedcd4ace8 Implement IP_DONTFRAG IP socket option enabling the Don't Fragment
flag on IP packets.  Currently this option is only repected on udp
and raw ip sockets.  On tcp sockets the DF flag is controlled by the
path MTU discovery option.

Sending a packet larger than the MTU size of the egress interface
returns an EMSGSIZE error.

Discussed with:	rwatson
Sponsored by:	TCP/IP Optimization Fundraise 2005
2005-09-26 20:25:16 +00:00
jhb
4eeb530ac7 Small fixes to sis(4):
- Remove sis_unit and use device_printf() and if_printf() instead.
- Use callout_init_mtx() for the callout.
- Remove spls.
- Fix locking for ifmedia to happen in the ifmedia handlers rather than in
  sis_ioctl().
- Log an error message if we fail to allocate any resources.  Perform
  cleanup if we fail to allocate any resources so that we don't leave
  a mutex hanging around.

Tested by:	Jason Tsai jason dot tsai at newcyberian dot com (1-4)
MFC after:	3 days
2005-09-26 18:42:27 +00:00
jhb
be5947abab Add the spin lock used by the binary nvidia driver to the static lock
order list so that WITNESS and the driver play together nicely.

Tested by:	Harald Schmalzbauer
MFC after:	3 days
2005-09-26 18:30:12 +00:00
imp
e687ce4420 Emit a warning when a card matches multiple entries in our table. A
number of cards have been discovered to be matching on the strings of
the cis rather than manufacturer/product id for cards we already had a
prod id for.  This is a result of getting the list from the NetBSD
driver which also includes the OID for the cards where such a
distinction mattered (since it was tested against the MAC address we
got from the card).  Since we do not try to match OIDs, we do not need
the extra entries and they just waste space.

I'm guessing that some of the dlink entires (DE-660, DE-660+) and many
of the corega cards may fall into this boat and can safely be removed.
2005-09-26 18:27:13 +00:00
imp
45711c9160 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
rwatson
bc29fc3656 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
phk
7557f61ce6 This one goes as well. 2005-09-26 14:58:58 +00:00
phk
9ced30d43d Remove the old Makefile based nanobsd build method, the new shell script
based is far better and the only one supported from now on.
2005-09-26 14:57:27 +00:00
davidxu
fa2166ed09 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
des
953bbe6a0d Accept "maximum" and "minimum" modes as well as their abbreviations.
MFC after:	2 weeks
2005-09-26 12:16:27 +00:00
rwatson
87ac2d2498 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
rwatson
0106e151c3 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
njl
88a1a84601 Fix order and style(9) to match surrounding defs. 2005-09-26 07:45:35 +00:00
keramida
5b312e287b minor style.Makefile(5) fixes:
- WARNS before CFLAGS
- CFLAGS -DXXX before -IXXX

Approved by:	ru
2005-09-26 06:23:43 +00:00
sobomax
8d8767b58c 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
imp
add8494ccf 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
imp
7844c35474 Remove references to OLDCARD. 2005-09-25 21:26:09 +00:00
imp
5bc61bad5f 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
phk
58b495a6f0 Correct filesystem mountpoint 2005-09-25 21:23:19 +00:00
cognet
c29db74a1d Fix multiple abuses of __RMAN_RESOURCE_VISIBLE in the arm code.
Spotted out by:	phk
2005-09-25 21:06:50 +00:00
phk
8f15910404 __RMAN_RESOURCE_VISIBLE not necessary. 2005-09-25 20:21:48 +00:00
phk
1a9cbea53c __RMAN_RESOURCE_VISIBLE not needed. 2005-09-25 20:21:14 +00:00
phk
bf3c3b1eb9 Replace __RMAN_RESOURCE_VISIBLE with calls to public entry points
in rman module.
2005-09-25 20:12:30 +00:00
phk
4b78e0f816 Add rman_is_region_manager() for the benefit of an alpha hack. 2005-09-25 20:10:10 +00:00
phk
bfc2f12141 __RMAN_RESOURCE_VISIBLE is not actually needed. 2005-09-25 20:03:41 +00:00