| Age | Commit message (Collapse) | Author |
|
|
|
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.
Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)
Remove unnecessary or redundant interface attributes where they're not
needed.
There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)
...and a sentinel value CFARG_EOL.
Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.
Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
|
|
and remove code to handle failures that can no longer happen.
|
|
* Makes it easier to do code/feature analysis by not having
extra noop code/symbols spattered around.
* Only an issue in cac(4) and ciss(4); other drivers don't do this.
* No binary changes.
|
|
These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.
HOWEVER! Some subsystems have
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.
To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.
I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:
cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))
It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.
Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
|
|
Down with externs in .c!
|
|
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).
|
|
|
|
|
|
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
|
|
|
|
|
|
some other constants. These are provided by sys/param.h now.
|
|
|
|
|
|
|
|
for future device_t/softc spilt.
|
|
|
|
|
|
yet know about physical drives. Derived from the OpenBSD ciss(4) bio(4)
support.
|
|
for Solaris.
|
|
|
|
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
|
|
|
|
|
|
- Cut polling delay to make crashdumps faster.
|
|
|
|
|
|
- fix a couple of unused bugs
- no more -Wno-unused for i386
|
|
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
|
|
|
|
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
then fail
else
ask device match function
This is handled by config_stdsubmatch() now.
|
|
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
|
|
- fix variable shadowing
- remove unneeded casts
|
|
|
|
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
|
|
|
|
* don't let cac_ccb_alloc() sleep since it regularly runs in an
interrupt context
* return EAGAIN instead EBUSY (or -1), which is what the upper ld
layer expects to get on transient resource shortages.
* ignore error from cac_ccb_start(), since a `fifo full' condition is
handled internally in the lower layer, i.e. the transaction started
from ldstart() has been queued at the lower layer and must be taken
off ld's disk queue.
|
|
|
|
|
|
|
|
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
|
|
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
|
|
- Copy access method info into the softc so we don't double dereference.
- Remove static on functions.
|
|
|
|
|
|
|
|
|
|
|
|
driver.
|