Commit graph

34647 commits

Author SHA1 Message Date
Ian Dowse 49c2ff159f Split fcntl() into a wrapper and a kernel-callable kern_fcntl()
implementation. The wrapper is responsible for copying additional
structure arguments (struct flock) to and from userland.
2002-09-02 22:24:14 +00:00
Brooks Davis 9c2060cdf4 Hook up libkern/strlcpy.c and libkern/strlcat.c after repocopy.
Obtained from:	OpenBSD
Discussed on:	-arch
2002-09-02 20:16:22 +00:00
Brooks Davis 3a93719872 Make SCSI_DELAY setable at boot time and runtime via the
kern.cam.scsi_delay tunable/sysctl.

Reviewed by:	mdodd, njl
2002-09-02 20:10:19 +00:00
Matthew Dillon 05ef87980a Grammer cleanup 2002-09-02 17:27:30 +00:00
David Xu 67bdda9718 fix bogus CTR3 message.
Reviewed by: julian@freebsd.org (mentor)
2002-09-02 07:55:06 +00:00
Alan Cox 660ab349e5 o Remove an initialized but unused variable from pmap_remove_all(). 2002-09-02 05:13:37 +00:00
Jake Burkholder 5fe3ed629a Moved elf brand identification into a function. Fully identify the
brand early in the process of loading an elf file, so that we can
identify the sysentvec, and so that we do not continue if we do not
have a brand (and thus a sysentvec).  Use the values in the sysentvec
for the page size and vm ranges unconditionally, since they are all
filled in now.
2002-09-02 04:50:57 +00:00
Alan Cox 8a59b15cd4 o Synchronize updates to struct vm_page::cow with the page queues lock. 2002-09-02 04:04:12 +00:00
Jake Burkholder 8cf034521b Fixed more indentation bugs. 2002-09-02 02:41:26 +00:00
Jake Burkholder 4f4f7ac78c Remove NOFORTH=yes, it seems to work now thanks to scottl. 2002-09-02 01:11:46 +00:00
Brooks Davis 5906e69ac2 Continue de-counting i4b. Devices i4bctl, i4bcapi, iavc, i4bq921,
i4bq931, i4b, isic, iwic, ifpi, ifpi2, ifpnp, ihfc, and itjc are
no longer count devices.  Also remove a few other instances of N<DEVICE>
being used to control compilation of whole files.

Reviewed by:    hm
2002-09-02 00:52:11 +00:00
Matt Jacob ce68dae5d6 Fix things so that:
a) we don't believe what the board tells us all the time (if the BIOS
hasn't run, port page 2 and port page 0 tend to be garbage)

b) add the missing code to set parameters for the SPI cards.

MFC after:	0 days
2002-09-01 23:07:09 +00:00
Ian Dowse 4cf64ccaed Add a missing #include <sys/lockmgr.h>. 2002-09-01 23:02:10 +00:00
Scott Long 43e9d8a3a4 Minor fixups 2002-09-01 22:50:08 +00:00
Marcel Moolenaar 9010448c55 Sync up: remove device counts. 2002-09-01 22:34:58 +00:00
Ian Dowse 206a5d3a0c Use the new kern_* functions to avoid the need to store arguments
in the stack gap. This converts most VFS and signal related system
calls, as well as select().

Discussed on:	-arch
Approved by:	marcel
2002-09-01 22:30:27 +00:00
Jake Burkholder f36ba45234 Added fields for VM_MIN_ADDRESS, PS_STRINGS and stack protections to
sysentvec.  Initialized all fields of all sysentvecs, which will allow
them to be used instead of constants in more places.  Provided stack
fixup routines for emulations that previously used the default.
2002-09-01 21:41:24 +00:00
Alexander Kabaev 0f8a5e9b3f Restore Rev. 1.40 (remove "Keyboard yes/no" printf).
GCC 3.2 overflows boot2 by 12 bytes, this patch brings it back
within the boundaries, with 12 bytes available for future bloat.

Approved by:	obrien
2002-09-01 21:29:10 +00:00
Ian Dowse ff76632189 Add a new function linux_emul_convpath(), which is a version of
linux_emul_find() that does not use stack gap storage but instead
always returns the resulting path in a malloc'd kernel buffer.
Implement linux_emul_find() in terms of this function. Also add
LCONVPATH* macros that wrap linux_emul_convpath in the same way
that the CHECKALT* macros wrap linux_emul_find().
2002-09-01 21:15:37 +00:00
Ian Dowse 8f19eb88df Split out a number of mostly VFS and signal related syscalls into
a kernel-internal kern_*() version and a wrapper that is called via
the syscall vector table. For paths and structure pointers, the
internal version either takes a uio_seg parameter or requires the
caller to copyin() the data to kernel memory as appropiate. This
will permit emulation layers to use these syscalls without having
to copy out translated arguments to the stack gap.

Discussed on:		-arch
Review/suggestions:	bde, jhb, peter, marcel
2002-09-01 20:37:28 +00:00
Eric Anholt 4775259180 Remove drm_linux.h, move the two useful defines into drm_drv.h. Use fd locking
on -current.  Actually copy in data from userspace to kernel in the
linux-compat ioctl path.  Make sure ioctl sizes are as expected in the handler
functions.

Reviewed by:	rwatson
2002-09-01 17:45:04 +00:00
Robert Watson 2fc6567e9a Since we have vp and td cached in local variables, use those instead
of derefencing the VOP arguments again when calling the UFS code.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-09-01 16:06:40 +00:00
Bruce Evans f4dcc04737 Unbreak LINT a little by not attempting to configure the nonexist option
AHC_DEBUG_SEQUENCER.
2002-09-01 15:11:06 +00:00
Scott Long 7a55322993 Use the correct bit value for a debug options 2002-09-01 07:14:26 +00:00
Scott Long 3636639d7b Remove options that don't actually exist (in this form). 2002-09-01 07:13:10 +00:00
Mike Barcroft efc8456c2e Bump __FreeBSD_version for _BSD_FOO_T_ to _FOO_T_DECLARED switch.
This should have been committed about a week ago to coincide with the
actual changes.
2002-09-01 04:49:38 +00:00
Matt Jacob 55d03500b3 Upgrade to latest QLogic f/w from their intranet site for 2100, 2200 and
2300 cards.

MFC after:	1 day
2002-09-01 02:28:36 +00:00
Juli Mallett 237d2dda36 Stylistic fixes for the inclusion of the opt_puc.h header, so it comes from the
right places, and so it's sorted consistently with how all the other N-hundreds
of files ding this do it.

Submitted by:	Hiten Pandya <hiten@uk.FreeBSD.org>
2002-09-01 01:59:38 +00:00
Peter Wemm f517797954 'aicasm optional ahc ahd' means 'build aicasm only if BOTH ahc and ahd
are specified'.  Ie: it is a logical and, not a logical or.
2002-08-31 23:30:16 +00:00
Matthew Dillon ec61f55d42 Reduce the maximum KVA reserved for swap meta structures from 70 to 32 MB.
Reduce the swap meta calculation by a factor of 2, it's still massive overkill.

X-MFC after: immediately
2002-08-31 21:15:29 +00:00
Poul-Henning Kamp 1e89655a31 More cleaning up and unhacking:
Don't expect all RIDs to be PCI rids.  The previous code made at
least 1 mistake, even for PCI.

Give the card definitions a chance to specify a init function.
Use this instead of the gross superio hack.
Move the win877 init function to puc_pci.c where it belongs.

RIDs can actually be zero, don't set badmuxed if so.

Set a less incorrect end for the construct SYS_RES_IOPORT entries,
I guess both sio and lpt happen to use 8 IO ports, but that shouldn't
really be hardcoded this way.

Fixup puc_pccard.c to match.

We're getting closer.
2002-08-31 20:29:46 +00:00
Jake Burkholder d920042a00 Make this compile. 2002-08-31 19:33:59 +00:00
Poul-Henning Kamp e6ccea0a25 Don't enable PUC_DEBUG by accident 2002-08-31 18:42:31 +00:00
Poul-Henning Kamp 32f606d105 Split the puc driver in pci specific and generic parts.
Add a pccard frontend for it as well.

The PCcard stuff does not work yet because there is still some PCImagic
left in puc.c
2002-08-31 18:38:43 +00:00
Warner Losh 4ee27e3969 Make modems work:
Don't set the CCR_OPTION register when registering/deregistering
interrupts unless the card is a MFC card.  This makes a lot of cards
work that didn't work before.  These bits are only defined for MFC
cards.

Remove COOKIE_FOR_WARNER kludges that phk introduced.

Add more debug info.

Annoy the purists by committing two minor style nits at the same time.

Many thanks to phk.  He tracked this problem down to what was screwing
things up, so fixing it became trivially easy once the problem was
understood.
2002-08-31 18:34:30 +00:00
Justin T. Gibbs 7881765df4 Add cleandepend target. 2002-08-31 17:15:43 +00:00
Poul-Henning Kamp a15ddbdd65 Different and more correct workaround for broken cards under NEWCARD:
don't spam the configuration index register.

I'm not sure where those bits truly belong, but spamming the config
index sure doesn't do us any good.
2002-08-31 16:07:17 +00:00
Justin T. Gibbs e340544a9a Pass the cleandir target on to the aicasm Makefile. This should
fix the buildkernel target.
2002-08-31 14:50:46 +00:00
Poul-Henning Kamp 49bf3e26d1 Ignore all config entries which have a non-zero start I/O address.
This is a bandaid which makes some more PCCards work under NEWCARD
which would otherwise not work.

Cards with only fixed address windows still loose.
2002-08-31 14:38:24 +00:00
Justin T. Gibbs 02b8bc8062 Complete the hookup of ahd/ahc module building. 2002-08-31 06:57:50 +00:00
Justin T. Gibbs 97145a37a6 Enable ahd/ahc register pretty printing by default. This expedites
handling of bug reports.
2002-08-31 06:56:43 +00:00
Justin T. Gibbs 4e7bbbf96c Add support for ahd/ahc register pretty printing in diagnostics.
This feature can be disabled via the AHD/AHC_REG_PRETTY_PRINT kernel
option.

The ahc driver now uses the same debug options mechanism as ahd:
AHC_DEBUG 	- Compile in debugging code
AHC_DEBUG_OPTS	- String of debug options as listed in aic7xxx.h
2002-08-31 06:55:59 +00:00
Justin T. Gibbs 887fa2a22c Sync perforce Ids. 2002-08-31 06:53:06 +00:00
Justin T. Gibbs 1a1fbd0bda Identify new controllers and the aic7901A.
Move interrupt enable to the OSM.

Remove some debugging messages.

Remove chip bug workarounds for non-production asics.
2002-08-31 06:52:27 +00:00
Justin T. Gibbs 42eac0a945 Hook up the endian macros.
Correct some comments.
2002-08-31 06:51:51 +00:00
Justin T. Gibbs c1463ef7c0 Enable card interrupts in our OSM rather than in the core.
This ensures that we don't enter our interrupt handler until
all OSM components it might reference have been fully initialized
during attach.

Remove vestiges of untagged queue handling.

Add hints to ahd_get_scb() so it knows what type of SCB collision
management to perform for each new transaction.

Properly disable/enable IU_REQ with changes in tagged queuing and
disconnection settings passed in by CAM.
2002-08-31 06:51:15 +00:00
Justin T. Gibbs adcf242ea9 Correct lun representation during packetized operation.
Uninline some routines that are just too big to be inlined.

Add some helper macros for SCB ID collision management.

Use a hardware SCB rather than a full SCB for the "next
SCB to queue" sentinal.

Update for new "high SCBID bit" qoutfifo delivery scheme.

If interrupts are disabled on the card, don't bother running
our interrupt handler.  Our handler was called due to a shared
interrupt, and the card's interrupts are explicitly disabled
to prevent entry into our interrupt handler.
2002-08-31 06:50:39 +00:00
Justin T. Gibbs 8fdc126111 Add a prefix to be used for assembler generated tables and
functions for register pretty-printing.

Implement "top bit of SCBID is valid bit" qoutfifo delivery scheme.

"the the" -> "the".

Remove old and never used tag collision chain handling in the
sequencer.  Tag collisions are never allowed to get as far as
on the controller.

Simplify busy target table handling routines.

Update comments to reflect reality.

Add support for catching more protocol violations.

Correct a bug in data fifo handling in mixed packetized and
non-packetized environments.  SG_STATE must be cleared even
if an SG fetch is not in progress at the time of FIFO shutdown
or we may confuse the non-packetized transaction idle-loop.
2002-08-31 06:49:55 +00:00
Justin T. Gibbs 3ebc100928 Convert to new assembler field syntax.
Add preliminary Rev B definitions.

Add QOUTFIFO_ENTRY_VALID_TAG for new qoufifo scheme.

Reserve SCB space for large luns.
2002-08-31 06:49:11 +00:00
Justin T. Gibbs 544c53b8be Updates for new non-packetized SCB-ID collision avoidance,
busy target table addressing changes, our qoufifo scheme,
and long lun support.

Drop bus reset hold delay to 25us.

Remove chip workarounds for revisions that never went to
production.

Add aic7901A identification information.

Remove untagged queue logic.
2002-08-31 06:48:42 +00:00
Justin T. Gibbs 3f293aaf2c Identify the AIC7901A as such instead of an AIC7902.
Push protocol violation handler to its own routine.  We now
properly detect and recovery from the following target induced
protocol violations:
	o Unexpected or invalid non-packetized Relesection
	o Command complete with no status message
	o Good Status after incomplete cdb transfer

Add an SCB collision avoidance algorithm that allows us to
use all 512 SCBs for non-packetized operations.  There is
still the possibility of running out of SCBs with non-colliding
tag identifiers, but the algorithm ensures that the stall will
be rare and short lived.

Convert to a read-only algorithm for validing entries in the
qoufifo.  The sequencer now toggles the high bit of the SCB
identifier on each wrap around of the qinfifo.  If the high
bit doesn't match the expected value for this pass of the
qoufifo, the entry is not valid.  This has the benefit of
working on machines that have large granularity cache write
back semantics without requiring any additional memory.

Remove lots of code related to untagged SCB queues.  Since
these controllers can keep a fully busy target table, we
will never have untagged SCB queues.

Lots of improvements to diagnostic logging.

Clarify some comments.

Don't clear BUSFREE interrupt enable in SIMODE1 in the SELTO
handler.  Just clearing the interrupt status is sufficient and
this avoids the chance of disabling busfree detection in connection
that occurs while we are handling the busfree interrupt.

Clear all possible interrupt sources when handling a busfree
interrupt.  The hardware clears some but not all of them.

Don't panic if we get into the default SCSIINT handler.
Dump the card state and clear all interrupt sources in the
hope that we can continue.

LASTPHASE != PREVPHASE.  Use the correct PREVPHASE for testing
against values in the PERRDIAG register.

According to SPI4, the bus free that is required after certain
PPR negotiations will only occur at the end of all message phases.
Handle the bus free if it occurs after a transaction in either
the message-in or message-out phases.  The busfree can also occur
if the status of IU_REQ changes due to a WDTR or SDTR message.
We now set the expect busfree flag in ahd_set_syncrate so that
it works regardless of message type.

Correct a problem with missing certain busfree events.  The
chip supports single-stepping even if a SCSIINT is pending.
This obviates the need to clear all of the SCSI interrupt enables
prior to single stepping.  Since ENBUSFREE can only be disabled
manually and not re-enabled, avoiding touching this bit in the
single-step case yields reliable bus free detection.

Enhance ahd_clear_intstat to clear all SCSIINT sources.

Only use ahd_update_pending_scbs() if we are active on the
bus.  We cannot modify the "MK_MESSAGE" bits on SCBs in the
execution queue if a selection might be in process since
the sequencer uses this bit to detect PPR negotiation to
a target with an outstanding IU_REQ agreement.

Allocate the SCB delivery mechansim's sentinal SCB specially
so we don't waste a valid SCB for this task.

Move tranceive state settle logic to ahd_chip_init() since
this needs to occur after every chip reset, not just the
chip reset that happens during primary driver initialization.

Correct a bug with transmitting lun information in packetized
connections.

Restrict busy target table operations to the range of luns
that can be used for non-packetized connections.  Larger luns
can only be accessed in packetized mode.

Correct a busy target table addressing bug.

Be more careful about how we shutdown the DMA engines during
bus reset events.

Only freeze the SIMQ once regardless of the number of bus
reset events that occur while we are polling for the resets
to stop.

Don't rely on the sequencer remaining paused() during our
reset poll.  It is safe for the sequencer to run during this
time, and many callers to the bus reset code would need to
be modified to make this assumption universally true.

Even if we are not going to clobber SCB state when an auto-request
sense SCB has a check condition, we must still unfreeze the queue.
Re-arrange the BAD STATUS handler to handle this case appropriately.

Modify the SCB download size depending on whether long luns are
being stored in the SCB.

Add ahd_print_register() for pretty printing register diagnostics.

Don't trust that the flexport logic to detect the presence of
a seeprom is available.  It may not be on some motherboard
implementations.

"the the" -> "the"
2002-08-31 06:48:14 +00:00
Justin T. Gibbs d10a3e08c6 If interrupts are disabled on the card, don't bother running
our interrupt handler.  Our handler was called due to a shared
interrupt, and the card's interrupts are explicitly disabled
to prevent entry into our interrupt handler.
2002-08-31 06:46:37 +00:00
Justin T. Gibbs 6c746b27b7 Update Perforce Ids. 2002-08-31 06:45:28 +00:00
Justin T. Gibbs 274c41275c Move interrupt enable into the OSM.
Set the AHC_LSCBS_ENABLED softc flag appropriately.

Convert to using softc storage for our seeprom data.

Break seeprom parsing out into a separate routine.

Change our policy in regards to AHC_SPIOCAP so that we
will allow auto-termination to take place on some aic7855
based cards.

Remove initialized but never really used variables.
2002-08-31 06:44:56 +00:00
Justin T. Gibbs 4c4797e6b4 Cleanup endian macros.
Honor the AHC_REG_PRETTY_PRINT option.

Add lock placeholders for new locks used by the core.  These
are not currently needed for FreeBSD.
2002-08-31 06:44:20 +00:00
Justin T. Gibbs 226aa6ea7a Enable card interrupts from the OSM.
Use "offset == 0" not "period == 0" to denote async trasnfers.

Implement TARG_IMMEDIATE_SCB non-disconnected target mode
SCB delivery scheme.

In our timeout handler, don't rely on the phase already being
set to denote an active connection.  IDENTIFY_SEEN is more
than sufficient.

Verify that the softc passed in ahc_detach is still known
to the driver before blindly using it.
2002-08-31 06:43:55 +00:00
Justin T. Gibbs 62cdfa05f2 Add a prefix to be used for assembler generated tables and
functions for register pretty-printing.

Only clear SELDO once we've recorded enough information for
the host to understand that the connection is valid.  The
host uses the SELDO status as a handshake to close this
race window.

Correct a bug in target mode handling of non-disconnected
transactions.  The host would indicate the correct SCB to
DMA by setting the SCB id in the currently selected hardware
SCB.  Unfortunately, we would then immediated allocate a
hardware SCB which, depending on the access patern might not
be the same hardware SCB that the host setup for us.  Avoid
this by having the host put the SCBID into scratch ram.
2002-08-31 06:43:15 +00:00
Justin T. Gibbs 264fafe657 Convert to new assembler field syntax.
Document the SXFRCTL2 register found on U2 and U160 controllers.

Overload the MWI_RESIDUAL field for use as the SCB to be downloaded
for "immediate" (or those without the disconnect privledge)
transactions.

Add scratch ram locations for the 274X that give us a bit more
information including whether to enable extended translation.
2002-08-31 06:42:38 +00:00
Justin T. Gibbs 3b06611aa7 Drop the bus reset hold delay back down to 25us. The 250us
value slipped in from a debugging session.

Add AHC_LSCBS_ENABLED and AHC_SCB_CONFIG_USED ahc_flags which
allow for some code to move to the core.

Remove extern for ahc_syncrates[].  The OSMs no longer need
direct access to this array.

Add serial eeprom field to the ahc softc.

Prototype ahc_search_untagged_queues() and ahc_print_register().

Convert to AHC_SHOW_XXX debug option format.
2002-08-31 06:42:10 +00:00
Justin T. Gibbs 31b6c79691 Add ahc_print_devinfo() to simplify some diagnostic output.
Switch to using the same AHC_SHOW_XXX format as the ahd driver.

Always give the target a MSG_INITIATOR_DET_ERR for unexpected
DT or ST phase errors.

Add AHC_SHOW_SELTO diagnostics.

Force renegotiation whenever an unexpected bus free occurs
to rule out a negotiation mismatch as the cause for the error.

Use "offset != 0" as an intenal indicator of "async" rather than
using a period of 0.

In ahc_fetch_devinfo(), correct a bug in getting "our id" as
target.  We weren't looking at all the SEQ_FLAGS that indicate
that we are still in a selected rather than reselected state.

Add support for the AHC_SHOW_MESSAGES debugging option.

If ahc_parse_msg() tells us to terminate the message loop,
do so without acking the message.  The message may be one
that the sequencer needs to handle on its own.

In ahc_parse_msg() return MSGLOOP_TERMINATED for all messages
the sequencer handles.

Allocate storage for, and track, seeprom contents in our softc.

Touch all SCB bytes to avoid parity errors should one of our
debugging routines read an otherwise uninitiatlized byte.

S/G lists must be 8 byte aligned.  Reflect this in our DMA tag.

"the the" -> "the" in a comment

When pausing the card to perform error recovery, ensure that we
are not in the process of being selected or have just been selected
but have not yet handled that selection.  This leaves only one other
race window, in the command complete handler, that needs to be fixed
to make recovery 100% bullet proof.

Convert a few straglers from bsd u_intX_t to inttypes uintX_t.

Remove unused variables.

Split out searching of the untagged holding queues to its own
routine.  In certain recovery scenarios, we want to just
remove entries in the untagged queue without touching related
transactions that are in the QINFIFO or WAITING queues that are
searched by ahc_search_qinfifo().

Add an implementation of the ahc_print_register() routine which
"pretty prints" registers.  The extra bloat in the form of string
tables for this feature is controlled by the AHC_REG_PRETTY_PRINT
option.

Fix a few bugs in ahc_enable_lun() that could prevent controllers
lacking the multiple-target-id feature from changing "our id" on
the fly.  Add a large comment to this section while I'm here
describing the restrictions on "id switching".
2002-08-31 06:41:37 +00:00
Justin T. Gibbs b73b70cca7 Pass unparsed serial eeprom information into the driver core.
Honor the extended translation setting for EISA cards now that
I've determined where this information is kept.

Defer card interrupt enabling to the OSM since it may have
some initialization to perform that must occur before interrupts
can be enabled.
2002-08-31 06:40:32 +00:00
Justin T. Gibbs 63183d8c4e Update assembler syntax and assembler to allow generation of register
description tables used for diagnostic "pretty printing".
2002-08-31 06:39:41 +00:00
Bruce Evans efdfb8fea3 db_ps.c:
Don't attempt to follow null pointers for zombie processes in db_ps().

Style fix: use explicit an comparison with NULL for all null pointer
checks in db_ps() instead of for half of them.

db_interface.c:
Fixed ddb's handling of traps from with ddb on i386's only.

This was mostly fixed in rev.1.27 (by longjmp()'ing back to the top
level) but was completly broken in rev.1.48 (by not unwinding the new
state (mainly db_active) either before or after the longjmp().  This
mostly never worked for other arches, since rev.1.27 has not been ported
and lower level longjmp()'s only handle traps for memory accesses.  All
cases should be handled at a lower level to provided better control and
simplify unwinding of state.

Implementation details: don't pretend to maintain db_active in a nested
way -- ddb cannot be reentered in a nested way.  Use db_active instead
of the db_global_jmpbuf_valid flag and longjmp()'s return value for things
related to reentering ddb.  [re]entering is still not atomic enough.
2002-08-31 04:25:44 +00:00
Peter Wemm 31cdffc6d8 Take a shot at fixing up a whole stack of style and other embarresing
unforced errors that Bruce identified.  I have not yet addressed all of
his concerns.
2002-08-31 03:33:32 +00:00
John Baldwin ea9b09fef2 Maxmem is a long, so update printf format so this compiles. 2002-08-31 03:21:59 +00:00
Peter Wemm 0b1482d1fd Do not use an object for the pte and pv zones on ia64 because it overrides
the pmap_allocf() function that we provide above.  We still use the limits
via other means.

Submitted by:	jeff
2002-08-31 03:11:20 +00:00
Justin T. Gibbs 621c0e6c92 Tell the user about a failed IRQ mapping rather than fail silently. 2002-08-31 03:04:08 +00:00
Scott Long f1757c6ee7 Make ficl work on sparc64. The assumption that int == long == void * is
very pervasive in this code.  This fixes a few of those assumptions and
band-aids over some others.

Tested on: ia32 alpha sparc64

Reviewed by:	peter jake (in concept)
2002-08-31 01:04:53 +00:00
Justin T. Gibbs e211c13e86 Add IDs for upcoming LSI U320 products that use the MegaRAID interface.
Adjust format of one comment so it doesn't wrap at 80 columns.
Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 18:28:00 +00:00
Matthew Dillon cac4515267 Implement data, text, and vmem limit checking in the elf loader and svr4
compat code.  Clean up accounting for multiple segments.  Part 1/2.

Submitted by:	Andrey Alekseyev <uitm@zenon.net> (with some modifications)
MFC after:	3 days
2002-08-30 18:09:46 +00:00
Justin T. Gibbs 817bd00cec Reserve majors 171 and 172 for the "mide" (LSI MegaRAID IDE control device)
and "mided" (LSI MegaRAID IDE disk device).

Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 16:54:02 +00:00
John Baldwin 401e7fff61 Revert previous untested revision. The i386 loader consists of three parts:
At the front is btxldr, in the middle is BTX itself (our mini-kernel), and
then the 'client' (loader.bin) which is the actual loader itself.  boot2
just executes a raw ELF or a.out binary with the only setup provided being
that a bootinfo structure is passed on the stack.  Now, since loader.bin
is a BTX client, the loader needs to be able to locate a BTX kernel for
the client to execute in the context.  Thus, just like pxelder, btxldr
uses the a.out header on the loader binary to find the BTX kernel stored
in the loader and set it up.  It does _not_ just reuse the BTX kernel
that boot2 invoked it with.  This is because it can't assume that it will
_have_ a "spare" BTX kernel lying around.  For example, when cdboot
loads the loader there isn't an existing BTX kernel.  In fact, cdboot
will only work with an a.out loader as well since it also "borrows" the
BTX kernel in the loader binary (which it finds by parsing the a.out
header) just as pxeldr does.  The only difference between cdboot and
pxeldr is where they get /boot/loader from.

If we wanted to make /boot/loader be an actual ELF binary we would need
to change the following utilites to handle that (and they all have to be
able to handle locating the BTX kernel inside of an ELF binary somehow):
- btxldr
- pxeldr
- cdboot

If we didn't want to require a flag day but make the transition smooth
then we need to be able to support both a.out and ELF versions of
/boot/loader which isn't exactly trivial since all three of these utilities
are written in assembly.

Pointy-hat to:	peter
2002-08-30 14:59:47 +00:00
Maxim Sobolev d8afaeb24b Whitespace-only: don't mix tabs and spaces for doing identation. 2002-08-30 14:21:01 +00:00
Maxim Sobolev 25faf49d12 Fix a silly typo in user-setable promisc mode code.
Pointed out by:	Yann Berthier <yb@sainte-barbe.org>
MFC after:	1 day
2002-08-30 13:37:13 +00:00
Mitsuru IWASAKI 6c40705212 s/hint.acpi.0.disable/hint.acpi.0.disabled/
Fix device hints entry for disabling acpi(4).
This also should fix the arbitration with apm(4) when both drivers
are enabled.

Note that your /boot/device.hints needs to be updated if you want to
stop auto-loading acpi.ko or disable acpi(4).
2002-08-30 11:11:07 +00:00
Poul-Henning Kamp d0e9b8dbc4 Correctly handle setting, getting and deleting EA's with zero length content.
Sponsored by:	DARPA & NAI Labs.
2002-08-30 08:57:09 +00:00
Andrey A. Chernov 692821870b Unbreak kernel build by printing Maxmem using %ld instead of old (now changed)
%u
2002-08-30 06:13:39 +00:00
Scott Long eb3025b3ed The aac driver needs 256K of contiguous physical memory in order to
attach.  If it can't get that (highly likely if loaded as a module on
a system that's been up for a while), give a more descriptive error
message.
Also clean up some nearby style nits.

MFC after:	2 days
2002-08-30 05:02:07 +00:00
Peter Wemm 447b3772dc Change hw.physmem and hw.usermem to unsigned long like they used to be
in the original hardwired sysctl implementation.

The buf size calculator still overflows an integer on machines with large
KVA (eg: ia64) where the number of pages does not fit into an int.  Use
'long' there.

Change Maxmem and physmem and related variables to 'long', mostly for
completeness.  Machines are not likely to overflow 'int' pages in the
near term, but then again, 640K ought to be enough for anybody.  This
comes for free on 32 bit machines, so why not?
2002-08-30 04:04:37 +00:00
Matt Jacob d3ecac6617 Sigh. Ken Merry convinced me that my attempts to DTRT were wrong.
Replace dual copyright with a plain BSD style copyright assigned
to LSI Logic. This is still within the intents of express consent
from LSI.

MFC after:	2 days
2002-08-30 03:36:50 +00:00
Matt Jacob eae4a35f9f Add 909A PCI id.
MFC after:	2 days
2002-08-30 02:35:31 +00:00
Matt Jacob 8d4ee0ece1 Add an additional copyright (with the express consent of LSI Logic) that
specifically allows for (via 'BSD Style' licensing) source && binary
redistribution.

Pointy hat to: Matt, for not getting this done ahead of time.

MFC after: 2 days
2002-08-30 02:34:19 +00:00
Peter Wemm 60e4a5e539 AARGH! btoc() is used in the MI buffer sizing routines to calculate
the minimum of either physmem or KVA.  But.. btoc() casts the address
to (unsigned int).  This is NOT GOOD on 64 bit machines and on alpha and
ia64, this results in a buffer limit of around 500K (not megs).  This
causes extreme disk access problems on alpha and ia64.  Since this cast
is simply to ensure that it is unsigned, use 'vm_offset_t' instead.  This
is available because it is already defined in types.h.

Alpha has been suffering from this for ages. It always felt like the
caching wasn't working, and unfortunately it turned out that way. :-(
2002-08-30 00:29:52 +00:00
Julian Elischer 472be95807 Rejig the code to figure out estcpu and work out how long a KSEGRP has been
idle. What was there before was surprisingly ALMOST correct.

Peter and I fried our brains on this for a couple of hours figuring out
what this actually means in the context of multiple threads.

Reviewed by:	peter@freebsd.org
2002-08-30 00:25:49 +00:00
Peter Wemm c34fd0a79a Try #2 at having /boot/loader default to ELF. Have pxeldr build its
own a.out version of loader.bin rather than depend on ../loader/loader
being a.out.
2002-08-29 23:37:44 +00:00
Peter Wemm ee92a1ab51 Actually remove the a.out kld loader. While I am not 100% sure, I believe
it is broken.  It certainly has been suffering neglect.  It is not needed
because we never shipped a.out kld's and they never really worked right.
2002-08-29 23:04:05 +00:00
Peter Wemm ba568b7e46 Actually remove the stale a.out kld support. This is the stuff that was
never updated for the metadata infrastructure.
2002-08-29 23:02:37 +00:00
Julian Elischer 88151aa3f5 Fix crack-smoking code that was panicing on the quad xeon:
- If either of proc or kse are NULL during thread_exit(), then
          the kernel is going to fault because parts of the function
          assume they aren't NULL.  Instead, just assert they aren't NULL
          (as well as the kse group) and assume they are in all of the
          code.  It doesn't make sense for them to be NULL here anyways.
        - Move the PROC_UNLOCK(p) up above clearing td_proc, etc. since
          otherwise we will panic if the proc's lock is contested.

Submitted by:	jhb@freebsd.org
2002-08-29 19:49:53 +00:00
Scott Long c02a39a15d Fix a silly off my one error that caused crashes on resume in certain
circumstances.  The problem was only reported with -stable, but it's
obviously wrong in -current also.  MFC is forthcoming.

Submitted by:	doconnor@dsoft.com.au
2002-08-29 15:06:26 +00:00
Darren Reed 1851791868 some ipfilter files that accidently got imported here 2002-08-29 13:27:26 +00:00
Mitsuru IWASAKI 3aea1e1405 Add sanity check seeing if adjusted start address exceeds end address
after boundary and alignment adjustment.
2002-08-29 12:39:21 +00:00
Mitsuru IWASAKI c4d2c0a1de Fix kernel build breakage when ACPI_DEBUG option is specified. 2002-08-29 08:31:06 +00:00
Jake Burkholder bafbd49201 Renamed poorly named setregs to exec_setregs. Moved its prototype to
imgact.h with the other exec support functions.
2002-08-29 06:17:48 +00:00
Jake Burkholder 409017e8e1 Fixed printf format errors. 2002-08-29 05:49:04 +00:00
Jake Burkholder 16d7d18097 Minor cleanup. 2002-08-29 02:39:39 +00:00
Peter Wemm e581f644a4 Initiate deorbit burn of i386 a.out kld "support" in loader. Note that
this was quite broken, it never was updated for metadata support.
The a.out kld file support was never really used, as it wasn't necessary.
You could always load elf kld's, even in an a.out kernel.
2002-08-29 02:02:28 +00:00
Jake Burkholder 0654f7911f Removed legacy signal trampoline. 2002-08-29 01:59:54 +00:00
Jake Burkholder 4fc642a3d9 Removed support for in-kernel signal code. 2002-08-29 01:55:24 +00:00
Mitsuru IWASAKI d62ab2f4a1 Resolve conflicts arising from the ACPI CA 20020815 import. 2002-08-29 01:52:27 +00:00
Mitsuru IWASAKI b7a95606db This commit was generated by cvs2svn to compensate for changes in r102550,
which included commits to RCS files with non-trunk default branches.
2002-08-29 01:51:24 +00:00
Mitsuru IWASAKI 2d12e67c7d Vendor import of the Intel ACPI CA 20020815 drop. 2002-08-29 01:51:24 +00:00
Peter Wemm 448a5139d4 Initiate deorbit burn for sys/kern/link_aout.c. We never shipped a.out
kld's anywhere, and it was always possible to load ELF kld's even in an
a.out kernel.  There is no reason for this to exist anymore, and a.out
kld support has been suffering serious bitrot over the years.  They have
not been fully functional for quite some time.
2002-08-29 01:48:09 +00:00
Jake Burkholder f3bec5d746 Don't require that sysentvec.sv_szsigcode be non-NULL. 2002-08-29 01:28:27 +00:00
Jake Burkholder b17c50db93 Unrot SPARSE_MAPPING code (vm_map_pageable -> vm_map_wire). 2002-08-29 01:16:14 +00:00
Peter Wemm d13947c3b0 updatepri() works on a ksegrp (where the scheduling parameters are), so
directly give it the ksegrp instead of the thread.  The only thing it used
to use in the thread was the ksegrp.

Reviewed by:	julian
2002-08-28 23:45:15 +00:00
Peter Wemm 97e2d5fc53 OK, I have had it with losing my console because the AP's print their "I am
alive!" message right as the scsi probe messages happen.  This is a bit
nasty, but it seems to work.  At the point that we unlock the AP's, briefly
wait till they are all done while we hold the console on their behalf.
2002-08-28 23:24:05 +00:00
Poul-Henning Kamp de7ac779e9 Only try to flush the FIFO of 500 characters, return EIO if that fails.
This at least prevents the total hang of the machine when I open a
PCCARD sio device on -current, but it does not solve the problem.
2002-08-28 22:25:41 +00:00
Archie Cobbs f2f03122c3 accept(2) on a socket that has been shutdown(2) normally returns
ECONNABORTED. Make this happen in the non-blocking case as well.
The previous behavior was to return EAGAIN, which (a) is not
consistent with the blocking case and (b) causes the application
to think the socket is still valid.

PR:		bin/42100
Reviewed by:	freebsd-net
MFC after:	3 days
2002-08-28 20:56:01 +00:00
Alfred Perlstein b20ea17938 Allow one to grab the definition of struct ucred by defining _WANT_UCRED
instead of forcing _KERNEL.

Move the include of sys/_label.h in ucred.h under the
_KERNEL || _WANT_UCRED case.
2002-08-28 20:39:48 +00:00
Josef Karthauser 9f1c775798 Add a device description for Intel 82801CA/CAM (ICH3) USB controller
USB-C.

PR:	kern/41963
2002-08-28 20:24:49 +00:00
Mitsuru IWASAKI f3a6cbb651 Change default value of hw.acpi.sleep_delay to 0.
This caused problems (reset or lock up) at wakeup.
2002-08-28 18:46:09 +00:00
Maxim Sobolev 9717c34cf8 Add IFF_POLLING into the list of flags which are protected from changing via
ioctl(SIOCSIFFLAGS).

MFC after:	1 day
2002-08-28 15:55:49 +00:00
Orion Hodson 47d5a0f3e5 Marginally simplify dsp_open error handling by adding an early test to
determine liklihood of opening device in requested directions.  Makes for
simpler error handling and change should close kern/35004.

PR: kern/35004.
2002-08-28 15:19:30 +00:00
Darren Reed ecae20848a Finally merge in the changes from ipfilter 3.4.29 to freebsd-current.
Main changes here are related to the ftp proxy and making that work better.
2002-08-28 13:41:36 +00:00
Darren Reed 070700595d This commit was generated by cvs2svn to compensate for changes in r102514,
which included commits to RCS files with non-trunk default branches.
2002-08-28 13:26:01 +00:00
Darren Reed 39cf61414c Import IPfilter 3.4.29. Main purpose is to address ftp proxy problems. 2002-08-28 13:26:01 +00:00
Guido van Rooij 7251aa2022 Add a new command: show pciregs, equivalent to pciconf -l
Reviewed by:	Doug Rabson (quite some time ago)
MFC after:	1 week
2002-08-28 10:02:59 +00:00
Nate Lawson 4927b7b149 printf -> CAM_DEBUG so debugging prints are tunable.
MFC after:	1 week
2002-08-28 07:03:44 +00:00
Nate Lawson 42f821c717 Use csio pointer instead of dereferencing hcb.
MFC after:	1 week
2002-08-28 07:00:58 +00:00
Bruce Evans 1a90705201 Forward declare struct thread so that this header doesn't depend on its
own namespace pollution/compatibility cruft.

Removed the main part of the pollution.  All clients have been converted
to either not depend on getting old locking interfaces from this new
locking header, or usual case to get it from another header (typically
vnode.h, where declaring old loccking interfaces is less bogus because
vnode.h uses them internally).
2002-08-28 05:14:55 +00:00
Nate Lawson 57b89bbc65 Add \n to various printfs. grep shows these should be the last ones. 2002-08-27 18:43:14 +00:00
Warner Losh 1fd2cdcb2f Fix this pending the decision of which of the redundant
sys/modules/{pc,}cbb/Makefile to remove.
2002-08-27 15:59:19 +00:00
Hellmuth Michaelis 52b5377d2f Bugfix to enable dialer "connected" response. 2002-08-27 14:19:28 +00:00
Bruce Evans d834a93b27 Removed explicit rule for creating a null opt_bus.h. kmod.mk does this
automatically once opt_foo.h is in SRCS, modulo some carelessness in
removing garbage in stale versions of opt_foo.h (touch(1) should not
be used to create opt_foo.h in kmod.mk or elsewhere).

Cleaned up nearby rule for creating opt_ddb.h.
2002-08-27 13:39:31 +00:00
Bruce Evans ecc56e1395 <sys/lock.h> is a prerequisite for <sys/mutex.h>, so include the former
here before the latter instead of depending on namespace pollution in
<sys/mumble.h> or on accidentally placed includes in netsmb/*.c.
2002-08-27 12:22:06 +00:00
Bruce Evans 7e9e7dc4ed Include <sys/lockmgr.h> for old lock interfaces instead of depending on
namespace pollution in <sys/lock.h>.
2002-08-27 11:51:55 +00:00
Bruce Evans 2c55fd74fc Include <sys/lockmgr.h> for old lock interfaces instead of including
<sys/lock.h> solely for its namespace pollution.
2002-08-27 10:28:33 +00:00
Bruce Evans 8302d183f3 Include <sys/lockmgr.h> for the definitions of the locking interfaces that
are implemented here instead of depending on namespace pollution in
<sys/lock.h>.  Fixed nearby include messes (1 disordered include and 1
unused include).
2002-08-27 09:59:47 +00:00
Mitsuru IWASAKI cfd820d382 Fix a bug about the cooling system controlling in acpi_thermal driver.
Recent version of ACPI CA returns the package object which contains
object reference elements if the elements are named objects.
We need to be careful when you use acpi_ForeachPackageObject() in new
code...
2002-08-27 07:53:55 +00:00
Tom Rhodes f5c94aed8f Whitespace fix from last commit. 2002-08-27 01:02:56 +00:00
Tom Rhodes e7c9ad3b10 Fix some grammar errors in loader.conf.5
PR:		40237
Submitted by:	Chris Pepper <pepper@rockefeller.edu>
2002-08-27 01:01:31 +00:00
John Baldwin abec7762ba Have to create opt_bus.h for sys/bus.h to be happy. *sigh*
Noticed by:	imp and others
2002-08-26 21:11:56 +00:00
John Baldwin 3cb751691f Oops, forgot to hook up the ACPI PCI bus in the module.
Noticed by:	imp
2002-08-26 19:00:36 +00:00
Prafulla Deuskar 90fd36aac8 Back out TX/RX descriptor/buffer management changes from earier commit.
We are having panics with the driver under stress with jumbo frames.
Unfortunately we didnot catch it during our regular test cycle.
I am going to MFC the backout immediately.
2002-08-26 18:59:16 +00:00
Ian Dowse 02bd1bcd2a Add a new KTR type KTR_CONTENTION, and use it in the mutex code to
log the start and end of periods during which mtx_lock() is waiting
to acquire a sleep mutex. The log message includes the file and
line of both the waiter and the holder.

Reviewed by:	jhb, jake
2002-08-26 18:39:38 +00:00
John Baldwin e7f52ff8bb Hook up the new ACPI PCI bus and catch up to ACPI PCI bridge driver changes. 2002-08-26 18:32:00 +00:00
Ian Dowse 9261400aa2 Add WITNESS_FILE() and WITNESS_LINE(), which allow users of witness
to print out the file and line from the lock object. These will be
used shortly by CTR() calls in the mutex code.

Reviewed by:	jhb, jake
2002-08-26 18:31:26 +00:00
John Baldwin 2ccfc93222 Overhaul the ACPI PCI bridge driver a bit:
- Add an ACPI PCI-PCI bridge driver (the previous driver just handled
  Host-PCI bridges) that is a PCI driver that is a subclass of the generic
  PCI-PCI bridge driver.  It overrides probe, attach, read_ivar, and
  pci_route_interrupt.
  - The probe routine only succeeds if our parent is an ACPI PCI bus which
    we test for by seeing if we can read our ACPI_HANDLE as an ivar.
  - The attach routine saves a copy of our handle and calls the new
    acpi_pcib_attach_common() function described below.
  - The read_ivar routine handles normal PCI-PCI bridge ivars and adds an
    ivar to return the ACPI_HANDLE of the bus this bridge represents.
  - The route_interrupt routine fetches the _PRT (PCI Interrupt Routing
    Table) from the bridge device's softc and passes it off to
    acpi_pcib_route_interrupt() to route the interrupt.
- Split the old ACPI Host-PCI bridge driver into two pieces.  Part of
  the attach routine and most of the route_interrupt routine remain in
  acpi_pcib.c and are shared by both ACPI PCI bridge drivers.
  - The attach routine verifies the PCI bridge is present, reads in
    the _PRT for the bridge, and attaches the child PCI bus.
  - The route_interrupt routine uses the passed in _PRT to route a PCI
    interrupt.
  The rest of the driver is the ACPI Host-PCI bridge specific bits that
  live in acpi_pcib_acpi.c.
  - We no longer duplicate pcib_maxslots but use it directly.
  - The driver now uses the pcib devclass instead of its own devclass.
    This means that PCI busses are now only children of pcib devices.
  - Allow the ACPI_HANDLE for the child PCI bus to be read as an ivar
    of the child bus.
  - Fetch the _PRT for routing PCI interrupts directly from our softc
    instead of walking the devclass to find ourself and then fetch our
    own softc.

With this change and the new ACPI PCI bus driver, ACPI can now properly
route interrupts for devices behind PCI-PCI bridges.  That is, the
Itanium2 with like 10 PCI busses can now boot ok and route all the PCI
interrupts.  Hopefully this will also fix problems people are having with
CardBus bridges behind PCI-PCI bridges not properly routing interrupts
when ACPI is used.

Tested on:	i386, ia64
2002-08-26 18:30:27 +00:00
John Baldwin 28bf1fad05 Add an ACPI PCI bus driver that is a subclass of the generic PCI bus
driver.  This driver overrides the probe, attach, and read_ivar methods.

If the parent bridge is an ACPI PCI bridge, then the probe routine will
match, otherwise it will fail.  It tests this by seeing if it can get
the ACPI_HANDLE ivar from the bridge device.

In the attach routine, it uses pci_add_children() to add all the child
devices (but with a slightly larger ivar so it can store ACPI_HANDLE's
for child devices) and then walks through the ACPI namespace below the
bus device to cache ACPI_HANDLE's for all child devices present in the
namespace.  It does this by comparing the pci slot and function to the
address encoded in _ADR of the devices in the ACPI namespace.

The read_ivar routine passes most requests off to pci_read_ivar()
and adds a new request so that the ACPI_HANDLE for a child device can
be read.

To add proper power support the power methods can be overridden as well,
but that is not currently implemented.  Also, there are cases where a
device may show in the ACPI namespace as a PCI device that the PCI probe
does not find.  Currently such devices are ignored.

Tested on:	i386, ia64
2002-08-26 17:55:42 +00:00
Justin T. Gibbs c7ce0c37af Adjust scsi_calc_syncparam() to the exception table changing from 10ths to
100ths of ns.  This should correct a problem with camcontrol "ignoring"
requests to negotiate to slower speeds.
2002-08-26 17:13:35 +00:00
John Baldwin 6f0d58848f Export a few symbols as globals to allow subclassing of this driver. In
OOP speak, you would mark these as 'protected' members.  Specifically:
- Make the pcib_softc struct public so it can be used by subclasses.
- Make pcib_{read,write}_ivar(), pcib_alloc_resource(), pcib_maxslots(),
  and pcib_{read,write}_config() globals that can be used by subclasses.
- Make the pcib devclass a global variable.
- Move most of the pcib_attach() function into a global
  pcib_attach_common() function that can be called by the attach routines
  of subclasses.

Tested on:	i386, alpha, sparc64, ia64
2002-08-26 15:57:08 +00:00
John Baldwin 42dbeaee02 Various changes to make it easier to subclass the PCI bus device.
- Make the pci devclass a global variable.
- Add child devices in pci_attach() instead of pci_probe().  Change
  pci_probe() to just check for a valid bus number from the associated
  bridge and return -1000 if successful.  This allows subclasses of the
  PCI bus driver to override the generic driver.
- Move the code to load the vendor data into its own public function.
  Really though, doing this at attach is just plain wrong.  This should
  really be done in the module load routine instead.  As a side effect,
  the 'busno' variable in pci_attach() is now no longer static (minor
  bug that was harmless so far.)
- Change pci_add_children() to take an extra argument that is the size of
  the device info structure passed to pci_read_device() and make it public
  so subclasses of the PCI bus can call it in their attach routines.
- Move the bits to attach a probed PCI child to a PCI bus into a global
  pci_add_child() function.  This will allow subclasses that can detect
  a PCI device not found in the normal PCI probe to add those devices in
  their own attach routine.  (I have seen this in the ACPI tree on my
  laptop for example.)  As a side effect, change the static function
  pci_add_resources() to get the busno, slot, and func from the passed
  in dinfo structure instead of requiring them as function arguments.

Tested on:	i386, alpha, ia64, sparc64
2002-08-26 15:23:52 +00:00
John Baldwin 473f1ca90d In acpi_pcib_route_interrupt(), the code claims to check to see if a PCI
LNK device (interrupt source provider sort of) is present before using it,
but the code actually tested the status (_STA) of the PCI bridge device
doing the routing, not the actual LNK device.  Fix it to check the status
of the LNK device.
2002-08-26 15:12:47 +00:00
Julian Elischer b39f32841b move the assert to cover more cases 2002-08-26 05:02:56 +00:00
Mike Barcroft 646d21a5a3 Since arm and powerpc aren't far enough to set stathz, take a
preemptive strike and change _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_
to 128.

Approved by:	benno
2002-08-26 03:44:11 +00:00
Mike Barcroft 091fe703a4 Fix a long-standing bug on alpha:
Change _BSD_CLK_TCK_ and _BSD_CLOCKS_PER_SEC_ to match stathz.  This
  should result in bug for bug compatibility in staticly linked
  programs and dynamicly linked programs should see an immediate
  correction.
2002-08-26 02:39:03 +00:00
Jake Burkholder 81f223ca02 Fixed most indentation bugs. 2002-08-25 22:36:52 +00:00
Jake Burkholder ca0387ef9f Fixed placement of operators. Wrapped long lines. 2002-08-25 20:48:45 +00:00
Mike Barcroft dd7770019a Move intrmask_t to the kernel-only section of <sys/types.h>. Add some
comments submitted by bde.
2002-08-25 19:26:31 +00:00
Mitsuru IWASAKI 9c4d34df76 Add suspend/resume method to syscons. This switch the mode
(text <-> graphics) by changing current vty during ACPI
sleep/wakeup (maybe APM also).
2002-08-25 18:35:44 +00:00
Julian Elischer c341dbce8b Fix a couple of typos in comments.
Submitted by:	Jake Burkholder <jake@locore.ca>
2002-08-25 17:49:28 +00:00
Philippe Charnier 93b0017f88 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:23:09 +00:00
Bruce Evans 64fc62d407 Turned format checking back on. It was left turned off for too long after
the gcc lossage that caused it to be turned off was fixed.

Tested with:	i386/{GENERIC,LINT,...}, alpha/GENERIC
2002-08-25 08:05:02 +00:00
Mitsuru IWASAKI ff01efb50d Add new sysctl MIB (hw.acpi.sleep_delay) to specify the delay (in
seconds) before ACPI sleep.  Some machines might need this to sleep
by Hot-key.
2002-08-25 06:13:53 +00:00
Alan Cox 6508a194aa o Retire pmap_pageable(). It's an advisory routine that none
of our platforms implements.
2002-08-25 04:20:05 +00:00
Crist J. Clark 784d7650f7 Lock the sysctl(8) knobs that turn ip{,6}fw(8) firewalling and
firewall logging on and off when at elevated securelevel(8). It would
be nice to be able to only lock these at securelevel >= 3, like rules
are, but there is no such functionality at present. I don't see reason
to be adding features to securelevel(8) with MAC being merged into 5.0.

PR:		kern/39396
Reviewed by:	luigi
MFC after:	1 week
2002-08-25 03:50:29 +00:00
Julian Elischer 9712591e35 Reformat some comments to fit in 80 columns and
rewrite some comments that have 'aged' poorly.
2002-08-25 02:56:15 +00:00
Bruce Evans 34bdf0dcbf Fixed printf format errors and style bugs in rev.1.92. This is the version
that should have been committed in rev.1.93.
2002-08-25 02:39:07 +00:00
Bruce Evans 152ffafe85 Oops, the previous commit wasn't the version that I meant to commit (it
does some extra things which are probably harmless).  Back it out.
2002-08-25 02:34:18 +00:00
Orion Hodson 933ce6fa4b Add suspend and resume support.
Contributed by:	Takanori Watanabe <takawata@FreeBSD.org>
PR:		kern/41809
2002-08-25 02:00:49 +00:00
Bruce Evans 760e2cb04a Fixed editing errors in rev.1.4 which manifested as printf format errors
at compile time and probably as panics at runtime.
2002-08-25 01:32:22 +00:00
Bruce Evans 109a8e7c0c Fixed printf format errors and style bugs in previous commit. 2002-08-25 01:08:27 +00:00
Alan Cox fff6062ab6 o Retire vm_page_zero_fill() and vm_page_zero_fill_area(). Ever since
pmap_zero_page() and pmap_zero_page_area() were modified to accept
   a struct vm_page * instead of a physical address, vm_page_zero_fill()
   and vm_page_zero_fill_area() have served no purpose.
2002-08-25 00:22:31 +00:00
Jake Burkholder fd559a8a39 Fixed white space around operators, casts and reserved words.
Reviewed by:	md5
2002-08-24 22:55:16 +00:00
Marcel Moolenaar c2926e2329 Use 'p' as the partition specifier instead of 's'. We continue to use
's' for compatibility partitions (ie partitions with a BSD disklabel).
Partition numbers continue to start with 1.
Example /etc/fstab:
	# Device        Mountpoint      FStype          Options	...
	/dev/da0p1      /efi            msdos           rw	...
	/dev/da0p2      /               ufs             rw	...
	/dev/da0p3      none            swap            sw	...
2002-08-24 22:42:16 +00:00
Jake Burkholder a7cddfed7f return x; -> return (x);
return(x); -> return (x);

Reviewed by:	md5
2002-08-24 22:01:40 +00:00
Nick Sayer 47172de8a2 Be sure to unregister from sndstat on unregister. Gets rid of phantom
sndstat output after removing uaudio.
2002-08-24 19:13:11 +00:00
Alan Cox 15c176c119 o Use vm_object_lock() in place of directly locking Giant.
Reviewed by:	md5
2002-08-24 18:44:52 +00:00
Alan Cox 4eaa117956 o Use vm_object_lock() in place of Giant when manipulating a vm object
in vm_map_insert().
2002-08-24 17:52:08 +00:00
Matthew Dillon 4f1e1f32b6 Correct bug in t_bw_rtttime rollover, #undef USERTT 2002-08-24 17:22:44 +00:00
Marc Fonvieille 1739cac24b Fix typos: s/O2Mirco/O2Micro/
Approved by:	imp
2002-08-24 07:46:08 +00:00
Alan Cox d52bc3438c o Resurrect vm_object_lock() and vm_object_unlock() from revision 1.19.
(For now, they simply acquire and release Giant.)
2002-08-24 07:15:14 +00:00
Marcel Moolenaar 5cf8741861 Work around a GCC optimization bug on ia64: In link_elf_symbol_values(),
a pointer to a symbol is given and we have to find the containing symbol
table. We do this by bounds checking. For some strange reason (ie I
haven't found the root cause) the first test succeeded for said symbol,
implying that the symbol came from the .dynsym table. In reality however
the symbol actually resided in the .symtab table. Needless to say that
all that was returned was junk.

The upper bounds check was: (symptr - baseptr) < symtab_size
This has been rewritten to: symptr < (baseptr + symtab_size)

As a side-effect, slightly more optimal (and still correct :-) code can
be generated on ia64.
2002-08-24 05:01:33 +00:00
Hajimu UMEMOTO 0731a74b08 check packet length before fetching ESP crypto checksum.
Obtained from:	KAME
MFC after:	2 days
2002-08-24 04:48:13 +00:00
Peter Wemm a5074f708e Add some \n's to printf()s 2002-08-24 02:51:28 +00:00
Peter Wemm c1b8161326 Fix unit wiring. Also, change the variable "hit" to "wired" so that it
is more obvious.

Obtained from:	gibbs/ken
2002-08-24 02:47:01 +00:00
Alfred Perlstein 8e708563c7 style: put return types on a line by themselves. 2002-08-24 00:02:03 +00:00
Alfred Perlstein e3d2833a26 style:
put return values on a line by themselves.
 fix some paste issues where whitespace was used instead of tabs.
2002-08-23 23:49:02 +00:00
Alfred Perlstein 26be7d1c1b Put return values from functions on a line by themselves.
Ok'd previously by: wpaul
2002-08-23 23:19:25 +00:00
Peter Wemm 2149c527f5 Move the TAILQ_INIT(&td->td_selq) before the retry: label. Otherwise in
some circumstances when we get a select collision, we can end up with
cases where we do not clear some sip->si_thread on the way out, leading to
page faults in selwakeup().  This should solve the problem where postfix
can crash the kernel during select collisions.

Reviewed by: alfred
2002-08-23 22:43:28 +00:00
Marcel Moolenaar 1b570732c5 s/_BSD_VA_LIST_/__va_list/. The former type doesn't exist anymore. 2002-08-23 22:19:57 +00:00
Peter Wemm 8b2624e85c Ok, somebody please shoot me. The asm I wrote for the ranged IPI shootdown
was wrong.  It only ever invalidated one page due to me getting the loop
terminator wrong.  This explains the DISABLE_PG_G effect on SMP.
2002-08-23 21:45:59 +00:00
Orion Hodson 4408eb15b0 Make sure channel buffer start is associated with channel, otherwise
getptr is broken.  Noise reported by Thomas Draney <tmdraney@yahoo.com> who
also tested the patch.
2002-08-23 20:54:32 +00:00
Julian Elischer 7ed56cf283 Add the complex state TDS_SUSP_SLP.
This state is to allow some experimentation and not YET used..
The theory is that a thread that is about to sleep is placed on the sleep
queue and then discovers it should suspend, and is placed on suspend queue.
(these are separate queues and it can be on both). It will not become runnable
until it has been removed from BOTH queues. i.e. a wakeup event
has occured AND the process has been unsuspended. If it were not on the sleep
queue when suspended, then the (possibly only) wakeup event might arrive and
not find any process to wake up. this would result in the thread
sleeping 'forever' when the suspension is lifted. This state will
transition to one of TDS_SLP or TDS_SUSPENDED, depending upon which
constraint is lifted first.
2002-08-23 20:13:22 +00:00
Archie Cobbs 7d151849d0 Don't use "NULL" when "0" is really meant.
But in this case, "-1" is really meant.

Reviewed by:	darrenr
2002-08-23 20:07:19 +00:00
Mike Barcroft b7df450647 o Fix namespace issues in <sys/mman.h>.
o Move mode_t details from <sys/types.h> into <sys/_types.h>.
o Add primitives for sharing the mode_t and off_t typedefs.
o Add typedefs mode_t, off_t, and size_t to <sys/mman.h>.

PR:	21644
2002-08-23 20:04:49 +00:00
Mike Barcroft bd8e0716d9 Move several MI types from <machine/_types.h> to <sys/_types.h>.
These types are unlikely to ever become very MD.  They include:
clockid_t, ct_rune_t, fflags_t, intrmask_t, mbstate_t, off_t, pid_t,
rune_t, socklen_t, timer_t, wchar_t, and wint_t.

While moving them, make a few adjustments (submitted by bde):
o __ct_rune_t needs to be precisely `int', not necessarily __int32_t,
  since the arg type of the ctype functions is int.
o __rune_t, __wchar_t and __wint_t inherit this via a typedef of
  __ct_rune_t.
o Some minor wording changes in the comment blocks for ct_rune_t and
  mbstate_t.

Submitted by:	bde (partially)
2002-08-23 16:49:06 +00:00
Scott Long 3a48fb1bf7 Remove stddef.h from the header list
Prodded by: peter
2002-08-23 14:10:55 +00:00
Murray Stokely b1acc4a299 Add a belated entry for amdpm(4).
Submitted by:	marius@alchemy.franken.de
MFC After:	1 day
2002-08-23 08:00:31 +00:00
Julian Elischer d9d6e34fd0 Don't re-lock the sched lock if we didn't unlock it.
Original error by: David Xu <bsddiy@yahoo.com>
Fix by:	David Xu <bsddiy@yahoo.com>
Completely failed to spot it: Julian Elischer <julian@freebsd.org>
2002-08-23 07:23:44 +00:00
Matt Jacob 90f62fd23f Do some minor cleanups found during backport to RELENG_4. 2002-08-23 06:56:31 +00:00
Matt Jacob 019717e053 Pick a cleaner method (and put in a separate function) for finding
the peer device on a dual board.
2002-08-23 06:56:08 +00:00
Orion Hodson 108082c42e s/AC97_MIX_PHONES/AC97_MIX_AUXOUT/ to match ac97r2.{2,3}.
Attempt to determine what function of AUX_OUT is: "True line level
out", "Headphone out", or "4-Channel out" and frig OSS mixer label
accordingly.

Addresses problem raised by Randy Bush on -multimedia of not being
able to hear audio on ich2 m/b which was eventually found to be
because the mixer monitor value was 0.  On this h/w the label
"monitor" should now be presented as the marginally more intuitive
"ogain".
2002-08-23 06:19:28 +00:00
Jake Burkholder 0b0fe2194d Removed unneeded include of machine/types.h (which no longer exists). 2002-08-23 05:01:19 +00:00
Jeff Roberson ad32f726db - Fix a mistake in my last few commits. The PDROP flag stops msleep from
re-acquiring the mutex.

Pointy hat to:	me
Noticed by:	tegge
2002-08-23 00:32:03 +00:00
Tom Rhodes abe78e9708 Fix a bug where large msdos partitions were not handled correctly, and fix
a few fsck_msdosfs related 'issues'

PR:		28536, 30168
Submitted by:	Jiangyi Liu <jyliu@163.net> && NetBSD
Approved by:	rwatson (mentor)
2002-08-22 22:17:11 +00:00
Peter Wemm c6d6cf1772 s/sus/sys/ in the a.out kernel case.
Submitted by:	julian
2002-08-22 22:01:53 +00:00
Julian Elischer 49539972e9 slight cleanup of single-threading code for KSE processes 2002-08-22 21:45:58 +00:00
Archie Cobbs 4a6a94d8d8 Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
Peter Wemm b87a69181e Use machine/limits.h rather than userland limits.h (which may come from
the userland source tree, or even worse: /usr/include)
2002-08-22 20:44:17 +00:00