Commit Graph

50138 Commits

Author SHA1 Message Date
Stephan Uphoff
b9a80acadb Force MUTEX_WAKE_ALL.
A race condition in single thread wakeup may break priority inheritance.

Tested   by: pho
Reviewed by: jhb,julian
Approved by: sam (mentor)
MFC: ASAP
2004-10-12 16:28:18 +00:00
Ruslan Ermilov
f49f4f366b Back out cumulative changes from revs. 1.92-1.94: "make depend"
followed by "make depend" shouldn't do anything.  It doesn't
seem to be a problem anymore, and if someone finds it to break
again, please contact me so we can work on a real fix.

Reviewed by:	bde
2004-10-12 15:08:24 +00:00
Ruslan Ermilov
1f0896165b Style fixes, including:
- Sort kmod.mk knobs in the documentation section.
- Fixed misuses of the word "KLD" which stands for
  "kernel ld", or "kernel linker", where kernel
  module is meant.
- Removed redundant uses of ${.OBJDIR}.
- Whitespace and indentation fixes.
- CLEANFILES cleanup.
- Target redefinition protection (install.debug).

Submitted by:	bde, ru
Reviewed by:	ru, bde
2004-10-12 15:04:10 +00:00
Robert Watson
f5c3a74502 Assert that the entropy source category provided by a caller submitting
entropy is valid, as an invalid source will cause dereferencing of an
array of queues to an incorrect memory location.
2004-10-12 14:57:14 +00:00
Robert Watson
a9befd40dd Add a note ahea of the esource enum that if new entropy source
categories are added, the set of entropy source assertions in the
harvesting code also need to be updated.
2004-10-12 14:55:59 +00:00
Poul-Henning Kamp
f4bc0127f4 Do not enable ECHO modes by default when a tty port is opened. If the other
device also does echo'ing this can result in a character-storm before we
ever get a chance to disable the echo modes.
2004-10-12 13:31:39 +00:00
Gleb Smirnoff
a176c2aeaf Fix packet flow when both ng_ether(4) and bridge(4) are in use:
- push all bridge logic from if_ethersubr.c into bridge.c
  make bridge_in() return mbuf pointer (or NULL).
- call only bridge_in() from ether_input(), after ng_ether_input()
  was optinally called.
- call bridge_in() from ng_ether_rcv_upper().

Long description:	http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html
Reported by:		Jian-Wei Wang <jwwang at FreeBSD.csie.NCTU.edu.tw>
Tested by:		myself, Sergey Lyubka
Reviewed by:		sam
Approved by:		julian (mentor)
MFC after:		2 months
2004-10-12 10:33:42 +00:00
Robert Watson
71e7578499 Mark i4b IPR and SPPP drivers as NET_NEEDS_GIANT(), as they both
interface with the network stack but are not yet sufficiently
synchronized to run without the Giant lock.  It migh be possible
to mark the interfaces as IFF_NEEDSGIANT, but I'm unable to test
that configuration and am unfamiliar with the architecture of
i4b.
2004-10-12 09:25:52 +00:00
Poul-Henning Kamp
920f6e438f Use generic tty code.
New device names are ttyy{unit}
2004-10-12 09:21:03 +00:00
Poul-Henning Kamp
71ee88dacc Use generic tty code instead of local copies.
New devicename is ttyy{unit}{port}

No callout devices created as there is no modemcontrol on these ports.

Add data structure to represent each port to avoid excessive array use.
2004-10-12 09:18:37 +00:00
Bruce M Simpson
cdd2389652 Pass through the commands necessary to format USB floppy devices,
from within umass_ufi_transform(). This includes the 12-byte commands
FORMAT_UNIT, WRITE_AND_VERIFY, VERIFY, and READ_FORMAT_CAPACITIES
(sorted in numerical order).

Reviewed by:	ken, scottl
MFC after:	2 weeks
2004-10-12 08:58:57 +00:00
Bruce M Simpson
c68a9309c3 Add necessary data structures and definitions for the 12-byte SCSI
commands READ_FORMAT_CAPACITIES, WRITE_AND_VERIFY, and VERIFY.

Reviewed by:	ken, scottl
Source:		USB Mass Storage UFI Specification v1.0
MFC after:	2 weeks
2004-10-12 08:55:02 +00:00
Poul-Henning Kamp
79a8d927d3 Use generic tty code instead of (comparatively little) local copies. 2004-10-12 08:22:31 +00:00
Poul-Henning Kamp
5bd1ebd7d4 Add missing zero flag argument. 2004-10-12 08:22:08 +00:00
Poul-Henning Kamp
09af1b6cdd Add zero flags argument to sysctl calls. 2004-10-12 07:59:02 +00:00
Poul-Henning Kamp
e1e785a3d4 Add missing zero flag arguments to sysctl calls.
Add missing pointy hat to peter@
2004-10-12 07:58:13 +00:00
Poul-Henning Kamp
a1bd71b260 Add missing zero flag arguments to calls to userland_sysctl() 2004-10-12 07:49:15 +00:00
Brian Feldman
812851b6c9 Account for failure in vm_pager_allocate() or vm_pager_get_pages() in
md(8).  The former is generally not going to fail, but the latter can
fail when the underlying swap device returns an error.

There are still plenty of other places where vm_pager_get_pages() failing
will lead directly to crashes, so it's a good idea to put your swap on
RAID if you care enough to put any of your disks on RAID....
2004-10-12 04:47:16 +00:00
Brian Feldman
6f299fa373 When loading GEOM modules, we expect the actual load process to be done
by the time that kldload(8) returns.  Satisfy that by making the GEOM
module load event -- only when the kernel is !cold -- wait until the
GEOM module init function has finished instead of returning immediately.

This is the other half of fixing md(8) (actually, "mfs" in fstab(5))
that is similar to r1.128 of src/sys/dev/md/md.c.  This bug would be
why RAM disks would often fail on boot and the first call to mdconfig(8)
would probably fail.

pjd has ideas for not requiring kldload(8) to work synchronously for
control devices that could make this obsolete.

Silence on:	-arch
2004-10-12 04:44:54 +00:00
Brian Feldman
00b5244e28 Further modify bulk endpoint behavior to be able to tear down the
current transfer fully in the "purge" routine, and to actually finish
kicking out any read()s in progress.
2004-10-12 04:02:06 +00:00
Nate Lawson
4a25d7ffe2 * Remove the acpi attachment from the es1888. It has an identify method
that conjures up the device node so it isn't true PNP.  Noticed by jhb@.

* Add an attachment for esscontrol since it too uses ISA_PNP_PROBE.

* Move an attachment from snd_mss to snd_pnpmss.  The latter is the real
  PNP user.
2004-10-12 01:56:03 +00:00
Peter Wemm
a7bc3102c4 Put on my peril sensitive sunglasses and add a flags field to the internal
sysctl routines and state.  Add some code to use it for signalling the need
to downconvert a data structure to 32 bits on a 64 bit OS when requested by
a 32 bit app.

I tried to do this in a generic abi wrapper that intercepted the sysctl
oid's, or looked up the format string etc, but it was a real can of worms
that turned into a fragile mess before I even got it partially working.

With this, we can now run 'sysctl -a' on a 32 bit sysctl binary and have
it not abort.  Things like netstat, ps, etc have a long way to go.

This also fixes a bug in the kern.ps_strings and kern.usrstack hacks.
These do matter very much because they are used by libc_r and other things.
2004-10-11 22:04:16 +00:00
Peter Wemm
2bdd560907 Belatedly catch up with the dev_t/cdev changes from a few months back.
Extract the struct cdev pointer and the tty device from inside rather than
incorrectly casting the 'struct cdev *' pointer to a 'dev_t' int.  Not
that this was particularly important since it was only used for reading
vmcore files.
2004-10-11 21:56:27 +00:00
Peter Wemm
598f31f75a MFi386: sync with latest updates 2004-10-11 21:51:27 +00:00
Joerg Wunsch
31e81ae45d Revert the change from rev 1.168. ru convinced me that the situation
that was fixed by this should not normally happen, and since I did not
record the traces of my failed build attempt that had been solved with
that change, it's not entirely clear whether it hadn't been a pilot
error on my end.  In dubio pro reo. :-)
2004-10-11 21:23:56 +00:00
Stephan Uphoff
f7717523a2 Trace information about a buffer while we still control it.
Reviewed by:    phk
Approved by:    sam (mentor)
2004-10-11 21:22:59 +00:00
Nate Lawson
f435261d6d Update C3 support when BM control is not present.
* Fix a bug where caches were flushed on non-C3 transitions.
* Be sure a working flush cache instruction is present before using it.
* Disable C3 completely if it isn't present.
2004-10-11 21:15:10 +00:00
Warner Losh
fd492ee0e6 Make the lower range of the memory area 0x80000000 again. Also
introduce hw.{pci,acpi}.host_mem_start tunable to change this.

MFC: ASAP
2004-10-11 21:10:23 +00:00
Andre Oppermann
de10fe70e1 Correctly unregister a netisr by clearing the ni->ni_queue field to NULL as
well.  This field is actually used by various netisr functions to determine
the availablility of the specified netisr.  This uncomplete unregister leads
directly to a crash when the KLD unregistering the netisr is unloaded.

Submitted by:	Sam <sah@softcardsystems.com>
MFC after:	3 days
2004-10-11 20:01:43 +00:00
Nate Lawson
8909901fdd Add acpi attachments for ISA sound drivers. This is needed so they'll
probe and attach when ACPI is enabled.

Submitted by:	takawata (sbc fix)
MFC after:	1 day
2004-10-11 19:52:31 +00:00
Gleb Smirnoff
366538f251 Rename _m_tag_free() to m_tag_free_default() and make it non-static.
Approved by:	sam
2004-10-11 18:40:19 +00:00
Olivier Houchard
9c2ac80375 Use a default MD_ROOT_SIZE of 65535. 2004-10-11 14:42:06 +00:00
Olivier Houchard
ed4dc69883 Use MD_ROOT_SIZE, instead of our own macro. 2004-10-11 14:41:38 +00:00
Robert Watson
acf032f516 When harvesting entropy from an ethernet mbuf, do so before freeing the
mbuf.

RELENG_5 candidate.
2004-10-11 10:21:34 +00:00
Robert Watson
cc34aa2094 Add entropy harvest mutex to hard-coded spin lock witness lock order,
remove previous entropy harvesting mutex names as they are no longer
present.  Commit to this file was ommitted when randomdev_soft.c:1.5
was made.

Feet shot:	Robert Huff <roberthuff at rcn dot com>
2004-10-11 08:26:18 +00:00
Robert Watson
35b260cd69 Rework sofree() logic to take into account a possible race with accept().
Sockets in the listen queues have reference counts of 0, so if the
protocol decides to disconnect the pcb and try to free the socket, this
triggered a race with accept() wherein accept() would bump the reference
count before sofree() had removed the socket from the listen queues,
resulting in a panic in sofree() when it discovered it was freeing a
referenced socket.  This might happen if a RST came in prior to accept()
on a TCP connection.

The fix is two-fold: to expand the coverage of the accept mutex earlier
in sofree() to prevent accept() from grabbing the socket after the "is it
really safe to free" tests, and to expand the logic of the "is it really
safe to free" tests to check that the refcount is still 0 (i.e., we
didn't race).

RELENG_5 candidate.

Much discussion with and work by:	green
Reported by:	Marc UBM Bocklet <ubm at u-boot-man dot de>
Reported by:	Vlad <marchenko at gmail dot com>
2004-10-11 08:11:26 +00:00
Gleb Smirnoff
570343bfec Assign pointer NULL, not 0.
Approved by:	julian (mentor)
2004-10-11 07:28:36 +00:00
Nate Lawson
a0885d3f14 Notify the user when the battery is critically low. In the future, we
may want to shut down here but the chance of BIOS vendors getting this
wrong is high.  They're only supposed to announce this when all batteries
hit their critical level but past experience indicates we should be
conservative about this for now.
2004-10-11 06:18:07 +00:00
Nate Lawson
18ececa0b8 If bus mastering control is not available (PM2_BLK), don't just disable
C3.  Instead, flush caches before entering C3.  This may be slower but
provides good power savings.
2004-10-11 06:06:42 +00:00
Nate Lawson
7f35f90eae Match surrounding style, not style(msmith). 2004-10-11 05:42:12 +00:00
Nate Lawson
31ad3b8802 Move the code for halting the CPU (acpi_cpu_c1) into machdep files.
This removes the last MD portion of acpi_cpu.c.

MFC after:	2 weeks
2004-10-11 05:39:15 +00:00
Warner Losh
905454c86c Fix conflicts I didn't fix before I committed my busspace changes.
Noticed by: ru@ (and likely tinderbox, I haven't checked)
2004-10-11 00:58:24 +00:00
Peter Edwards
8fe457d687 Fix off-by-one error in fd_native_types that results in a panic on boot
for machines with 2.88M floppies.

Reviewed By: phk
2004-10-10 23:39:59 +00:00
David Malone
08de85f54a Rename thread args to be called "td" rather than "p" to be
consistent with other bits of this file. There should be no
functional change.

Submitted by:	Andrea Campi (many moons ago)
MFC after:	2 month
2004-10-10 18:34:30 +00:00
Søren Schmidt
b913aa0b7f Dont sleep with lock held. 2004-10-10 13:24:39 +00:00
Gleb Smirnoff
8c4a75be4a Revert last commit since it breaks API.
Requested by:	sam
2004-10-10 09:16:48 +00:00
Julian Elischer
042b7b1af0 Don't release the slot twice.. sched_rem() has already done it.
Submitted by:	stephan uphoff (ups at tree dot com)
MFC after:	3 days
2004-10-10 05:19:22 +00:00
Julian Elischer
9b036bdf5a Remove duplicate line. 2004-10-10 05:07:43 +00:00
Warner Losh
ac00fac23a Convert to newbus. (chances are we could now move this to dev/pbio
since I believe it is now MI, but that hasn't been done yet).

Reviewed by: dds
2004-10-10 03:26:20 +00:00
Robert Watson
a28ce935d9 Modify entropy harvesting locking strategy:
- Trade off granularity to reduce overhead, since the current model
  doesn't appear to reduce contention substantially: move to a single
  harvest mutex protecting harvesting queues, rather than one mutex
  per source plus a mutex for the free list.

- Reduce mutex operations in a harvesting event to 2 from 4, and
  maintain lockless read to avoid mutex operations if the queue is
  full.

- When reaping harvested entries from the queue, move all entries from
  the queue at once, and when done with them, insert them all into a
  thread-local queue for processing; then insert them all into the
  empty fifo at once.  This reduces O(4n) mutex operations to O(2)
  mutex operations per wakeup.

In the future, we may want to look at re-introducing granularity,
although perhaps at the granularity of the source rather than the
source class; both the new and old strategies would cause contention
between different instances of the same source (i.e., multiple
network interfaces).

Reviewed by:	markm
2004-10-09 22:04:13 +00:00
Nate Lawson
894d8d3c03 Fix fsbtodb() for UFS1. This fixes an overflow for file sizes >1 TB,
allowing for sizes up to 4 TB.  This doesn't affect UFS2 since b is already
a 64 bit type, coincidental with daddr_t.

Submitted by:	bde
2004-10-09 20:16:06 +00:00
Brian Feldman
55fc8c1146 In the previous revision, I did not intend to change the default value
of "nosleepwithlocks."

Submitted by:	ru
2004-10-09 18:51:32 +00:00
Robert Watson
cf2942b67c Acquire the send socket buffer lock around tcp_output() activities
reaching into the socket buffer.  This prevents a number of potential
races, including dereferencing of sb_mb while unlocked leading to
a NULL pointer deref (how I found it).  Potentially this might also
explain other "odd" TCP behavior on SMP boxes (although  haven't
seen it reported).

RELENG_5 candidate.
2004-10-09 16:48:51 +00:00
Robert Watson
b10eb61529 Add SOCKBUF_UNLOCK_ASSERT(), which asserts that the current thread does
not hold the mutex for a socket buffer.
2004-10-09 16:42:57 +00:00
Ken Smith
27dd55ed35 Flush the register windows before we start changing the context.
Submitted by:	Andrew Belashov <bel (at) orel.ru> (slightly modified)
Reviewed by:	jake
2004-10-09 16:42:09 +00:00
Søren Schmidt
8353d82bfd Add support for the ICH6 in legacy mode.
The AHCI part is not supported yet, but is in the works.

5.3 RC1 candidate
2004-10-09 16:27:13 +00:00
Dag-Erling Smørgrav
7ea5573cd8 Return 0, not NULL, from a function declared as returning int. 2004-10-09 14:20:18 +00:00
Joerg Wunsch
4e8ba8de26 Forcibly create symlinked headers, otherwise the build process may fail
if the target link already existed (e. g. -DNO_KERNELCLEAN).
2004-10-09 13:51:28 +00:00
Gleb Smirnoff
42c5607501 Remove inlined m_tag_free(). Rename _m_tag_free() to m_tag_free()
and make it visible (same way as in OpenBSD). Describe usage in manpage.

This change is useful for creating custom free methods, which
call default free method at their end.

While here, make malloc declaration for mbuf tags more informative.

Approved by:	julian (mentor), sam
MFC after:	1 month
2004-10-09 13:25:19 +00:00
David E. O'Brien
3b33d41dc2 style(9) 2004-10-09 08:31:21 +00:00
Brian Feldman
41f57cbc8d Don't "implicitly order all sleep locks before spin locks" in witness
when the spin lock in question isn't -- it's the critical_enter() that
KDB set.  No more panic in DDB for console -> syscons -> tty -> knote
operations.
2004-10-09 08:16:37 +00:00
Takanori Watanabe
42d69dd63e Don't use matchlvl attach arg. It seems to be not initialized
in FreeBSD probe mechanism.
2004-10-09 07:48:31 +00:00
Pyun YongHyeon
e60fc88fa6 Port NetBSD auxio driver. The driver was modified to use led(4) and can
be used to announce various system activity.
The auxio device provides auxiliary I/O functions and is found on various
SBus/EBus UltraSPARC models. At present, only front panel LED is
controlled by this driver.

Approved by:    jake (mentor)
Reviewed by:    joerg
Tested by:      joerg
2004-10-09 07:31:03 +00:00
Scott Long
2f93f011ec Don't count RNBC (internal buffer full) towards the RX error count since it's
not really an error.

Submitted by: Gerrit Nagelhout
2004-10-09 07:27:03 +00:00
Søren Schmidt
39e6971cba Only do the geometry translations on ad* devices, other devices seems to
have their own way of life.
Those other devices translations should be moved here as well.
2004-10-08 21:27:27 +00:00
Brian Feldman
ab14a3f7aa Fix critical stability problems that can cause UMA mbuf cluster
state management corruption, mbuf leaks, general mbuf corruption,
and at least on i386 a first level splash damage radius that
encompasses up to about half a megabyte of the memory after
an mbuf cluster's allocation slab.  In short, this has caused
instability nightmares anywhere the right kind of network traffic
is present.

When the polymorphic refcount slabs were added to UMA, the new types
were not used pervasively.  In particular, the slab management
structure was turned into one for refcounts, and one for non-refcounts
(supposed to be mostly like the old slab management structure),
but the latter was almost always used through out.  In general, every
access to zones with UMA_ZONE_REFCNT turned on corrupted the
"next free" slab offset offset and the refcount with each other and
with other allocations (on i386, 2 mbuf clusters per 4096 byte slab).

Fix things so that the right type is used to access refcounted zones
where it was not before.  There are additional errors in gross
overestimation of padding, it seems, that would cause a large kegs
(nee zones) to be allocated when small ones would do.  Unless I have
analyzed this incorrectly, it is not directly harmful.
2004-10-08 20:19:29 +00:00
Nate Lawson
4f8c4e4d53 Update a quirk for the ASUS P5A to disable the timer. It appears to work fine
with acpi but the timer runs twice as fast.  Note that the main problem
(system doesn't work properly with acpi disabled) should be fixed separately.

Changes:
* Add a quirk to disable the timer
* Merge the P5A and P5A-B quirks since they appear to be based on the
  same ASL.

PR:		i386/72450
Tested by:	Kevin Oberman <oberman es.net>
MFC after:	3 days
2004-10-08 17:56:47 +00:00
Max Laier
22d0ab2ef8 Fix sis, bfe and ndis in the same way dc was fixed:
Do not tell the hardware to send when there were no packets enqueued.

Found and reviewed by:	green
MFC after:		1 days
2004-10-08 16:14:42 +00:00
Max Laier
85bba4455a Change pfil starvation prevention from fail-open to fail-close.
We return ENOBUF to indicate the problem, which is an errno that should be
handled well everywhere.

Requested & Submitted by:	green
Silently okay'ed by:		The rest of the firewall gang
MFC after:			3 days
2004-10-08 12:07:20 +00:00
Alan Cox
aced26ce6e Make pte_load_store() an atomic operation in all cases, not just i386 PAE.
Restructure pmap_enter() to prevent the loss of a page modified (PG_M) bit
in a race between processors.  (This restructuring assumes the newly atomic
pte_load_store() for correct operation.)

Reviewed by: tegge@
PR: i386/61852
2004-10-08 08:23:43 +00:00
Poul-Henning Kamp
e3240372a7 Use generic tty processing code instead of local copy.
New device names are {tty,cua}G$(adapter)$(port)[.lock,.init]
2004-10-08 06:45:10 +00:00
Brooks Davis
ab67442f0c Since net/net_osdep.c contained only one function that could be
trivially implemented as a macro, do that and remove it.  NetBSD did
this quite a while ago.
2004-10-08 00:24:30 +00:00
Bruce M Simpson
736e35999e Style. Use ETHER_IS_MULTICAST() appropriately instead of masking off the bit.
Reviewed by:	jmallett
2004-10-07 20:56:29 +00:00
Ken Smith
de4447e1c0 Back out v1.58... We still don't know what is causing the specific
problem I had but it's happening in code that is messing around with
register windows - I'm willing to live with that piece being sensitive
to this and it looks like the other problems we had reported lately
are not fixed by using -O instead of -O2.

Sorry for the churn.  Looks like I need a second pointy hat.  Someone
tells me they stack well.  :-))))
2004-10-07 20:36:56 +00:00
Pawel Jakub Dawidek
7aefe57c5c Be sure to always return 0 for negative access requests.
Reported by:	Maciej Kucharz <qk@comp.waw.pl>
2004-10-07 20:13:23 +00:00
Søren Schmidt
6c35773729 Move the PC98 specific geometry "gunk" to geom_pc98.c where it belongs.
This also adds support for bigger disks on the controller I have access to,
and maybe others if I understood the adhoc methods used on those.

Those with more PC98 bigdrive controllers it is hereby invited to add/fix
support for those in geom_pc98.c and not using #ifdef PC98 all over the place.
2004-10-07 17:37:09 +00:00
Warner Losh
bacb482d94 Port pbio to HEAD.
OK'd by: dds
2004-10-07 16:21:03 +00:00
Robert Watson
fcf4e3a168 When running with debug.mpsafenet=0, initialize IP multicast routing
callouts as non-CALLOUT_MPSAFE.  Otherwise, they may trigger an
assertion regarding Giant if they enter other parts of the stack from
the callout.

MFC after:	3 days
Reported by:	Dikshie < dikshie at ppk dot itb dot ac dot id >
2004-10-07 14:13:35 +00:00
David Xu
84e0b075f6 Add an execve command for kse_thr_interrupt to allow libpthread to
restore signal mask correctly, this is required by POSIX.

Reviewed by: deischen
2004-10-07 13:50:10 +00:00
Søren Schmidt
e59142714c Add SHARP to the pool of drives that doesn not need byteswapping of
the model etc fields from identify.
2004-10-07 11:43:25 +00:00
Poul-Henning Kamp
e7e1338d36 Use generic ttycode instead of local copy. 2004-10-07 06:19:11 +00:00
David Xu
ebfcca3d61 Regen to unbreak world.
Pointy hat to: mtm
2004-10-07 01:09:46 +00:00
David Schultz
cda5aba4b9 Back out rev 1.240; it is unnecessary. In particular,
p1 == curthread, so _PHOLD(p1) will not have to block
to swap in p1.

Noticed by:	jhb
2004-10-06 23:53:49 +00:00
Poul-Henning Kamp
276f72c550 Don't set the BIO_ONQUEUE debugging flag until we actually put the bio
onto a queue.  This made the ENOMEM handling an instant panic.
2004-10-06 20:59:59 +00:00
Poul-Henning Kamp
3a5f9a2bd2 Use generic tty code instead of local copies. 2004-10-06 20:01:49 +00:00
Ken Smith
e47bf36158 Back out v1.49. Recent findings suggest sparc64 may not be ready for
-O2 on kernel compiles after all.  While working on adding a KASSERT
to sparc64/sparc64/rwindow.c I found that it was "position sensitive",
putting it above a call to flushw() instead of below caused corruption
of processes on the system.  jake and jhb have both confirmed there is
no obvious explanation for that.  The exact same kernel code does not
have the process corruption problem if compiled with -O instead of -O2.
There have been signs of similar issues floated on the sparc64@ mailing
list, lets see if this helps make them go away.

Note this isn't an optimal fix as far as the file format goes, if this
disgusts too many people I'll fix it the right way.  Since compiling
with something other than -O is a known problem this format would prevent
a change to the default causing grief.  And this may also help motivate
finding out what the compiler is doing wrong so we can shift back to
using -O2. :-)

My turn for the pointy hat...  One of the florescent ones...

MFC after:	2 days
2004-10-06 19:55:14 +00:00
Søren Schmidt
6192895db8 Fix the PC98 lockups on boot.
The interchannel locking for PC98 needed to be updated to match the
rest of the locking in ATA.
2004-10-06 19:46:08 +00:00
Pawel Jakub Dawidek
dd12956ac7 Geoms without softc are geoms which are initialized, so wait for them. 2004-10-06 18:47:15 +00:00
Warner Losh
e625cbacaf Add missing 'static' 2004-10-06 15:18:12 +00:00
Mike Makonnen
401901ac43 Close a race between a thread exiting and the freeing of it's stack.
After some discussion the best option seems to be to signal the thread's
death from within the kernel. This requires that thr_exit() take an
argument.

Discussed with: davidxu, deischen, marcel
MFC after: 3 days
2004-10-06 14:23:00 +00:00
Pawel Jakub Dawidek
18d2addc23 Look out for geoms without softc.
Reported by:	tegge
2004-10-06 14:15:47 +00:00
Warner Losh
5cee9db399 For older systems with ACPI which don't have a pci <-> pci bridge,
allocate unallocated memory resources from the top 32MB of the address
space rather than the top 2GB.  While the latter works on some
chipsets, it fails badly on others.  32MB is more conservative and
matches what cheap harware from this era is hardwired to pass.
2004-10-06 07:26:52 +00:00
Warner Losh
0b3a486f21 For legacy PCI bridges, limit memory allocation to the top 32MB of
RAM.  Many older, legacy bridges only allow allocation from this
range.  This only appies to devices who don't have their memory
assigned by the BIOS (since we allocate the ranges so assigned
exactly), so should have minimal impact.

Hoewver, for CardBus bridges (cbb), they rarely get the resources
allocated by the BIOS, and this patch helps them greatly.  Typically
the 'bad Vcc' messages are caused by this problem.
2004-10-06 07:22:58 +00:00
Brian Feldman
93daabdd83 Don't recurse the BPF descriptor lock during the BIOCSDLT operation
(and panic).  To try to finish making BPF safe, at the very least,
the BPF descriptor lock really needs to change into a reader/writer
lock that controls access to "settings," and a mutex that controls
access to the selinfo/knote/callout.  Also, use of callout_drain()
instead of callout_stop() (which is really a much more widespread
issue).
2004-10-06 04:25:37 +00:00
SUZUKI Shinsuke
6f9e3ebf47 fixed too delayed routing cache expiry. (tvtohz() converts a time interval to ticks, whereas hzto() converts an absolute time to ticks)
Obtained from: KAME
2004-10-06 03:32:26 +00:00
Marcel Moolenaar
07cf947238 Add the Madison II, which is the second generation Madison. The Madison II
is model 2 in the Itanium 2 family and has up to 9MB of L3 cache and clocks
higher than 1.5Ghz. There's no LV variant AFAICT.
2004-10-06 02:43:28 +00:00
David Xu
195f5806e4 Close a race between thr_create and sysctl -w, the thr_scope_sys could
be changed when thr_create is running, and we tested it for several times.
2004-10-06 02:29:19 +00:00
Greg Lehey
57259f2864 vtryrecycle: Don't rely on type VBAD alone to mean that we don't need
to clean the vnode.  If v_data is set, we still need to
	     clean it.  This code change should catch all incidents of
	     the previous commit (INVARIANTS only).
2004-10-06 02:09:59 +00:00
Greg Lehey
f2154b33d2 getnewvnode: Weaken the panic "cleaned vnode isn't" to a warning.
Discussion: this panic (or waning) only occurs when the kernel is
  compiled with INVARIANTS.  Otherwise the problem (which means that
  the vp->v_data field isn't NULL, and represents a coding error and
  possibly a memory leak) is silently ignored by setting it to NULL
  later on.

  Panicking here isn't very helpful: by this time, we can only find
  the symptoms.  The panic occurs long after the reason for "not
  cleaning" has been forgotten; in the case in point, it was the
  result of severe file system corruption which left the v_type field
  set to VBAD.  That issue will be addressed by a separate commit.
2004-10-06 02:06:11 +00:00
David Xu
e0cfeb44a8 Restore some code removed in revision 1.193 and 1.194, julian said
he'd like to keep these code.
2004-10-06 00:49:41 +00:00
David Xu
906ac69d08 In original kern_execve() code, at the start of the function, it forces
all other threads to suicide, problem is execve() could be failed, and
a failed execve() would change threaded process to unthreaded, this side
effect is unexpected.
The new code introduces a new single threading mode SINGLE_BOUNDARY, in
the mode, all threads should suspend themself at user boundary except
the singler. we can not use SINGLE_NO_EXIT because we want to start from
a clean state if execve() is successful, suspending other threads at unknown
point and later resuming them from there and forcing them to exit at user
boundary may cause the process to start from a dirty state. If execve() is
successful, current thread upgrades to SINGLE_EXIT mode and forces other
threads to suicide at user boundary, otherwise, other threads will be resumed
and their interrupted syscall will be restarted.

Reviewed by: julian
2004-10-06 00:40:41 +00:00
Julian Elischer
f8135176c9 Fix whitespace botch that only showed up in the commit message diff :-/
MFC after:	4 days
2004-10-05 22:14:02 +00:00
Brooks Davis
2627ac6f42 Bump __FreeBSD_version for addition of newsyslog -d. 2004-10-05 22:09:12 +00:00
Julian Elischer
fcb7c67b7b Slight cleanup in the single threading code.
MFC after:	4 days
2004-10-05 22:05:25 +00:00
Julian Elischer
c20c691bed When preempting a thread, put it back on the HEAD of its run queue.
(Only really implemented in 4bsd)

MFC after:	4 days
2004-10-05 22:03:10 +00:00
Julian Elischer
c5c3fb335f Oops. left out part of the diff.
MFC after:	4 days
2004-10-05 21:26:27 +00:00
Julian Elischer
d39063f20d Use some macros to trach available scheduler slots to allow
easier debugging.

MFC after:	4 days
2004-10-05 21:10:44 +00:00
Julian Elischer
6f23adbc11 light rearrangement of some code to get some locking
more correct

MFC after:	4 days
2004-10-05 20:48:16 +00:00
Nate Lawson
67e87637df When the user overrides the DSDT, replace any SSDTs with a simple no-op
table.  acpidump(8) concatenates the body of the DSDT and SSDTs so an
edited ASL will contain all the necessary information.  We can't use a
completely empty table since ACPI-CA reports this as a problem.

MFC after:	3 days
2004-10-05 20:41:44 +00:00
Julian Elischer
e5bedcef92 Break out to a separate function, the code to revert a multithreaded
process back to officially being a non-threaded program.

MFC after:	4 days
2004-10-05 20:39:26 +00:00
Sam Leffler
b83a279f19 Add 802.11-specific events that are dispatched through the routing socket.
This really doesn't belong here but is preferred (for the moment) over
adding yet another mechanism for sending msgs from the kernel to user apps.

Reviewed by:	imp
2004-10-05 19:48:33 +00:00
Sam Leffler
0cc8f89a4a add ETHERTYPE_PAE for EAPOL/802.1x 2004-10-05 19:28:52 +00:00
John Baldwin
78c85e8dfc Rework how we store process times in the kernel such that we always store
the raw values including for child process statistics and only compute the
system and user timevals on demand.

- Fix the various kern_wait() syscall wrappers to only pass in a rusage
  pointer if they are going to use the result.
- Add a kern_getrusage() function for the ABI syscalls to use so that they
  don't have to play stackgap games to call getrusage().
- Fix the svr4_sys_times() syscall to just call calcru() to calculate the
  times it needs rather than calling getrusage() twice with associated
  stackgap, etc.
- Add a new rusage_ext structure to store raw time stats such as tick counts
  for user, system, and interrupt time as well as a bintime of the total
  runtime.  A new p_rux field in struct proc replaces the same inline fields
  from struct proc (i.e. p_[isu]ticks, p_[isu]u, and p_runtime).  A new p_crux
  field in struct proc contains the "raw" child time usage statistics.
  ruadd() has been changed to handle adding the associated rusage_ext
  structures as well as the values in rusage.  Effectively, the values in
  rusage_ext replace the ru_utime and ru_stime values in struct rusage.  These
  two fields in struct rusage are no longer used in the kernel.
- calcru() has been split into a static worker function calcru1() that
  calculates appropriate timevals for user and system time as well as updating
  the rux_[isu]u fields of a passed in rusage_ext structure.  calcru() uses a
  copy of the process' p_rux structure to compute the timevals after updating
  the runtime appropriately if any of the threads in that process are
  currently executing.  It also now only locks sched_lock internally while
  doing the rux_runtime fixup.  calcru() now only requires the caller to
  hold the proc lock and calcru1() only requires the proc lock internally.
  calcru() also no longer allows callers to ask for an interrupt timeval
  since none of them actually did.
- calcru() now correctly handles threads executing on other CPUs.
- A new calccru() function computes the child system and user timevals by
  calling calcru1() on p_crux.  Note that this means that any code that wants
  child times must now call this function rather than reading from p_cru
  directly.  This function also requires the proc lock.
- This finishes the locking for rusage and friends so some of the Giant locks
  in exit1() and kern_wait() are now gone.
- The locking in ttyinfo() has been tweaked so that a shared lock of the
  proctree lock is used to protect the process group rather than the process
  group lock.  By holding this lock until the end of the function we now
  ensure that the process/thread that we pick to dump info about will no
  longer vanish while we are trying to output its info to the console.

Submitted by:	bde (mostly)
MFC after:	1 month
2004-10-05 18:51:11 +00:00
Paul Saab
a55db2b6e6 - Estimate the amount of data in flight in sack recovery and use it
to control the packets injected while in sack recovery (for both
  retransmissions and new data).
- Cleanups to the sack codepaths in tcp_output.c and tcp_sack.c.
- Add a new sysctl (net.inet.tcp.sack.initburst) that controls the
  number of sack retransmissions done upon initiation of sack recovery.

Submitted by:	Mohan Srinivasan <mohans@yahoo-inc.com>
2004-10-05 18:36:24 +00:00
John Baldwin
b85975277e Add a critical section in turnstile_unpend() from before dropping the
turnstile chain lock until after making all the awakened threads
runnable.  First, this fixes a priority inversion race.  Second, this
attempts to finish waking up all of the threads waiting on a turnstile
before doing a preemption.

Reviewed by:	Stephan Uphoff (who found the priority inversion race)
2004-10-05 18:00:30 +00:00
Takanori Watanabe
6e4c3467ce Minor Bug fix. Some file was not translated. 2004-10-05 16:53:37 +00:00
Pawel Jakub Dawidek
8d02a378aa Back out changes which were introduced to delay mounting root file system.
Those changes were made on gmirror needs, but now gmirror handles this
by itself.
2004-10-05 11:26:43 +00:00
Pawel Jakub Dawidek
59883b3b34 Before root file system is mounted, wait for mirrors in degraded state. 2004-10-05 11:17:08 +00:00
David Xu
b3a4fb14b3 Use scheduler api to adjust thread priority. 2004-10-05 09:10:30 +00:00
Poul-Henning Kamp
e742b4f879 Use generic tty code instead of local copy.
Also divorce this driver from the sio driver.
2004-10-05 07:42:19 +00:00
Warner Losh
534e7194f8 Yet another case of resources:
+        * 9:   0x3f0-0x3f3,0x3f4-0x3f5,0x3f7

This requires only one change to support.  Rather than keying on the
size of the resource being 2, instead key off the end & 7 being 3.
This covers the same cases that the size of 2 would catch, but also
covers the new above case.

In addition, I think it is clearer to use the end in preference to the
size and start for case #8 as well.  Turns two tests into one, and
catches no other cases.

Make minor commentary changes to deal with new case #9.

# This change is specifically minimal to allow easy MFC.  A more
# extensive change will go into current once I've had a chance to test
# it on a lot of hardware...
2004-10-05 07:18:11 +00:00
Takanori Watanabe
919f5630ec Fix unionfs problems when a directory is mounted on other directory
with different file systems. This may cause ill things
with my previous fix. Now it translate fsid of direct child of
mount point directory only.

Pointed out by: Uwe Doering
2004-10-05 05:59:29 +00:00
Scott Long
41023fb33e Remove SWI_CAMNET since it's no longer used. Re-sort SWI priorities in its
absence.
2004-10-05 04:52:41 +00:00
Eric Anholt
161cb1a5c6 Add PCI ID for VIA K8T800Pro chipset. Tested with agptest and X with DRI
enabled, but not 3D.
2004-10-05 04:40:32 +00:00
Scott Long
2e8f0ae68c Remove the camnet swi and CAM_PERIPH_NET. It has never been used, and given
that netowrk-over-scsi never really took off, there is little chance that
it will ever be needed.
2004-10-05 04:22:20 +00:00
Warner Losh
14889b4229 Add taskqueue_drain. This waits for the specified task to finish, if
running, or returns.  The calling program is responsible for making sure
that nothing new is enqueued.

# man page coming soon.
2004-10-05 04:16:01 +00:00
Scott Long
8aebfc9c7e Use a taskqueue rather than an swi to handle deferred notifications. 2004-10-05 04:03:00 +00:00
Yaroslav Tykhiy
fc67901f36 Add a more verbose description for `device vlan'
to the above comment block devoted to such descriptions.
2004-10-04 14:16:17 +00:00
Yaroslav Tykhiy
1270082c84 Hint a kernel builder that vlan needs miibus, which isn't obvious. 2004-10-04 14:06:01 +00:00
Poul-Henning Kamp
37abb77f25 Change the perfectly precise message
printf("No buffers busy after final sync");
to
       printf("All buffers synced.");
in order to not leave the users wondering if there should be.
2004-10-04 13:13:23 +00:00
Poul-Henning Kamp
0d0d73e427 Use tty layer generic code instead of local copy.
Device names {cua,tty}R%r[.init,.lock] clashes with pty(4) driver
and allows for only 32 ports.  This should probably be revisited.
2004-10-04 09:38:53 +00:00
Julian Elischer
c233d032d2 Another case where we need to guard against a partially
constructed process.

Submitted by: Stephan Uphoff ( ups at tree.com	)
MFC after:	3 days
2004-10-04 06:45:48 +00:00
Alan Cox
caa665aae3 Undo revision 1.251. This change was a performance pessimizing work-around
that is no longer required.  (In fact, it is not clear that it was ever
required in HEAD or RELENG_4, only RELENG_3 required a work-around.)  Now,
as before revision 1.251, if the preexisting PTE is invalid, pmap_enter()
does not call pmap_invalidate_page() to update the TLB(s).

Note: Even with this change, the handling of a copy-on-write fault is
inefficient, in such cases pmap_enter() calls pmap_invalidate_page() twice.

Discussed with: bde@
PR: kern/16568
2004-10-03 20:14:07 +00:00
Julian Elischer
a9b5dc7d6d Always strt out with an initilalised ksegrp structure.
MFC after:	3 days
2004-10-03 20:06:11 +00:00
Stefan Farfeleder
08c7cd06b9 Use the correct printf specifier.
PR:	47187
2004-10-03 16:34:01 +00:00
Stefan Farfeleder
c8c529b86f The macro for the function specifier inline is spelled '__inline'. 2004-10-03 16:12:29 +00:00
Stefan Farfeleder
b3fc3d57e5 Use the correct type for iop_attach(). 2004-10-03 16:06:46 +00:00
David Xu
482d099c50 Don't bother to turn off other P_STOPPED bits for SIGKILL, doing
so would cause kernel to produce an unkillable process in some cases,
especially, P_STOPPED_SINGLE has a singling thread, turning off the
bit would mess the state.
2004-10-03 13:23:49 +00:00
MIHIRA Sanpei Yoshiro
e1135559d2 Add device ID for atuwi USB wlan driver,
(Atmel at76c503a http://vitsch.net/bsd/atuwi)
	o AINCOMM AWU2000B
	o ATMEL WL1130USB

PR:		kern/72195
Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch@Vitsch.net>
MFC after:	1 week
2004-10-03 09:30:09 +00:00
Brian Feldman
77b691e0ad Prevent reentrancy of the IPv6 routing code (leading to crash with
INVARIANTS on, who knows what with it off).
2004-10-03 00:49:33 +00:00
Brian Feldman
c99ee9e042 Add support to IPFW for matching by TCP data length. 2004-10-03 00:47:15 +00:00
Brian Feldman
6daf7ebd28 Add support to IPFW for classification based on "diverted" status
(that is, input via a divert socket).
2004-10-03 00:26:35 +00:00
Brian Feldman
974dfe3084 Add to IPFW the ability to do ALTQ classification/tagging. 2004-10-03 00:17:46 +00:00
Alan Cox
8ceb3dcb60 The physical address stored in the vm_page is page aligned. There is no
need to mask off the page offset bits.  (This operation made some sense
prior to i386/i386/pmap.c revision 1.254 when we passed a physical address
rather than a vm_page pointer to pmap_enter().)
2004-10-03 00:16:43 +00:00
Doug White
763f534e3c Disable MTU feedback in IPv6 if the sender writes data that must be fragmented.
Discussed extensively with KAME.  The API author's intent isn't clear at this
point, so rather than remove the code entirely, #if 0 out and put a big
comment in for now. The IPV6_RECVPATHMTU sockopt is available if the
application wants to be notified of the path MTU to optimize packet sizes.

Thanks to JINMEI Tatuya <jinmei@isl.rdc.toshiba.co.jp> for putting up
with my incessant badgering on this issue, and fenner for pointing out
the API issue and suggesting solutions.
2004-10-02 23:45:02 +00:00
Brian Feldman
96ee6195ef * Use two cdevsw's for ugen(4): one for control endpoints, and one for
data endpoints.  The control endpoint doesn't need read/write/poll
  operations, and more importantly, the thread counts should be
  separate so that the control endpoint can properly reference itself
  while deleting and recreating the data endpoints.
* Add some macros that handle referencing/releasing devices, and use them
  for sleeping/woken-up and open/close operations as apppropriate.
* Use d_purge for FreeBSD, and a loop testing the open status for all
  the endpoints for NetBSD and OpenBSD, so that when the device is
  detached, the right thing always happens.
2004-10-02 22:49:54 +00:00
Brian Feldman
df3d6ec928 * When toggling short transfers on a bulk transfer endpoint, cancel and
restart the current waiting transfer.  If this isn't done, the device's
  next transfer (that we would like to do a short read on) is going to
  return an error -- for short transfer.
* For bulk transfer endpoints, restore the maximum transfer length each
  time a transfer is done, or the first short transfer will make all the
  rest that size or smaller.
* Remove impossibilities (malloc(M_WAITOK) == NULL, &var == NULL).
2004-10-02 22:33:26 +00:00
Lukas Ertl
4cb1b18827 Don't allow to create a drive that already exists. 2004-10-02 20:50:21 +00:00
Lukas Ertl
d9d3a74c87 Correctly skip the '/dev/' part when creating new drives and prefix
a drive's provider with '/dev/' when printing the config.

Reported by:  will@
2004-10-02 20:12:20 +00:00
Poul-Henning Kamp
80e6a01a9a Add #ifdef _KERNEL which allows sicontrol(8) to include this file
from userland to get the debugging definitions.
2004-10-02 18:49:29 +00:00
Takanori Watanabe
d354520ebc Fix a problem when you try to mount a directory on another directory
belongs to the same filesystem. In this problem, getcwd(3) will fail.

I found the problem two years ago and I have forgotten to merge.

http://docs.FreeBSD.org/cgi/mid.cgi?200202251435.XAA91094
2004-10-02 17:17:04 +00:00
Poul-Henning Kamp
aefadae38e Use generic device/tty adaptation code.
New device names are "{tty|cua}A$(card)$(port)[.init|.lock]"

Put a portname in the port structure if SI_DEBUG is defined to avoid
need to inspect minor number to construct name..

Constify some strings.

Remove duplicated DBG_ #defines.
2004-10-02 16:56:08 +00:00
Pawel Jakub Dawidek
c7e17f4bbe Unlock g_gate_list_mtx mutex when we cannot allocate unit number.
MT5 candidate.

PR:		kern/72253
Submitted by:	Ivan Voras <ivoras@fer.hr>
2004-10-02 15:03:26 +00:00
Poul-Henning Kamp
d5bd33eeac Add support for CTS modemsignal as well.
RI does not seem to be supported.
2004-10-02 12:47:30 +00:00
Alan Cox
07b3303943 Eliminate unnecessary uses of PHYS_TO_VM_PAGE() from pmap_enter(). These
uses predate the change in the pmap_enter() interface that replaced the
page's physical address by the address of its vm_page structure.  The
PHYS_TO_VM_PAGE() was being used to compute the address of the same vm_page
structure that was being passed in.
2004-10-02 07:34:58 +00:00
Alan Cox
bbda1f18d9 Remove an unused declaration. (I should have included this change in
revision 1.486.)
2004-10-02 05:58:32 +00:00
Alan Cox
86dac448f2 Add a SOCKBUF_LOCK() to a rarely executed path in do_sendfile(). 2004-10-02 05:37:47 +00:00
Sam Leffler
1bfe790716 Remove extraneous SECPOLICY_LOCK_DESTROY calls that cause the mutex to be
destroyed twice.

Submitted by:	Roselyn Lee
2004-10-02 00:19:05 +00:00
Ruslan Ermilov
886ea9fc5c Document MD commands. 2004-10-01 19:44:42 +00:00
Olivier Houchard
74e9b5ed3b Add optimized version of the bswap macroes for constants if __OPTIMIZED__ is
defined.
2004-10-01 16:55:59 +00:00
Olivier Houchard
d60ea0a816 There's no need to turn on MALLOC_PROFILE by default. 2004-10-01 16:51:37 +00:00
Olivier Houchard
fbaa643e9a Don't attempt to profile __udivsi3() and friends, as mcount() uses them. 2004-10-01 16:44:08 +00:00
Yoshihiro Takahashi
725991af20 Add more PnP serial cards support.
PR:		kern/72226
Submitted by:	Hirokazu WATANABE <wnabe@par.odn.ne.jp>
2004-10-01 15:58:54 +00:00
Yoshihiro Takahashi
92f8f73a93 Fix BIOS default geometry on pc98.
PR:		kern/72225
Submitted by:	Hirokazu WATANABE <wnabe@par.odn.ne.jp>
2004-10-01 15:57:23 +00:00
Maxime Henrion
8c7ff1f331 Read the MAC address in the EEPROM in the correct byte order. This
is a no-op on little endian architectures, but fixes getting the MAC
address for some dc(4) cards on big endian architectures.

This is a RELENG_5 candidate.

Tested by:	gallatin (powerpc), marius (sparc64)
First version of the patch written by:	gallatin
2004-10-01 15:23:31 +00:00
Alfred Perlstein
50434413b0 Clear a process's procfs trace points upon delivery of SIGKILL.
MT5 candidate. (Desired features for 5.3-RELEASE "More truss problems")
2004-10-01 14:15:20 +00:00
Søren Schmidt
844acbc7a3 Always set half'n'half mode on ICH* chips. 2004-10-01 09:06:22 +00:00
Søren Schmidt
49686bbcaf Fix the serverworks modesetting code, of mask offset was wrong. 2004-10-01 09:04:53 +00:00
Brian Feldman
cbaf877f7d Add ALTQ support for dc(4), based upon a mostly-working patch from mlaier. 2004-10-01 07:04:09 +00:00
Brian Feldman
3d57a2e58e Conditionalize IFF_NEEDSGIANT, like everything else here, on IS_MPSAFE.
The driver doesn't look any less safe without Giant than with, and works
with IS_MPSAFE set to 1 here, so others should probably test it as such.
2004-10-01 07:01:38 +00:00
Poul-Henning Kamp
ba2851254f Fix a LOR relating to freeing cdevs. 2004-10-01 06:33:39 +00:00
Warner Losh
000d5e07e0 assign 187 to ata over ethernet for Sam's ata over ethernet driver.
# Yes, this is the right thing to do: we keep assignments for 4.x here
# to document them, and Sam has a nearly completed driver.
2004-10-01 06:04:24 +00:00
Alfred Perlstein
576c004fb9 cover soreadable and sowriteable with the corresponding socketbuffer locks. 2004-10-01 05:54:06 +00:00
David Schultz
506d3e1bcc nfsclient/nfs_bio.c has a PHOLD() without a PRELE(). Neither should
be necessary here.  Also, use killproc() instead of psignal().
2004-10-01 05:01:41 +00:00
David Schultz
299bc7367d Avoid calling _PHOLD(p1) with p2's lock held, since _PHOLD()
may block to swap in p1.  Instead, call _PHOLD earlier, at a
point where the only lock held happens to be p1's.
2004-10-01 05:01:29 +00:00
David Schultz
616b5f90d3 Don't PHOLD() the target process in procfs, since this is already done
in pseudofs.  Moreover, PHOLD() may block between the p_candebug()
access check and the actual operation.
2004-10-01 05:01:17 +00:00
David Schultz
46ec41ecb4 Fix the following race:
1. Process p1 is currently being swapped in.
  2. Process p2 calls linux_ptrace(PTRACE_GETFPXREGS, p1_pid, ...)
  3. After acquiring a reference to FIRST_THREAD_IN_PROC(p1),
     p2 blocks in faultin() while p1 finishes being swapped in.
     This means p2 won't get back the lock on p1 until after p1's
     threads are runnable.
  4. After p1 is swapped in, the first thread in p1 exits.
  5. p2 now uses its dangling reference to p1's first thread.
2004-10-01 05:01:00 +00:00
Ruslan Ermilov
c09be59eb6 The "autoboot" command also has a third (optional) parameter. 2004-10-01 00:15:13 +00:00
Ruslan Ermilov
3075c18308 Don't give instructions on how to disable ACPI in the MI section.
For novice users, beastie.4th can just do it.  Expert users can
read ACPI instructions by typing "help ACPI".
2004-09-30 21:57:16 +00:00
Ruslan Ermilov
ab737c5f07 Setting "kernel" to an absolute path is a bad idea because
after loading such a kernel, "module_path" will be set to
an insane value.  Fixed example by providing an equivalent
setting.  For the record, when automatically loading a
kernel (commands "boot" and "boot-conf"), the following is
tried, in this order:

	path=/boot/${kernel} file=${bootfile}
	path=/boot/${kernel} file=${kernel}
	path=${kernel} file=${bootfile}
	path=${kernel} file=${kernel}
	path=${module_path} file=${kernel}
2004-09-30 21:48:51 +00:00
Søren Schmidt
8f0fb9584e Resurrect dump that broke with the last update. 2004-09-30 20:54:59 +00:00
Ruslan Ermilov
a0a87f4d13 Bring this file more up to date. 2004-09-30 20:02:07 +00:00
Ruslan Ermilov
bc19e3ee42 Retire now useless userconfig_script_*. 2004-09-30 18:23:35 +00:00
John Baldwin
4a2aa5d054 Fix a typo to fix the !DIAGNOSTIC build.
Submitted by:	many
2004-09-30 18:13:18 +00:00
Brian Feldman
88ef2880c1 Validate the action pointer to be within the rule size, so that trying to
add corrupt ipfw rules would not potentially panic the system or worse.
2004-09-30 17:42:00 +00:00
Ruslan Ermilov
9fd3ae4889 The value of $interpret is "OK", in uppercase. 2004-09-30 17:12:05 +00:00
Ruslan Ermilov
25d34c013f Fixed the default value of the $prompt variable, document what
happens if $prompt is unset.
2004-09-30 17:11:26 +00:00
Ruslan Ermilov
ced68b5b2c Setting dump device from loader(8) has not been supported since 2002. 2004-09-30 15:27:37 +00:00
Ken Smith
e946ee1355 This along with v1.6 of counter.c fixes some timecounter issues on
MP machines (hopefully).  CPU timers are OK on UP machines but we
don't keep the timers in sync on MP machines so if the CPU's timer
is chosen as the primary timecounter it's possible for time to
not be monotonically increasing because different CPU's counters
may be used at different times.  But the CPU's counters are otherwise
one of the higher quality counters available.  So, on UP machines
we'll use a relatively high quality value but on MP machines we'll
use a quality that should prevent the CPU's counters from being chosen.

Requested by:	green (who did the first version of the patch)
Reviewed by:	marius, green
MFC after:	1 week
2004-09-30 14:38:59 +00:00
Ken Smith
9886f01b6f Set the tc_quality field of the struct before calling tc_init(), since
the structure space had been obtained from malloc() its contents is
random garbage.  The choice of value being set is part of a larger effort
to solve some timecounter issues on MP machines (while working on that
we noticed this problem).

Noticed by:	marius
Reviewed by:	marius, green
MFC after:	3 days
2004-09-30 14:30:29 +00:00
Ruslan Ermilov
818d0cba7f The default value of "bootfile" has been "kernel" since 2000. 2004-09-30 14:06:03 +00:00
Ruslan Ermilov
a9ad4b2bc7 Mention "help index" in the online help, and provide a help for
the `?' command.
2004-09-30 13:47:30 +00:00
Ruslan Ermilov
cf52f7c4de Added support for the -D boot option. 2004-09-30 13:11:55 +00:00
Ruslan Ermilov
69a02bda38 Document boot_cdrom, boot_multicons, and boot_serial.
Reduce diffs between help.common and loader(8).
Mention that boot_userconfig is currently a no-op.
2004-09-30 13:09:00 +00:00
Lukas Ertl
c3aadfb9d6 Make it possible to rebuild degraded RAID5 plexes. Note that it is
currently not possible to do this while the volume is mounted.

MFC in:  1 week
2004-09-30 12:57:35 +00:00
Ruslan Ermilov
af9cb375e8 `?' is not the same as "help index". 2004-09-30 12:16:23 +00:00
Poul-Henning Kamp
0cd3cb9a15 Assign a global unit number for the tty slave devices (init/lock) using
the new subr_unit.c code.

For now assert Giant in ttycreate() and ttyfree().  It is not obvious that
it will ever pay off to lock these with anything else.
2004-09-30 10:38:48 +00:00
Alfred Perlstein
56330e2f94 Forward declare struct kaioinfo to un-void a pointer in struct proc. 2004-09-30 09:18:48 +00:00
Poul-Henning Kamp
f6bde1fd05 Add a new API for allocating unit number (-like) resources.
Allocation is always lowest free unit number.

A mixed range/bitmap strategy for maximum memory efficiency.  In
the typical case where no unit numbers are freed total memory usage
is 56 bytes on i386.

malloc is called M_WAITOK but no locking is provided (yet).  A bit of
experience will be necessary to determine the best strategy.  Hopefully
a "caller provides locking" strategy can be maintained, but that may
require use of M_NOWAIT allocation and failure handling.

A userland test driver is included.
2004-09-30 07:04:03 +00:00
Peter Wemm
12bdf8d107 Remove extra */
Submitted by: Manfred Antar <null@pozo.com>
2004-09-30 02:13:42 +00:00
Sam Leffler
422e4f5b5b Add missing locking for secpolicy refcnt manipulations.
Submitted by:	Roselyn Lee
2004-09-30 01:08:02 +00:00
Robert Watson
dbfb9a4ee6 Merge netipsec/key.c:1.17 into KAME pfkey implementation:
date: 2004/09/26 02:01:27;  author: sam;  state: Exp;  lines: +0 -5
  Correct handling of SADB_UPDATE and SADB_ADD requests.  key_align may
  split the mbuf due to use of m_pulldown.  Discarding the result because
  of this does not make sense as no subsequent code depends on the entire
  msg being linearized (only the individual pieces).  It's likely
  something else is wrong here but for now this appears to get things back
  to a working state.

  Submitted by:   Roselyn Lee

This change was also made in the KAME CVS repository as key.c:1.337 by
itojun.
2004-09-30 00:49:55 +00:00
Philip Paeps
34ed91b45b Introduce a tunable to disable support for Synaptics touchpads. A number of
people have reported problems (stickyness, aiming difficulty) which is proving
difficult to fix, so this will default to disable until sometime after 5.3R.

To enable Synaptics support, set the 'hw.psm.synaptics_support=1' tunable.

MT5 candidate.

Approved by:	njl
2004-09-29 23:49:57 +00:00
Ken Smith
009b028629 We seem to have occasions where sending an IPI takes significantly
longer than 'normal'.  The cause is still being tracked down but
in the meantime there are machines where raising IPI_RETRIES does
help - it's not just a case of the machine staying locked up longer
and then panic-ing anyway.  Several helpful folks on sparc64@ tried
a patch that helped figure out what to raise this number to.

Discussed on:	sparc64@
MFC after:	3 days
2004-09-29 21:39:36 +00:00
Jacques Vidrine
e618ea0cdb Disallow negative coordinates and sizes in the syscons CONS_SCRSHOT
ioctl.

Reported by:	Christer Oberg <christer.oberg@deprotect.com>
2004-09-29 21:36:07 +00:00
Alan Cox
0a752e9843 Prevent the unexpected deallocation of a page table page while performing
pmap_copy().  This entails additional locking in pmap_copy() and the
addition of a "flags" parameter to the page table page allocator for
specifying whether it may sleep when memory is unavailable.  (Already,
pmap_copy() checks the availability of memory, aborting if it is scarce.
In theory, another CPU could, however, allocate memory between
pmap_copy()'s check and the call to the page table page allocator,
causing the current thread to release its locks and sleep.  This change
makes this scenario impossible.)

Reviewed by: tegge@
2004-09-29 19:20:40 +00:00
John Baldwin
30b490009b Only fall back to probing the floppy drives via hints if there is a failure
in the actual _FDE parsing.  If the failure occurs earlier such as in
fdc_attach() then don't try to probe any drives.

MFC after:	3 days
Reviewed by:	njl
Tested by:	Christian Laursen xi at borderworlds dot dk
2004-09-29 19:08:34 +00:00
Max Laier
a8b4525f63 Fix typeo. Should read ***!***IFQ_DRV_IS_EMPTY.
This might fix some of the trouble around em(4) filling up its buffers.

Submitted by:	mtm
Pointy hat to:	mlaier
MFC after:	2 days
2004-09-29 18:28:28 +00:00
Bill Paul
3229c9302a When opening a pipe, usbd_setup_pipe() will do a usbd_clear_endpoint_stall()
to make sure the pipe is ready. Some devices apparently don't support
the clear stall command however. So what happens when you issue such
devices a clear stall command? Typically, the command just times out.
This, at least, is the behavior I've observed with two devices that
I own: a Rio600 mp3 player and a T-Mobile Sidekick II.

It used to be that after the timeout expired, the pipe open operation
would conclude and you could still access the device, with the only
negative effect being a long delay on open. But in the recent past,
someone added code to make the timeout a fatal error, thereby breaking
the ability to communicate with these devices in any way.

I don't know exactly what the right solution is for this problem:
presumeably there is some way to determine whether or not a device
supports the 'clear stall' command beyond just issuing one and waiting
to see if it times out, but I don't know what that is. So for now,
I've added a special case to the error checking code so that the
timeout is once again non-fatal, thereby letting me use my two
devices again.
2004-09-29 18:12:33 +00:00
Brian Feldman
1abf2c3678 Account for alias devices when tearing them down in destroy_dev() so we
don't panic on a NULL cdev->si_devsw.
2004-09-29 16:38:38 +00:00
Bill Paul
983b3659b8 Fix minor indentation/formatting nit. (No code changes.) 2004-09-29 15:46:37 +00:00
Dag-Erling Smørgrav
479439b4fe Turn VM_KMEM_SIZE_MAX and VM_KMEM_SIZE_SCALE into tunables.
MFC after:	3 days
2004-09-29 14:21:40 +00:00
Ruslan Ermilov
4d0cb59f0f Fixed exiting from pager using the `q' key while paging
"help index" or "help <topic>" with list of subtopics.
2004-09-29 13:43:55 +00:00
Max Laier
d6a8d58875 Add an additional struct inpcb * argument to pfil(9) in order to enable
passing along socket information. This is required to work around a LOR with
the socket code which results in an easy reproducible hard lockup with
debug.mpsafenet=1. This commit does *not* fix the LOR, but enables us to do
so later. The missing piece is to turn the filter locking into a leaf lock
and will follow in a seperate (later) commit.

This will hopefully be MT5'ed in order to fix the problem for RELENG_5 in
forseeable future.

Suggested by:		rwatson
A lot of work by:	csjp (he'd be even more helpful w/o mentor-reviews ;)
Reviewed by:		rwatson, csjp
Tested by:		-pf, -ipfw, LINT, csjp and myself
MFC after:		3 days

LOR IDs:		14 - 17 (not fixed yet)
2004-09-29 04:54:33 +00:00
Robert Watson
48ac555d83 Assign so_pcb to NULL rather than 0 as it's a pointer.
Spotted by:	dwhite
2004-09-29 04:01:13 +00:00
Peter Wemm
ffee5dac09 MFi386: rev 1.239 - invalidate tlb after pte update 2004-09-29 01:59:10 +00:00
Peter Wemm
083e5bdc72 MFi386: rev 1.236 - improve panic message for a busted mptable 2004-09-29 01:58:24 +00:00
Poul-Henning Kamp
ae59037978 Use generic infrastructure for the ucom driver instead of local stuff.
This changes the naming of USB serial devices to: /dev/ttyU%d and
/dev/cuaU%d for call-in and call-out devices respectively.  (Please
notice: capital 'U')

Please also note that we now have .init and .lock devices for USB
serial ports.  These are not persistent across device removal.  devd(8)
can be used to configure them on attachment time.

These changes also improve the chances of the system surviving if
the USB device is unplugged at an inconvenient time.  At least we
do not rip things apart while there are any threads in the device
driver anymore.

	Remove cdevsw, rely on the tty generic one.

	Don't make_dev(), use ttycreate() which does all the magic.

	In detach, do close procesing if we ripped things apart
	while the device was open.  Call ttyfree() once we're done
	cleaning up.
2004-09-28 20:23:49 +00:00
Poul-Henning Kamp
0dc66bbe28 Add -1 to this non-existent use of m_print in the source tree so LINT
compiles again :-)
2004-09-28 20:14:51 +00:00
Poul-Henning Kamp
cf287576e5 Add functions to create and free the "tty-ness" of a serial port in a
generic way.  This code will allow a similar amount of code to be
removed from most if not all serial port drivers.

	Add generic cdevsw for tty devices.

	Add generic slave cdevsw for init/lock devices.

	Add ttypurge function which wakes up all know generic sleep
	points in the tty code, and calls into the hw-driver if it
	provides a method.

	Add ttycreate function which creates tty device and optionally
	cua device.  In both cases .init/.lock devices are created
	as well.

	Change ttygone() slightly to also call the hw driver provided
	purge routine.

	Add ttyfree() which will purge and destroy the cdevs.

	Add ttyconsole mode for setting console friendly termios
	on a port.
2004-09-28 19:33:49 +00:00
John-Mark Gurney
7b12509082 improve the mbuf m_print function.. Only pull length from pkthdr if there
is one, detect mbuf loops and stop, add an extra arg so you can only print
the first x bytes of the data per mbuf (print all if arg is -1), print
flags using %b (bitmask)...

No code in the tree appears to use m_print, and it's just a maner of adding
-1 as an additional arg to m_print to restore original behavior..

MFC after:	4 days
2004-09-28 18:40:18 +00:00
Bill Paul
2bb980892d Arrgh. Recently I tried using ugen(4) in an application that uses
select(2), and discovered to my horror that ugen(4)'s bulk in/out support
is horribly lobotomized. Bulk transfers are done using the synchronous
API instead of the asynchronous one. This causes the following broken
behavior to occur:

- You open the bulk in/out ugen device and get a descriptor
- You create some other descriptor (socket, other device, etc...)
- You select on both the descriptors waiting until either one has
  data ready to read
- Because of ugen's brokenness, you block in usb_bulk_transfer() inside
  ugen_do_read() instead of blocking in select()
- The non-USB descriptor becomes ready for reading, but you remain blocked
  on select()
- The USB descriptor becomes ready for reading
- Only now are you woken up so that you can ready data from either
  descriptor.

The result is select() can only wake up when there's USB data pending. If
any other descriptor becomes ready, you lose: until the USB descriptor
becomes ready, you stay asleep.

The correct approach is to use async bulk transfers, so I changed
the read code to use the async bulk transfer API. I left the write
side alone for now since it's less of an issue.

Note that the uscanner driver has the same brokenness in it.
2004-09-28 18:39:04 +00:00
John-Mark Gurney
22a11c9657 fix jumbo frames as much as they can be fixed for re. We now cap the MTU
to 7422 since it appears that the 8169S can't transmit anything larger..
The 8169S can receive full jumbo frames, but we don't have an mru to let
the upper layers know this...

add fixup so that this driver should work on alignment constrained platforms
(!i386 && !amd64)

MFC after:	5 days
2004-09-28 18:22:24 +00:00
Ken Smith
fc449eb47a Add an assertion that the pcb_nsaved field of the pcb be less than
MAXWIN to the register window manipulation functions - rwindow_load()
calls rwindow_save() so this one addition should take care of both.
This should help find places that pcb_nsaved doesn't get initialized
properly.

Suggested by:	jake
2004-09-28 16:36:58 +00:00
Olivier Houchard
77ee40aac5 Calling fuword from fuword32 with bl and without returning after is really a bad
idea.
Any way I get a customized CVS template with "Pointy hat to:	cognet"
pre-filled ?
2004-09-28 14:39:26 +00:00
Olivier Houchard
022fb84224 Always invalidate the whole data cache in pmap_enter() for now.
It should not be needed.
2004-09-28 14:38:14 +00:00
Olivier Houchard
e462e1ba03 Remove dead code. 2004-09-28 14:37:39 +00:00
Poul-Henning Kamp
4f116178ba Remove support for accessing device nodes in UFS/FFS.
Device nodes can still be created and exported with NFS.
2004-09-28 13:30:58 +00:00
Poul-Henning Kamp
19fa21aa50 Protect the start/end counts on consumers and providers with the up/down
mutexes.

Make it possible to also protect the disk statistics (at a minor cost in
performance) by setting bit 2 of kern.geom.collectstats.
2004-09-28 11:56:37 +00:00
Poul-Henning Kamp
c0f46dd1e4 Remove support for using NFS device nodes. 2004-09-28 08:50:01 +00:00
Pawel Jakub Dawidek
8dd5480d29 - Set maximum request size to MAXPHYS (128kB), instead of DFLPHYS (64kB).
- Set minimum request size to sectorsize, instead of 512 bytes.

Approved by:	phk (some time ago)
2004-09-28 08:34:27 +00:00
Pawel Jakub Dawidek
604fce4f60 Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose.
No functional change.
2004-09-28 07:33:37 +00:00
Mark Murray
932fc0bcb3 Be consistant; make the memrange bit be part of the mem module like
i386.
2004-09-28 07:29:54 +00:00
Mark Murray
393202b77c Add the memrange bits to the loadable module.
MT5 after:	3 days
2004-09-28 07:26:00 +00:00
Paul Saab
c6eadeaa66 Add ICH6 support. 2004-09-28 01:32:58 +00:00
Pawel Jakub Dawidek
e5e7825cc3 Decrease kern.geom.raid3.timeout to 4, so it is smaller than
vfs.root.mountdelay by default.
2004-09-27 22:12:14 +00:00
Pawel Jakub Dawidek
6c25233782 Deny invalid I/O requests which comes from userland here, because later
we'll get a panic.
MT5 candidate.

Reviewed by:	phk
2004-09-27 22:10:01 +00:00
Poul-Henning Kamp
87d451b95e Desupport device nodes on EXT2 filesystems. 2004-09-27 20:38:46 +00:00
Pawel Jakub Dawidek
d2fb9c62e2 Avoid race while synchronizing components. It is very hard to bump into,
but it is possible:
1. Read data from good component for synchronization.
2. Write data to the same area.
3. Write synchronization data, which are now stale.

Found by:	tegge (for gmirror)
2004-09-27 20:32:35 +00:00
Poul-Henning Kamp
52c55a26b1 Remove NFS4 vop method vector for devices: we are desupporing device nodes
on anything but DEVFS and in this case it was not even used (see below).

Put the NFS4 vop method for fifo's behind "#if 0" because it is unused.
Add a XXX comment to say that I think the unusedness is a bug.
2004-09-27 20:02:50 +00:00
Andrew Gallatin
e237071f1a Add sc_iostart to softc and unbreak the build.
This was forgotten in my previous commit to add i/o port to uninorth.c

Pointy-hat to: me
2004-09-27 19:51:58 +00:00
Poul-Henning Kamp
9f2b7bc4a8 style consistency. 2004-09-27 19:44:39 +00:00
Pawel Jakub Dawidek
829c0864cb Minor, but very important condition fix. The current one can never be true. 2004-09-27 19:32:26 +00:00
Poul-Henning Kamp
961da2716b Give cluster_write() an explicit vnode argument.
In the future a struct buf will not automatically point out a vnode for us.
2004-09-27 19:14:10 +00:00
Ken Smith
e400e0825a Some minor print/panic message cleanups. 2004-09-27 16:06:38 +00:00
Pawel Jakub Dawidek
cf41526bdc Decrease kern.geom.mirror.timeout to 4, so it is smaller than
vfs.root.mountdelay by default.
2004-09-27 13:47:37 +00:00
Ken Smith
705ea0213d Initialize the count of saved register windows to 0 in the pcb created
for the new thread.  The rest of the fields in the pcb wind up being
written to before they're read as a normal part of the pcb usage but
this field may be read upon return to userland, having it be uninitialized
garbage is bad.

Submitted by:	Andrew Belashov (bel at orel dot ru)
Reviewed by:	jake
MFC after:	3 days
2004-09-27 12:34:47 +00:00
Poul-Henning Kamp
a5993c332a Used cached cdevsw pointer. 2004-09-27 06:34:30 +00:00
Poul-Henning Kamp
743cd76a73 Add cdevsw->d_purge() support.
This device method shall wake up any threads sleeping in the device driver
and make the depart the drivers code for good.
2004-09-27 06:18:25 +00:00
Pawel Jakub Dawidek
0217ba9893 Forgot to commit addition of ds_resync field. 2004-09-26 20:42:35 +00:00
Pawel Jakub Dawidek
e8adbe4499 Avoid race while synchronizing components. It is very hard to bump into,
but it is possible:
1. Read data from good component for synchronization.
2. Write data to the same area.
3. Write synchronization data, which are now stale.

Found by:	tegge
2004-09-26 20:41:07 +00:00
Marcel Moolenaar
287e12f172 ...And fix WITNESS builds: declare syscallnames. 2004-09-26 20:39:56 +00:00
Pawel Jakub Dawidek
31522023f9 Simplify code a bit. 2004-09-26 20:30:15 +00:00
Søren Schmidt
b5dee91f5f Remove the old ATA_*LOCK_CH macros that used atomic ops and use
mutexes instead.
This closes the last (known) race issues in ATA which should fix
the various hangs etc seen on heavy loaded systems.

Change from using timeout functions to using callout functions in
the timeout code. This together with above closes the race that could
happen if timeout and device interrupt occured simultaniously.

Also fix the possible recursion in ata_reinit() on very dodgy
devices that could take us down in the probe.
2004-09-26 11:48:43 +00:00
Søren Schmidt
c5b2c44ce8 Rearrange the order of I/O's in dma-start/stop, some chipsets are very
picky on the order of this, especially in error situations.
2004-09-26 11:42:42 +00:00
Johan Karlsson
1868ee666e style: Move the { back to the else line to match the }.
Discussed with:		glebius
X-MFC after:		5.3-Release
2004-09-26 09:01:02 +00:00
Marcel Moolenaar
e6aa723212 Fix a bug introduced in the previous commit: kdb_cpu_trap() gets to
the trapframe via kdb_frame, but kdb_frame was not initialized until
after the call to kdb_cpu_trap(). Ergo: kdb_cpu_trap() was moved too
far up.

Pointy hat: marcel
2004-09-26 06:48:59 +00:00
Warner Losh
57a7beac10 detach before ivar delete. 2004-09-26 05:51:43 +00:00
Sam Leffler
6f9bd550cc Correct handling of SADB_UPDATE and SADB_ADD requests. key_align may split
the mbuf due to use of m_pulldown.  Discarding the result because of this
does not make sense as no subsequent code depends on the entire msg being
linearized (only the individual pieces).  It's likely something else is wrong
here but for now this appears to get things back to a working state.

Submitted by:	Roselyn Lee
2004-09-26 02:01:27 +00:00
Andrew Gallatin
714aa5b939 Add support for i/o-ports. This was cut and pasted from grackle.c 2004-09-26 01:56:20 +00:00
Hidetoshi Shimokawa
898b6e55d2 Invalidate dcons buffer on shutdown. 2004-09-26 01:15:38 +00:00
Marcel Moolenaar
feae534e49 Fix INVARIANTS build: Include <machine/cpu.h>. 2004-09-26 00:38:56 +00:00
Poul-Henning Kamp
3ba0c6b127 Use the floppy drive unit number to name the /dev entry, not the
controller unit number.

Submitted by:	Rostislav Krasny <rosti_bsd@yahoo.com>
2004-09-25 08:56:57 +00:00
Nate Lawson
6e1151b6ab Allow routing to the SCI even if it's not in the list of valid IRQs.
MFC if:		no problems
2004-09-25 06:15:56 +00:00
Paul Saab
5dc9afc584 Fix the statements for checking if we're dealing with a 5705/5750.
Pointhat to:	me
2004-09-25 05:07:20 +00:00
Marcel Moolenaar
03bfdd1362 Move the IA-32 trap handling from trap() to ia32_trap(). Move the
ia32_syscall() function along with it to ia32_trap.c. When COMPAT_IA32
is not defined, we'll raise SIGEMT instead.
2004-09-25 04:27:44 +00:00
Julian Elischer
2179a22cc7 Use the universal 'threaded process' flag rather than the
specific tests for different threading systems.

MFC after:	1 week
2004-09-25 00:53:46 +00:00
Paul Saab
e53d81eee9 Add support for the BCM5750/5751. Unfortunately the documentation
I have from Broadcom does not give much information on these devices,
so the Broadcom Linux driver was used for clues to what these chips
support.  It turns out they are similar to the 5705 with the 5751
being the PCI-Express version and needing special work-arounds and
settings.
2004-09-24 22:24:33 +00:00
Joerg Wunsch
360048a7ef Few (trailing) whitespace and spelling fixes. 2004-09-24 20:33:52 +00:00
Joerg Wunsch
3fc95726c4 Protect fdc->flags within the worker thread, too.
Use kthread_exit() instead of falling through the end of the worker
thread's main function.  Since kthread_exit() wakeup(9)s everyone
sleeping on the thread handle, drop the superfluous wakeup() call.
2004-09-24 20:28:00 +00:00
John Baldwin
8914e6f41c Sort forward declared structures. 2004-09-24 20:27:45 +00:00
John Baldwin
a9a64385e7 Some more whitespace, style, and comment fixes.
Submitted by:	bde (mostly)
2004-09-24 20:27:04 +00:00
John Baldwin
4afec35169 Add a proc *p pointer for td->td_proc to make this code easier to read. 2004-09-24 20:26:15 +00:00
John Baldwin
9eba48462e Improve the panic message for a busted MP table with conflicting entries
for the same PCI interrupt.

Tested by:	Pavel Gubin pg at ie dot tusur dot ru
MFC after:	3 days
2004-09-24 18:42:54 +00:00
David Schultz
f6bcadc4fc Don't look for swap blocks in objects that aren't swap-backed.
I expect that this will fix the following panic, reported by Jun:
	swap_pager_isswapped: failed to locate all swap meta blocks

MT5 candidate
2004-09-24 16:04:20 +00:00
Poul-Henning Kamp
61909e4c4f Lock the flags field with the mutex.
Improve a number of comments.
2004-09-24 13:04:49 +00:00
Hidetoshi Shimokawa
5a11c2d9ea Sync with DragonFly BSD. 2004-09-24 12:43:57 +00:00
Maxim Konovalov
4bc37f9836 o Turn net.inet.ip.check_interface sysctl off by default.
When net.inet.ip.check_interface was MFCed to RELENG_4 3+ years ago in
rev. 1.130.2.17 ip_input.c it was 1 by default but shortly changed to
0 (accidently?) in rev. 1.130.2.20 in RELENG_4 only.  Among with the
fact this knob is not documented it breaks POLA especially in bridge
environment.

OK'ed by:	andre
Reviewed by:	-current
2004-09-24 12:18:40 +00:00
Pawel Jakub Dawidek
12f5309d62 Document vfs.root.mountdelay value.
Reminded by:	ru
2004-09-24 09:33:48 +00:00
Pawel Jakub Dawidek
d0257d9c10 Rename 'mount_root_delay' tunable to 'vfs.root.mountdelay', which fits
a bit better to our current naming scheme.

Discussed with:	ru
2004-09-24 09:19:03 +00:00
Poul-Henning Kamp
891822a853 XXX mark two places where we do not hold a threadcount on the dev when
frobbing the cdevsw.

In both cases we examine only the cdevsw and it is a good question if we
weren't better off copying those properties into the cdev in the first
place.  This question will be revisited.
2004-09-24 08:32:36 +00:00
Poul-Henning Kamp
b2deb1d205 Remove the cdevsw() function which is now unused. 2004-09-24 08:30:57 +00:00
Poul-Henning Kamp
6f077de596 Hold threadcount while throbbing cdevsw in our underlying driver.
This is a bit heavyhanded, and will be simplified once the tty code
learns to properly deal with disappearing hw and drivers.
2004-09-24 08:26:03 +00:00
Poul-Henning Kamp
969d098b0f Hold thread reference while we frob cdevsw. 2004-09-24 08:12:41 +00:00
Poul-Henning Kamp
9bd188b936 Hold proper thread count while frobbing drivers ioctl. 2004-09-24 07:24:02 +00:00
Poul-Henning Kamp
8f7bea8b99 Hold threadcount reference when we call into the underlying console
driver.
2004-09-24 07:16:56 +00:00
Poul-Henning Kamp
fe0b82752b Eliminate devsw() call, we are not dereferencing the pointer. 2004-09-24 07:11:02 +00:00
Poul-Henning Kamp
bd8a0d70f4 Remove devsw() call missed in last commit. 2004-09-24 07:08:33 +00:00
Poul-Henning Kamp
af8b19780a Remove SI_ISDISK, I found a better solution. 2004-09-24 06:55:32 +00:00
Poul-Henning Kamp
a7830346e2 Assert topology is held in g_dev_getprovider().
Don't call devsw().  It is not necessary, and we do not need to hold dev_lock
to compare the devsw pointer to our own since we do not dereference it.
2004-09-24 06:43:20 +00:00
Poul-Henning Kamp
f69f5fbd42 Hold thread reference while frobbing cdevsw. 2004-09-24 06:37:00 +00:00
Poul-Henning Kamp
8ff33adb8c Hold threadref while we throb cdevsw in devtoname() 2004-09-24 06:29:23 +00:00
Poul-Henning Kamp
38f878d739 Use vn_isdisk() to check if vnode is a disk.
(repeat, CVS core dumped on me)
2004-09-24 06:23:31 +00:00
Poul-Henning Kamp
233b81be1c use vn_isdisk() to see if vnode is a disk. 2004-09-24 06:21:43 +00:00
Poul-Henning Kamp
6e8d420249 Hold dev_lock and check for NULL devsw pointer when we service FIODTYPE ioctl. 2004-09-24 06:16:48 +00:00
Poul-Henning Kamp
70526ca6a5 Hold dev_lock and check for NULL devsw pointer when we determine
if a vnode is a disk.
2004-09-24 06:16:08 +00:00
Poul-Henning Kamp
751fdd08fe Use dev_re[fl]thread() to maintain a ref on the device driver while
we call the ->d_mmap function.
2004-09-24 05:59:11 +00:00
Poul-Henning Kamp
5ef8cac184 Use def_re[fl]thread().
Retire various old compatibility helpers.
2004-09-24 05:58:06 +00:00
Poul-Henning Kamp
6230ce6aa9 use dev_re[fl]thread() rather than home rolled versions. 2004-09-24 05:55:03 +00:00
Poul-Henning Kamp
2c15afd888 Introduce dev_re[lf]thread() functions.
dev_refthread() will return the cdevsw pointer or NULL.  If the
return value is non-NULL a threadcount is held which much be released
with dev_relthread().  If the returned cdevsw is NULL no threadcount
is held on the device.
2004-09-24 05:54:32 +00:00