Commit graph

55688 commits

Author SHA1 Message Date
Max Laier b6de9e91bd Remove bridge(4) from the tree. if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on:	-arch
Reviewed by:	thompsa
X-MFC-after:	never (RELENG_6 as transition period)
2005-09-27 18:10:43 +00:00
Peter Wemm 458d22f302 Don't let the upper bits of %dr6/%dr7 get set.
Submitted by:  Nate Eldredge <neldredge@math.ucsd.edu>
2005-09-27 18:10:26 +00:00
John Baldwin 7e9e371f2d Use the refcount API to manage the reference count for user credentials
rather than using pool mutexes.

Tested on:	i386, alpha, sparc64
2005-09-27 18:09:42 +00:00
John Baldwin b2149bde1f Use the reference count API to manage the reference counts for process
limit structures rather than using pool mutexes to protect the reference
counts.

Tested on:	i386, alpha, sparc64
2005-09-27 18:07:05 +00:00
Peter Wemm a11ea6e325 Regenerate 2005-09-27 18:04:52 +00:00
Peter Wemm add121a476 Implement 32 bit getcontext/setcontext/swapcontext on amd64. I've added
stubs for ia64 to keep it compiling.  These are used by 32 bit apps such
as gdb.
2005-09-27 18:04:20 +00:00
John Baldwin 55b4a5ae0d 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
John Baldwin d6fe50b6b9 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
John Baldwin 3c2bc2bf26 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
Roman Kurakin 732c9a1701 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
Robert Watson a0e81bce69 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
Roman Kurakin 3dde86fe4c 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
Christian S.J. Peron 6acd4b6189 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
Christian S.J. Peron 7f300b47dd Mark the extended attribute syscalls as being MP safe.
Requested by:	jhb
2005-09-27 14:32:04 +00:00
Ruslan Ermilov 360d00a0b2 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
Yoshihiro Takahashi 819766797e Switch from OLDCARD to NEWCARD on pc98. 2005-09-27 13:10:24 +00:00
Gleb Smirnoff 5cd88eb04a Fix build. 2005-09-27 09:11:44 +00:00
Maxime Henrion 05bd8c224e 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
Scott Long 722e0ae489 Report status in hex, not decimal. 2005-09-27 01:59:32 +00:00
Andre Oppermann 8dbf6c2dc8 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
Andre Oppermann b2828ad291 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
John Baldwin 25067ba265 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
John Baldwin d27acf445e 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
Warner Losh e51bf22777 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
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