Commit Graph

50689 Commits

Author SHA1 Message Date
Pyun YongHyeon
38fa13a6a2 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 Moolenaar
2ba0042660 Remove struct ia64_itir and use a plain old uint64_t instead. 2004-11-21 21:40:08 +00:00
Olivier Houchard
b1ff74ebb3 Cleanup. 2004-11-21 19:41:27 +00:00
Olivier Houchard
7fc1bf0371 Set the frame pointer to 0 in fork_trampoline(). 2004-11-21 19:33:47 +00:00
Olivier Houchard
9ebe15a1d7 Implement breakpoints and single stepping on arm.
Obtained from:	NetBSD
2004-11-21 18:11:39 +00:00
Olivier Houchard
75f88c7ca4 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
Warner Losh
4b87c653f9 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
Yoshihiro Takahashi
ea54c3694c uart_i8251_ops is gone. 2004-11-21 15:18:35 +00:00
Robert Watson
98734750b4 s/send/sent/ in comment describing TCPS_SYN_RECEIVED. 2004-11-21 14:38:04 +00:00
David Schultz
c17ff94938 Neither of the arguments to closef() can be NULL anymore, so don't
check for that.
2004-11-21 11:06:24 +00:00
Scott Long
4c10e55d26 Remove an extra #include 2004-11-21 06:28:35 +00:00
Scott Long
938eaf8e6b 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
Scott Long
25590d09b9 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
Scott Long
1248408df3 Don't force busdma to pre-allocate bounce pages for static allocations. 2004-11-21 04:03:29 +00:00
Scott Long
8a40c10eb9 Don't force busdma to pre-allocate bounce pages for the parent tag. 2004-11-21 04:02:36 +00:00
Max Laier
ed0cf68945 Commit ALTQ-patch for ed(4).
Requested and tested by:	pav
MFC after:			1 week
2004-11-21 02:42:09 +00:00
Marcel Moolenaar
57a8f01dc1 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 Moolenaar
0204ed7a3f Include the header with the register definitions from sys/dev/ic. They
are shared now.
2004-11-21 01:43:27 +00:00
Marcel Moolenaar
43f0d5705e This file was repocopied from sys/dev/uart/uart_dev_z8530.h. 2004-11-21 01:34:15 +00:00
Marcel Moolenaar
caf45b058e This file was repocopied from sys/dev/uart/uart_dev_sab82532.h. 2004-11-21 01:33:39 +00:00
Marcel Moolenaar
694f13aaff 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 Moolenaar
76563bea53 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 Moolenaar
4f5d62fbc6 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 Moolenaar
165af6d313 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
David Schultz
6db36923ad Remove local definitions of RANGEOF() and use __rangeof() instead.
Also remove a few bogus casts.
2004-11-20 23:00:59 +00:00
Olivier Houchard
7b90b2998e Remove useless code. 2004-11-20 16:52:30 +00:00
Olivier Houchard
3488a2f7d9 Implement enough to be able to enter and leave DDB. 2004-11-20 16:52:10 +00:00
Olivier Houchard
579d53f4cf Get the kernel stack right now that the u-area is gone. 2004-11-20 16:51:32 +00:00
Max Khon
9595dba40d 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 Moolenaar
268597acfe Sort MFILES. 2004-11-20 06:09:11 +00:00
David Schultz
d567bd70be Remove the declaration of uarea_pages.
Reviewed by:	arch@
2004-11-20 02:33:05 +00:00
David Schultz
920cb0c946 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
David Schultz
626ff2081f 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
David Schultz
b99d6e6f6f Update the comment about what NO_SWAPPING does.
Reviewed by:	arch@
2004-11-20 02:32:15 +00:00
David Schultz
0ef5c36ff1 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
David Schultz
75b5bcbad6 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
David Schultz
d305a6da98 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
David Schultz
837f4b104e 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
David Schultz
6484fde022 Remove references to U area and garbage collect includes.
Reviewed by:	arch@
2004-11-20 02:30:59 +00:00
David Schultz
ab44ebf537 Remove UAREA_PAGES.
Reviewed by:	arch@
2004-11-20 02:29:50 +00:00
David Schultz
449835405d 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
David Schultz
11111b709f U areas are going away, so don't allocate one for process 0.
Reviewed by:	arch@
2004-11-20 02:29:25 +00:00
David Schultz
9799b417d5 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
David Schultz
8b059651ba 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
David Schultz
ff3fd2e764 user.h is included only to get pcb.h, so use the latter directly instead. 2004-11-20 02:28:14 +00:00
Olivier Houchard
a8a2a16a08 Increase cnt.v_syscall and cnt.v_trap when needed. 2004-11-20 00:55:57 +00:00
Gleb Smirnoff
654ec77877 Remove unused macro.
Approved by:	julian (mentor)
2004-11-19 22:35:53 +00:00
Gleb Smirnoff
92947dc698 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
Maksim Yevmenkin
bb50f99e30 Correct typo. Return ENXIO instead of EIO. 2004-11-19 18:54:54 +00:00
Scott Long
5932596e0d 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
Scott Long
e835255791 Revert part of rev 1.56. Tag boundaries are handled by splitting segments,
not through bouncing.
2004-11-19 17:51:29 +00:00
Mark Santcroos
9b7fe7e497 Place function comment above the right function. 2004-11-19 00:58:30 +00:00
Mark Santcroos
463b173e50 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
Mark Santcroos
f16ab45fbc 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
Mark Santcroos
2524cfb753 Rebuild from syscalls.master:1.179
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:52:40 +00:00
Mark Santcroos
6b270b4825 Add ntp_gettime(2) system call.
Reviewed by:	imp, phk, njl, peter
Approved by:	njl
2004-11-18 23:46:14 +00:00
Mark Santcroos
932cfd418c 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
Justin T. Gibbs
803bbd69c4 Add some useful target mode diagnostics for incoming commands
under the AHC_SHOW_TQIN debug flag.
2004-11-18 20:33:43 +00:00
Justin T. Gibbs
ad32f91b6b 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
Poul-Henning Kamp
75ad04b4f6 Add dropped implementation of ioctl for fifos. 2004-11-18 17:18:11 +00:00
Poul-Henning Kamp
18dc737317 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
Poul-Henning Kamp
7cc9fb79db Pass path to filesystem when mounting root 2004-11-18 14:31:24 +00:00
Gleb Smirnoff
c1384b5ae2 - 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 Roberson
b646893f0f - 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
Poul-Henning Kamp
c31e6a8dc8 Make more sense out of vop_stdcreatevobject() 2004-11-18 07:55:05 +00:00
Justin T. Gibbs
9a4f1a4dd4 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
Warner Losh
243e5038c3 this should have been deleted a while ago 2004-11-18 04:30:17 +00:00
Justin T. Gibbs
709a936f1f 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
Olivier Houchard
0e425b6c47 Move KERNPHYSADDR and KERNVIRTADDR from std.i80321 to std.iq31244.
Use the correct KERNPHYSADDR.
2004-11-18 00:05:09 +00:00
Christian Brueffer
b0103a491a Correct URL of the programming manual. 2004-11-17 23:36:11 +00:00
Christian Brueffer
b0452ccacc Add missing /* DEVICE_POLLING */ 2004-11-17 23:33:56 +00:00
Max Laier
9a6a6eeba2 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
John-Mark Gurney
39189ef797 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 Strobl
37f37506de 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
John-Mark Gurney
1f48dc25d7 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
Robert Watson
1fbf6dc5f1 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 Strobl
906ca21abe 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 Strobl
f46d4a6741 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 Strobl
8ff995cc5f 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
John Baldwin
d0b4135e00 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
Robert Watson
8b099b734b 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
Robert Watson
21335a5e45 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
Robert Watson
42726d8ae8 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 Strobl
f3cb1d7863 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 Strobl
2d86abb059 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 Strobl
ac20cbd343 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
Scott Long
5f26d98581 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
Poul-Henning Kamp
a0fbccc9e7 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
Poul-Henning Kamp
db446e30cc 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
Poul-Henning Kamp
d533c6e9a5 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
Poul-Henning Kamp
003e18aef4 Make vnode bypass for fifos (read, write, poll) mandatory. 2004-11-17 07:30:02 +00:00
Poul-Henning Kamp
ea566ae2a5 Make vnode bypass for devices mandatory. 2004-11-17 07:18:49 +00:00
Pyun YongHyeon
94a4f968c1 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
John Baldwin
2d68e3fb92 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
Nate Lawson
ae56b59f8b 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
Diomidis Spinellis
7690a6e4ba 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
Maksim Yevmenkin
6e81ac21f3 Add vkdb(4) man page and connect vkbd(4) to the build. 2004-11-16 17:19:04 +00:00
Maksim Yevmenkin
f89a7b24b4 Add virtual AT keyboard driver vkbd(4).
Not yet connected to the build.
2004-11-16 16:59:23 +00:00
John Baldwin
a51dae09ec 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
Poul-Henning Kamp
8ccf264fcc Polish code to correctly reflect structure. 2004-11-16 14:47:04 +00:00
Poul-Henning Kamp
1b5cd47aa0 Move a FILEDESC_UNLOCK upwards to silence witness. 2004-11-16 14:41:31 +00:00
Poul-Henning Kamp
dc99052535 Move a FILEDESC_UNLOCK up to maintain correct nesting of FILEDESC/FILE
locking.
2004-11-16 09:12:03 +00:00
Poul-Henning Kamp
9bb4281603 Eliminate pointless goto. 2004-11-16 08:22:06 +00:00
Poul-Henning Kamp
7f21497282 Add missing break. 2004-11-16 06:57:52 +00:00
Olivier Houchard
826a7f03c5 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
Ian Dowse
f6b587096b 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
Olivier Houchard
1101dd6d06 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
John-Mark Gurney
c42f170477 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
Poul-Henning Kamp
8352b1925d 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
Poul-Henning Kamp
f608397595 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
Poul-Henning Kamp
f661e9a0bc Straighten the ioctl function out to have only one exit point. 2004-11-15 21:51:28 +00:00
Poul-Henning Kamp
48ab5b2d21 Forgot to remove now unused variable in last commit. 2004-11-15 21:28:00 +00:00
Poul-Henning Kamp
136211e58e It is not necessary to hold vn_start_write/vn_finished_write around VOP_REVOKE. 2004-11-15 21:27:06 +00:00
Poul-Henning Kamp
718fe8e2bf Next FILEDESC_LOCK properly around FILE_LOCK 2004-11-15 21:26:13 +00:00
Warner Losh
6d1ab6edac Fix an off by one error. MAXPATHLEN already has +1. 2004-11-15 20:51:32 +00:00
Warner Losh
2451114ab1 Remove more debugging 2004-11-15 20:08:44 +00:00
Warner Losh
2adc126b6c Add acpi_sony to the list of drivers that are built. 2004-11-15 19:46:22 +00:00
John-Mark Gurney
069114c230 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
Warner Losh
f5c56019b9 Put _ray back, as appropriate. 2004-11-15 16:33:18 +00:00
Poul-Henning Kamp
970d8904d6 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
Poul-Henning Kamp
d6d64f0f2c 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
Yoshihiro Takahashi
26e582a2ea PC98 does not have ACPI. 2004-11-15 13:28:03 +00:00
Lukas Ertl
fb4e65d035 Move RAID5 offset calculation into a separate function to avoid
code duplication.
2004-11-15 13:04:55 +00:00
Lukas Ertl
94175098f1 Share gv_roughlength() between kernel and userland, as we will need it
there later.
2004-11-15 12:30:59 +00:00
Poul-Henning Kamp
9c83534dd8 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
Poul-Henning Kamp
5c6e573ffb Add pbgetbo()/pbrelbo() lighter weight versions of pbgetvp()/pbrelvp(). 2004-11-15 08:47:18 +00:00
Poul-Henning Kamp
ce664eaf8e Don't manually set b_bufobj, pbgetvp() does this for us. 2004-11-15 08:38:50 +00:00
Poul-Henning Kamp
287013d287 More kasserts. 2004-11-15 08:33:09 +00:00
Poul-Henning Kamp
d7fe1f51ad style polishing. 2004-11-15 08:22:38 +00:00
Poul-Henning Kamp
a752aa8f17 Move pbgetvp() and pbrelvp() to vm_pager.c with the rest of the pbuf stuff. 2004-11-15 08:12:50 +00:00
Poul-Henning Kamp
e8a7bef39e expect the caller to have called pbrelvp() if necessary. 2004-11-15 08:07:26 +00:00
Poul-Henning Kamp
676f3ee26c Explicitly call pbrelvp() 2004-11-15 08:06:05 +00:00
Poul-Henning Kamp
492871f585 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
Warner Losh
c2aed5122b 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
Warner Losh
b42dda8abf 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
Warner Losh
0d171ad896 Add comment about why amd64 and ia64 don't build acpi modules. 2004-11-15 04:49:20 +00:00
Marcel Moolenaar
982ea33b89 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 Moolenaar
bfa307a39c 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 Moolenaar
a0c88fb1d9 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 Moolenaar
d8518925d0 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 Moolenaar
54e2bcc7ad 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 Moolenaar
ecf4dc2505 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
Scott Long
428b40b211 Make it clear that the acpi modules can only be compiled on i386. 2004-11-14 20:53:17 +00:00
Don Lewis
f38e4909dd s/return_VALUE/return / to fix build breakage when ACPI_DEBUG is
defined.
2004-11-14 20:37:41 +00:00
Robert Watson
1eef0330d9 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
David E. O'Brien
acebe0cb2c 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
Poul-Henning Kamp
11bcbee11b Move the bit of the syncer which deals with vnodes into a separate
function.
2004-11-14 15:24:38 +00:00
Poul-Henning Kamp
ca51b19b18 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
Poul-Henning Kamp
3e15c66f2a style polish. 2004-11-14 12:04:34 +00:00
Poul-Henning Kamp
2e4fed7c56 Move #define up. 2004-11-14 09:21:01 +00:00