Commit Graph

50869 Commits

Author SHA1 Message Date
cognet
d64d5a2922 Add arm/mem.c. 2004-11-22 22:20:50 +00:00
rwatson
ec333e6577 Remove "Unlocked read" annotations associated with previously unlocked
use of socket buffer fields in the TCP input code.  These references
are now protected by use of the receive socket buffer lock.

MFC after:	1 week
2004-11-22 13:16:27 +00:00
yongari
e3c41706a9 Make hme(4) mpsafe
- Let hme_start()/hme_init() acquire lock and then call
   hme_start_locked()/hme_init_locked() respectivly.
 - Teardown interrupt handler before hme_detach().
 - Remove IFF_NEEDSGIANT flag and mark interrupt handler INTR_MPSAFE.
 - Set callout handler to CALLOUT_MPSAFE.
 - Add locks in hme MII interface.

Reviewed by:	jake
Tested by:	Julian C. Dunn  <jdunn at opentrend dot net>
MFC after:	2 weeks
2004-11-22 06:46:30 +00:00
marcel
480c409ecf Remove struct ia64_itir and use a plain old uint64_t instead. 2004-11-21 21:40:08 +00:00
cognet
f90c20620f Cleanup. 2004-11-21 19:41:27 +00:00
cognet
9990b1a0eb Set the frame pointer to 0 in fork_trampoline(). 2004-11-21 19:33:47 +00:00
cognet
22b168ab24 Implement breakpoints and single stepping on arm.
Obtained from:	NetBSD
2004-11-21 18:11:39 +00:00
cognet
774795721a Do not attempt to skip a breakpoint that is a result of a software single step,
or bad things happen.
2004-11-21 18:11:02 +00:00
imp
362677f869 Properly wither the geom container on detach. This will allow one to
then later reload fdc and not have duplicate fd devices in dev.

# Maybe this should be moved to a convenience function.

Reviewed by: phk
2004-11-21 16:25:21 +00:00
nyan
8ce0911a9f uart_i8251_ops is gone. 2004-11-21 15:18:35 +00:00
rwatson
69595c71c3 s/send/sent/ in comment describing TCPS_SYN_RECEIVED. 2004-11-21 14:38:04 +00:00
das
e764a6edec Neither of the arguments to closef() can be NULL anymore, so don't
check for that.
2004-11-21 11:06:24 +00:00
scottl
374ba89ea3 Remove an extra #include 2004-11-21 06:28:35 +00:00
scottl
2a9c9c91a8 MFC amd64:
Consolidate all of the bounce tests into the BUS_DMA_COULD_BOUNCE flag.
  Allocate the bounce zone at either tag creation or map creation to help
  avoid null-pointer derefs later on.  Track total pages per zone so that
  each zone can get a minimum allocation at tag creation time instead of
  being defeated by mis-behaving tags that suck up the max amount.
2004-11-21 04:43:28 +00:00
scottl
3018b80090 Consolidate all of the bounce tests into the BUS_DMA_COULD_BOUNCE flag.
Allocate the bounce zone at either tag creation or map creation to help
avoid null-pointer derefs later on.  Track total pages per zone so that
each zone can get a minimum allocation at tag creation time instead of
being defeated by mis-behaving tags that suck up the max amount.
2004-11-21 04:15:26 +00:00
scottl
0b30660485 Don't force busdma to pre-allocate bounce pages for static allocations. 2004-11-21 04:03:29 +00:00
scottl
6f7ab617d8 Don't force busdma to pre-allocate bounce pages for the parent tag. 2004-11-21 04:02:36 +00:00
mlaier
0ccf8f0d91 Commit ALTQ-patch for ed(4).
Requested and tested by:	pav
MFC after:			1 week
2004-11-21 02:42:09 +00:00
marcel
7a1c331305 o Support for the i8251 wasn't there. Remove the files.
o  Remove the headers with IC register definitions. The headers are
   now taken from sys/dev/ic
2004-11-21 01:51:37 +00:00
marcel
835ad23df6 Include the header with the register definitions from sys/dev/ic. They
are shared now.
2004-11-21 01:43:27 +00:00
marcel
1fa26ac061 This file was repocopied from sys/dev/uart/uart_dev_z8530.h. 2004-11-21 01:34:15 +00:00
marcel
725f195a21 This file was repocopied from sys/dev/uart/uart_dev_sab82532.h. 2004-11-21 01:33:39 +00:00
marcel
5d458a18cb Stop building uart_dev_i8251.c. It was copied from uart_dev_ns8250.c
without ever being changed to actually work with an i8251. Nobody is
working on this either at the moment, so it's not about to change
soon.
When the code necessary to support the i8251 is committed, this can
be reverted again.
2004-11-20 23:38:48 +00:00
marcel
a0d6670526 Include the common <dev/ic/ns16550.h> instead of the private
<dev/uart_dev_ns8250.h>. The latter can be removed now.
2004-11-20 23:22:04 +00:00
marcel
b27f556929 o Remove the com_thr, com_rhr, com_isr and com_lctl defines. They are
not used and aliases for other defines.
o  Add REG_DATA as an alias for com_data. Likewise for other register
   defines.
o  Add LCR_SBREAK and make CFCR_SBREAK an alias for it. Likewise for
   the other LCR register bits that are known with the CFCR prefix.
o  Add MCR_IE and make MCR_IENABLE an alias for it.
o  Add LSR_TEMT and make LSR_TSRE an alias for it.
o  Add LSR_THRE and make LSR_TXRDY as alias for it.
o  Add FCR_ENABLE and make FIFO_ENABLE as alias for it. Likewise for
   the other FCR register bits that are known with the FIFO prefix.
o  Add EFR_CTS and make EFR_AUTOCTS an alias for it.
o  Add EFR_RTS and make EFR_AUTORTS an alias for it.

This is a first step in cleaning up the definitions in this file.
2004-11-20 23:19:42 +00:00
marcel
5819df2a6e o Remove opt_ddb.h from SRCS.
o  Add opt_gdb.h and opt_kdb.h to SRCS.
2004-11-20 23:04:32 +00:00
das
6175c08488 Remove local definitions of RANGEOF() and use __rangeof() instead.
Also remove a few bogus casts.
2004-11-20 23:00:59 +00:00
cognet
feeee6f8b5 Remove useless code. 2004-11-20 16:52:30 +00:00
cognet
75354c7e52 Implement enough to be able to enter and leave DDB. 2004-11-20 16:52:10 +00:00
cognet
c2bbd5fdeb Get the kernel stack right now that the u-area is gone. 2004-11-20 16:51:32 +00:00
fjoe
89f1126514 Use M_ZERO to not panic in mtx_init when INVARIANTS enabled.
Submitted by:	simokawa
MFC after:	1 week
2004-11-20 13:10:04 +00:00
marcel
f92a530b7d Sort MFILES. 2004-11-20 06:09:11 +00:00
das
252b79ceed Remove the declaration of uarea_pages.
Reviewed by:	arch@
2004-11-20 02:33:05 +00:00
das
e02efdf4e6 Remove the p_uarea and p_upages_obj fields from struct proc.
Prototype new routines to allocate, copy, and free pstats.

Reviewed by:	arch@
2004-11-20 02:32:50 +00:00
das
35f1e7649c Remove the uarea column from the DDB 'ps' display, and from grog's gdb
scripts.

Reviewed by:	arch@
2004-11-20 02:32:42 +00:00
das
917ee09309 Update the comment about what NO_SWAPPING does.
Reviewed by:	arch@
2004-11-20 02:32:15 +00:00
das
8d8b5ace18 Maintain the broken state of backwards compatibilty for a.out (and
PECOFF!) core dumps.  None of the old versions of gdb I tried were
able to read a.out core dumps before or after this change.

Reviewed by:	arch@
2004-11-20 02:32:04 +00:00
das
02205f8827 We don't do U area swapping anymore, so update some comments. Also,
prototype the new routine that creates a mock U area for a.out core
dumps.

Reviewed by:	arch@
2004-11-20 02:31:46 +00:00
das
dbdcb7be99 Remove UAREA_PAGES and USPACE definitions. The definitions of
USPACE_SVC_STACK_TOP, USPACE_SVC_STACK_BOTTOM, USPACE_UNDEF_STACK_TOP,
and USPACE_UNDEF_STACK_BOTTOM look wrong to me, so I'm leaving them
alone.

Reviewed by:	arch@
2004-11-20 02:31:37 +00:00
das
799ea28b61 Remove some references to U area here while trying not to break
anything.  Someone with ARM hardware could do a lot more to untangle
this code.

Reviewed by:	arch@
2004-11-20 02:31:23 +00:00
das
901a681d75 Remove references to U area and garbage collect includes.
Reviewed by:	arch@
2004-11-20 02:30:59 +00:00
das
90a65a896e Remove UAREA_PAGES.
Reviewed by:	arch@
2004-11-20 02:29:50 +00:00
das
c072a76d90 U areas are going away, so don't allocate them. It's worrisome that
mp_machdep.c was using UAREA_PAGES to allocate something that isn't a
U area, and that there seems to be an implicit assumption that the PCB
is just past the end of the kernel stack.

Reviewed by:	arch@
2004-11-20 02:29:36 +00:00
das
8375566745 U areas are going away, so don't allocate one for process 0.
Reviewed by:	arch@
2004-11-20 02:29:25 +00:00
das
af608beb40 Disable U area swapping and remove the routines that create, destroy,
copy, and swap U areas.

Reviewed by:	arch@
2004-11-20 02:29:00 +00:00
das
22907ad4ac Malloc p_stats instead of putting it in the U area. We should consider
simply embedding it in struct proc.

Reviewed by:	arch@
2004-11-20 02:28:48 +00:00
das
ec9f9971e7 user.h is included only to get pcb.h, so use the latter directly instead. 2004-11-20 02:28:14 +00:00
cognet
d28f205253 Increase cnt.v_syscall and cnt.v_trap when needed. 2004-11-20 00:55:57 +00:00
glebius
c52af354ac Remove unused macro.
Approved by:	julian (mentor)
2004-11-19 22:35:53 +00:00
glebius
4eeaf10421 Cancel pending timeout before scheduling a new one. This fixes
item leak, I've introduced with previous change.

Approved by:	julian (mentor)
2004-11-19 20:23:46 +00:00
emax
9f3a10cb66 Correct typo. Return ENXIO instead of EIO. 2004-11-19 18:54:54 +00:00
scottl
f6f04e816f Revert part of rev 1.57. The tag boundary is honored by splitting the
segment, not by bouncing.
2004-11-19 17:56:22 +00:00
scottl
34b1372302 Revert part of rev 1.56. Tag boundaries are handled by splitting segments,
not through bouncing.
2004-11-19 17:51:29 +00:00
marks
2edc978740 Place function comment above the right function. 2004-11-19 00:58:30 +00:00
marks
dca89dc1d6 Rebuild from compat/freebsd32/syscalls.master:1.43
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:56:09 +00:00
marks
60b0534c96 32-bit FreeBSD ABI compatibility stubs from syscalls.master:1.179
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:54:26 +00:00
marks
443920bae9 Rebuild from syscalls.master:1.179
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:52:40 +00:00
marks
3041fc9932 Add ntp_gettime(2) system call.
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:46:14 +00:00
marks
d0ae6351d9 Add system call implementation of ntp_gettime(2).
Moved most of the work to ntp_gettime1(), which is now called by
ntp_gettime() and ntp_sysctl().

Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:44:49 +00:00
gibbs
1b5955369f Add some useful target mode diagnostics for incoming commands
under the AHC_SHOW_TQIN debug flag.
2004-11-18 20:33:43 +00:00
gibbs
b2e3496e1c Revert to basing all timeout/timer values in ms rather than us. The switch
to us was to help out the Linux port, but really just invited overflow.
In fact, the request sense timer was overflowing prior to this change making
it much shorter than intended.

aic_osm_lib.h:
	Be more careful about overflow in all timer/timeout primitives.
2004-11-18 20:22:31 +00:00
phk
a1fa5f3147 Add dropped implementation of ioctl for fifos. 2004-11-18 17:18:11 +00:00
phk
959fcf0357 Ok, first blunder: ioctls are not entirely unused on vnodes anymore :-)
Add dropped call to VOP_IOCTL().
2004-11-18 17:15:04 +00:00
phk
e424635fea Pass path to filesystem when mounting root 2004-11-18 14:31:24 +00:00
glebius
1ad65ec555 - Since divert protocol is not connection oriented, remove SS_ISCONNECTED flag
from divert sockets.
- Remove div_disconnect() method, since it shouldn't be called now.
- Remove div_abort() method. It was never called directly, since protocol
  doesn't have listen queue. It was called only from div_disconnect(),
  which is removed now.

Reviewed by:	rwatson, maxim
Approved by:	julian (mentor)
MT5 after:	1 week
MT4 after:	1 month
2004-11-18 13:49:18 +00:00
jeff
9caab2e843 - Eliminate the acquisition and release of the bqlock in bremfree() by
setting the B_REMFREE flag in the buf.  This is done to prevent lock order
   reversals with code that must call bremfree() with a local lock held.
   This also reduces overhead by removing two lock operations per buf for
   fsync() and similar.
 - Check for the B_REMFREE flag in brelse() and bqrelse() after the bqlock
   has been acquired so that we may remove ourself from the free-list.
 - Provide a bremfreef() function to immediately remove a buf from a
   free-list for use only by NFS.  This is done because the nfsclient code
   overloads the b_freelist queue for its own async. io queue.
 - Simplify the numfreebuffers accounting by removing a switch statement
   that executed the same code in every possible case.
 - getnewbuf() can encounter locked bufs on free-lists once Giant is removed.
   Remove a panic associated with this condition and delay asserts that
   inspect the buf until after it is locked.

Reviewed by:	phk
Sponsored by:	Isilon Systems, Inc.
2004-11-18 08:44:09 +00:00
phk
dbceb16b54 Make more sense out of vop_stdcreatevobject() 2004-11-18 07:55:05 +00:00
gibbs
6025687bd2 Correct another location where inquiry length as calculated from the
inquiry additional length field is off by one.

MFC: 3 days
2004-11-18 07:24:29 +00:00
imp
72ebe7a7c1 this should have been deleted a while ago 2004-11-18 04:30:17 +00:00
gibbs
fd54e1bc5a Correct an off-by-one in the calculation of the inquiry buffer length
to request from devices during the "long inquiry" portion of our probe.
This same bug was fixed in the 4.x stream a few years ago, but the fix
was never propogated to -current.

This fix is slightly different than in -stable:

 o Use offsetof() instead of a hard coded constant so as the make
   the code more self-explainatory.

 o Round odd long inquiry lengths up so as to avoid tickling ignore
   wide residue bugs in broken parallel SCSI devices running with a
   wide transfer negotiation.

MFC: 3 days
2004-11-18 04:14:32 +00:00
cognet
1158e30208 Move KERNPHYSADDR and KERNVIRTADDR from std.i80321 to std.iq31244.
Use the correct KERNPHYSADDR.
2004-11-18 00:05:09 +00:00
brueffer
602feeb308 Correct URL of the programming manual. 2004-11-17 23:36:11 +00:00
brueffer
fd1079c3d1 Add missing /* DEVICE_POLLING */ 2004-11-17 23:33:56 +00:00
mlaier
4603a76576 Fix host route addition for more than one address to a loopback interface
after allowing more than one address with the same prefix.

Reported by:	Vladimir Grebenschikov <vova NO fbsd SPAM ru>
Submitted by:	ru (also NetBSD rev. 1.83)
Pointyhat to:	mlaier
2004-11-17 23:14:03 +00:00
jmg
2687765483 only clear the IFF_OACTIVE flag when we have a chance of being able to
queue a packet to the hardware... instead of when the hardware queue is
empty..

don't initalize cur_tx now that it doesn't need to be...

Pointed out by:	bde
2004-11-17 21:35:22 +00:00
marius
95d6e9930c Remove the whole uart_cpu_identify() stuff again. Now that it's no longer
used on sparc64 they are only stubs on all architectures and it doesn't
look like if we would need it in the near future again.

Ok'ed by:	marcel
2004-11-17 20:01:43 +00:00
jmg
f5e433d72b sync comment on IFF_OACTIVE with reality.. IFF_OACTIVE is set when the
hardware cannot take anymore packets, and so will supress the calling of
the device's if_start method...

Submitted by:	bde
2004-11-17 18:32:44 +00:00
rwatson
d15ad1ae11 Hook up mac_sysv_{msg,sem,shm}.c to the build when compiling with MAC
support.
2004-11-17 17:33:59 +00:00
marius
dccaff7976 Add a front-end for the `rtc' device which is a MC146818 compatible
clock found on the ISA bus (some USIIe, USIIi and USIIIi models) and
EBus (USIII models) instead of a MK48Txx clock.

Testet by:	Matthew T. Lager" <freebsd@trinetworks.com> on Sun Fire V100,
		Xavier Beaudouin <kiwi@oav.net> on Netra X1 (initial version)
2004-11-17 16:41:42 +00:00
marius
3cd1a80422 Add a driver back end for MC146818 and compatible clocks based on the
respective NetBSD driver for use with the genclock interface.
It's first use will be on sparc64 but it was also tested on alpha with
a preliminary patch to switch alpha to use the genclock code together
with this driver instead of the respective code in alpha/alpha/clock.c
and the rather MD mcclock(4). Using it on i386 and amd64 won't be that
hard but some changes/extensions to improve the genclock code in general
should be done first, e.g. add locking and make it easier to access the
NVRAM usually coupled with RTCs.
2004-11-17 16:37:25 +00:00
marius
5883c14f19 o sparc64/isa/isa.c:
- The claim in the commit log of rev. 1.11 of dev/uart/uart_cpu_sparc64.c
    etc. that UARTs are the only relevant ISA devices on sparc64 turned out
    to be false. While there are sparc64 models where UARTs are the only
    devices on the ISA bus there are in fact also low-cost models where all
    devices traditionally found on the EBus are hooked up to the ISA bus.
    There are also models that use a mix between EBus and ISA devices with
    things like an AT keyboard controller and other rather interesting
    devices that we might want to support in the futute hook up to the ISA
    bus.
    In order to not need to add sparc64 specific device_identify methods to
    all of the respective ISA drivers and also not add OFW specific code to
    the common ISA code make the sparc64 ISA bus code fake up PnP devices so
    most ISA drivers probe their devices without further changes.
    Unfortunately Sun doesn't adhere to the ISA bindings defined in IEEE
    1275-1994 for the properties of most of the ISA devices which would
    allow to obtain the vendor and logical IDs from their properties. So we
    we just use a simple table which maps the name properties to PnP IDs.
    This could be done in a more sophisticated way but I courrently don't
    see the need for this. [1]
  - Add the children with fully mapped and specified resources (in the OFW
    sense) similar to what is done in the EBus code for the IRQ resources
    of the children as adjusting the resources and the resource list entries
    respectively in isa_alloc_resource() as done perviously causes trouble
    with drivers which use rman_get_start(), pass-through or allocate and
    release resources multiple times, etc.
    Adjusting the resources might be better off in a bus_activate_resource
    method but the common ISA code currently doesn't allow for an
    isa_activate_resource(). [2]
    With this change:
    - ppbus(4) and lpt(4) attach and work (modulo ECP mode, which requires
      real ISADMA code but it currently only consists of stubs on sparc64).
    - atkbdc(4) and atkbdc(4) attach, no further testing done.
    - fdc(4) itself attaches but causes a hang while attaching fd0 also
      when is DMA disabled, further work in fdc(4) is required here as e.g.
      fd0 uses the address of fd1 on sparc64 (not sure if sparc64 supports
      more than one floppy drive at all).
    All of these drivers previously caused panics in the sparc64 ISA code.
  - Minor changes, e.g. use __FBSDID, remove a dupe word in a comment and
    declare one global variable which isn't used outside of isa.c static.
o dev/uart/uart_cpu_sparc64.c and modules/uart/Makefile:
  - Remove the code for registering the UARTs on the ISA bus from the
    sparc64 uart_cpu_identify() again and rely on probing them via PnP.

Original idea by:	tmm [1]
No objections by:	tmm [1], [2]
2004-11-17 14:44:10 +00:00
jhb
9c6e87707d Don't bother exiting storming mode once a second to see if it has gone
away, instead only exit storming mode when an interrupt stops firing long
enough for the ithread to exit the loop and go back to sleep.

Tested by:	macrus (cruder version)
2004-11-17 14:39:41 +00:00
rwatson
eca95622d4 Implement MAC entry points relating to System V IPC, calling into the
MAC policies to perform object life cycle operations and access
control checks.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-17 13:14:24 +00:00
rwatson
9fdfeb56f4 In the kernel-only portionss of System V IPC objects (messages,
message queues, shared memory segments, and semaphores), add a struct
label pointer, which will hold the MAC labels for the objects.  As a
result of recent work to separate kernel and user space ABIs, this
should not break the ABI for applications using System V IPC, but will
require a rebuild of the ipcs monitoring tool.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-17 13:12:06 +00:00
rwatson
bbe546d283 Define new MAC framework and policy entry points for System V IPC
objects and operations:

- System V IPC message, message queue, semaphore, and shared memory
  segment init, destroy, cleanup, create operations.

- System V IPC message, message queue, seamphore, and shared memory
  segment access control entry points, including rights to attach,
  destroy, and manipulate these IPC objects.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-17 13:10:16 +00:00
marius
32940d3738 Shorten the description of the mk48txx driver to just say that it supports
MK48Txx clocks, there are now to many models supported to list them all here.
2004-11-17 12:57:24 +00:00
marius
2686579ad5 o Sync with the NetBSD mk48txx driver (the result simplyfies some changes
I have in mind for the genclock interface):
  - Recognize the MK48T18 as well (differs from the MK48T08 only in
    packaging options and voltages).
  - Allow MD code to provide functions for reading/writing NVRAM/RTC
    locations.
    If passed NULL, the old behaviour using bus_space_{read,write}_1() is
    used. Otherwise, all access to the chip goes via the MD functions.
    This is necessary for mvmeppc boards where the mk48txx NVRAM/RTC is
    not directly addressable.
  - Cleanup MI mk48txx(4) todclock driver:
    - Prepare mk48txxvar.h and leave only register definitions in
      mk48txxreg.h.
    - Define struct mk48txx_softc as usual devices and allocate necessary
      members in it.
    - Change mk48txx_attach() to only take a device_t.
o While converting the sparc64 eeprom driver to the above changes:
  - Remove some dead code and stale comments.
  - Use the NVRAM size provided by the mk48txx driver instead of hardcoding
    it as suggested by a comment.
  - Add a comment about why it doesn't make much sense to read the hostid
    directly from the NVRAM except for displaying it when attaching.
  - Don't print the hostid if it reads all zero because it's stored
    elsewhere.
2004-11-17 12:54:12 +00:00
marius
03daabfd53 Catch up with version 600000 of config(8), quotes around device names
containing digits are no longer required.
2004-11-17 12:07:14 +00:00
scottl
db12de4f40 Don't set the BUS_DMA_ALLOCNOW flag for the parent tag or the tags that are
used for static memory allocations.

Discussed with: sos
2004-11-17 11:27:30 +00:00
phk
d6a49a1565 Push Giant down through ioctl.
Don't grab Giant in the upper syscall/wrapper code

NET_LOCK_GIANT in the socket code (sockets/fifos).

mtx_lock(&Giant) in the vnode code.

mtx_lock(&Giant) in the opencrypto code.  (This may actually not be
needed, but better safe than sorry).

Devfs grabs Giant if the driver is marked as needing Giant.
2004-11-17 09:09:55 +00:00
phk
313ccfcf9e Push Giant down through select and poll.
Don't grab Giant in the upper syscall/wrapper code

NET_LOCK_GIANT in the socket code (sockets/fifos).

mtx_lock(&Giant) in the vnode code.

Devfs grabs Giant if the driver is marked as needing Giant.
2004-11-17 08:01:10 +00:00
phk
3dab450860 Split the FILEDESC_LOCK in two variants.
FILEDESC_LOCK_FAST will just grab the interlocking mutex and hold
it.  This should be used for simple modifications of a field.

FILEDESC_LOCK holds a (homegrown) sleepable lock which should be used
where sleeping is required.

The homegrown lock will probably be replaced with a generic type of lock
once we have found out how that should look.

Help and reviews by:	rwatson
2004-11-17 07:39:58 +00:00
phk
a94fe69bb7 Make vnode bypass for fifos (read, write, poll) mandatory. 2004-11-17 07:30:02 +00:00
phk
07ea2b1e7d Make vnode bypass for devices mandatory. 2004-11-17 07:18:49 +00:00
yongari
b1b71135ee Make interrupt coalescing work on big endian systems.
Also change struct ucode.length to be in number of elements (u_int32_t)
to help endian handling.

MFC after:	2 weeks
2004-11-17 04:25:10 +00:00
jhb
cc03c9de7d Initiate deorbit burn sequence for 80386 support in FreeBSD: Remove
80386 (I386_CPU) support from the kernel.
2004-11-16 20:42:32 +00:00
njl
18775667fc Enable throttling/C3 quirks for PIIX4 parts. Defer checking quirks until
after boot so that PCI is initialized and we can probe for the problem
chipsets.  Note that while probed but unusable states are disabled, they
aren't freed yet.  In the future, it may make sense to detach them.

Tested by:	Adam K Kirchoff <adamk at voicenet com>
MFC after:	2 days
2004-11-16 18:47:42 +00:00
dds
a4e1c49bd1 Improvements and fixes in the 1.241 commit:
- Have TS_ZOMBIE ttys return POLLHUP instead of POLLERR
- Remove unneeded POLLWRNORM (old bug)
- TS_ZOMBIE ttys will set POLLIN and POLLRDNORM
- Do not call selrecord in TS_ZOMBIE ttys

PR:             kern/73821
Reviewed by:	bde
MFC after:	4 weeks
2004-11-16 17:41:16 +00:00
emax
e1a47b6295 Add vkdb(4) man page and connect vkbd(4) to the build. 2004-11-16 17:19:04 +00:00
emax
0beb137e9e Add virtual AT keyboard driver vkbd(4).
Not yet connected to the build.
2004-11-16 16:59:23 +00:00
jhb
9933c3bdef Adjust the interrupt storm handling code to better handle a storm. When
a storm is detected, enter "storming" mode which throttles the interrupt
source such that the handlers are run once every clock tick.  Previously
we allowed a full set of storm_threshold interations through the handler
before going back to sleep.  Also, this currently will intentionally exit
storming mode once a second to see if the storm has passed.

Tested by:	marcus
Discussed with:	bde
2004-11-16 16:09:46 +00:00
phk
d37a7160db Polish code to correctly reflect structure. 2004-11-16 14:47:04 +00:00
phk
815ab9f694 Move a FILEDESC_UNLOCK upwards to silence witness. 2004-11-16 14:41:31 +00:00
phk
205866145e Move a FILEDESC_UNLOCK up to maintain correct nesting of FILEDESC/FILE
locking.
2004-11-16 09:12:03 +00:00
phk
79449e0341 Eliminate pointless goto. 2004-11-16 08:22:06 +00:00
phk
b3f08741db Add missing break. 2004-11-16 06:57:52 +00:00
cognet
7369f4070b Simplify a bit bus_dmamap_load_buffer by removing the "first" parameter, use
nseg == -1 instead.

Obtained from:	NetBSD
2004-11-16 00:57:44 +00:00
iedowse
2d37c72581 Fix just the worst of the timeout race conditions that the previous
backed out commits were trying to address: when cancelling the timeout
callout, also cancel the abort_task event, since it is possible that
the timeout has already fired and set up an abort_task.
2004-11-16 00:48:27 +00:00
cognet
06281152f5 MFi386:
- inlina bus_dmamap_load_buffer
- Directly pass the pmap to bus_dmamap_load_buffer, instead of the struct thread
2004-11-15 23:59:28 +00:00
jmg
4cdb4f64c1 move the lock after the NULL check so we don't have a hard(er) to diagnose
panic...

Pointed out by:	Bjoern A. Zeeb
2004-11-15 22:24:32 +00:00
phk
1329297d10 Make vnode bypass the default for devices.
Can be disabled in case of problems with
	vfs.devfs.fops=0
in loader.conf
2004-11-15 22:11:09 +00:00
phk
c941065285 Give vn_poll single exit point (to make it easier to insert
"mtx_unlock(&Giant)" real soon now).
2004-11-15 21:56:42 +00:00
phk
8f49227258 Straighten the ioctl function out to have only one exit point. 2004-11-15 21:51:28 +00:00
phk
784764896a Forgot to remove now unused variable in last commit. 2004-11-15 21:28:00 +00:00
phk
1249faecf0 It is not necessary to hold vn_start_write/vn_finished_write around VOP_REVOKE. 2004-11-15 21:27:06 +00:00
phk
98f4e5dca8 Next FILEDESC_LOCK properly around FILE_LOCK 2004-11-15 21:26:13 +00:00
imp
4e6fd1a485 Fix an off by one error. MAXPATHLEN already has +1. 2004-11-15 20:51:32 +00:00
imp
c68fcd13fa Remove more debugging 2004-11-15 20:08:44 +00:00
imp
68b696e9e4 Add acpi_sony to the list of drivers that are built. 2004-11-15 19:46:22 +00:00
jmg
079e5a8053 fix the missing lock in sk_jfree (verified w/ an assert)
also fix up handling and proding of the tx, _OACTIVE is now handled
better...

Submitted by:	Peter Edwards (sk_jfree)
Obtained from:	OpenBSD and/or NetBSD (tx prod)
2004-11-15 19:37:21 +00:00
imp
df8d3131f2 Put _ray back, as appropriate. 2004-11-15 16:33:18 +00:00
phk
b9a3a171cc Make FILE_LOCK and FILEDESC_LOCK nest properly by postponing the the
release of FILEDESC_LOCK a few more lines.
2004-11-15 16:10:55 +00:00
phk
0e1bc6bd7d Add file ops to fifofs so that we can bypass vnodes (and Giant) for the
heavy-duty operations (read, write, poll/select, kqueue).

Disabled for now, enable with "vfs.fifofs.fops=1" in loader.conf.
2004-11-15 14:51:44 +00:00
nyan
b5f85e2fdb PC98 does not have ACPI. 2004-11-15 13:28:03 +00:00
le
255694f7fc Move RAID5 offset calculation into a separate function to avoid
code duplication.
2004-11-15 13:04:55 +00:00
le
c174c57d9d Share gv_roughlength() between kernel and userland, as we will need it
there later.
2004-11-15 12:30:59 +00:00
phk
d8b3df3cb9 Make VOP_BMAP return a struct bufobj for the underlying storage device
instead of a vnode for it.

The vnode_pager does not and should not have any interest in what
the filesystem uses for backend.

(vfs_cluster doesn't use the backing store argument.)
2004-11-15 09:18:27 +00:00
phk
6809658d1c Add pbgetbo()/pbrelbo() lighter weight versions of pbgetvp()/pbrelvp(). 2004-11-15 08:47:18 +00:00
phk
ce936d6e83 Don't manually set b_bufobj, pbgetvp() does this for us. 2004-11-15 08:38:50 +00:00
phk
f71f0d1e60 More kasserts. 2004-11-15 08:33:09 +00:00
phk
042171d217 style polishing. 2004-11-15 08:22:38 +00:00
phk
ca008fe171 Move pbgetvp() and pbrelvp() to vm_pager.c with the rest of the pbuf stuff. 2004-11-15 08:12:50 +00:00
phk
4d081241bd expect the caller to have called pbrelvp() if necessary. 2004-11-15 08:07:26 +00:00
phk
f57555b632 Explicitly call pbrelvp() 2004-11-15 08:06:05 +00:00
phk
199df0cd61 Order of arguments after "optional" is not without significance:
the first field must be the name of the enabling device/option,
otherwise config doesn't know there is an option/device of that
name.
2004-11-15 07:48:22 +00:00
imp
8dabebd604 After discussions with Nate, repo copy the acpi assist drivers from
i386 to dev/acpi_support.  In theory, these devices could be found
other than in i386 machines only as amd64 becomes more popular.  These
drivers don't appear to do anything i386 specific, so move them to
dev/acpi_support.  Move config lines to files so that those
architectures that don't support kernel modules can build them into
the kernel.  At the same time, rename acpi_snc to acpi_sony to follow
the lead of all the other specialty devices.
2004-11-15 05:54:15 +00:00
imp
d54bf69758 Merge 1.3 from acpi_snc.c: don't use return_VALUE() macro
Improve style(9) compliance.
2004-11-15 05:12:17 +00:00
imp
001d3e9474 Add comment about why amd64 and ia64 don't build acpi modules. 2004-11-15 04:49:20 +00:00
marcel
74ed0a250c Apply a bandaid to avoid hangs on Ultra 2 machines. The second Z8530
connects to the keyboard and mouse and needs some special treatment.
Until this is fully understood, implemented and tested, simply avoid
probing the second Z8530. This is also what the zs(4) driver does.
2004-11-15 02:47:37 +00:00
marcel
ec1c3ebc3d Be slightly more paranoid about using the divisor in a division and
the calculated baudrate. Neither should be 0.
2004-11-15 00:00:24 +00:00
marcel
48c39479f7 Remove the BR tag. When the machine doesn't have the DIG64 HCDP
table with console settings, we now only need to know at which
address the UART lives. Leaving the baudrate unspecified results
in us using the baudrate at which the UART operates. This removes
one parameter that can interfere with a successful installation
out of the box.
2004-11-14 23:42:48 +00:00
marcel
c55bdcd31d Implement UART_IOCTL_BAUD. Consequently, when the baudrate was unset
for the console, we emit the actual baudrate during bus enumeration.
2004-11-14 23:31:19 +00:00
marcel
e8dfdbc0d9 Add UART_IOCTL_BAUD to allow us to query the hardware about the
current baudrate setting. Use this ioctl() when we don't know the
baudrate of the sysdev (as represented by a 0 value). When the
ioctl() fails, e.g. when the backend hasn't implemented it or the
hardware doesn't provide the means to determine its current baudrate
setting, we invalidate the baudrate setting by setting it to -1.
None of the backends currently implement the new ioctl().
2004-11-14 23:12:14 +00:00
marcel
3c345cd780 Make sure the baudrate specified with the BR tag is somewhat sane.
A baudrate we consider insane is silently replaced with 0. When the
baudrate is 0, we will not try to program the hardware. Instead we
leave the communication speed unaltered, maximizing the chance to
have a working console. Obviously this means we allow specifying a
0 baudrate for exactly that purpose.
2004-11-14 21:38:22 +00:00
scottl
4b4f25fcb1 Make it clear that the acpi modules can only be compiled on i386. 2004-11-14 20:53:17 +00:00
truckman
5e446cf703 s/return_VALUE/return / to fix build breakage when ACPI_DEBUG is
defined.
2004-11-14 20:37:41 +00:00
rwatson
0188f1bf36 Further refine the if_em vlan fix in if_em.c:1.53:
- Because em_encap() can now fail in a way that leaves us without an
  mbuf chain, potentially set *m_headp to NULL if that happens, so that
  the caller can do the right thing.  This case can occur when we try
  to prepend the vlan header mbuf but can't allocate additional memory.

- Modify the caller of em_encap() to detect a NULL m_head and not try
  to queue the mbuf if that happens.

- When em_encap() fails, make sure to call bus_dmamap_destroy() to
  clean up.
2004-11-14 20:20:28 +00:00
obrien
36c3b3ee0b Commit more debugging output. This is a little bit of using a large hammer,
but sk(4) is so prevalent on AMD64 motherboards we need to reduce the number
of round trips in the mailing lists trying to get sufficient information to
make sure we've got a handle on all the problems and are working towards
making sk(4) solid.

Submitted by:	bz
2004-11-14 20:17:01 +00:00
phk
d632cb3d94 Move the bit of the syncer which deals with vnodes into a separate
function.
2004-11-14 15:24:38 +00:00
phk
7339a0b3dc Rearrange memory management for ioctl arguments to use stronger checks
for illegal values and don't store them on the stack any more.
2004-11-14 14:34:12 +00:00
phk
39a0a1611e style polish. 2004-11-14 12:04:34 +00:00
phk
c61620e47e Move #define up. 2004-11-14 09:21:01 +00:00
imp
75553849ef Use PORTSDIR, falling back to /usr/ports 2004-11-14 00:22:18 +00:00
imp
d3854eb0e5 Kill ACPI_FUNCTION_TRACE. It is killing the tinderbox build, and it
isn't worth adding to the modules lists that we have to hard code for
this to work.  Since we print PID right away, we have a trace point
already.

Minor knf while I'm here.
2004-11-13 23:39:56 +00:00
phk
b99ff6bbb6 Eliminate vop_revoke() function now that devfs_revoke() does the entire job. 2004-11-13 23:38:13 +00:00
phk
aa4f69ad30 Integrate most of vop_revoke() into devfs_revoke() where it belongs. 2004-11-13 23:37:29 +00:00
phk
437fa95897 Add the devfs_fp_check() function which helps us get from a struct file
to a cdev and a devsw, doing all the relevant checks along the way.

Add the check to see if fp->f_vnode->v_rdev differs from our cached
fp->f_data copy of our cdev.  If it does the device was revoked and
we return ENXIO.
2004-11-13 23:21:54 +00:00
phk
9c54a75d69 The default VOP_REVOKE() should be vop_panic() as we should never
get here in the first place.
2004-11-13 22:59:52 +00:00
phk
5a34290b15 VOP_REVOKE() is only ever for VCHR vnodes, so unionfs does not
need a vop_revoke() method.
2004-11-13 22:56:26 +00:00
bz
a67c7e7512 Set ramsize depending on a value from eprom instead of using
hardcoded 128k for Yukon devices. 88E8001 only has 64k of on-chip RAM[1].

[1] http://www.marvell.com/products/pcconn/yukon/Yukon_88E8001_10_073103_final.pdf

Tested by:	amd64, current
Approved by:	rwatson (mentor)
MFC after:	1 week
2004-11-13 20:21:57 +00:00
phk
7204610fc8 fifos doesn't need a vop_lookup, the default will do fine. 2004-11-13 18:51:13 +00:00
phk
d5fcd8fb46 Polish two functions a bit so that it is easier to wrap them in
locks if/when we need that.
2004-11-13 17:21:26 +00:00
mlaier
5780422cd7 Merge copyright notices.
Requested by:	njl
2004-11-13 17:05:40 +00:00
ru
fe9c31f6ff There's no reason for "read" and "echo" commands to not
appear in the online command list.
2004-11-13 17:04:55 +00:00
cognet
c49c604bed Remove debugging printf. 2004-11-13 15:12:26 +00:00
cognet
341a002b6b Don't forget to clear the PG_WRITEABLE flag when appropriate. 2004-11-13 14:54:31 +00:00
cognet
35680a9d48 Use uma_prealloc() on the l2table_zone to prevent a LOR at startup. 2004-11-13 14:41:27 +00:00
phk
0eb6213e4d Be prepared to accept NULL mountargs as part of root-mounting. 2004-11-13 13:04:31 +00:00
phk
216166ee0d Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not
an issue.

The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.
2004-11-13 11:53:02 +00:00
rwatson
5f3907b408 Correct two incorrectly merged changes introduced in sysv_sem.c:1.71:
return EINVAL rather than setting error, and don't free sops
unconditionally.  The first change was merged accidentally as part of
the larger set of changes to introduce MAC labels and access control,
and potentially lead to continued processing of a request even after
it was determined to be invalid.  The second change was due to changes
in the semaphore code since the original work was performed.

Pointed out by:	truckman
2004-11-13 08:06:40 +00:00
marcel
6961594095 Fix the MDIOCDETACH ioctl() for md(4). Now that the md_file field in
the mdio structure is an array and not a pointer, we cannot test for
it to be NULL. It never is. Instead, test for md_file[0] to be '\0'.
2004-11-13 05:00:12 +00:00
philip
faa1fd5f15 o Change the strcmp() to a strncmp() to allow us to attach to 'E'
models of laptops, which are essentially the same as the normal
   ones, as far as acpi_asus is concerned[1]

 o Use the above as an excuse to reshuffle the mess I made of the
   probe function when I originally wrote it.

Reported by:	    Soeren Larsen <soeren@whiteswan.dk>
2004-11-12 23:21:19 +00:00
philip
da2085deb3 Minor whitespace nitpicking to reduce my diffs of Real Changes[tm] 2004-11-12 23:06:13 +00:00
glebius
a4a6b8f0c4 Fix ng_ksocket(4) operation as a divert socket, which is pretty useful
and has been broken twice:

- in the beginning of div_output() replace KASSERT with assignment, as
  it was in rev. 1.83. [1] [to be MFCed]
- refactor changes introduced in rev. 1.100: do not prepend a new tag
  unconditionally. Before doing this check whether we have one. [2]

A small note for all hacking in this area:
when divert socket is not a real userland, but ng_ksocket(4), we receive
_the same_ mbufs, that we transmitted to socket. These mbufs have rcvif,
the tags we've put on them. And we should treat them correctly.

Discussed with:	mlaier [1]
Silence from:	green [2]
Reviewed by:	maxim
Approved by:	julian (mentor)
MFC after:	1 week
2004-11-12 22:17:42 +00:00
cognet
ac7d3d8927 Implement interrupt counting, so that vmstat -i work. 2004-11-12 21:49:05 +00:00
mlaier
583a3d8244 Change the way we automatically add prefix routes when adding a new address.
This makes it possible to have more than one address with the same prefix.
The first address added is used for the route. On deletion of an address
with IFA_ROUTE set, we try to find a "fallback" address and hand over the
route if possible.
I plan to MFC this in 4 weeks, hence I keep the - now obsolete - argument to
in_ifscrub as it must be considered KAPI as it is not static in in.c. I will
clean this after the MFC.

Discussed on:	arch, net
Tested by:	many testers of the CARP patches
Nits from:	ru, Andrea Campi <andrea+freebsd_arch webcom it>
Obtained from:	WIDE via OpenBSD
MFC after:	1 month
2004-11-12 20:53:51 +00:00
ru
cbfb2cb072 Ports aren't generally ready for parallel make.
Pointed by:	Ben Mesander
2004-11-12 20:44:51 +00:00
peter
07d725f51d Catch a few more autofs references.
Submitted by:  obrien
2004-11-12 19:44:30 +00:00
jhb
747be736a2 Spell _KERNEL correctly so that UP kernels are actually optimized again.
Submitted by:	pjd
2004-11-12 19:18:46 +00:00
jhb
ba0a3a16d6 - Use the SMP style ops for atomic_load/store() in userland so that
libraries and binaries will work on both UP and SMP machines.
- Remove unnecessary gcc memory barrier from the UP atomic_store() op.

Submitted by:	bde
2004-11-12 18:40:22 +00:00
brueffer
55709213ca Add altq support.
Patch by mlaier.

Approved by:	mlaier
MFC after:	2 weeks
2004-11-12 18:12:04 +00:00
ru
6261ed946f Pass the "?" command output through the pager.
(This doesn't quite work as this command is overridden by Forth,
and some Forth commands are appended to the output.)
2004-11-12 13:27:49 +00:00
rwatson
891fcc9766 Second of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Use _kernel variants on _ds structures for System V sempahores, message
queues, and shared memory.  When interfacing with userspace, export
only the _ds subsets of the _kernel data structures.  A lot of search
and replace.

Define the message structure in the _KERNEL portion of msg.h so that it
can be used by other kernel consumers, but not exposed to user space.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:23:47 +00:00
rwatson
bfd525c6fc First of several commits to allow kernel System V IPC data structures
to be modified and extended without breaking the user space ABI:

Define _kernel wrapper data structures for the user-exposed data
structures that current server as the internal data structures for
the implementation:

- struct msqid_kernel wraps struct msqid_ds.
- struct semid_kernel wraps truct semid_ds.
- struct shmid_kernel wraps struct shmid_ds.
- Don't expose extern definition 'shmsegs' outside of sysv_shm.c.

Submitted by:	Dandekar Hrishikesh <rishi_dandekar at sbcglobal dot net>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, SPAWAR, McAfee Research
2004-11-12 13:21:39 +00:00
rwatson
56c8fde970 Correct a bug in the if_em driver relating to the use of vlans with
promiscuous mode introduced in 1.45, which programs the em card not
to strip or prepend tags when in promiscuous mode without also
modifying behavior to manually prepend a vlan header in the event
that the card isn't doing it on transmit.  Due to a feature of card
operation, if the global VLAN prepend/strip register isn't set,
setting the VLAN tag flag on individual packet descriptors will
cause the packet to be transmitted using ISL encapsulation rather
than 802.1Q VLAN encapsulation.

This fix causes em_encap() to prepend the header by tracking whether
the card is configured to temporarily disable prepending/stripping
due to promiscuous mode.  As a result, entering promiscuous mode on
the parent em interface no longer causes vlans to appear to "wedge"
or transmit ISL-encapsulated frames, which typically will not be
configured/spoken by the other endpoints on the VLAN trunk.  This
bug may also exist in other drivers, and the additional vlan
encapsulation logic should be abstracted and centralized in
if_vlan.c if so.

RELENG_5_3 candidate.

MFC after:	1 week
Tested by:	pjd, rwatson
Reported by:	astesin at ukrtelecom dot net
Reported by:	Mike Tancsa <mike at sentex dot net>
Reported by:	Iasen Kostov <tbyte at OTEL dot net>
2004-11-12 11:03:07 +00:00
phk
488ffe7864 Put back the vfs_object_create() calls, they do make a difference when
my test-setup does what I want it to instead of what I ask it to.

Pointed out by:	tegge
2004-11-12 10:27:14 +00:00
imp
2fe0d6951d Doh! This one crept in two commits ago and didn't get weeded out on
the last commit.  Sorry gang.

Conical Hat: imp
2004-11-12 04:48:24 +00:00
iedowse
1db017cf8c Put back usb_uncallout_drain(), as it is now also used by umass.c. 2004-11-12 03:24:12 +00:00
iedowse
b431db5c74 Back out my recent changes for timeout races, as there have been
reports of problems. The bug is probably that there are cases where
`xfer->timeout && !sc->sc_bus.use_polling' is not a suitable test
for an active timeout callout, so an explicit flag will be necessary.
Apologies for the breakage.
2004-11-12 02:57:35 +00:00
imp
54bb856be5 Various whitespace nits.
Noticed by: njl
2004-11-12 02:18:42 +00:00
imp
4527d16373 Don't use aha after calling aha_free. 2004-11-12 00:46:52 +00:00
imp
bf6428d60d PORTS_MODULES: a list of ports to build with this kernel.
# I directly use the targets for building this, but it was suggested
# to use portupgrade.  I couldn't fit that into the target model, so I
# punted.
2004-11-11 23:58:14 +00:00
imp
9489ed7779 Kill the 802.11 crypo changes that shouldn't have been committed.
Noticed by: phillip@
2004-11-11 23:30:03 +00:00
imp
9b37fa7711 Commit takawata-san's Sony Notebook Controller driver, integrated into
the tree.  Small tweaks were made by myself to eliminate unnecessary
includes and some other minor issues.  Last time I asked takawata-san
about this driver, he suggested I commit it.

Submitted by: takawata
2004-11-11 22:54:58 +00:00
jhb
dabf0d0c4f - Place the gcc memory barrier hint in the right place in the 80386 version
of atomic_store_rel().
- Use the 80386 versions of atomic_load_acq() and atomic_store_rel() that
  do not use serializing instructions on all UP kernels since a UP machine
  does need to synchronize with other CPUs.  This trims lots of cycles from
  spin locks on UP kernels among other things.

Benchmarked by:	rwatson
2004-11-11 22:42:25 +00:00
jhb
feb4d6ee90 Only warn about missing _PRT tables if bootverbose is set. I've yet to see
a bridge without a _PRT were a _PRT was needed.  Instead, the warning in
dmesg is a false warning and only serves to cause unnecessary concern.

MFC after:	1 week
2004-11-11 22:33:08 +00:00
rwatson
d7f30dee55 Correct a bug in nfsrv_create() where a call to nfsrv_access() might
be made holding the NFS server mutex.  To clean this up, introduce a
version of the function, nfsrv_access_withgiant(), that expects the
NFS server mutex to already have been dropped and Giant acquired.
Wrap nfsrv_access() around this.  This permits callers to more
efficiently check access if they're in a code block performing VFS
operations, and can be substitited for the nfsrv_access() call that
triggered this bug.

PR:		73807, 73208
MFC after:	1 week
2004-11-11 21:30:52 +00:00
jeff
311bbf4546 - Temporarily disable the nice -20 throttling code. It has some interaction
with APM that I do not understand yet.

Reported & Tested by:	glebius
2004-11-11 19:48:57 +00:00
glebius
6e5bd296a6 - Introduce protosw_init().
- Utilize it in net_init_domain().
- Utilize it pf_proto_register(), fixing panic on
  natd start.

Reviewed by:	ru, phk, obrien
2004-11-11 19:19:54 +00:00
obrien
ddc9de072e Catch up with the header repo copy. 2004-11-11 19:14:09 +00:00
phk
530b64583e Add missing '='
Spotted by:	obrien
2004-11-11 19:02:01 +00:00
des
d7f5c2c69a Unbreak the build.
Pointy hat to:	bms
2004-11-11 19:00:51 +00:00
dds
a701823f99 Return POLLERR rather than POLLIN/POLLOUT on TS_ZOMBIE ttys.
PR:		kern/73821
MFC after:	4 weeks
2004-11-11 16:10:54 +00:00
bms
facb1683b8 Remove now-unused sysctl members. 2004-11-11 15:33:40 +00:00
bms
f53d94c2fb Move per-instance sysctls under the per-device-instance tree.
Reviewed by:	mux
Prodded by:	rwatson
2004-11-11 15:31:38 +00:00
ru
7181853f80 Fix build.
Submitted by:	Taku YAMAMOTO
2004-11-11 13:01:13 +00:00
imp
08094f6af8 pbio has moved to dev/pbio
Prodded by: peter
2004-11-11 04:53:46 +00:00
brueffer
4c011814bd Add device polling support
Original patch by me, improvements by ru

Happy birthday to:	BSDforen.de!
Approved by:		ru
MFC after:		2 weeks
2004-11-10 23:04:39 +00:00
cognet
725eca69bd Don't forget to include opt_vm.h. 2004-11-10 22:11:08 +00:00
cognet
1cf3104ff5 Convert the IQ31244 code to use ARM32_NEW_VM_LAYOUT. 2004-11-10 22:09:39 +00:00
cognet
735956cb8e Add a new option, ARM32_NEW_VM_LAYOUT. When set, we try to put up to 4
L2 tables in one page, instead of the old 1 L2 table <=> 1 page behavior.
While I'm there, add ARM9_CACHE_WRITE_THROUGH, which I forgot last time.
2004-11-10 22:08:27 +00:00
cognet
bcb8f16584 Invalidate the data cache in pmap_qremove() instead of in pmap_kenter(),
and in pmap_enter_quick() instead of pmap_enter().
2004-11-10 21:46:04 +00:00
markm
828644a064 Remove at request of author, perhaps to be re-added later. 2004-11-10 19:54:18 +00:00
trhodes
feba3ea981 Remove files repocopied to sys/sparc64/sbus. 2004-11-10 14:11:10 +00:00
trhodes
2f6f7628e1 Fix paths after repocopies done by scottl
Reviewed by:	marius
OK'ed by:	scottl
2004-11-10 14:09:52 +00:00
nyan
cc99cb5f1a Fix build error with ED_DEBUG.
PR:		kern/72753
2004-11-10 13:16:12 +00:00
nyan
1a58c69767 cosmetic changes. 2004-11-10 12:28:06 +00:00
nyan
f7dac9e604 MFi386: revision 1.1170 2004-11-10 12:24:30 +00:00
glebius
b14e3d011c Add myself to copyright.
Approved by:	marks
2004-11-10 11:18:05 +00:00
phk
4a69aafbc4 remove unused variable 2004-11-10 09:56:28 +00:00
phk
16982b2183 Remove hack which mounts the root filesystem R/W if the device is
named 'md<something>'.  While convenient, it does not belong here,
if anywhere at all.
2004-11-10 07:36:09 +00:00
phk
9fdf027988 Slim vnodes by another four bytes by eliminating the (now) unused field
v_cachedid.
2004-11-10 07:31:06 +00:00
phk
d09bec0098 Pick up the inode number using VOP_GETATTR() rather than caching it
in all vnodes on the off chance that linprocfs needs it.  If we can afford
to call vn_fullpath() we can afford the much cheaper VOP_GETATTR().
2004-11-10 07:25:37 +00:00
phk
cea5000057 Remove vn_todev() 2004-11-10 07:17:28 +00:00
phk
28bd6b5898 Don't use vn_todev(). 2004-11-10 07:16:59 +00:00
phk
95d99361de fix some comments 2004-11-10 06:53:31 +00:00
simokawa
36690451fe Fix malloc type in free(). 2004-11-10 06:21:47 +00:00
julian
0c7042c36c Add record capability.
Submitted by:	Taku Yamamoto  (original author)
2004-11-10 04:29:09 +00:00
scottl
8d0c676b01 MFi386 rev 1.63-1.64:
Use tag-specific pools of bounce pages instead of a single global pool.
2004-11-10 03:49:24 +00:00
trhodes
e849b9601d Remove __P here too.
Ok'ed by:	cognet
2004-11-10 01:33:42 +00:00
imp
aef628c1eb Learn that 'b' comes before 'e' in ISO-LATIN-1 2004-11-10 00:54:18 +00:00
iedowse
f834839bdf Keep a handle on the startup rescan timer and cancel the timer if
the device goes away.
2004-11-10 00:48:22 +00:00
imp
5bf0e6b98a Make pci_do_powerstate default to 1 now that we've done the release to
get more testing.  This should help things a little.
2004-11-10 00:41:39 +00:00
imp
8c126525fe Tweaks to the resource allocation to allow a few of my obscure
cdrom/ata controller PC Card devices work better.
2004-11-10 00:33:05 +00:00
imp
1e7f87c964 Sort function names. 2004-11-10 00:07:09 +00:00
phk
a633563324 Use mount flags instead of NULL path to detect root filesystem mount. 2004-11-09 23:38:10 +00:00
pjd
64bf081bc3 Before trying to update metadata (so open consumer for writing), be sure
that the events queue is empty. In other case we're able to hit the race
where for example da0s1 is tasted by some other class, which means that
da0 is open with exclusive bit set, which means that we can't open da0
for writing if it is our component.

Reported by:	Attila Nagy <bra@fsn.hu> (and somebody else sometime ago,
		                          but I cannot find who it was)
2004-11-09 23:27:21 +00:00
pjd
412bff1f39 Introduce g_waitidlelock() function which is simlar to g_waitidle(),
but should be called with the topology lock held and returns with the
topology lock held and empty event queue.

Approved by:	phk (sometime ago)
2004-11-09 23:20:50 +00:00
trhodes
37a1084115 Remove stale comment after previous commit.
Noticed by:	pjd
2004-11-09 23:19:21 +00:00
pjd
a2d5ae235d Don't rely on DIRTY flag to be sure that consumer if open, because
DIRTY flag can be removed in idle process. Use consumer's acw field
instead to avoid opening consumer twice.
2004-11-09 23:15:40 +00:00
phk
8fe1c85657 Stop pretending to have a vm_object backing the underlying disk vnode:
it isn't used for anything anywhere and the vnode_pager would explode
if we attempted to.
2004-11-09 23:12:45 +00:00
pjd
5cac522046 For BIO_READ check if provider is open for reading and for BIO_WRITE,
check if provider is open for writing.
This fixes panic when device is open only for writing and we send write
request.
2004-11-09 23:04:45 +00:00
phk
6f9f259ced Make getdiskbyname() static to vfs_mount.c.
Eliminate use of vn_todev() while here.
2004-11-09 23:03:34 +00:00
phk
7bef55364a Remove vnode->v_cachedfs.
It was only used for the highly dangerous "export all vnodes with a sysctl"
function.
2004-11-09 22:51:03 +00:00
wilko
d6ff934045 Get in sync with reality: TurboLaser was never really well supported to
start with, so let it die in peace.  While there, remove Multia-class
as 486-like performance will not buy us much when 6.x arrives.
2004-11-09 22:24:47 +00:00
phk
5eae02ee76 Detect root mount attempts on the flag, not on the NULL path. 2004-11-09 22:21:52 +00:00
phk
37ad4f1923 Refuse attempts to mount root filesystem 2004-11-09 22:21:10 +00:00
phk
921930c585 Refuse attemps to mount root filesystem 2004-11-09 22:14:57 +00:00
mlaier
b188666781 Remove the #if 0 wrapping around !ALTQ stuff that can't be used due to ABI
stability anyway.
2004-11-09 21:29:28 +00:00
iedowse
3e514b9f37 Attempt to fix a number of race conditions in the handling of
transfer timeouts that typically cause a transfer to be completed
twice, resulting in panics and page faults:

 o A transfer completion interrupt could arrive while an abort_task
   event was set up, so the transfer would be aborted after it had
   completed. This is very easy to reproduce. Fix this by setting
   the transfer status to USBD_TIMEOUT before scheduling the
   abort_task so that the transfer completion code will ignore it.

 o The transfer completion code could execute concurrently with the
   timeout callout, leaving the callout blocked (e.g. waiting for
   Giant) while the transfer completion code runs. In this case,
   callout_stop() does not prevent the callout from running, so
   again the timeout code would run after the transfer was complete.
   Handle this case by checking the return value from callout_stop(),
   and ignoring the transfer if the callout could not be removed.

 o Finally, protect against a timeout callout occurring while a
   transfer is being aborted by another process. Here we arrange
   for the timeout processing to ignore the transfer, and use
   callout_drain() to ensure that the callout has really gone before
   completing the transfer.

This was tested by repeatedly performing USB transfers with a timeout
set to approximately the same as the normal transfer completion
time. In the PR below, apparently this occurred by accident with a
particular printer and the default timeout.

PR:		kern/71491
2004-11-09 20:51:32 +00:00