The NetBSD Project

CVS log for src/sys/kern/subr_autoconf.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.265.4.1: download - view: text, markup, annotated - select for diffs
Tue Aug 1 14:54:58 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.265: preferred, colored; next MAIN 1.266: preferred, colored
Changes since revision 1.265: +3 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #1688):

	sys/kern/subr_autoconf.c: revision 1.308

autoconf(9): Avoid potential ABA bug in config_makeroom.

When we unlock alldevs_lock to allocate a new cd_devs array nsp,
other threads may have:
1. freed the old one (osp),
2. done some other memory allocation,
3. allocated a new _larger_ array whose address happens to concide
   with osp (e.g., in (2) the page was recycled for a different pool
   cache), and
4. updated cd_devs back to osp but increased cd_ndevs.

In that case, the memory may be corrupted: we try to copy the wrong
number of device_t pointers into nsp and we free osp with the wrong
(stale) length.

Avoid this by checking whether cd_ndevs has changed too -- if not,
osp might have been recycled but at least the lengths we're about to
copy and free are still correct so there's no harm in an ABA
situation.

Revision 1.306.4.2: download - view: text, markup, annotated - select for diffs
Tue Aug 1 14:53:54 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-10
CVS tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Diff to: previous 1.306.4.1: preferred, colored; branchpoint 1.306: preferred, colored; next MAIN 1.307: preferred, colored
Changes since revision 1.306.4.1: +3 -3 lines
Pull up following revision(s) (requested by riastradh in ticket #285):

	sys/kern/subr_autoconf.c: revision 1.308

autoconf(9): Avoid potential ABA bug in config_makeroom.

When we unlock alldevs_lock to allocate a new cd_devs array nsp,
other threads may have:
1. freed the old one (osp),
2. done some other memory allocation,
3. allocated a new _larger_ array whose address happens to concide
   with osp (e.g., in (2) the page was recycled for a different pool
   cache), and
4. updated cd_devs back to osp but increased cd_ndevs.

In that case, the memory may be corrupted: we try to copy the wrong
number of device_t pointers into nsp and we free osp with the wrong
(stale) length.

Avoid this by checking whether cd_ndevs has changed too -- if not,
osp might have been recycled but at least the lengths we're about to
copy and free are still correct so there's no harm in an ABA
situation.

Revision 1.306.4.1: download - view: text, markup, annotated - select for diffs
Sun Jul 30 12:04:22 2023 UTC (16 months, 1 week ago) by martin
Branches: netbsd-10
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +21 -10 lines
Pull up following revision(s) (requested by riastradh in ticket #260):

	sys/kern/subr_autoconf.c: revision 1.314

autoconf(9): Print `waiting for devices' normally once a minute.

Revision 1.314: download - view: text, markup, annotated - select for diffs
Tue Jul 18 11:57:37 2023 UTC (16 months, 3 weeks ago) by riastradh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +21 -10 lines
autoconf(9): Print `waiting for devices' normally once a minute.

Revision 1.313: download - view: text, markup, annotated - select for diffs
Tue May 23 08:16:43 2023 UTC (18 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +2 -4 lines
autoconf(9): Omit config_detach kernel lock assertion too for now.

like in config_attach_pseudo, this assertion almost certainly
indicates real bugs, but let's try to get the tests back and running
again before addressing those.

Revision 1.312: download - view: text, markup, annotated - select for diffs
Tue May 23 00:31:42 2023 UTC (18 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +2 -4 lines
autoconf(9): Omit config_attach_pseudo kernel lock assertion for now.

Breaks too many things that I didn't test in the branch (cgd, fss,
&c.); let's address all forty-odd cases before turning it on.

Revision 1.311: download - view: text, markup, annotated - select for diffs
Mon May 22 14:58:22 2023 UTC (18 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +176 -13 lines
autoconf(9): New functions for referenced attach/detach.

New functions:

- config_found_acquire(dev, aux, print, cfargs)
- config_attach_acquire(parent, cf, aux, print, cfargs)
- config_attach_pseudo_acquire(cf, aux)
- config_detach_release(dev, flags)
- device_acquire(dev)

The config_*_acquire functions are like the non-acquire versions, but
they return a referenced device_t, which is guaranteed to be safe to
use until released.  The device's detach function may run while it is
referenced, but the device_t will not be freed and the parent's
.ca_childdetached routine will not be called.

=> config_attach_pseudo_acquire additionally lets you pass an aux
   argument to the device's .ca_attach routine, unlike
   config_attach_pseudo which always passes NULL.

=> Eventually, config_found, config_attach, and config_attach_pseudo
   should be made to return void, because use of the device_t they
   return is unsafe without the kernel lock and difficult to use
   safely even with the kernel lock or in a UP system.  For now,
   they require the caller to hold the kernel lock, while
   config_*_acquire do not.

config_detach_release is like device_release and then config_detach,
but avoids the race inherent with that sequence.

=> Eventually, config_detach should be eliminated, because getting at
   the device_t it needs is unsafe without the kernel lock and
   difficult to use safely even with the kernel lock or in a UP
   system.  For now, it requires the caller to hold the kernel lock,
   while config_detach_release does not.

device_acquire acquires a reference to a device.  It never fails and
can be used in thread context (but not interrupt context, hard or
soft).  Caller is responsible for ensuring that the device_t cannot
be freed; in other words, the device_t must be made unavailable to
any device_acquire callers before the .ca_detach function returns.
Typically device_acquire will be used in a read section (mutex,
rwlock, pserialize, &c.) in a data structure lookup, with
corresponding logic in the .ca_detach function to remove the device
from the data structure and wait for all read sections to complete.

Proposed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2023/05/10/msg028889.html

Revision 1.310: download - view: text, markup, annotated - select for diffs
Fri Apr 21 17:35:43 2023 UTC (19 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +3 -2 lines
autoconf(9): Add a comment where we risk arithmetic overflow.

Revision 1.309: download - view: text, markup, annotated - select for diffs
Sun Apr 16 11:18:25 2023 UTC (19 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +4 -2 lines
autoconf(9): Assert alldevs_lock held in config_unit_nextfree.

The one caller, config_unit_alloc, guarantees it through
config_alldevs_enter/exit.

Revision 1.308: download - view: text, markup, annotated - select for diffs
Sun Apr 16 11:14:58 2023 UTC (19 months, 3 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +3 -3 lines
autoconf(9): Avoid potential ABA bug in config_makeroom.

When we unlock alldevs_lock to allocate a new cd_devs array nsp,
other threads may have:

1. freed the old one (osp),
2. done some other memory allocation,
3. allocated a new _larger_ array whose address happens to concide
   with osp (e.g., in (2) the page was recycled for a different pool
   cache), and
4. updated cd_devs back to osp but increased cd_ndevs.

In that case, the memory may be corrupted: we try to copy the wrong
number of device_t pointers into nsp and we free osp with the wrong
(stale) length.

Avoid this by checking whether cd_ndevs has changed too -- if not,
osp might have been recycled but at least the lengths we're about to
copy and free are still correct so there's no harm in an ABA
situation.

XXX pullup-8
XXX pullup-9
XXX pullup-10

Revision 1.307: download - view: text, markup, annotated - select for diffs
Wed Feb 22 17:00:16 2023 UTC (21 months, 2 weeks ago) by riastradh
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +16 -6 lines
autoconf(9): Clarify assertions about iattr in config_search.

Revision 1.306: download - view: text, markup, annotated - select for diffs
Tue Sep 13 09:43:33 2022 UTC (2 years, 2 months ago) by riastradh
Branches: MAIN
CVS tags: netbsd-10-base, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Branch point for: netbsd-10
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +11 -7 lines
autoconf(9): New diagnostic to detect double-detach.

- Rename dv_detached -> dv_detach_committed.
- Add dv_detach_done, asserted false and then set in config_detach.

dv_detach_done may appear redundant with dv_del_gen, but dv_del_gen
will be used to safely detect config_detach on two valid references
to a device (e.g., a bus detaching its child concurrently with drvctl
detaching the same child), while dv_detach_done is strictly a
diagnostic to detect races in the config_detach API.

Currently the config_detach API itself is unsafe, but we can add a
config_detach_release function that simultaneously releases and
detaches a referenced device_t; this will continue to use dv_del_gen
to safely avoid multiple detach, and dv_detach_done to check for
races in usage.

Revision 1.305: download - view: text, markup, annotated - select for diffs
Tue Sep 13 09:40:38 2022 UTC (2 years, 2 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +18 -10 lines
autoconf(9): Improve diagnostics for config_detach_enter/commit/exit.

Revision 1.304: download - view: text, markup, annotated - select for diffs
Wed Aug 24 11:19:25 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +6 -6 lines
pmf(9): *_child_register never fails.  Make it return void.

No kernel bump because this isn't documented or used in any modules,
only in dev/pci/pci.c and dev/cardbus/cardbus.c which are as far as I
know always statically linked into the kernel.

The next change, however, will require a revbump -- to make
pmf_device_register return void so we can prune vast swaths of dead
error branches.

Revision 1.303: download - view: text, markup, annotated - select for diffs
Wed Aug 24 11:18:56 2022 UTC (2 years, 3 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +4 -4 lines
kern: device_pmf_driver_register never fails, so make it return void.

No ABI bump despite change to device.h because this is used only
inside autoconf.

Revision 1.302: download - view: text, markup, annotated - select for diffs
Fri Aug 12 16:16:12 2022 UTC (2 years, 4 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +17 -6 lines
autoconf(9): Provide diagnostics for config_detach_* misuse.

Revision 1.301: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:38:59 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +3 -2 lines
sys: Split struct device into a private device_impl.h.

Include this only inside autoconf itself, and a few files that abuse
autoconf in ways I can't confidently make easy fixes for.

XXX kernel ABI change requires bump -- no more use of struct device
internals allowed, previously done by some drivers

Revision 1.300: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:38:24 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +27 -14 lines
autoconf(9): Disentangle slightly circuitous config_detach logic.

No functional change intended.

Revision 1.299: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:38:15 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +41 -8 lines
autoconf(9): New function config_detach_commit.

When a driver's .ca_detach function has committed to detaching -- it
definitely won't back out with EBUSY, for instance -- it can call
this to wake all pending calls to device_lookup_acquire and make them
fail immediately.

This is necessary to break a deadlock if the device_lookup_acquire
calls happen inside I/O operations which the driver's .ca_detach
function waits for the completion of -- without config_detach_commit,
I/O operations would be stuck in device_lookup_acquire waiting for
.ca_detach and .ca_detach would be stuck waiting for I/O operations
to return.

Most drivers won't need to call this: for autoconf drivers used the
traditional way by devsw for userland device nodes, the .ca_detach
routine uses vdevgone, and we will arrange to make vdevgone call
config_detach_commit automagically in such drivers anyway.

XXX kernel ABI change to struct device requires bump -- later change
will make struct device opaque to ABI, but we're not there yet

Revision 1.298: download - view: text, markup, annotated - select for diffs
Mon Mar 28 12:33:41 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +172 -14 lines
autoconf(9): New localcount-based device instance references.

device_lookup_acquire looks up an autoconf device instance, if found,
and acquires a reference the caller must release with device_release.
If attach or detach is still in progress, device_lookup_acquire waits
until it completes.  While references are held, the device's softc
will not be freed or reused until the last reference is released.

The reference is meant to be held while opening a device in the short
term, and then to be passed off to a longer-term reference that can
be broken explicitly by detach -- usually a device special vnode,
which is broken by vdevgone in the driver's *_detach function.

Sleeping while holding a reference is allowed, e.g. waiting to open a
tty.  A driver must arrange that its *_detach function will interrupt
any threads sleeping while holding references and cause them to back
out so that detach can complete promptly.

Subsequent changes to subr_devsw.c will make bdev_open and cdev_open
automatically take a reference to an autoconf instance for drivers
that opt into this, so there will be no logic changes needed in most
drivers other than to connect the autoconf cfdriver to the
bdevsw/cdevsw I/O operation tables.  The effect will be that *_detach
may run while d_open is in progress, but no new d_open can begin
until *_detach has backed out from or committed to detaching.

XXX kernel ABI change to struct device requires bump -- later change
will make struct device opaque to ABI, but we're not there yet

Revision 1.297: download - view: text, markup, annotated - select for diffs
Mon Mar 21 22:20:32 2022 UTC (2 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +4 -10 lines
autoconf(9): Enter more timing samples into entropy pool.

Previously, we sampled the time of each _failed_ config_search.  I'm
not sure why -- there was no explanation in the comment or the commit
message introducing this in rev. 1.230.2.1 on tls-earlyentropy.

With this change, we sample the time of _every_ search including the
successful ones -- and also measure the time to attach which often
includes things like probing device registers, triggering device
reset and waiting for it to post, &c.

Revision 1.296: download - view: text, markup, annotated - select for diffs
Sat Mar 12 19:26:33 2022 UTC (2 years, 9 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +6 -5 lines
autoconf(9): Refuse to consider negative unit numbers in cfdata.

Reported-by: syzbot+a63ae6c58df86f40b6f3@syzkaller.appspotmail.com

Revision 1.295: download - view: text, markup, annotated - select for diffs
Sun Feb 6 19:29:52 2022 UTC (2 years, 10 months ago) by tnn
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +4 -4 lines
move attribute before function declarator

Revision 1.294: download - view: text, markup, annotated - select for diffs
Sun Feb 6 11:56:00 2022 UTC (2 years, 10 months ago) by martin
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +3 -5 lines
Revert previous, mark cfdriver_iattr_count as __diagused instead.

Revision 1.293: download - view: text, markup, annotated - select for diffs
Sat Feb 5 15:17:40 2022 UTC (2 years, 10 months ago) by martin
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +4 -2 lines
cfdriver_iattr_count() is only used in a KASSERT, so #ifdef DIAGNOSTIC it.

Revision 1.292: download - view: text, markup, annotated - select for diffs
Sat Jan 29 20:35:11 2022 UTC (2 years, 10 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +11 -12 lines
pmf(9): Conditionalize pmflock_debug output on PMFLOCK_DEBUG.

This is really only helpful for debugging the software logic to
handle the trees of devices for suspend/resume, not for debugging the
drivers, which is most of what we need to do.  If anyone still finds
this useful they can make a sysctl knob for it or something, but for
now this substantially reduces the amount of debug output that's
getting in my way.

Revision 1.291: download - view: text, markup, annotated - select for diffs
Fri Dec 31 14:19:57 2021 UTC (2 years, 11 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +2 -4 lines
libkern: Make KASSERT verify expression is valid if !DIAGNOSTIC.

This way it is no longer necessary to mark variables __diagused if
they are used in KASSERT conditions.

Fix fallout from this by removing now-unnecessary and `#ifdef
DIAGNOSTIC'.

Don't do the same for KDASSERT if !DEBUG -- unlike KASSERT and
DIAGNOSTIC, variables needed by KDASSERT and DEBUG are likely to be
expensive to compute (and potentially difficult for a compiler to
prove flushable), so we don't want to require them under !DEBUG.

Revision 1.290: download - view: text, markup, annotated - select for diffs
Mon Oct 11 10:59:09 2021 UTC (3 years, 2 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +12 -5 lines
Squash "holding up boot" messages into a single line, and only print the
device list if no progress has been made in 1 second.

Revision 1.289: download - view: text, markup, annotated - select for diffs
Sat Aug 7 16:19:18 2021 UTC (3 years, 4 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +91 -134 lines
Merge thorpej-cfargs2.

Revision 1.288.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 15:00:15 2021 UTC (3 years, 4 months ago) by thorpej
Branches: thorpej-cfargs2
Diff to: previous 1.288: preferred, colored; next MAIN 1.289: preferred, colored
Changes since revision 1.288: +84 -135 lines
Address concerns about limited compile-time type checking with the
tag-value mechanism of specifying arguments to config_search(),
config_found(), and config_attach() by replacing the tag-value scheme
with a "struct cfargs", a pointer to which is passed to the aforementioned
functions instead.

The structure has a version field to allow for future ABI versioning
flexibility.  The external structure is canononicalized internally
before use.

To ease the initialization of this structure, use a variadic preprocessor
macro, CFARGS(), to construct an anonymous "struct cfargs" inline, the
address of which is passed to the target function.  A CFARGS_NONE macro
provides a symbolic stand-in for when the caller doesn't want to pass
arguments (currently expands to NULL and is handled during canonicalization).

Revision 1.278.2.2: download - view: text, markup, annotated - select for diffs
Thu Jun 17 04:46:33 2021 UTC (3 years, 5 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.278.2.1: preferred, colored; next MAIN 1.279: preferred, colored
Changes since revision 1.278.2.1: +152 -29 lines
Sync w/ HEAD.

Revision 1.288: download - view: text, markup, annotated - select for diffs
Mon Jun 14 08:55:49 2021 UTC (3 years, 5 months ago) by skrll
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base
Branch point for: thorpej-cfargs2
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +3 -3 lines
Fix UP build

Revision 1.287: download - view: text, markup, annotated - select for diffs
Sun Jun 13 09:30:48 2021 UTC (3 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +9 -4 lines
autoconf(9): Take kernel lock in config_detach.

config_detach is used in too many places to audit for now -- so
although I'm quite sure it is racy (e.g., with cloning devices and
drvctl: drvctl -d a newly opened fss0 before sc_state has
transitioned from FSS_IDLE), this will mitigate the immediate fallout
until we can properly fix autoconf's notions of device pointers.

Revision 1.286: download - view: text, markup, annotated - select for diffs
Sun Jun 13 00:11:46 2021 UTC (3 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +7 -2 lines
autoconf(9): Sprinkle KASSERT(dev->dv_pending == 0) in dealloc paths.

This would have made uhub's config_pending_incr leak more obvious by
crashing in KASSERT(dev->dv_pending == 0) early on, rather than
crashing in a tailq panic later on when the config_pending list gets
corrupted with use-after-free because nothing took the device off
dv_pending_list when attached.

(This is slightly academic now because config_detach blocks until
dev->dv_pending == 0, but it doesn't hurt and makes the intent
clearer.)

Revision 1.285: download - view: text, markup, annotated - select for diffs
Sun Jun 13 00:11:17 2021 UTC (3 years, 5 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +36 -18 lines
autoconf(9): Take kernel lock in a few entry points.

The arguments to config_attach_pseudo, config_init/fini_component,
and config_cfdata_attach/detach are generally statically allocated
objects in a module or the main kernel and as such are stable, and
there are no data structure invariants they assume the kernel lock
will covers from call to call.  So there should be no need for the
caller to hold the kernel lock.

Should fix panic on modload of, e.g., nvmm.

Revision 1.284: download - view: text, markup, annotated - select for diffs
Sat Jun 12 12:14:13 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +4 -2 lines
autoconf(9): Must hold alldevs_lock to iterate dv_list on alldevs.

Revision 1.283: download - view: text, markup, annotated - select for diffs
Sat Jun 12 12:13:51 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +61 -9 lines
autoconf(9): Prevent concurrent attach/detach and detach/detach.

- Use config_pending_incr/decr around attach.  No need for separate
  flag indicating device is still attaching.  (dv_flags locking is also
  incoherent.)

- Any config_pending now blocks config_detach.

- New dv_detaching exclusive lock for config_detach.

Revision 1.282: download - view: text, markup, annotated - select for diffs
Sat Jun 12 12:12:11 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +26 -2 lines
autoconf(9), drvctl(4): Sprinkle kernel lock assertions.

Revision 1.281: download - view: text, markup, annotated - select for diffs
Sat Jun 12 12:11:49 2021 UTC (3 years, 6 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +27 -10 lines
autoconf(9): Take kernel lock on various entries into autoconf.

Most of autoconf still tacitly assumes the kernel lock is held.

Revision 1.278.2.1: download - view: text, markup, annotated - select for diffs
Thu May 13 00:47:32 2021 UTC (3 years, 7 months ago) by thorpej
Branches: thorpej-i2c-spi-conf
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +18 -9 lines
Sync with HEAD.

Revision 1.280: download - view: text, markup, annotated - select for diffs
Wed Apr 28 03:21:57 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +13 -4 lines
Validate the return value of cfprint functions before using it to
index the msgs[] array.  Use designated initializers to initialize
msgs[].

Revision 1.279: download - view: text, markup, annotated - select for diffs
Tue Apr 27 14:48:28 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +7 -7 lines
The Amiga and Atari ports abuse some autoconfiguration internals as part
of their early console bring-up, so we need to expose some of the new
internals to them and adapt the call sites.

Revision 1.278: download - view: text, markup, annotated - select for diffs
Sat Apr 24 23:37:00 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
Branch point for: thorpej-i2c-spi-conf
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +179 -35 lines
Merge thorpej-cfargs branch:

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?).

Revision 1.277.2.13: download - view: text, markup, annotated - select for diffs
Mon Apr 5 00:26:47 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.12: preferred, colored; branchpoint 1.277: preferred, colored; next MAIN 1.278: preferred, colored
Changes since revision 1.277.2.12: +8 -2 lines
Document that config_probe() really should just return a bool, but
explain why it cannot, currently.

Revision 1.277.2.12: download - view: text, markup, annotated - select for diffs
Sun Apr 4 19:23:53 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.11: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.11: +18 -3 lines
Add a config_probe() function.  This is currently a synonym for config_match(),
but exists so as to make a distinction between probing (as is done in indirect
configuration) and matching (which is done in direct configuration).

The intention is for direct config "submatch" routines to use config_match()
and for indirect config "search" routines to use config_probe().

Revision 1.277.2.11: download - view: text, markup, annotated - select for diffs
Sun Apr 4 19:12:27 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.10: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.10: +14 -7 lines
Add a CFARG_SEARCH tag, which specifies an indirect config search function
(which has the same signature as a direct config submatch function).  This
is a synonym for CFARG_SUBMATCH internally, but this is an implementation
detail; the two things should be distinct to callers, because submatch
and search functions have different behaviors.  Only one SEARCH or SUBMATCH
argument is allowed.

Also, change config_get_cfargs() to panic if an unknown tag is passed
(we don't know what kind of argument to consume after an unknown tag, so
this is fatal).

Revision 1.274.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:29:00 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.274: preferred, colored; next MAIN 1.275: preferred, colored
Changes since revision 1.274: +296 -23 lines
Sync with HEAD.

Revision 1.277.2.10: download - view: text, markup, annotated - select for diffs
Sat Apr 3 16:09:44 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.9: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.9: +20 -5 lines
Add CFARG_DEVHANDLE, allowing direct configuration using e.g. ACPI or
OpenFirmware / FDT to associate the handle with the device_t.

Revision 1.277.2.9: download - view: text, markup, annotated - select for diffs
Sat Apr 3 15:37:07 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.8: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.8: +33 -21 lines
- Give config_devalloc() the tagged variadic argument treatment.
- Only extract the values from the variadic argument list if we're
  going to use them locally.  If not, just pass them along (using
  va_copy() if necessary).  This serves to future-proof the intermediaries
  as new cfarg_t tag values are added in the future.

Revision 1.277.2.8: download - view: text, markup, annotated - select for diffs
Sat Apr 3 06:54:29 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.7: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.7: +4 -12 lines
config_attach_loc() -> config_attach() with CFARG_LOCATORS argument.

Revision 1.277.2.7: download - view: text, markup, annotated - select for diffs
Sat Apr 3 01:57:18 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.6: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.6: +27 -8 lines
Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.

Revision 1.277.2.6: download - view: text, markup, annotated - select for diffs
Fri Apr 2 22:17:46 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.5: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.5: +2 -13 lines
config_found_ia() -> config_found() w/ CFARG_IATTR.

Revision 1.277.2.5: download - view: text, markup, annotated - select for diffs
Mon Mar 22 17:21:09 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.4: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.4: +6 -5 lines
Temporarily continue to provide config_found_ia().

Revision 1.277.2.4: download - view: text, markup, annotated - select for diffs
Mon Mar 22 02:01:02 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.3: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.3: +2 -6 lines
Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.

Revision 1.277.2.3: download - view: text, markup, annotated - select for diffs
Sun Mar 21 21:09:16 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.2: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.2: +25 -9 lines
Give config_found() the same variadic arguments treatment as
config_search().  This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls.  Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.

Revision 1.277.2.2: download - view: text, markup, annotated - select for diffs
Sun Mar 21 17:58:40 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277.2.1: preferred, colored; branchpoint 1.277: preferred, colored
Changes since revision 1.277.2.1: +20 -2 lines
In config_search(), we already asserted that either an interface
attribute is not specified, or the specified attribute is carried
by the parent.

Add an additional assertion: That an interface attribute is specified
or that the parent has fewer than 2 interface attributes (i.e. lack of
interface attribute specification would be ambiguous).

Yes, "fewer than 2".  Zero interface attributes doesn't really make sense,
because a device cannot then be a parent of another device by definition.
But cfparent_match() would already catch this situation gracefully, and
there is obviously no ambiguity when a device has no interface attributes.

Revision 1.277.2.1: download - view: text, markup, annotated - select for diffs
Sat Mar 20 19:33:41 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +67 -9 lines
The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
  tag-value variadic arguments that can be passed to the various
  config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
  for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
  variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
  Noticed several incorrect usages along the way, which will be
  audited in a future commit.

Revision 1.277: download - view: text, markup, annotated - select for diffs
Wed Jan 27 04:54:08 2021 UTC (3 years, 10 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-cfargs-base
Branch point for: thorpej-cfargs
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +60 -3 lines
Add device_compatible_match_id() and device_compatible_lookup_id(), which
are like device_compatible_match() and device_compatible_lookup(), but
take a single scalar value as an ID.

Add a "uintptr_t id" field to device_compatible_entry, in an anonymous
union with the existing "const char *compat" field.

Revision 1.276: download - view: text, markup, annotated - select for diffs
Sun Jan 24 17:42:36 2021 UTC (3 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +218 -30 lines
Refactor and simplify device_compatible_match(), and also provide
device_compatible_p{match,lookup}() which treats the strings in the
driver compatible data as pmatch(9) patterns.

Add device_compatible_{,p}{match,lookup}_strlist(), which are the same, but
take an OpenFirmware-style string list rather than an array of strings
for the device data.

Revision 1.275: download - view: text, markup, annotated - select for diffs
Mon Jan 18 15:28:21 2021 UTC (3 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +34 -6 lines
Change the device_compatible_match() function to only perform the match.
Introduce a device_compatible_lookup() function to return an entry based
on the same matching criteria (a'la of_search_compatible()).

Update iic_compatible_match() to reflect the above change, and introduce
iic_compatible_lookup().  This pattern is less awkward to use.

Revision 1.274: download - view: text, markup, annotated - select for diffs
Sat Oct 3 22:32:50 2020 UTC (4 years, 2 months ago) by riastradh
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +20 -10 lines
autoconf: Blame devices holding up boot with config_pending.

Blame message requires `boot -x' (AB_DEBUG).

Fix ata so it doesn't mismatch config_pending_incr/decr devices.

Revision 1.273: download - view: text, markup, annotated - select for diffs
Sat Aug 1 11:18:26 2020 UTC (4 years, 4 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +14 -14 lines
avoid VLA for the sizeof() calculations

Revision 1.272: download - view: text, markup, annotated - select for diffs
Sat Jun 27 13:53:10 2020 UTC (4 years, 5 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +11 -11 lines
prop_dictionary_[sg]et_cstring{,_nocopy} -> prop_dictionary_[sg]et_string{,_nocopy}

Revision 1.271: download - view: text, markup, annotated - select for diffs
Mon May 25 21:05:01 2020 UTC (4 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +6 -19 lines
Remove support for the !DVF_PRIV_ALLOC case; device_t and driver private
storage separation are now mandatory.

Revision 1.270: download - view: text, markup, annotated - select for diffs
Thu Apr 30 03:28:18 2020 UTC (4 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +6 -3 lines
Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources.  Hardware RNG devices should have hardware-specific
health tests.  For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug.  Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
  kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
  knob kern.entropy.depletion; otherwise it is disabled, and once the
  system reaches full entropy it is assumed to stay there as far as
  modern cryptography is concerned.

- No `entropy estimation' based on sample values.  Such `entropy
  estimation' is a contradiction in terms, dishonest to users, and a
  potential source of side channels.  It is the responsibility of the
  driver author to study the entropy of the process that generates
  the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
  it's ready, if we've never reached full entropy, and with a rate
  limit afterward.  Operators can force consolidation now by running
  sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
  whenever entropy is consolidated into the global pool.
  . Usage: Cache entropy_epoch() when you seed.  If entropy_epoch()
    has changed when you're about to use whatever you seeded, reseed.
  . Epoch is never zero, so initialize cache to 0 if you want to reseed
    on first use.
  . Epoch is -1 iff we have never reached full entropy -- in other
    words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
    but it is better if you check for changes rather than for -1, so
    that if the system estimated its own entropy incorrectly, entropy
    consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
  happening:
  . kern.entropy.needed - bits of entropy short of full entropy
  . kern.entropy.pending - bits known to be pending in per-CPU pools,
    can be consolidated with sysctl -w kern.entropy.consolidate=1
  . kern.entropy.epoch - number of times consolidation has happened,
    never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
  Hash_DRBGs.  There are only two in the system: user_cprng for
  /dev/urandom and sysctl kern.?random, and kern_cprng for kernel
  users which may need to operate in interrupt context up to IPL_VM.

  (Calling cprng_strong in interrupt context does not strike me as a
  particularly good idea, so I added an event counter to see whether
  anything actually does.)

- Event counters provide operator visibility into when reseeding
  happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.

Revision 1.262.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:51 2020 UTC (4 years, 8 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.262.2.1: preferred, colored; branchpoint 1.262: preferred, colored; next MAIN 1.263: preferred, colored
Changes since revision 1.262.2.1: +71 -27 lines
Merge changes from current as of 20200406

Revision 1.265.6.1: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:21:03 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.265: preferred, colored; next MAIN 1.266: preferred, colored
Changes since revision 1.265: +71 -27 lines
Sync with head.

Revision 1.269: download - view: text, markup, annotated - select for diffs
Thu Feb 27 20:16:38 2020 UTC (4 years, 9 months ago) by macallan
Branches: MAIN
CVS tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +9 -3 lines
when reporting events to devmon, pass location info along if we find it

Revision 1.268: download - view: text, markup, annotated - select for diffs
Tue Feb 25 19:34:37 2020 UTC (4 years, 9 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +2 -2 lines
Previous commit resolves:
netbsd boot error: panic: ASan: Unauthorized Access In ADDR: Addr
 ADDR [8 bytes, read, PoolUseAfterFree]

Reported-by: syzbot+43111d810160fb4b978b@syzkaller.appspotmail.com

Revision 1.267: download - view: text, markup, annotated - select for diffs
Tue Feb 25 19:14:05 2020 UTC (4 years, 9 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +9 -7 lines
fix use-after-free in config_interrupts_thread() found by KASAN, introduced
with addition of the locking; problem pointed out by kamil@

Revision 1.266: download - view: text, markup, annotated - select for diffs
Thu Feb 20 21:14:23 2020 UTC (4 years, 9 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +58 -22 lines
protect deferred lists' manipulation by config_misc_lock, same as
config_pending semaphore itself; right now this also covers
DVF_ATTACH_INPROGRESS flag

Revision 1.262.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:09:03 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +17 -11 lines
Sync with HEAD

Revision 1.257.2.4: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:02:04 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.257.2.3: preferred, colored; branchpoint 1.257: preferred, colored; next MAIN 1.258: preferred, colored
Changes since revision 1.257.2.3: +11 -5 lines
Sync with HEAD, resolve a few conflicts

Revision 1.265: download - view: text, markup, annotated - select for diffs
Sat Dec 1 02:08:16 2018 UTC (6 years ago) by msaitoh
Branches: MAIN
CVS tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: netbsd-9, ad-namecache
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +3 -4 lines
 Fix compile error.

Revision 1.264: download - view: text, markup, annotated - select for diffs
Sat Dec 1 01:51:38 2018 UTC (6 years ago) by msaitoh
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +12 -5 lines
 Add new dv_flags value DVF_ATTACH_INPROGRESS. Currenty, this flags is used
only for checking the registration of pmf.

 This flag should be set when an attach function(ca_attach) doesn't complete
the whole attach work when the function returned. config_interrupts() set it.
It's also required for device drivers who do a part of the attach work in their
own kthread to set it.

Revision 1.257.2.3: download - view: text, markup, annotated - select for diffs
Sun Sep 30 01:45:55 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.257.2.2: preferred, colored; branchpoint 1.257: preferred, colored
Changes since revision 1.257.2.2: +8 -8 lines
Ssync with HEAD

Revision 1.253.2.1: download - view: text, markup, annotated - select for diffs
Sun Sep 23 17:33:15 2018 UTC (6 years, 2 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1
Diff to: previous 1.253: preferred, colored; next MAIN 1.254: preferred, colored
Changes since revision 1.253: +8 -8 lines
Pull up following revision(s) (requested by mrg in ticket #1025):

	sys/kern/subr_autoconf.c: revision 1.263
	sys/kern/kern_drvctl.c: revision 1.44
	sys/sys/device.h: revision 1.156
	sys/sys/systm.h: revision 1.278

- move export for devmon_insert_vec into sys/device.h.
- export root_is_mounted for future USB RB_ASKNAME hack.
- make some things in subr_autoconf.c static
- move device_printf() prototype out from the middle of two sets of
  aprint_*() prototypes.

Revision 1.263: download - view: text, markup, annotated - select for diffs
Tue Sep 18 01:25:09 2018 UTC (6 years, 2 months ago) by mrg
Branches: MAIN
CVS tags: pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +8 -8 lines
- move export for devmon_insert_vec into sys/device.h.
- export root_is_mounted for future USB RB_ASKNAME hack.
- make some things in subr_autoconf.c static
- move device_printf() prototype out from the middle of two sets of
  aprint_*() prototypes.

Revision 1.257.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 28 04:38:08 2018 UTC (6 years, 4 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.257.2.1: preferred, colored; branchpoint 1.257: preferred, colored
Changes since revision 1.257.2.1: +13 -38 lines
Sync with HEAD

Revision 1.262: download - view: text, markup, annotated - select for diffs
Tue Jun 26 06:03:57 2018 UTC (6 years, 5 months ago) by thorpej
Branches: MAIN
CVS tags: phil-wifi-base, pgoyette-compat-0906, pgoyette-compat-0728
Branch point for: phil-wifi
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +4 -29 lines
In my quest to make device_compatible_entry (and associated goo)
super-general, it turns out I also made it a little to cumbersome
to use (if my tired fingers are any indication).  So, this is a
course-correction -- one string per entry (like of_compat_data,
which it will soon replace), and remove the over-verbose macros.

Revision 1.261: download - view: text, markup, annotated - select for diffs
Tue Jun 26 04:32:35 2018 UTC (6 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +11 -11 lines
Change device_compatible_match() and iic_compatible_match() to return
the weighted match value and take an optional compatible-entry pointer,
rather than the other way around.

Revision 1.257.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 25 07:26:04 2018 UTC (6 years, 5 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +66 -2 lines
Sync with HEAD

Revision 1.260: download - view: text, markup, annotated - select for diffs
Tue Jun 19 04:10:51 2018 UTC (6 years, 5 months ago) by thorpej
Branches: MAIN
CVS tags: pgoyette-compat-0625
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +6 -5 lines
Sigh, fix another stupid mistake in previous that squeaked by because,
again, I booted the wrong test kernel.

Revision 1.259: download - view: text, markup, annotated - select for diffs
Mon Jun 18 16:31:42 2018 UTC (6 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +3 -3 lines
Fix a silly mistake in device_compatible_entry_matches() that I made
while re-factoring this from a prior version.

(I booted the wrong kernel when testing, oops.)

Revision 1.258: download - view: text, markup, annotated - select for diffs
Mon Jun 18 15:36:54 2018 UTC (6 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +65 -2 lines
Add device_compatible_match(), a generalized routine for weighted
matching of device_compatible_entry data to a device's "compatible"
strings.

Revision 1.257: download - view: text, markup, annotated - select for diffs
Sun Mar 4 07:12:18 2018 UTC (6 years, 9 months ago) by mlelstv
Branches: MAIN
CVS tags: pgoyette-compat-base, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +68 -76 lines
expose struct devicelist alldevs again.

Revision 1.256: download - view: text, markup, annotated - select for diffs
Fri Jan 26 22:58:09 2018 UTC (6 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +3 -2 lines
Ensure that dev is not NULL - CID/1428649

Revision 1.223.2.5: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:38:45 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.223.2.4: preferred, colored; next MAIN 1.224: preferred, colored
Changes since revision 1.223.2.4: +203 -166 lines
update from HEAD

Revision 1.255: download - view: text, markup, annotated - select for diffs
Fri Oct 27 12:25:15 2017 UTC (7 years, 1 month ago) by joerg
Branches: MAIN
CVS tags: tls-maxphys-base-20171202
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +2 -2 lines
Revert printf return value change.

Revision 1.254: download - view: text, markup, annotated - select for diffs
Fri Oct 27 09:59:16 2017 UTC (7 years, 1 month ago) by utkarsh009
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +4 -4 lines
[syzkaller] Cast all the printf's to (void *)
> as a result of new printf(9) declaration.

Revision 1.233.2.8: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:53:07 2017 UTC (7 years, 3 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.7: preferred, colored; branchpoint 1.233: preferred, colored; next MAIN 1.234: preferred, colored
Changes since revision 1.233.2.7: +97 -97 lines
Sync with HEAD

Revision 1.253: download - view: text, markup, annotated - select for diffs
Thu Jun 1 02:45:13 2017 UTC (7 years, 6 months ago) by chs
Branches: MAIN
CVS tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, matt-nb8-mediatek-base, matt-nb8-mediatek
Branch point for: netbsd-8
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +2 -19 lines
remove checks for failure after memory allocation calls that cannot fail:

  kmem_alloc() with KM_SLEEP
  kmem_zalloc() with KM_SLEEP
  percpu_alloc()
  pserialize_create()
  psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.

Revision 1.252.4.4: download - view: text, markup, annotated - select for diffs
Wed May 17 01:44:18 2017 UTC (7 years, 6 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.252.4.3: preferred, colored; branchpoint 1.252: preferred, colored; next MAIN 1.253: preferred, colored
Changes since revision 1.252.4.3: +9 -2 lines
At suggestion of chuq@, modify config_attach_pseudo() to return with a
reference held on the device.

Adapt callers to expect the reference to exist, and to ensure that the
reference is released.

Revision 1.252.4.3: download - view: text, markup, annotated - select for diffs
Sun Apr 30 05:18:53 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.252.4.2: preferred, colored; branchpoint 1.252: preferred, colored
Changes since revision 1.252.4.2: +9 -3 lines
Release the interlock mutex before calling device_release().

Ensure that device_release() gets called even if the (ca->ca_detach)()
call fails.

Revision 1.252.4.2: download - view: text, markup, annotated - select for diffs
Fri Apr 28 06:00:33 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.252.4.1: preferred, colored; branchpoint 1.252: preferred, colored
Changes since revision 1.252.4.1: +26 -3 lines
Introduce config_detach_release() which does all the work from the
former config_detach().  Now, config_detach() simply acquires a
reference to the device, which config_detach_release() can release!

This is needed because some drivers call config_detach() with a
reference, while other drivers have not been updated to use the
localcount reference mechanism.  So we provide a shim to make
everyone equal.

Revision 1.252.4.1: download - view: text, markup, annotated - select for diffs
Thu Apr 27 05:36:37 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: prg-localcount2
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +104 -6 lines
Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita.  There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.

Revision 1.246.2.9: download - view: text, markup, annotated - select for diffs
Tue Apr 25 09:03:03 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.8: preferred, colored; branchpoint 1.246: preferred, colored; next MAIN 1.247: preferred, colored
Changes since revision 1.246.2.8: +5 -4 lines
Use KASSERTMSG() to ensure that the device has a localcount.

Revision 1.247.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:02 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.247: preferred, colored; next MAIN 1.248: preferred, colored
Changes since revision 1.247: +97 -80 lines
Sync with HEAD

Revision 1.246.2.8: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:57:47 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.7: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.7: +97 -80 lines
Sync with HEAD

Revision 1.252: download - view: text, markup, annotated - select for diffs
Mon Mar 20 01:24:06 2017 UTC (7 years, 8 months ago) by riastradh
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1
Branch point for: prg-localcount2
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +9 -15 lines
#if DIAGNOSTIC panic ---> KASSERT; __diagused police

Revision 1.251: download - view: text, markup, annotated - select for diffs
Mon Mar 20 01:13:07 2017 UTC (7 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +79 -69 lines
Gather alldevs into a cacheline-aligned struct.

Revision 1.250: download - view: text, markup, annotated - select for diffs
Mon Mar 20 01:06:29 2017 UTC (7 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +6 -6 lines
Omit needless volatile qualifiers.

All these variables are used exclusively with alldevs_mtx held, not
atomics.  No need for volatile voodoo here.

Revision 1.249: download - view: text, markup, annotated - select for diffs
Mon Mar 20 01:05:03 2017 UTC (7 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +4 -2 lines
Assert ownership of alldevs_mtx, as required for config_makeroom.

The one caller in config_unit_alloc guarantees ownership, via
config_alldevs_enter and preserved by config_makeroom.

Revision 1.248: download - view: text, markup, annotated - select for diffs
Mon Mar 20 00:30:03 2017 UTC (7 years, 8 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +20 -9 lines
Make sure we hold alldevs_mtx for access to alldevs in deviter.

- Extend alldevs_mtx section in deviter_init.
- Assert ownership of alldevs_mtx in private functions:
  . deviter_reinit
  . deviter_next1
  . deviter_next2
- Acquire alldevs_mtx in deviter_next.

(alldevs_mtx is not relevant to the struct deviter object, which is
private to the caller who must guarantee exclusive access to it.)

Revision 1.233.2.7: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:56:03 2016 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.6: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.6: +25 -23 lines
Sync with HEAD

Revision 1.246.2.7: download - view: text, markup, annotated - select for diffs
Tue Jul 26 03:24:23 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.6: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.6: +7 -7 lines
Sync with HEAD

Revision 1.246.2.6: download - view: text, markup, annotated - select for diffs
Sun Jul 24 05:39:29 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.5: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.5: +17 -4 lines
Add a device_acquire() for when we need to grab a reference and we
already have a pointer to the device.

Revision 1.246.2.5: download - view: text, markup, annotated - select for diffs
Fri Jul 22 12:03:15 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.4: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.4: +3 -3 lines
Fix logic to avoid dereferencing NULL pointer

Revision 1.246.2.4: download - view: text, markup, annotated - select for diffs
Fri Jul 22 02:05:39 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.3: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.3: +2 -3 lines
Remove stray debugging info

Revision 1.246.2.3: download - view: text, markup, annotated - select for diffs
Fri Jul 22 02:02:24 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.2: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.2: +22 -7 lines
In config_devfree(), free the 'struct localcount'

In device_lookup_private_acquire() we need to ensure that the caller has
access to the device_t so the reference that we're acquiring can later
be device_release()d.  So we must require that the device has non-NULL
private data where the pointer back to the device_t can be stored (ie,
in xxx->sc_dev).

Revision 1.247: download - view: text, markup, annotated - select for diffs
Tue Jul 19 07:44:03 2016 UTC (8 years, 4 months ago) by msaitoh
Branches: MAIN
CVS tags: pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +7 -7 lines
 Print number of attach error regardless of AB_QUIET and AB_SILENT.

Revision 1.246.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 16 22:06:42 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246.2.1: preferred, colored; branchpoint 1.246: preferred, colored
Changes since revision 1.246.2.1: +44 -7 lines
Add new xxx_acquire variants for device_lookup_private() and
device_find_by_driver_unit_acquire rather than blindly making the old
variants call localcount_acquire().

Also fix a couple of locking sequences.

Thanks to Taylor for the review!

Revision 1.246.2.1: download - view: text, markup, annotated - select for diffs
Sat Jul 16 02:13:07 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +49 -8 lines
Initial set of changes for subr_autoconf usage of localcount mechanism.

Nothing actually uses this yet - all callers of device_lookup() need
conversion to device_lookup_acquire()/device_release().  This also
means that callers of device_lookup_private() need to be modified to
call device_release() when finished accessing the softc.

XXX Perhaps device_lookup_private() should be removed, and all callers
XXX modified to use device_lookup_acquire()/.../device_release()?

Revision 1.246: download - view: text, markup, annotated - select for diffs
Fri Jul 15 01:17:47 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: MAIN
CVS tags: pgoyette-localcount-base
Branch point for: pgoyette-localcount
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +3 -3 lines
Also, don't hard-code the function name in the message;  use __func__

Revision 1.245: download - view: text, markup, annotated - select for diffs
Fri Jul 15 01:13:10 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +6 -4 lines
As suggested by christos@, use KASSERTMSG()

Revision 1.244: download - view: text, markup, annotated - select for diffs
Thu Jul 14 21:57:06 2016 UTC (8 years, 4 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +2 -7 lines
Remove a call to panic() which duplicates the subsequent KASSERT()!

XXX Since everything has (or should have) been switched to dev_t, we
XXX could probably remove the check for
XXX
XXX	ca->ca_devsize >= sizeof(struct device)
XXX
XXX But someone ought to check on that first!

Reviewed by riastradh@

Revision 1.243: download - view: text, markup, annotated - select for diffs
Mon Jul 11 07:42:13 2016 UTC (8 years, 5 months ago) by msaitoh
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +20 -15 lines
KNF. No functional change.

Revision 1.233.2.6: download - view: text, markup, annotated - select for diffs
Sat Jul 9 20:25:20 2016 UTC (8 years, 5 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.5: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.5: +9 -3 lines
Sync with HEAD

Revision 1.231.2.3: download - view: text, markup, annotated - select for diffs
Tue Jul 5 19:09:17 2016 UTC (8 years, 5 months ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1
Diff to: previous 1.231.2.2: preferred, colored; branchpoint 1.231: preferred, colored; next MAIN 1.232: preferred, colored
Changes since revision 1.231.2.2: +9 -3 lines
Pull up following revision(s) (requested by bouyer in ticket #1186):
	sys/dev/ata/wd.c: revision 1.421
	sys/kern/subr_autoconf.c: revision 1.242 via patch
	sys/sys/device.h: revision 1.149
Add a new config_detach() flag, DETACH_POWEROFF, which is set when
detaching devices at shutdown time with RB_POWERDOWN.
When detaching wd(4), put the drive in standby before detach
for DETACH_POWEROFF.
Fix PR kern/51252

Revision 1.242: download - view: text, markup, annotated - select for diffs
Sun Jun 19 09:35:06 2016 UTC (8 years, 5 months ago) by bouyer
Branches: MAIN
CVS tags: nick-nhusb-base-20160907
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +9 -3 lines
Add a new config_detach() flag, DETACH_POWEROFF, which is set when
detaching devices at shutdown time with RB_POWERDOWN.
When detaching wd(4), put the drive in standby before detach
for DETACH_POWEROFF.
Fix PR kern/51252

Revision 1.233.2.5: download - view: text, markup, annotated - select for diffs
Fri Apr 22 15:44:16 2016 UTC (8 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.4: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.4: +16 -37 lines
Sync with HEAD

Revision 1.241: download - view: text, markup, annotated - select for diffs
Mon Mar 28 09:50:40 2016 UTC (8 years, 8 months ago) by skrll
Branches: MAIN
CVS tags: nick-nhusb-base-20160529, nick-nhusb-base-20160422
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +16 -37 lines
Simplify.  No functional change.

Revision 1.233.2.4: download - view: text, markup, annotated - select for diffs
Sat Mar 19 11:30:31 2016 UTC (8 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.3: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.3: +10 -7 lines
Sync with HEAD

Revision 1.240: download - view: text, markup, annotated - select for diffs
Sun Mar 13 10:07:22 2016 UTC (8 years, 9 months ago) by mlelstv
Branches: MAIN
CVS tags: nick-nhusb-base-20160319
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +9 -6 lines
gcc silently optimizes away a != NULL check if a pointer has been
used before.

- assert that old size == 0 or old pointer valid
- check for size instead
- rewrite array splice operation with simple loops instead of memcpy/memset.

Revision 1.239: download - view: text, markup, annotated - select for diffs
Thu Jan 28 16:32:40 2016 UTC (8 years, 10 months ago) by christos
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +3 -3 lines
Don't detach devices if we are dumping core.

Revision 1.233.2.3: download - view: text, markup, annotated - select for diffs
Sun Dec 27 12:10:05 2015 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.2: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.2: +24 -5 lines
Sync with HEAD (as of 26th Dec)

Revision 1.238: download - view: text, markup, annotated - select for diffs
Sun Dec 20 04:21:03 2015 UTC (8 years, 11 months ago) by pgoyette
Branches: MAIN
CVS tags: nick-nhusb-base-20151226
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +3 -2 lines
If we process the callback immediately, don't bother adding it to the
list of future callbacks.  We've already processed the list (and removed
all the entries), and there's nothing in the future that will process
the list again.

This avoids the possibility of leaving an entry in the list that points
to an unloaded module's former address space.

Revision 1.237: download - view: text, markup, annotated - select for diffs
Mon Dec 7 11:38:46 2015 UTC (9 years ago) by pgoyette
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +19 -5 lines
Modularize drvctl(4)

Revision 1.231.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 16 14:40:41 2015 UTC (9 years ago) by msaitoh
Branches: netbsd-7
Diff to: previous 1.231.2.1: preferred, colored; branchpoint 1.231: preferred, colored
Changes since revision 1.231.2.1: +6 -2 lines
Pull up following revision(s) (requested by joerg in ticket #1030):
	sys/kern/subr_autoconf.c: revision 1.236
Add the parent device (if present) to the device properties, making it
easier to identify devices in the tree with drvctl(8).

Revision 1.236: download - view: text, markup, annotated - select for diffs
Sun Nov 8 21:03:00 2015 UTC (9 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +6 -2 lines
Add the parent device (if present) to the device properties, making it
easier to identify devices in the tree with drvctl(8).

Revision 1.233.2.2: download - view: text, markup, annotated - select for diffs
Sat Jun 6 14:40:21 2015 UTC (9 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233.2.1: preferred, colored; branchpoint 1.233: preferred, colored
Changes since revision 1.233.2.1: +5 -5 lines
Sync with HEAD

Revision 1.235: download - view: text, markup, annotated - select for diffs
Mon Apr 13 16:46:33 2015 UTC (9 years, 8 months ago) by riastradh
Branches: MAIN
CVS tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +3 -3 lines
Convert remaining MI <sys/rnd.h> stragglers.  Many MD ones left.

Revision 1.233.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 6 15:18:20 2015 UTC (9 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +31 -4 lines
Sync with HEAD

Revision 1.231.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 9 08:56:01 2015 UTC (9 years, 9 months ago) by snj
Branches: netbsd-7
CVS tags: netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +31 -4 lines
Pull up following revision(s) (requested by mrg in ticket #576):
	sys/kern/init_main.c: revision 1.462
	sys/kern/subr_autoconf.c: revision 1.234
	sys/sys/device.h: revision 1.147
wait for config_mountroot threads to complete before we tell init it
can start up.  this solves the problem where a console device needs
mountroot to complete attaching, and must create wsdisplay0 before
init tries to open /dev/console.  fixes PR#49709.
XXX: pullup-7

Revision 1.234: download - view: text, markup, annotated - select for diffs
Fri Mar 6 09:28:15 2015 UTC (9 years, 9 months ago) by mrg
Branches: MAIN
CVS tags: nick-nhusb-base-20150406
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +31 -4 lines
wait for config_mountroot threads to complete before we tell init it
can start up.  this solves the problem where a console device needs
mountroot to complete attaching, and must create wsdisplay0 before
init tries to open /dev/console.  fixes PR#49709.

XXX: pullup-7

Revision 1.233: download - view: text, markup, annotated - select for diffs
Thu Nov 6 08:46:04 2014 UTC (10 years, 1 month ago) by uebayasi
Branches: MAIN
CVS tags: nick-nhusb-base
Branch point for: nick-nhusb
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +8 -7 lines
Make config_stdsubmatch() human-readable.

Revision 1.232: download - view: text, markup, annotated - select for diffs
Fri Sep 5 05:57:21 2014 UTC (10 years, 3 months ago) by matt
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +13 -13 lines
Don't next structure and enum definitions.
Don't use C++ keywords new, try, class, private, etc.

Revision 1.223.2.4: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:04:29 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.223.2.3: preferred, colored
Changes since revision 1.223.2.3: +33 -22 lines
Rebase to HEAD as of a few days ago.

Revision 1.231: download - view: text, markup, annotated - select for diffs
Sun Aug 10 16:44:36 2014 UTC (10 years, 4 months ago) by tls
Branches: MAIN
CVS tags: tls-maxphys-base, netbsd-7-base
Branch point for: netbsd-7
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +17 -2 lines
Merge tls-earlyentropy branch into HEAD.

Revision 1.220.2.4: download - view: text, markup, annotated - select for diffs
Thu May 22 11:41:03 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.220.2.3: preferred, colored; branchpoint 1.220: preferred, colored; next MAIN 1.221: preferred, colored
Changes since revision 1.220.2.3: +22 -24 lines
sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.227.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 17:46:07 2014 UTC (10 years, 6 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.227: preferred, colored; next MAIN 1.228: preferred, colored
Changes since revision 1.227: +18 -22 lines
sync with head

Revision 1.230.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 7 02:20:00 2014 UTC (10 years, 8 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.230: preferred, colored; next MAIN 1.231: preferred, colored
Changes since revision 1.230: +17 -2 lines
Get more entropy into the system early:

	1) Add device attach timings from autoconf.
	2) Accumulate the output of kernel printf (as well as the times
	   when it's called) and add this periodically.  To avoid issues
	   with recursion through diagnostic printfs, we use SHA512 to
	   accumulate the printf output, then mix in its output.
	3) Add all sysctl settings -- mixes in the hostname and likely a
	   bit more.

Revision 1.230: download - view: text, markup, annotated - select for diffs
Tue Feb 25 18:30:11 2014 UTC (10 years, 9 months ago) by pooka
Branches: MAIN
CVS tags: yamt-pagecache-base9, tls-earlyentropy-base, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +4 -14 lines
Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.

Revision 1.229: download - view: text, markup, annotated - select for diffs
Fri Oct 25 16:08:18 2013 UTC (11 years, 1 month ago) by martin
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +4 -4 lines
Mark diagnostic-only variables

Revision 1.228: download - view: text, markup, annotated - select for diffs
Sat Oct 12 16:49:01 2013 UTC (11 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +14 -8 lines
Pass the device name in, so we can debug what deferred drivers did not work.

Revision 1.227: download - view: text, markup, annotated - select for diffs
Fri Jun 28 15:33:40 2013 UTC (11 years, 5 months ago) by christos
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +3 -3 lines
delete useless initialization
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html

Revision 1.223.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 25 00:29:52 2013 UTC (11 years, 9 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.223.2.2: preferred, colored
Changes since revision 1.223.2.2: +11 -4 lines
resync with head

Revision 1.226: download - view: text, markup, annotated - select for diffs
Sat Feb 9 00:31:21 2013 UTC (11 years, 10 months ago) by christos
Branches: MAIN
CVS tags: khorben-n900, agc-symver-base, agc-symver
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +6 -4 lines
printflike maintenance.

Revision 1.220.2.3: download - view: text, markup, annotated - select for diffs
Wed Jan 23 00:06:21 2013 UTC (11 years, 10 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.220.2.2: preferred, colored; branchpoint 1.220: preferred, colored
Changes since revision 1.220.2.2: +7 -2 lines
sync with head

Revision 1.225: download - view: text, markup, annotated - select for diffs
Thu Jan 10 10:15:59 2013 UTC (11 years, 11 months ago) by mlelstv
Branches: MAIN
CVS tags: yamt-pagecache-base8
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +7 -2 lines
Also report attachment of pseudo-devices to userland.

Revision 1.223.2.2: download - view: text, markup, annotated - select for diffs
Tue Nov 20 03:02:43 2012 UTC (12 years ago) by tls
Branches: tls-maxphys
Diff to: previous 1.223.2.1: preferred, colored
Changes since revision 1.223.2.1: +4 -4 lines
Resync to 2012-11-19 00:00:00 UTC

Revision 1.220.2.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:22:33 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.220.2.1: preferred, colored; branchpoint 1.220: preferred, colored
Changes since revision 1.220.2.1: +6 -6 lines
sync with head

Revision 1.224: download - view: text, markup, annotated - select for diffs
Sat Oct 27 17:18:39 2012 UTC (12 years, 1 month ago) by chs
Branches: MAIN
CVS tags: yamt-pagecache-base7, yamt-pagecache-base6
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +4 -4 lines
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.

Revision 1.223.2.1: download - view: text, markup, annotated - select for diffs
Wed Sep 12 06:15:34 2012 UTC (12 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +8 -4 lines
Initial snapshot of work to eliminate 64K MAXPHYS.  Basically works for
physio (I/O to raw devices); needs more doing to get it going with the
filesystems, but it shouldn't damage data.

All work's been done on amd64 so far.  Not hard to add support to other
ports.  If others want to pitch in, one very helpful thing would be to
sort out when and how IDE disks can do 128K or larger transfers, and
adjust the various PCI IDE (or at least ahcisata) drivers and wd.c
accordingly -- it would make testing much easier.  Another very helpful
thing would be to implement a smart minphys() for RAIDframe along the
lines detailed in the MAXPHYS-NOTES file.

Revision 1.223: download - view: text, markup, annotated - select for diffs
Thu Aug 30 02:24:20 2012 UTC (12 years, 3 months ago) by matt
Branches: MAIN
Branch point for: tls-maxphys
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +4 -4 lines
Give config thread more descriptive names.

Revision 1.220.2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 17 00:08:27 2012 UTC (12 years, 7 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +88 -5 lines
sync with head

Revision 1.220.6.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 07:35:32 2012 UTC (12 years, 9 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.220: preferred, colored; next MAIN 1.221: preferred, colored
Changes since revision 1.220: +88 -5 lines
merge to -current.

Revision 1.222: download - view: text, markup, annotated - select for diffs
Mon Jan 30 23:31:27 2012 UTC (12 years, 10 months ago) by matt
Branches: MAIN
CVS tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +5 -5 lines
Use proper ANSI prototypes for foo() -> foo(void)
Caught when compiling with -Wold-style-definition

Revision 1.221: download - view: text, markup, annotated - select for diffs
Mon Jan 16 19:42:40 2012 UTC (12 years, 10 months ago) by pgoyette
Branches: MAIN
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +85 -2 lines
Include autoconfig info interface-attributes, locators) in device property
dictionaries.

Revision 1.220: download - view: text, markup, annotated - select for diffs
Wed Aug 31 18:31:02 2011 UTC (13 years, 3 months ago) by plunky
Branches: MAIN
CVS tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +4 -4 lines
NULL does not need a cast

Revision 1.219: download - view: text, markup, annotated - select for diffs
Sat Aug 27 19:52:22 2011 UTC (13 years, 3 months ago) by martin
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +4 -3 lines
Enhance a panic message slightly

Revision 1.218: download - view: text, markup, annotated - select for diffs
Tue Aug 9 21:07:14 2011 UTC (13 years, 4 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +4 -4 lines
Correct a comment on config_found_sm_loc().

Revision 1.217: download - view: text, markup, annotated - select for diffs
Tue Aug 2 21:23:24 2011 UTC (13 years, 4 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +3 -2 lines
Re-add include of "drvctl.h", as its removal a year and a half ago broke
drvctl DRVGETEVENT.

Revision 1.203.2.6: download - view: text, markup, annotated - select for diffs
Sun Jun 12 00:24:29 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203.2.5: preferred, colored; branchpoint 1.203: preferred, colored; next MAIN 1.204: preferred, colored
Changes since revision 1.203.2.5: +3 -0 lines
sync with head

Revision 1.210.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:09:33 2011 UTC (13 years, 6 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.210: preferred, colored; next MAIN 1.211: preferred, colored
Changes since revision 1.210: +14 -43 lines
Sync with HEAD.

Revision 1.216: download - view: text, markup, annotated - select for diffs
Wed Jun 1 02:43:33 2011 UTC (13 years, 6 months ago) by christos
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -2 lines
provide a diagnostic for unsplit drivers.

Revision 1.203.2.5: download - view: text, markup, annotated - select for diffs
Tue May 31 03:05:02 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203.2.4: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.4: +0 -1 lines
sync with head

Revision 1.215: download - view: text, markup, annotated - select for diffs
Sun Apr 24 18:46:22 2011 UTC (13 years, 7 months ago) by rmind
Branches: MAIN
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +2 -3 lines
- Replace few malloc(9) uses with kmem(9).
- Rename buf_malloc() to buf_alloc(), fix comments.
- Remove some unnecessary inclusions.

Revision 1.203.2.4: download - view: text, markup, annotated - select for diffs
Thu Apr 21 01:42:09 2011 UTC (13 years, 7 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203.2.3: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.3: +1 -1 lines
sync with head

Revision 1.214: download - view: text, markup, annotated - select for diffs
Sat Apr 2 08:11:31 2011 UTC (13 years, 8 months ago) by mbalmer
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +3 -3 lines
Fix misplaced parenthesis.  From henning.petersen@t-online.de, thanks.

Revision 1.203.2.3: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:55:17 2011 UTC (13 years, 9 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203.2.2: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.2: +13 -42 lines
sync with head

Revision 1.163.4.2.4.3: download - view: text, markup, annotated - select for diffs
Tue Feb 8 21:56:01 2011 UTC (13 years, 10 months ago) by cliff
Branches: matt-nb5-mips64
Diff to: previous 1.163.4.2.4.2: preferred, colored; branchpoint 1.163.4.2: preferred, colored; next MAIN 1.163.4.3: preferred, colored
Changes since revision 1.163.4.2.4.2: +26 -27 lines
use mutex_obj_alloc() to allocate config_queues_lock and dc_funcs_lock
instead of declaring them statically.

Revision 1.210.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 8 16:19:59 2011 UTC (13 years, 10 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.210: preferred, colored; next MAIN 1.211: preferred, colored
Changes since revision 1.210: +10 -41 lines
Sync with HEAD

Revision 1.163.4.2.4.2: download - view: text, markup, annotated - select for diffs
Tue Feb 8 06:04:59 2011 UTC (13 years, 10 months ago) by cliff
Branches: matt-nb5-mips64
Diff to: previous 1.163.4.2.4.1: preferred, colored; branchpoint 1.163.4.2: preferred, colored
Changes since revision 1.163.4.2.4.1: +44 -2 lines
- add config_queues_lock to serialize access to deferred_config_queue and
interrupt_config_queue for adds, deletes and (those DIAGNOSTIC) searches
- add dc_funcs_lock to serialize dispatch of deferred config functions
many (all?) of which may not be MP safe.

Revision 1.213: download - view: text, markup, annotated - select for diffs
Sun Feb 6 23:25:17 2011 UTC (13 years, 10 months ago) by jmcneill
Branches: MAIN
CVS tags: bouyer-quota2-nbase, bouyer-quota2-base
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +2 -33 lines
- add support for using compressed images as splash images
- retire SPLASHSCREEN_PROGRESS and SPLASHSCREEN_IMAGE options

Revision 1.163.4.2.4.1: download - view: text, markup, annotated - select for diffs
Sat Feb 5 06:00:14 2011 UTC (13 years, 10 months ago) by cliff
Branches: matt-nb5-mips64
Diff to: previous 1.163.4.2: preferred, colored
Changes since revision 1.163.4.2: +3 -2 lines
- include opt_multiprocessor.h for explicit MULTIPROCESSOR dependency

Revision 1.212: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:07:16 2011 UTC (13 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +2 -8 lines
Let the linker instead of the C preprocessor configure the kernel: make
weak aliases device_register(9) and device_register_post_config(9)
for the stub routine voidop().  Get rid of __HAVE_DEVICE_REGISTER and
__HAVE_DEVICE_REGISTER_POST_CONFIG.

Revision 1.211: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:00:34 2011 UTC (13 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +10 -4 lines
If there are readers or writers in the alldevs list, don't remove a
device_t out from under them, but tag it for deletion, later.

Revision 1.210: download - view: text, markup, annotated - select for diffs
Fri Jan 14 10:18:21 2011 UTC (13 years, 11 months ago) by martin
Branches: MAIN
CVS tags: jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +3 -3 lines
Using "int" variables with sysctl's CTLTYPE_BOOL is a simple receipt to
loose on big endian machines. So make the variables "bool".

Revision 1.163.4.3: download - view: text, markup, annotated - select for diffs
Sat Nov 20 17:41:27 2010 UTC (14 years ago) by riz
Branches: netbsd-5
CVS tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.163.4.2: preferred, colored; branchpoint 1.163: preferred, colored; next MAIN 1.164: preferred, colored
Changes since revision 1.163.4.2: +3 -3 lines
Pull up following revision(s) (requested by hubertf in ticket #1386):
	sys/dev/raidframe/rf_netbsdkintf.c: revision 1.258
	sys/dev/pad/pad.c: revision 1.11
	sys/dev/scsipi/cd.c: revision 1.288
	sys/dev/isa/pcppi.c: revision 1.33
	sys/kern/subr_autoconf.c: revision 1.169
'boot -z' bogons

Revision 1.200.2.3: download - view: text, markup, annotated - select for diffs
Fri Oct 22 07:22:27 2010 UTC (14 years, 1 month ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.200.2.2: preferred, colored; branchpoint 1.200: preferred, colored; next MAIN 1.201: preferred, colored
Changes since revision 1.200.2.2: +2 -0 lines
Sync with HEAD (-D20101022).

Revision 1.146.2.8: download - view: text, markup, annotated - select for diffs
Sat Oct 9 03:32:31 2010 UTC (14 years, 2 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.7: preferred, colored; branchpoint 1.146: preferred, colored; next MAIN 1.147: preferred, colored
Changes since revision 1.146.2.7: +4 -2 lines
sync with head

Revision 1.200.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 17 06:47:29 2010 UTC (14 years, 3 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.200.2.1: preferred, colored; branchpoint 1.200: preferred, colored
Changes since revision 1.200.2.1: +73 -7 lines
Sync with HEAD.

Revision 1.209: download - view: text, markup, annotated - select for diffs
Mon Aug 16 17:29:52 2010 UTC (14 years, 3 months ago) by jruoho
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, uebayasi-xip-base4, uebayasi-xip-base3, matt-mips64-premerge-20101231
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +4 -2 lines
From jmcneill@: call config_deferred(9) in rescan_with_cfdata().

Revision 1.146.2.7: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:54:41 2010 UTC (14 years, 4 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.6: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.6: +226 -29 lines
sync with head.

Revision 1.203.2.2: download - view: text, markup, annotated - select for diffs
Sat Jul 3 01:19:54 2010 UTC (14 years, 5 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203.2.1: preferred, colored; branchpoint 1.203: preferred, colored
Changes since revision 1.203.2.1: +67 -3 lines
sync with head

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sat Jun 26 06:43:13 2010 UTC (14 years, 5 months ago) by tsutsui
Branches: MAIN
CVS tags: yamt-nfs-mp-base10, uebayasi-xip-base2
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +7 -4 lines
Rather than referring a global variable rootvnode in autoconf(9),
prepare and use an internal "root_is_mounted" flag for config_mountroot(9).

Should fix annoying dependency problem in librump reported by Paul Goyette
on current-users@:
http://mail-index.NetBSD.org/current-users/2010/06/25/msg013771.html

Revision 1.207: download - view: text, markup, annotated - select for diffs
Fri Jun 25 15:10:42 2010 UTC (14 years, 5 months ago) by tsutsui
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +63 -2 lines
Add config_mountroot(9), which defers device configuration
after mountroot(), like config_interrupt(9) that defers
configuration after interrupts are enabled.
This will be used for devices that require firmware loaded
from the root file system by firmload(9) to complete device
initialization (getting MAC address etc).

No objection on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/18/msg008370.html
and will also fix PR kern/43125.

Revision 1.203.2.1: download - view: text, markup, annotated - select for diffs
Sun May 30 05:17:57 2010 UTC (14 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +161 -28 lines
sync with head

Revision 1.206: download - view: text, markup, annotated - select for diffs
Fri Apr 30 21:17:22 2010 UTC (14 years, 7 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +10 -8 lines
IPL_VM is the highest interrupt priority where alldevs is read/written,
and acquiring alldevs_mtx already blocks those interrupts, so delete the
splhigh()/splx() in config_alldevs_lock()/_unlock().

Release alldevs_mtx while freeing memory with kmem_free(9); according to
new documentation, kmem_free(9) can sleep! :-) Thanks to rmind@ for the
tip.

Next step: use finer-grained locking, probably by adding a mutex to
    cfdriver_t.

And after that: make sure that all threads of execution are out of the
    device_t and/or softc before releasing their memory.

Revision 1.200.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:44:11 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +185 -48 lines
Sync with HEAD.

Revision 1.205: download - view: text, markup, annotated - select for diffs
Mon Apr 19 11:20:56 2010 UTC (14 years, 7 months ago) by jruoho
Branches: MAIN
CVS tags: uebayasi-xip-base1
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +3 -3 lines
Use CTLTYPE_BOOL.

Revision 1.204: download - view: text, markup, annotated - select for diffs
Thu Mar 25 19:23:18 2010 UTC (14 years, 8 months ago) by pooka
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +152 -21 lines
Add init/fini for components (modules etc.).  These eat the standard
driver/attach/data typically present and once some locking is grown
in here, these routines can be made to fail or succeed a component
attachment/detachment atomically.

Revision 1.146.2.6: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:18 2010 UTC (14 years, 9 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.5: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.5: +510 -482 lines
sync with head

Revision 1.203: download - view: text, markup, annotated - select for diffs
Wed Feb 24 22:38:10 2010 UTC (14 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +14 -14 lines
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.

Revision 1.202: download - view: text, markup, annotated - select for diffs
Fri Feb 19 22:28:47 2010 UTC (14 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +12 -11 lines
Avoid a potential crash:  get more struct device initialization
out of the way before trying to get a unit number.  If we cannot
get a unit number, we call config_devfree(), which expects for
fields such as dv_flags, dv_cfattach, and dv_private to be initialized.

Revision 1.201: download - view: text, markup, annotated - select for diffs
Mon Feb 15 20:20:34 2010 UTC (14 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +12 -7 lines
Extract a subroutine, const char *cfdata_ifattr(cfdata_t cf), that
returns the name of the interface attribute that associates cf with
its parent.  Use cfdata_ifattr() at several sites in the autoconf
code.

Revision 1.200: download - view: text, markup, annotated - select for diffs
Sun Jan 31 15:10:12 2010 UTC (14 years, 10 months ago) by pooka
Branches: MAIN
CVS tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +2 -146 lines
Device accessors are only marginally related to autoconf, so put them
into subr_device.c instead of having them in subr_autoconf.c.

Since none of the copyrights in subr_autoconf.c really match the
history of device accessors, I took the liberty of slapping (c)
2006 TNF onto subr_device.c.

Revision 1.199: download - view: text, markup, annotated - select for diffs
Tue Jan 19 21:54:53 2010 UTC (14 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +3 -3 lines
A new survey of the code indicates that the very highest interrupt
priority level where the kernel accesses alldevs is IPL_VM, where
some hardware interrupt handlers call config_deactivate(9).  Lower
the IPL of alldevs_mtx from IPL_HIGH to IPL_VM, accordingly.

Revision 1.198: download - view: text, markup, annotated - select for diffs
Tue Jan 19 21:24:36 2010 UTC (14 years, 10 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +42 -37 lines
Refactor: as suggested by rmind@, extract duplicate code into
subroutines config_alldevs_enter() and config_alldevs_exit().  This
change amounts to textual substitution.  No functional change intended.

We do not collect garbage in device_lookup(), so there is no use dumping
it: get rid of the garbage list.  Do not call config_dump_garbage().

In device_lookup_private(), call device_lookup() instead of duplicating
the code from device_lookup().

Revision 1.197: download - view: text, markup, annotated - select for diffs
Tue Jan 12 22:11:13 2010 UTC (14 years, 11 months ago) by rmind
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +66 -46 lines
Revert 1.194 rev.

Revision 1.196: download - view: text, markup, annotated - select for diffs
Sun Jan 10 13:42:34 2010 UTC (14 years, 11 months ago) by martin
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +6 -2 lines
Add a new optional function device_register_post_config(), symmetric to
device register, called after config is done with a device.
Only used if an arch defines  __HAVE_DEVICE_REGISTER_POSTCONFIG.

Revision 1.195: download - view: text, markup, annotated - select for diffs
Fri Jan 8 20:07:14 2010 UTC (14 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +26 -26 lines
Expand PMF_FN_* macros.

Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri Jan 8 12:07:08 2010 UTC (14 years, 11 months ago) by rmind
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +46 -66 lines
Simplify device G/C: use global list and config_alldevs_unlock_gc().

Revision 1.193: download - view: text, markup, annotated - select for diffs
Fri Jan 8 00:09:45 2010 UTC (14 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +8 -2 lines
Move all copies of ifattr_match() to sys/kern/subr_autoconf.c.

Revision 1.192: download - view: text, markup, annotated - select for diffs
Thu Jan 7 22:39:52 2010 UTC (14 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +8 -2 lines
Add a do-nothing child-detachment hook, null_childdetached(device_t,
device_t).

Revision 1.191: download - view: text, markup, annotated - select for diffs
Tue Jan 5 22:42:16 2010 UTC (14 years, 11 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +15 -29 lines
Call device_lookup() from device_lookup_private() instead of
duplicating code.

Per suggestions by rmind@:

Simplify some code that used "empty statements," ";".

Don't collect garbage in device_lookup{,_private}(), since they
are called in interrupt context from certain drivers.

Make config_collect_garbage() KASSERT() that it does not run in
interrupt or software-interrupt context.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Tue Dec 15 03:02:24 2009 UTC (15 years ago) by dyoung
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +167 -134 lines
Per rmind@'s suggestion, avoid an acquire/release-mutex dance by
collecting garbage in two phases:  in the first stage, with
alldevs_mtx held, gather all of the objects to be freed onto a
list.  Drop alldevs_mtx, and in the second stage, free all the
collected objects.

Also per rmind@'s suggestion, remove KASSERT(!mutex_owned(&alldevs_mtx))
throughout, it is not useful.

Find a free unit number and allocate it for a new device_t atomically.
Before, two threads would sometimes find the same free unit number
and race to allocate it.  The loser panicked.  Now there is no
race.

In support of the changes above, extract some new subroutines that
are private to this module: config_unit_nextfree(), config_unit_alloc(),
config_devfree(), config_dump_garbage().

Delete all of the #ifdef __BROKEN_CONFIG_UNIT_USAGE code.  Only
the sun3 port still depends on __BROKEN_CONFIG_UNIT_USAGE, it's
not hard for the port to do without, and port-sun3@ had fair warning
that it was going away (>1 week, or a few years' warning, depending
how far back you look!).

Revision 1.189: download - view: text, markup, annotated - select for diffs
Sun Nov 29 15:17:30 2009 UTC (15 years ago) by pooka
Branches: MAIN
CVS tags: matt-premerge-20091211
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +6 -3 lines
Fix kernel build on platforms which define __BROKEN_CONFIG_UNIT_USAGE
and therefore don't take config_alldevs_lock() in config_devalloc().

Revision 1.188: download - view: text, markup, annotated - select for diffs
Thu Nov 12 23:16:28 2009 UTC (15 years, 1 month ago) by dyoung
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +4 -6 lines
Use TAILQ_FOREACH() instead of open-coding it.

I applied this patch with Coccinelle's semantic patch tool, spatch(1).
I installed Coccinelle from pkgsrc: devel/coccinelle/.  I wrote
tailq.spatch and kdefs.h (see below) and ran this command,

spatch -debug -macro_file_builtins ./kdefs.h -outplace \
    -sp_file sys/kern/tailq.spatch sys/kern/subr_autoconf.c

which wrote the transformed source file to /tmp/subr_autoconf.c.  Then I
used indent(1) to fix the indentation.

::::::::::::::::::::
::: tailq.spatch :::
::::::::::::::::::::

@@
identifier I, N;
expression H;
statement S;
iterator name TAILQ_FOREACH;
@@

- for (I = TAILQ_FIRST(H); I != NULL; I = TAILQ_NEXT(I, N)) S
+ TAILQ_FOREACH(I, H, N) S

:::::::::::::::
::: kdefs.h :::
:::::::::::::::

#define MAXUSERS 64
#define _KERNEL
#define _KERNEL_OPT
#define i386

/*
 * Tail queue definitions.
 */
#define	_TAILQ_HEAD(name, type, qual)					\
struct name {								\
	qual type *tqh_first;		/* first element */		\
	qual type *qual *tqh_last;	/* addr of last next element */	\
}
#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)

#define	TAILQ_HEAD_INITIALIZER(head)					\
	{ NULL, &(head).tqh_first }

#define	_TAILQ_ENTRY(type, qual)					\
struct {								\
	qual type *tqe_next;		/* next element */		\
	qual type *qual *tqe_prev;	/* address of previous next element */\
}
#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)

#define	PMF_FN_PROTO1	pmf_qual_t
#define	PMF_FN_ARGS1	pmf_qual_t qual
#define	PMF_FN_CALL1	qual

#define	PMF_FN_PROTO	, pmf_qual_t
#define	PMF_FN_ARGS	, pmf_qual_t qual
#define	PMF_FN_CALL	, qual

#define __KERNEL_RCSID(a, b)

Revision 1.187: download - view: text, markup, annotated - select for diffs
Thu Nov 12 19:10:30 2009 UTC (15 years, 1 month ago) by dyoung
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +315 -165 lines
Move a device-deactivation pattern that is replicated throughout
the system into config_deactivate(dev): deactivate dev and all of
its descendants.  Block all interrupts while calling each device's
activation hook, ca_activate.  Now it is possible to simplify or
to delete several device-activation hooks throughout the system.

Do not deactivate a driver while detaching it!  If the driver was
already deactivated (because of accidental/emergency removal), let
the driver cope with the knowledge that DVF_ACTIVE has been cleared.
Otherwise, let the driver access the underlying hardware (so that
it can flush caches, restore original register settings, et cetera)
until it exits its device-detachment hook.

Let multiple readers and writers simultaneously access the system's
device_t list, alldevs, from either interrupt or thread context:
postpone changing alldevs linkages and freeing autoconf device
structures until a garbage-collection phase that runs after all
readers & writers have left the list.

Give device iterators (deviter(9)) a consistent view of alldevs no
matter whether device_t's are added and deleted during iteration:
keep a global alldevs generation number.  When an iterator enters
alldevs, record the current generation number in the iterator and
increase the global number.  When a device_t is created, label it
with the current global generation number.  When a device_t is
deleted, add a second label, the current global generation number.
During iteration, compare a device_t's added- and deleted-generation
with the iterator's generation and skip a device_t that was deleted
before the iterator entered the list or added after the iterator
entered the list.

The alldevs generation number is never 0.  The garbage collector
reaps device_t's whose delete-generation number is non-zero.

Make alldevs private to sys/kern/subr_autoconf.c.  Use deviter(9)
to access it.

Revision 1.186: download - view: text, markup, annotated - select for diffs
Mon Oct 12 23:33:02 2009 UTC (15 years, 2 months ago) by yamt
Branches: MAIN
CVS tags: jym-xensuspend-nbase
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +2 -3 lines
remove no longer necessary include of drvctl.h

Revision 1.185: download - view: text, markup, annotated - select for diffs
Mon Sep 21 12:14:47 2009 UTC (15 years, 2 months ago) by pooka
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +15 -7 lines
Split config_init() into config_init() and config_init_mi() to help
platforms which want to call config_init() very early in the boot.

Revision 1.184: download - view: text, markup, annotated - select for diffs
Wed Sep 16 22:45:24 2009 UTC (15 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +2 -20 lines
Nothing calls config_activate(9) any longer, so delete it.

Revision 1.183: download - view: text, markup, annotated - select for diffs
Wed Sep 16 16:34:50 2009 UTC (15 years, 2 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +45 -63 lines
In pmf(9), improve the implementation of device self-suspension
and make suspension by self, by drvctl(8), and by ACPI system sleep
play nice together.  Start solidifying some temporary API changes.

1. Extract a new header file, <sys/device_if.h>, from <sys/device.h> and
   #include it from <sys/pmf.h> instead of <sys/device.h> to break the
   circular dependency between <sys/device.h> and <sys/pmf.h>.

2. Introduce pmf_qual_t, an aggregate of qualifications on a PMF
   suspend/resume call.  Start to replace instances of PMF_FN_PROTO,
   PMF_FN_ARGS, et cetera, with a pmf_qual_t.

3. Introduce the notion of a "suspensor," an entity that holds a
   device in suspension.  More than one suspensor may hold a device
   at once.  A device stays suspended as long as at least one
   suspensor holds it.  A device resumes when the last suspensor
   releases it.

   Currently, the kernel defines three suspensors,

   3a the system-suspensor: for system suspension, initiated
      by 'sysctl -w machdep.sleep_state=3', by lid closure, by
      power-button press, et cetera,

   3b the drvctl-suspensor: for device suspension by /dev/drvctl
      ioctl, e.g., drvctl -S sip0.

   3c the system self-suspensor: for device drivers that suspend
      themselves and their children.  Several drivers for network
      interfaces put the network device to sleep while it is not
      administratively up, that is, after the kernel calls if_stop(,
      1).  The self-suspensor should not be used directly.  See
      the description of suspensor delegates, below.

   A suspensor can have one or more "delegates".  A suspensor can
   release devices that its delegates hold suspended.  Right now,
   only the system self-suspensor has delegates.  For each device
   that a self-suspending driver attaches, it creates the device's
   self-suspensor, a delegate of the system self-suspensor.

   Suspensors stop a system-wide suspend/resume cycle from waking
   devices that the operator put to sleep with drvctl before the cycle.
   They also help self-suspension to work more simply, safely, and in
   accord with expectations.

4. Add the notion of device activation level, devact_level_t,
   and a routine for checking the current activation level,
   device_activation().  Current activation levels are DEVACT_LEVEL_BUS,
   DEVACT_LEVEL_DRIVER, and DEVACT_LEVEL_CLASS, which respectively
   indicate that the device's bus is active, that the bus and device are
   active, and that the bus, device, and the functions of the device's
   class (network, audio) are active.

   Suspend/resume calls can be qualified with a devact_level_t.
   The power-management framework treats a devact_level_t that
   qualifies a device suspension as the device's current activation
   level; it only runs hooks to reduce the activation level from
   the presumed current level to the fully suspended state.  The
   framework treats a devact_level_t qualifying device resumption
   as the target activation level; it only runs hooks to raise the
   activation level to the target.

5. Use pmf_qual_t, devact_level_t, and self-suspensors in several
   drivers.

6. Temporarily add an unused power-management workqueue that I will
   remove or replace, soon.

Revision 1.182: download - view: text, markup, annotated - select for diffs
Wed Sep 16 15:23:04 2009 UTC (15 years, 2 months ago) by pooka
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +7 -3 lines
Replace a large number of link set based sysctl node creations with
calls from subsystem constructors.  Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL

Revision 1.146.2.5: download - view: text, markup, annotated - select for diffs
Wed Sep 16 13:38:01 2009 UTC (15 years, 2 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.4: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.4: +17 -196 lines
sync with head

Revision 1.181: download - view: text, markup, annotated - select for diffs
Sun Sep 6 16:18:56 2009 UTC (15 years, 3 months ago) by pooka
Branches: MAIN
CVS tags: yamt-nfs-mp-base8
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +2 -108 lines
Remove autoconf dependency on vfs and dk:
opendisk() -> kern/subr_disk_open.c
config_handle_wedges -> dev/dkwedge/dk.c

Revision 1.180: download - view: text, markup, annotated - select for diffs
Thu Sep 3 15:20:08 2009 UTC (15 years, 3 months ago) by pooka
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +17 -90 lines
Move configure() and configure2() from subr_autoconf.c to init_main.c,
since they are only peripherially related to the autoconf subsystem
and more related to boot initialization.  Also, apply _KERNEL_OPT
to autoconf where necessary.

Revision 1.167.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 23 23:32:35 2009 UTC (15 years, 4 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.167.2.1: preferred, colored; branchpoint 1.167: preferred, colored; next MAIN 1.168: preferred, colored
Changes since revision 1.167.2.1: +94 -16 lines
Sync with HEAD.

Revision 1.146.2.4: download - view: text, markup, annotated - select for diffs
Sat Jul 18 14:53:23 2009 UTC (15 years, 4 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.3: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.3: +66 -13 lines
sync with head.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Tue Jul 14 13:24:00 2009 UTC (15 years, 5 months ago) by tsutsui
Branches: MAIN
CVS tags: yamt-nfs-mp-base7, yamt-nfs-mp-base6, jymxensuspend-base
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +10 -3 lines
Add a workaround for some traditional ports (amiga and atari):
- Defer callout_setfunc() call after config_init() call in configure().

Fixes silent hang before consinit() at least on atari.

These traditional ports use config(9) structures and
autoconf(9) functions to detect console devices, and
config_init() is called at very early stage at boot
where mutex(9) is not ready.

Actually config_init() has been split out from configure()
for these ports:
http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/kern/subr_autoconf.c#rev1.74
while x68k has been fixed properly:
http://mail-index.NetBSD.org/source-changes/2009/01/17/msg215673.html

See also:
http://mail-index.NetBSD.org/port-x68k/2008/12/31/msg000006.html
http://mail-index.NetBSD.org/port-atari/2009/07/03/msg000419.html

Revision 1.178: download - view: text, markup, annotated - select for diffs
Fri Jun 26 19:30:45 2009 UTC (15 years, 5 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +58 -12 lines
Switch to kmem(9).

(void *)pew is one way to get a struct work *, but let's
write&pew->pew_work, instead.  It is more defensive and persuasive.

Make miscellaneous changes in support of tearing down arbitrary
stacks of filesystems and devices during shutdown:

1 Move struct shutdown_state, shutdown_first(), and shutdown_next(),
  from kern_pmf.c to subr_autoconf.c.  Rename detach_all() to
  config_detach_all(), and move it from kern_pmf.c to subr_autoconf.c.
  Export all of those routines.

2 In pmf_system_shutdown(), do not suspend user process scheduling, and
  do not detach all devices: I am going to do that in cpu_reboot(),
  instead.  (Soon I will do it in an MI cpu_reboot() routine.)  Do still
  call PMF shutdown hooks.

3 In config_detach(), add a DIAGNOSTIC assertion: if we're exiting
  config_detach() at the bottom, alldevs_nwrite had better not be 0,
  because config_detach() is a writer of the device list.

4 In deviter_release(), check to see if we're iterating the device list
  for reading, *first*, and if so, decrease the number of readers.  Used
  to be that if we happened to be reading during shutdown, we ran the
  shutdown branch.  Thus the number of writers reached 0, the number
  of readers remained > 0, and no writer could iterate again.  Under
  certain circumstances that would cause a hang during shutdown.

Revision 1.146.2.3: download - view: text, markup, annotated - select for diffs
Sat Jun 20 07:20:31 2009 UTC (15 years, 5 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.2: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.2: +31 -6 lines
sync with head

Revision 1.177: download - view: text, markup, annotated - select for diffs
Fri May 29 23:27:08 2009 UTC (15 years, 6 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-nfs-mp-base5
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +4 -4 lines
In config_detach(9), if device deactivation fails with EOPNOTSUPP,
don't treat it as an error.  This should stop the kernel from
panicking in config_detach(9) when sd(4)/wd(4) detach.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Sun May 24 12:27:50 2009 UTC (15 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +29 -4 lines
Bus scans can make it appear as if the system has paused, so
twiddle constantly while config_interrupts() jobs are running.

Revision 1.167.2.1: download - view: text, markup, annotated - select for diffs
Wed May 13 17:21:57 2009 UTC (15 years, 7 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +164 -146 lines
Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.146.2.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:13:47 2009 UTC (15 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146.2.1: preferred, colored; branchpoint 1.146: preferred, colored
Changes since revision 1.146.2.1: +311 -221 lines
sync with head.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Fri May 1 08:27:41 2009 UTC (15 years, 7 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, jym-xensuspend-base
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +77 -77 lines
remove useless parenthesis

Revision 1.163.2.3: download - view: text, markup, annotated - select for diffs
Tue Apr 28 07:37:00 2009 UTC (15 years, 7 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.163.2.2: preferred, colored; branchpoint 1.163: preferred, colored; next MAIN 1.164: preferred, colored
Changes since revision 1.163.2.2: +82 -64 lines
Sync with HEAD.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Thu Apr 2 00:09:34 2009 UTC (15 years, 8 months ago) by dyoung
Branches: MAIN
CVS tags: nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +74 -63 lines
During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sat Mar 28 18:43:20 2009 UTC (15 years, 8 months ago) by christos
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +4 -6 lines
revert previous; ctags has been fixed.

Revision 1.172: download - view: text, markup, annotated - select for diffs
Wed Mar 25 21:48:36 2009 UTC (15 years, 8 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +6 -4 lines
ctags(1) gets confused by 'typedef struct X { } X_t', so break 'typedef
struct pmf_private { ... } pmf_private_t' into a struct definition and a
typedef definition.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Wed Mar 25 21:43:42 2009 UTC (15 years, 8 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +4 -2 lines
DVF_ACTIVE is unconditionally set when we attach a device, so
unconditionally clear it after we give a device's deactivate() routine a
chance.

Revision 1.170: download - view: text, markup, annotated - select for diffs
Wed Mar 25 21:28:50 2009 UTC (15 years, 8 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +7 -2 lines
When we attach a pseudo-device, set its cfdata_t's cf_fstate to
FSTATE_FOUND, as we do in config_attach_loc(), in order to avoid a
DIAGNOSTIC panic in config_detach() if we detach the device.

Revision 1.163.4.2: download - view: text, markup, annotated - select for diffs
Sun Mar 15 19:43:48 2009 UTC (15 years, 9 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb4-mips64-k7-u2a-k9b
Branch point for: matt-nb5-mips64
Diff to: previous 1.163.4.1: preferred, colored; branchpoint 1.163: preferred, colored
Changes since revision 1.163.4.1: +9 -9 lines
Pull up following revision(s) (requested by christos in ticket #458):
	sys/conf/Makefile.kern.inc: revision 1.121
	sys/conf/files: revision 1.940
	sys/kern/init_main.c: revision 1.381
	sys/kern/kern_ssp.c: revision 1.1
	sys/kern/subr_autoconf.c: revision 1.168
	sys/sys/device.h: revision 1.116
	sys/sys/systm.h: revision 1.233
Unbreak ssp kernels. The issue here that when the ssp_init() call was
deferred, it caused the return from the enclosing function to break, as
well as the ssp return on i386. To fix both issues, split configure in
two pieces the one before calling ssp_init and the one after, and move
the ssp_init() call back in main. Put ssp_init() in its own file, and
compile this new file with -fno-stack-protector. Tested on amd64.
XXX: If we want to have ssp kernels working on 5.0, this change needs to
be pulled up.

Revision 1.169: download - view: text, markup, annotated - select for diffs
Sat Mar 14 11:08:28 2009 UTC (15 years, 9 months ago) by ad
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +3 -3 lines
'boot -z' bogons

Revision 1.163.2.2: download - view: text, markup, annotated - select for diffs
Tue Mar 3 18:32:56 2009 UTC (15 years, 9 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.163.2.1: preferred, colored; branchpoint 1.163: preferred, colored
Changes since revision 1.163.2.1: +9 -9 lines
Sync with HEAD.

Revision 1.168: download - view: text, markup, annotated - select for diffs
Thu Feb 12 18:24:18 2009 UTC (15 years, 10 months ago) by christos
Branches: MAIN
CVS tags: nick-hppapmap-base2
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +9 -9 lines
Unbreak ssp kernels. The issue here that when the ssp_init() call was deferred,
it caused the return from the enclosing function to break, as well as the
ssp return on i386. To fix both issues, split configure in two pieces
the one before calling ssp_init and the one after, and move the ssp_init()
call back in main. Put ssp_init() in its own file, and compile this new file
with -fno-stack-protector. Tested on amd64.
XXX: If we want to have ssp kernels working on 5.0, this change needs to
be pulled up.

Revision 1.163.4.1: download - view: text, markup, annotated - select for diffs
Mon Feb 2 02:38:32 2009 UTC (15 years, 10 months ago) by snj
Branches: netbsd-5
CVS tags: netbsd-5-0-RC2
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +6 -5 lines
Pull up following revision(s) (requested by ad in ticket #339):
	sys/kern/subr_autoconf.c: revision 1.167
Don't need to hold kernel_lock for most of this (and not into the swapper!).

Revision 1.163.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:19:39 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +15 -18 lines
Sync with HEAD.

Revision 1.131.6.6: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:19 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131.6.5: preferred, colored; branchpoint 1.131: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131.6.5: +13 -16 lines
Sync with HEAD.

Revision 1.167: download - view: text, markup, annotated - select for diffs
Mon Dec 29 13:40:11 2008 UTC (15 years, 11 months ago) by ad
Branches: MAIN
CVS tags: mjf-devfs2-base
Branch point for: jym-xensuspend
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +6 -5 lines
Don't need to hold kernel_lock for most of this (and not into the swapper!).

Revision 1.166: download - view: text, markup, annotated - select for diffs
Mon Dec 29 12:52:50 2008 UTC (15 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +9 -13 lines
Don't do KM_NOSLEEP allocations.

Revision 1.156.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:15:08 2008 UTC (16 years ago) by haad
Branches: haad-dm
Diff to: previous 1.156.2.1: preferred, colored; branchpoint 1.156: preferred, colored; next MAIN 1.157: preferred, colored
Changes since revision 1.156.2.1: +4 -4 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.165: download - view: text, markup, annotated - select for diffs
Tue Nov 18 21:20:32 2008 UTC (16 years ago) by macallan
Branches: MAIN
CVS tags: haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +3 -3 lines
don't leak kmem on LP64

Revision 1.164: download - view: text, markup, annotated - select for diffs
Wed Nov 12 12:36:16 2008 UTC (16 years, 1 month ago) by ad
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +3 -3 lines
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.

Revision 1.156.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:17:28 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +88 -73 lines
Sync with HEAD.

Revision 1.131.6.5: download - view: text, markup, annotated - select for diffs
Sun Sep 28 10:40:53 2008 UTC (16 years, 2 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131.6.4: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.6.4: +86 -71 lines
Sync with HEAD.

Revision 1.147.2.3: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:38:56 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.147.2.2: preferred, colored; branchpoint 1.147: preferred, colored; next MAIN 1.148: preferred, colored
Changes since revision 1.147.2.2: +2 -3 lines
Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.147.2.2: download - view: text, markup, annotated - select for diffs
Thu Sep 18 04:31:43 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.147.2.1: preferred, colored; branchpoint 1.147: preferred, colored
Changes since revision 1.147.2.1: +89 -73 lines
Sync with wrstuden-revivesa-base-2.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sun Sep 7 22:36:36 2008 UTC (16 years, 3 months ago) by cube
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, netbsd-5-base, netbsd-5-0-RC1, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +2 -3 lines
Remove what seems to be a debug printf committed by accident.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Mon Sep 1 19:44:05 2008 UTC (16 years, 3 months ago) by drochner
Branches: MAIN
CVS tags: wrstuden-revivesa-base-2
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +7 -10 lines
fix the logics of device memory deallocation
(non-split devices paniced a diagnostic kernel)

Revision 1.161: download - view: text, markup, annotated - select for diffs
Wed Aug 27 05:40:25 2008 UTC (16 years, 3 months ago) by christos
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +7 -6 lines
better debugging messages.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Fri Aug 15 03:14:20 2008 UTC (16 years, 4 months ago) by matt
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +6 -3 lines
Don't call null handlers

Revision 1.159: download - view: text, markup, annotated - select for diffs
Fri Aug 15 03:08:26 2008 UTC (16 years, 4 months ago) by matt
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +72 -66 lines
Change subr_autoconf.c to use kmem_{*alloc,free}.
in pmf_deregister, don't constantly realloc.  just shift everything closer
to the front.  and then if empty, free.  When adding, add space for 4 more
entries.
Instead of n * sizeof(type) use C99 sizeof(type [n]).

Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Aug 14 21:51:08 2008 UTC (16 years, 4 months ago) by matt
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +8 -3 lines
Only deallocate dv_private if we had allocated it.

Revision 1.154.2.2: download - view: text, markup, annotated - select for diffs
Thu Jul 31 04:51:03 2008 UTC (16 years, 4 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.154.2.1: preferred, colored; next MAIN 1.155: preferred, colored
Changes since revision 1.154.2.1: +6 -2 lines
Sync with head.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Mon Jul 28 14:22:14 2008 UTC (16 years, 4 months ago) by drochner
Branches: MAIN
CVS tags: simonb-wapbl-nbase, simonb-wapbl-base
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +6 -2 lines
Avoid NULL pointer dereference on power handler deregistration if
it was not registered before. I assume that a lot of drivers do not
proper bookkeeping in the case the attach() exits early due to
errors. This is hard to fix and to test, so just be generous here.

Revision 1.131.6.4: download - view: text, markup, annotated - select for diffs
Sun Jun 29 09:33:14 2008 UTC (16 years, 5 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131.6.3: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.6.3: +10 -9 lines
Sync with HEAD.

Revision 1.147.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 23 04:31:51 2008 UTC (16 years, 5 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +76 -16 lines
Sync w/ -current. 34 merge conflicts to follow.

Revision 1.154.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 18 16:33:35 2008 UTC (16 years, 5 months ago) by simonb
Branches: simonb-wapbl
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +10 -11 lines
Sync with head.

Revision 1.144.2.3: download - view: text, markup, annotated - select for diffs
Tue Jun 17 09:15:03 2008 UTC (16 years, 5 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.144.2.2: preferred, colored; branchpoint 1.144: preferred, colored; next MAIN 1.145: preferred, colored
Changes since revision 1.144.2.2: +17 -11 lines
sync with head.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Wed Jun 11 15:56:11 2008 UTC (16 years, 6 months ago) by drochner
Branches: MAIN
CVS tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: haad-dm
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +7 -7 lines
tighten type checking: use device_t instead of void* at some places

Revision 1.155: download - view: text, markup, annotated - select for diffs
Wed Jun 11 06:26:32 2008 UTC (16 years, 6 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +5 -6 lines
In device_pmf_driver_deregister, postpone deleting a device_t's
reference to the PMF private data until the private data has no
more waiters.  This protects against a NULL dereference.

In device_pmf_lock1(), test a device_t for PMF registration before
dereferencing its PMF private data.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Fri Jun 6 17:52:40 2008 UTC (16 years, 6 months ago) by drochner
Branches: MAIN
Branch point for: simonb-wapbl
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +3 -2 lines
add a KASSERT to catch missing locators

Revision 1.153: download - view: text, markup, annotated - select for diffs
Thu Jun 5 21:55:51 2008 UTC (16 years, 6 months ago) by cegger
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +3 -2 lines
make this build

Revision 1.131.6.3: download - view: text, markup, annotated - select for diffs
Thu Jun 5 19:14:36 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131.6.2: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.6.2: +5 -0 lines
Sync with HEAD.

Also fix build.

Revision 1.152: download - view: text, markup, annotated - select for diffs
Wed Jun 4 12:45:28 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +7 -2 lines
- vm_page: put listq, pageq into a union alongside a LIST_ENTRY, so we can
  use both types of list.

- Make page coloring and idle zero state per-CPU.

- Maintain per-CPU page freelists. When freeing, put pages onto the local
  CPU's lists and the global lists. When allocating, prefer to take pages
  from the local CPU. If none are available take from the global list as
  done now. Proposed on tech-kern@.

Revision 1.144.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:05:39 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.144.2.1: preferred, colored; branchpoint 1.144: preferred, colored
Changes since revision 1.144.2.1: +61 -7 lines
sync with head

Revision 1.131.6.2: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:24:10 2008 UTC (16 years, 6 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131.6.1: preferred, colored; branchpoint 1.131: preferred, colored
Changes since revision 1.131.6.1: +76 -17 lines
Sync with HEAD.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Tue May 27 17:50:03 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-base3
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +17 -6 lines
Replace a couple of tsleep calls with cv_wait.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Sun May 25 15:03:01 2008 UTC (16 years, 6 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +7 -2 lines
Export device-driver and device-unit properties via drvctl

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sun May 25 12:30:40 2008 UTC (16 years, 6 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +41 -2 lines
Add DRVGETEVENT support for /dev/drvctl, based on devmon support by
Jachym Holecek for Google Summer of Code. DRVGETEVENT plist is currently
limited to event type, device name, and device parent name.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Mon May 19 17:06:02 2008 UTC (16 years, 6 months ago) by ad
Branches: MAIN
CVS tags: hpcarm-cleanup-nbase
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +2 -3 lines
Reduce ifdefs due to MULTIPROCESSOR slightly.

Revision 1.144.2.1: download - view: text, markup, annotated - select for diffs
Sun May 18 12:35:09 2008 UTC (16 years, 6 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +8 -7 lines
sync with head.

Revision 1.146.2.1: download - view: text, markup, annotated - select for diffs
Fri May 16 02:25:26 2008 UTC (16 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -3 lines
sync with head.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Tue Apr 29 14:35:21 2008 UTC (16 years, 7 months ago) by rmind
Branches: MAIN
CVS tags: yamt-pf42-base2, yamt-nfs-mp-base2
Branch point for: wrstuden-revivesa
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -3 lines
Split the runqueue management code into the separate file.
OK by <ad>.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Thu Apr 24 13:56:30 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
CVS tags: yamt-nfs-mp-base
Branch point for: yamt-nfs-mp
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +6 -3 lines
xc_broadcast: don't try to run cross calls on CPUs that are not yet running.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Tue Apr 22 11:45:28 2008 UTC (16 years, 7 months ago) by ad
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +2 -5 lines
Implement MP callouts as discussed on tech-kern. The CPU binding code is
disabled for the moment until we figure out what we want to do with CPUs
being offlined.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Mon Apr 14 18:07:51 2008 UTC (16 years, 8 months ago) by ad
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base
Branch point for: yamt-pf42
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +6 -2 lines
SSP: block interrupts when enabling, and move the init to just before
starting secondary processors.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Fri Apr 4 20:13:18 2008 UTC (16 years, 8 months ago) by cegger
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +10 -10 lines
use device_xname() where appropriate
OK martin

Revision 1.131.6.1: download - view: text, markup, annotated - select for diffs
Thu Apr 3 12:43:03 2008 UTC (16 years, 8 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +571 -77 lines
Sync with HEAD.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Tue Apr 1 10:37:42 2008 UTC (16 years, 8 months ago) by ad
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +61 -21 lines
Use multiple kthreads to process config_interrupts tasks. Proposed on
tech-kern.

Revision 1.131.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 24 07:16:14 2008 UTC (16 years, 8 months ago) by keiichi
Branches: keiichi-mipv6
Diff to: previous 1.131: preferred, colored; next MAIN 1.132: preferred, colored
Changes since revision 1.131: +512 -58 lines
sync with head.

Revision 1.119.6.3: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:05:00 2008 UTC (16 years, 8 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.119.6.2: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.6.2: +551 -75 lines
sync with HEAD

Revision 1.95.2.11: download - view: text, markup, annotated - select for diffs
Mon Mar 17 09:15:34 2008 UTC (16 years, 8 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.10: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95.2.10: +512 -58 lines
sync with head.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Wed Mar 12 18:02:22 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +36 -2 lines
Use device_t and its accessors throughout.  Use aprint_*_dev().

Improve PMF-ability.

        Add a 'flags' argument to suspend/resume handlers and
        callers such as pmf_system_suspend().

        Define a flag, PMF_F_SELF, which indicates to PMF that a
        device is suspending/resuming itself.  Add helper routines,
        pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
        that call pmf_device_suspend(dev, PMF_F_SELF) and
        pmf_device_resume(dev, PMF_F_SELF), respectively.  Use
        PMF_F_SELF to suspend/resume self in ath(4), audio(4),
        rtw(4), and sip(4).

        In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
        callbacks, provided by the bus front-end, with
        self-suspension/resumption.  Also, clean up the bus
        front-ends.  Make sure that the interrupt handler is
        disestablished during suspension.  Get rid of driver-private
        flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
        device_is_active()/device_has_power() calls, instead.

        In the network-class suspend handler, call if_stop(, 0)
        instead of if_stop(, 1), because the latter is superfluous
        (bus- and driver-suspension hooks will 'disable' the NIC),
        and it may cause recursion.

        In the network-class resume handler, prevent infinite
        recursion through if_init() by getting out early if we are
        self-suspending (PMF_F_SELF).

rtw(4) improvements:

        Destroy rtw(4) callouts when we detach it.  Make rtw at
        pci detachable.  Print some more information with the "rx
        frame too long" warning.

Remove activate() methods:

        Get rid of rtw_activate() and ath_activate().  The device
        activate() methods are not good for much these days.

Make ath at cardbus resume with crypto functions intact:

        Introduce a boolean device property, "pmf-powerdown".  If
        pmf-powerdown is present and false, it indicates that a
        bus back-end should not remove power from a device.

        Honor this property in cardbus_child_suspend().

        Set this property to 'false' in ath_attach(), since removing
        power from an ath at cardbus seems to lobotomize the WPA
        crypto engine.  XXX Should the pmf-powerdown property
        propagate toward the root of the device tree?

Miscellaneous ath(4) changes:

        Warn if ath(4) tries to write crypto keys to suspended
        hardware.

        Reduce differences between FreeBSD and NetBSD in ath(4)
        multicast filter setup.

        Make ath_printrxbuf() print an rx descriptor's status &
        key index, to help debug crypto errors.

        Shorten a staircase in ath_ioctl().  Don't check for
        ieee80211_ioctl() return code ERESTART, it never happens.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Tue Mar 11 02:42:41 2008 UTC (16 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +22 -3 lines
Add device_lookup_private() which is just device_private(device_lookup(&cd, i))
Most callers don't want the device_t, they want their softc and that's what
device_lookup_private returns.

Revision 1.139: download - view: text, markup, annotated - select for diffs
Fri Mar 7 07:03:06 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +134 -2 lines
PMF: synchronize device suspension and resumption.

Revision 1.138: download - view: text, markup, annotated - select for diffs
Fri Mar 7 06:29:20 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +3 -3 lines
Stop the kernel from panicking when it detaches sysbeep0:  do not
try to free the device driver-private storage if dv_private is
NULL.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Wed Mar 5 15:37:55 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +2 -6 lines
Remove a couple of bogus KASSERTs.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Wed Mar 5 07:09:18 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +267 -34 lines
Synchronize readers and writers of the device tree.

Add a device iterator object, deviter_t, and methods deviter_init(),
deviter_first(), and deviter_next() for visiting each device in
the device tree.

Take care not to re-shutdown a device in the event that the machine
panics during reboot and the operator types 'reboot' at the kernel
debugger prompt.

While I'm here, sprinkle PMF_FN_ARGS, PMF_FN_PROTO, et cetera.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Wed Mar 5 04:54:24 2008 UTC (16 years, 9 months ago) by dyoung
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +22 -18 lines
Introduce PMF_FN_{ARGS,PROTO}1, and use PMF_FN_{ARGS,PROTO} more
widely, further helping me to introduce PMF API changes piecemeal.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Tue Mar 4 11:52:37 2008 UTC (16 years, 9 months ago) by cube
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +10 -3 lines
Report a change from the cube-autoconf branch to allow
device_private(NULL).  That will ease the conversion of drivers to splitted
softc/device_t which is mandatory for cube-autoconf and will be done in
HEAD.

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Feb 28 14:25:12 2008 UTC (16 years, 9 months ago) by drochner
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +27 -4 lines
Extend the pmf suspend/resume hooks by a shutdown method, so drivers
can register a shutdown handler explicitely.
Install a pci bus shutdown handler which disables bus master accesses
for all childs, so the drivers don't need to care.
This will hopefully be sufficient to replace the shutdownhooks
(together with the powerhooks). (It has been suggested to use some
general event notification framework for shutdown handlers, but there
might be cases where shutdown handlers must be run in an order following
the device hierarchy, which wouldn't be easy with event handlers
not tied to drivers.)
approved by David Young

Revision 1.132: download - view: text, markup, annotated - select for diffs
Wed Feb 27 19:59:05 2008 UTC (16 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +12 -6 lines
Allow PRIV_ALLOC devices to have no private data.

Revision 1.95.2.10: download - view: text, markup, annotated - select for diffs
Wed Feb 27 08:36:56 2008 UTC (16 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.9: preferred, colored
Changes since revision 1.95.2.9: +36 -2 lines
sync with head.

Revision 1.120.4.4: download - view: text, markup, annotated - select for diffs
Mon Feb 18 21:06:46 2008 UTC (16 years, 9 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.120.4.3: preferred, colored; branchpoint 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120.4.3: +56 -34 lines
Sync with HEAD.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue Feb 12 17:30:59 2008 UTC (16 years, 10 months ago) by joerg
Branches: MAIN
CVS tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +36 -2 lines
Introduce device_find_by_xname and device_find_by_driver_unit to replace
alldevs iterations all over src.

Patch discussed with and improved on suggestioned from cube@.

Revision 1.95.2.9: download - view: text, markup, annotated - select for diffs
Mon Feb 11 14:59:58 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.8: preferred, colored
Changes since revision 1.95.2.8: +20 -33 lines
sync with head.

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Feb 6 20:24:17 2008 UTC (16 years, 10 months ago) by drochner
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +20 -33 lines
The tricks done in device_foreach_child() still don't make it safe to use
by config_detach_children(), because the latter can work recursively
and remove any number of devices, so rewrite config_detach_children()
to restart list traversal after each call of config_detach(), and since
only one user of device_foreach_child() is left (in kern_drvctl.c),
and it is simpler to open-code the loop than to deal with callbacks,
just remove it.

Revision 1.95.2.8: download - view: text, markup, annotated - select for diffs
Mon Jan 21 09:46:17 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.7: preferred, colored
Changes since revision 1.95.2.7: +363 -5 lines
sync with head

Revision 1.125.2.3: download - view: text, markup, annotated - select for diffs
Sat Jan 19 12:15:24 2008 UTC (16 years, 10 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.125.2.2: preferred, colored; branchpoint 1.125: preferred, colored; next MAIN 1.126: preferred, colored
Changes since revision 1.125.2.2: +2 -1 lines
Sync with HEAD

Revision 1.129: download - view: text, markup, annotated - select for diffs
Mon Jan 14 12:40:03 2008 UTC (16 years, 11 months ago) by yamt
Branches: MAIN
CVS tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +4 -3 lines
add a per-cpu storage allocator.

Revision 1.119.6.2: download - view: text, markup, annotated - select for diffs
Wed Jan 9 01:56:14 2008 UTC (16 years, 11 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.119.6.1: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.6.1: +378 -18 lines
sync with HEAD

Revision 1.125.2.2: download - view: text, markup, annotated - select for diffs
Tue Jan 8 22:11:39 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
CVS tags: bouyer-xeni386-merge1
Diff to: previous 1.125.2.1: preferred, colored; branchpoint 1.125: preferred, colored
Changes since revision 1.125.2.1: +3 -3 lines
Sync with HEAD

Revision 1.128: download - view: text, markup, annotated - select for diffs
Tue Jan 8 06:27:46 2008 UTC (16 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: matt-armv6-base
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +5 -4 lines
In device_foreach_child(), use a safe idiom for walking a list
whose elements we might be deleting.  This stops us from crashing
in config_detach_children().

Revision 1.127: download - view: text, markup, annotated - select for diffs
Fri Jan 4 21:18:12 2008 UTC (16 years, 11 months ago) by ad
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +2 -3 lines
Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.

Revision 1.125.2.1: download - view: text, markup, annotated - select for diffs
Wed Jan 2 21:56:07 2008 UTC (16 years, 11 months ago) by bouyer
Branches: bouyer-xeni386
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +45 -2 lines
Sync with HEAD

Revision 1.120.4.3: download - view: text, markup, annotated - select for diffs
Thu Dec 27 00:46:07 2007 UTC (16 years, 11 months ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.120.4.2: preferred, colored; branchpoint 1.120: preferred, colored
Changes since revision 1.120.4.2: +360 -3 lines
Sync with HEAD.

Revision 1.123.2.1: download - view: text, markup, annotated - select for diffs
Wed Dec 26 19:57:13 2007 UTC (16 years, 11 months ago) by ad
Branches: vmlocking2
Diff to: previous 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123: +360 -3 lines
Sync with head.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sun Dec 16 20:49:52 2007 UTC (16 years, 11 months ago) by dyoung
Branches: MAIN
CVS tags: vmlocking2-base3
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +45 -2 lines
Add config_deferred() for forcing the deferred configuration to
run, which we need to do from drvctl(4) sometimes.

Add device_foreach_child() for calling a function on each child of
a device_t.

Add config_detach_children() for detaching all of the children of
a device (uses device_foreach_child()).

Revision 1.125.4.1: download - view: text, markup, annotated - select for diffs
Sun Dec 16 18:54:05 2007 UTC (16 years, 11 months ago) by cube
Branches: cube-autoconf
Diff to: previous 1.125: preferred, colored; next MAIN 1.126: preferred, colored
Changes since revision 1.125: +3 -411 lines
Split off device-specific stuff out of subr_autconf.c, and split off
autoconf-specific stuff out of device.h.

The only functional change is the removal of the unused evcnt.h include in
device.h which (*sigh*) has side-effects in x86's intr.h, and probably some
other in the rest of the tree but I'm only compiling i386's QEMU for the
time being.

Revision 1.123.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 11 15:44:13 2007 UTC (17 years ago) by yamt
Branches: yamt-kmem
Diff to: previous 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123: +317 -3 lines
sync with head.

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Dec 9 21:11:57 2007 UTC (17 years ago) by jmcneill
Branches: MAIN
CVS tags: yamt-kmem-base3, yamt-kmem-base2, cube-autoconf-base
Branch point for: cube-autoconf, bouyer-xeni386
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -3 lines
Use aprint_debug to notify the user that a device does not implement the
power management framework rather than aprint_error.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sun Dec 9 20:28:44 2007 UTC (17 years ago) by jmcneill
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +317 -3 lines
Merge jmcneill-pm branch.

Revision 1.120.4.2: download - view: text, markup, annotated - select for diffs
Sat Dec 8 18:20:35 2007 UTC (17 years ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.120.4.1: preferred, colored; branchpoint 1.120: preferred, colored
Changes since revision 1.120.4.1: +5 -5 lines
Sync with HEAD.

Revision 1.119.4.9: download - view: text, markup, annotated - select for diffs
Sat Dec 8 16:21:40 2007 UTC (17 years ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.119.4.8: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.4.8: +21 -21 lines
Rename pnp(9) -> pmf(9), as requested by many.

Revision 1.95.2.7: download - view: text, markup, annotated - select for diffs
Fri Dec 7 17:32:57 2007 UTC (17 years ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.6: preferred, colored
Changes since revision 1.95.2.6: +5 -5 lines
sync with head

Revision 1.119.4.8: download - view: text, markup, annotated - select for diffs
Tue Nov 27 19:38:09 2007 UTC (17 years ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.7: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.7: +5 -5 lines
Sync with HEAD. amd64 Xen support needs testing.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Mon Nov 26 19:02:03 2007 UTC (17 years ago) by pooka
Branches: MAIN
CVS tags: yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base
Branch point for: yamt-kmem, vmlocking2
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +5 -5 lines
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern

Revision 1.119.4.7: download - view: text, markup, annotated - select for diffs
Wed Nov 21 21:56:02 2007 UTC (17 years ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.6: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.6: +8 -2 lines
Sync with HEAD.

Revision 1.120.4.1: download - view: text, markup, annotated - select for diffs
Mon Nov 19 00:48:48 2007 UTC (17 years ago) by mjf
Branches: mjf-devfs
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +16 -13 lines
Sync with HEAD.

Revision 1.120.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 18 19:35:49 2007 UTC (17 years ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.120.2.1: preferred, colored; branchpoint 1.120: preferred, colored; next MAIN 1.121: preferred, colored
Changes since revision 1.120.2.1: +6 -0 lines
Sync with HEAD

Revision 1.95.2.6: download - view: text, markup, annotated - select for diffs
Thu Nov 15 11:44:48 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.5: preferred, colored
Changes since revision 1.95.2.5: +16 -13 lines
sync with head.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:45:45 2007 UTC (17 years, 1 month ago) by ad
Branches: MAIN
CVS tags: bouyer-xenamd64-base2, bouyer-xenamd64-base
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +8 -2 lines
Boot the secondary processors just before the interrupt-enabled section
of autoconfig. This is needed if APs are able to take interrupts.

Revision 1.119.4.6: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:04:43 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.5: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.5: +10 -13 lines
Sync with HEAD.

Revision 1.120.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 13 16:02:17 2007 UTC (17 years, 1 month ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +10 -13 lines
Sync with HEAD

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun Nov 11 23:22:24 2007 UTC (17 years, 1 month ago) by matt
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +10 -13 lines
Change some initialization of static queues to compile time.
(xxx_INIT to xxx_HEAD_INITIALIZER).  Drop code which inits
non-auto (global or static) variables to 0 since that's
already implied by being non-auto.  Init some static/global
cpu_simple_locks at compile time.

Revision 1.119.4.5: download - view: text, markup, annotated - select for diffs
Wed Nov 7 01:14:15 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.4: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.4: +12 -2 lines
Introduce device_has_power to fix a race between resuming a device and
the device enabling interrupts as seen by jmcneill@ with uhci. Change
ehci, ohci, uhci and azalia to use this function to protect the
interrupt handler.

Revision 1.119.6.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:32:11 2007 UTC (17 years, 1 month ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +23 -11 lines
sync with HEAD

Revision 1.119.4.4: download - view: text, markup, annotated - select for diffs
Tue Nov 6 14:27:37 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.3: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.3: +300 -29 lines
Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
  three layers (class logic, device logic, bus logic), all of them being
  optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
  not suspended (even partially), device_is_enabled returns true if the
  device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
  pnp_system_resume. Before running any suspend/resume handlers, check
  that all currently attached devices support power management and bail
  out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
  can register what events they are interested in and whether the handler
  should be global or not.
- Introduce device_active API for devices to mark themselve in use from
  either the system or the device. Use this to implement the idle handling
  for audio and input devices. This is intended to replace most ad-hoc
  watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
  shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
  well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
  break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.

Revision 1.95.2.5: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:35:32 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.4: preferred, colored
Changes since revision 1.95.2.4: +23 -11 lines
sync with head.

Revision 1.117.2.3: download - view: text, markup, annotated - select for diffs
Tue Oct 9 13:44:29 2007 UTC (17 years, 2 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117.2.2: preferred, colored; branchpoint 1.117: preferred, colored; next MAIN 1.118: preferred, colored
Changes since revision 1.117.2.2: +23 -11 lines
Sync with head.

Revision 1.119.8.1: download - view: text, markup, annotated - select for diffs
Sat Oct 6 15:28:45 2007 UTC (17 years, 2 months ago) by yamt
Branches: yamt-x86pmap
Diff to: previous 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119: +23 -11 lines
sync with head.

Revision 1.119.4.3: download - view: text, markup, annotated - select for diffs
Tue Oct 2 18:29:02 2007 UTC (17 years, 2 months ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.2: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.2: +23 -11 lines
Sync with HEAD.

Revision 1.119.4.2: download - view: text, markup, annotated - select for diffs
Mon Oct 1 05:38:07 2007 UTC (17 years, 2 months ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.119.4.1: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.4.1: +14 -2 lines
Extend device API by device_power_private and device_power_set_private.
The latter is a temporary mean until the pnp_register API itself is
overhault. This functions allow a generic power handler to store its
state independent of the driver.

Use this and revamp the PCI power handling. Pretty much all PCI devices
had power handlers that did the same thing, generalize this in
pci_generic_power_register/deregister and the handler. This interface
offers callbacks for the drivers to save and restore state on
transistions. After a long discussion with jmcneill@ it was considered
to be powerful enough until evidence is shown that devices can handle
D1/D2 with less code and higher speed than without the full
save/restore. The generic code is carefully written to handle device
without PCI-PM support and ensure that the correct registers are written
to when D3 loses all state.

Reimplement the generic PCI network device handling on
top of PCI generic power handling.

Introduce pci_disable_retry as used and implemented locally at least by
ath(4) and iwi(4). Use it in this drivers to restore behaviour from
before the introduction of generic PCI network handling.

Convert all PCI drivers that were using pnp_register to the new
framework. The only exception is vga(4) as it is commonly used as
console device. Add a note therein that this should be fixed later.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Mon Sep 24 18:47:56 2007 UTC (17 years, 2 months ago) by joerg
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, vmlocking-base, jmcneill-base
Branch point for: mjf-devfs, bouyer-xenamd64
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +23 -11 lines
Introduce CFATTACH_DECL_NEW and CFATTACH_DECL2_NEW for drivers that
don't expect struct device as first field of softc. device_private uses
a new field of struct device to give the softc address and that field is
either set the struct device for old-style devices or a separate
allocation by config_devalloc. Both macros are intended as temporary
bandaid until all drivers are converted and will be removed later.

Revision 1.95.2.4: download - view: text, markup, annotated - select for diffs
Mon Sep 3 14:41:00 2007 UTC (17 years, 3 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.3: preferred, colored
Changes since revision 1.95.2.3: +246 -138 lines
sync with head.

Revision 1.117.2.2: download - view: text, markup, annotated - select for diffs
Mon Aug 20 21:27:37 2007 UTC (17 years, 3 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117.2.1: preferred, colored; branchpoint 1.117: preferred, colored
Changes since revision 1.117.2.1: +5 -2 lines
Sync with HEAD.

Revision 1.118.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 15 13:49:11 2007 UTC (17 years, 4 months ago) by skrll
Branches: nick-csl-alignment
Diff to: previous 1.118: preferred, colored; next MAIN 1.119: preferred, colored
Changes since revision 1.118: +5 -2 lines
Sync with HEAD.

Revision 1.119.4.1: download - view: text, markup, annotated - select for diffs
Fri Aug 3 22:17:29 2007 UTC (17 years, 4 months ago) by jmcneill
Branches: jmcneill-pm
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +23 -2 lines
Pull in power management changes from private branch.

Revision 1.119.10.2: download - view: text, markup, annotated - select for diffs
Fri Jul 20 22:15:48 2007 UTC (17 years, 4 months ago) by tsutsui
Branches: matt-mips64
Diff to: previous 1.119.10.1: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.10.1: +1718 -0 lines
Defer callout_startup2() (which calls softintr_establish(9)) call
after cpu_configure(9) for now because softintr(9) is initialized
in cpu_configure(9) on some ports.

Ok'ed by ad@ on current-users, and fixes hangs on m68k ports
during scsi probe.

Revision 1.119.10.1
Fri Jul 20 22:15:47 2007 UTC (17 years, 4 months ago) by tsutsui
Branches: matt-mips64
FILE REMOVED
Changes since revision 1.119: +0 -1718 lines
file subr_autoconf.c was added on branch matt-mips64 on 2007-07-20 22:15:48 +0000

Revision 1.119: download - view: text, markup, annotated - select for diffs
Fri Jul 20 22:15:47 2007 UTC (17 years, 4 months ago) by tsutsui
Branches: MAIN
CVS tags: yamt-x86pmap-base, nick-csl-alignment-base5, matt-mips64-base, hpcarm-cleanup
Branch point for: yamt-x86pmap, matt-mips64, matt-armv6, jmcneill-pm
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +5 -2 lines
Defer callout_startup2() (which calls softintr_establish(9)) call
after cpu_configure(9) for now because softintr(9) is initialized
in cpu_configure(9) on some ports.

Ok'ed by ad@ on current-users, and fixes hangs on m68k ports
during scsi probe.

Revision 1.117.2.1: download - view: text, markup, annotated - select for diffs
Sun Jul 15 13:27:42 2007 UTC (17 years, 5 months ago) by ad
Branches: vmlocking
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +124 -2 lines
Sync with head.

Revision 1.117.4.1: download - view: text, markup, annotated - select for diffs
Wed Jul 11 20:10:02 2007 UTC (17 years, 5 months ago) by mjf
Branches: mjf-ufs-trans
Diff to: previous 1.117: preferred, colored; next MAIN 1.118: preferred, colored
Changes since revision 1.117: +124 -2 lines
Sync with head.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sun Jun 24 01:43:35 2007 UTC (17 years, 5 months ago) by dyoung
Branches: MAIN
CVS tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: nick-csl-alignment
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +124 -2 lines
Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.

Revision 1.115.4.2: download - view: text, markup, annotated - select for diffs
Mon Mar 12 05:58:39 2007 UTC (17 years, 9 months ago) by rmind
Branches: yamt-idlelwp
Diff to: previous 1.115.4.1: preferred, colored; branchpoint 1.115: preferred, colored; next MAIN 1.116: preferred, colored
Changes since revision 1.115.4.1: +121 -138 lines
Sync with HEAD.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Mar 5 20:32:45 2007 UTC (17 years, 9 months ago) by drochner
Branches: MAIN
CVS tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup
Branch point for: vmlocking, mjf-ufs-trans
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +121 -138 lines
Make the attach functions for real and pseudo devices share as much code
as possible. For that, split out a function which does the allocation
of a softc (without linking it into global structures) and a function
which inserts the device into the global alldevs lists and the per-driver
cd_devs.
There is a little semantic change involved: the pseudo-device code didn't
interpret FSTATE_STAR as such, for no good reason. This looks harmless;
I'll modify driver frontends as I find ways to test.
Get config_makeroom() out of the public namespace - that's clearly an
internal of autoconf which drivers can't be allowed to deal with.

Revision 1.115.4.1: download - view: text, markup, annotated - select for diffs
Tue Feb 27 16:54:27 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-idlelwp
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -4 lines
- sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.

Revision 1.95.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:11:13 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.2: preferred, colored
Changes since revision 1.95.2.2: +4 -4 lines
sync with head.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Wed Feb 21 23:00:04 2007 UTC (17 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: ad-audiomp-base, ad-audiomp
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -4 lines
Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.95.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:50:06 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.1: preferred, colored
Changes since revision 1.95.2.1: +3 -3 lines
sync with head.

Revision 1.114.8.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:39:22 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.114: preferred, colored; next MAIN 1.115: preferred, colored
Changes since revision 1.114: +3 -3 lines
Sync with head.

Revision 1.114.10.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:07:11 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.114: preferred, colored; next MAIN 1.115: preferred, colored
Changes since revision 1.114: +3 -3 lines
sync with head

Revision 1.115: download - view: text, markup, annotated - select for diffs
Mon Oct 2 02:59:38 2006 UTC (18 years, 2 months ago) by chs
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, post-newlock2-merge, newlock2-nbase, newlock2-base, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Branch point for: yamt-idlelwp
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +3 -3 lines
remove details of the kernel malloc() implementation from header files:
 - change MALLOC() and FREE() to just call their function equivalents.
 - remove references to other malloc()-related constants.

Revision 1.103.4.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:57:16 2006 UTC (18 years, 3 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.103: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103: +153 -12 lines
sync with head

Revision 1.95.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:09:38 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +299 -89 lines
sync with head.

Revision 1.103.6.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:38:09 2006 UTC (18 years, 6 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.103.6.1: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103.6.1: +16 -52 lines
Sync with head.

Revision 1.108.6.2: download - view: text, markup, annotated - select for diffs
Wed May 24 15:50:41 2006 UTC (18 years, 6 months ago) by tron
Branches: peter-altq
Diff to: previous 1.108.6.1: preferred, colored; branchpoint 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108.6.1: +16 -52 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.108.2.2: download - view: text, markup, annotated - select for diffs
Wed May 24 10:58:41 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.108.2.1: preferred, colored; branchpoint 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108.2.1: +16 -52 lines
sync with head.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Sun May 14 05:26:59 2006 UTC (18 years, 7 months ago) by christos
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, rpaulo-netinet-merge-pcb-base, gdamore-uart-base, gdamore-uart, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +3 -2 lines
Initialize an uninitialized variable gcc 4 found

Revision 1.108.4.2: download - view: text, markup, annotated - select for diffs
Thu May 11 23:30:15 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.108.4.1: preferred, colored; branchpoint 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108.4.1: +15 -52 lines
sync with head

Revision 1.113: download - view: text, markup, annotated - select for diffs
Mon May 8 01:04:09 2006 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: elad-kernelauth-base
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +4 -2 lines
Initialize dv_properties in config_attach_pseudo().  PR kern/33438

Revision 1.112: download - view: text, markup, annotated - select for diffs
Fri May 5 18:04:43 2006 UTC (18 years, 7 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +13 -52 lines
Remove the devprop API and switch everthing over to the new proplib.  Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.

Revision 1.103.6.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:39:59 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +180 -3 lines
Sync with head.

Revision 1.108.4.1: download - view: text, markup, annotated - select for diffs
Wed Apr 19 05:13:59 2006 UTC (18 years, 7 months ago) by elad
Branches: elad-kernelauth
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +17 -5 lines
sync with head.

Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Sat Apr 1 12:07:40 2006 UTC (18 years, 8 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +17 -5 lines
sync with head.

Revision 1.108.6.1: download - view: text, markup, annotated - select for diffs
Fri Mar 31 09:45:28 2006 UTC (18 years, 8 months ago) by tron
Branches: peter-altq
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +17 -5 lines
Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Wed Mar 29 06:25:35 2006 UTC (18 years, 8 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -3 lines
Fix typo.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Wed Mar 29 06:08:16 2006 UTC (18 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +13 -2 lines
Add a device_private() to return the driver's private data (softc).
For now, this just returns the passed device_t (as a void *) because
device softcs currently contain a "struct device" as the first member.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Mar 29 06:00:47 2006 UTC (18 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +6 -5 lines
Replace device_locators() with device_locator(), and use it.

Revision 1.103.2.2: download - view: text, markup, annotated - select for diffs
Wed Mar 1 09:28:46 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.103.2.1: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103.2.1: +128 -2 lines
sync with head.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Feb 23 05:48:12 2006 UTC (18 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +15 -2 lines
Add device_is_a(), which returns true if the device is an instance
of the driver specified by name.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Sun Feb 19 15:01:21 2006 UTC (18 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +83 -2 lines
Add accessor functions for the device_t type.  Make device_lookup() a
real function, rather than a macro.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Feb 18 19:40:42 2006 UTC (18 years, 9 months ago) by martin
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +4 -2 lines
#if __i386__ the include of opt_splash.h for now - it is only defined
on i386.
XXX - Jared, this needs to be done differently!

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sat Feb 18 19:09:53 2006 UTC (18 years, 9 months ago) by jmcneill
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +32 -2 lines
If options SPLASHSCREEN and SPLASHSCREEN_PROGRESS are enabled, update the
animation periodically during autoconf.

Revision 1.103.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 18 15:39:18 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +42 -3 lines
sync with head.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Feb 18 05:04:13 2006 UTC (18 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +42 -3 lines
- Don't expose dev_propdb directly -- provide devprop_*() wrappers instead.
- Rework the ARMADILLO / epe device properties interaction so that it actually
  associates the MAC address property with the epe device instance.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Dec 24 19:12:23 2005 UTC (18 years, 11 months ago) by perry
Branches: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -3 lines
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Tue Dec 20 04:39:36 2005 UTC (18 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +76 -48 lines
Use new typedefs.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:24:29 2005 UTC (19 years ago) by christos
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +2 -2 lines
merge ktrace-lwp.

Revision 1.85.2.8: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:09:45 2005 UTC (19 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.7: preferred, colored; next MAIN 1.86: preferred, colored
Changes since revision 1.85.2.7: +77 -98 lines
Sync with HEAD. Here we go again...

Revision 1.100: download - view: text, markup, annotated - select for diffs
Mon Aug 29 19:13:48 2005 UTC (19 years, 3 months ago) by drochner
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -11 lines
in mapply(), call config_match() instead duplicating its code

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Aug 26 14:20:40 2005 UTC (19 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +14 -14 lines
nuke locdesc_t from orbit

Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu Aug 25 22:17:19 2005 UTC (19 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +25 -2 lines
now that we have information about default locator values
we can implement an universal submatch() function covering all
the standard cases:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

Revision 1.97: download - view: text, markup, annotated - select for diffs
Thu Aug 25 18:35:40 2005 UTC (19 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +5 -7 lines
replace the "locdesc_t" structure carrying the number of locators
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

Revision 1.96: download - view: text, markup, annotated - select for diffs
Thu Aug 25 15:06:28 2005 UTC (19 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +40 -12 lines
Replace the "locnames", attached to cfdata, which was solely good for
userconf, by more complete information (including default values) about
interface attributes, attached to the drivers which provide them.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Tue Jun 28 18:37:34 2005 UTC (19 years, 5 months ago) by drochner
Branches: MAIN
Branch point for: yamt-lazymbuf
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +10 -72 lines
clean up duplication which was to support the old (not locator passing)
API for bus "submatch" functions

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun May 29 22:24:15 2005 UTC (19 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +3 -3 lines
- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.

Revision 1.92.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:24 2005 UTC (19 years, 7 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +7 -7 lines
sync with -current

Revision 1.92.6.1: download - view: text, markup, annotated - select for diffs
Sat Mar 19 08:36:12 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +7 -7 lines
sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.85.2.7: download - view: text, markup, annotated - select for diffs
Fri Mar 4 16:52:00 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.6: preferred, colored
Changes since revision 1.85.2.6: +7 -7 lines
Sync with HEAD.

Hi Perry!

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sat Feb 26 21:34:55 2005 UTC (19 years, 9 months ago) by perry
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, kent-audio2-base
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +7 -7 lines
nuke trailing whitespace

Revision 1.85.2.6: download - view: text, markup, annotated - select for diffs
Tue Oct 19 15:58:05 2004 UTC (20 years, 1 month ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.5: preferred, colored
Changes since revision 1.85.2.5: +16 -8 lines
Sync with HEAD

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri Oct 15 04:38:37 2004 UTC (20 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-km-base2, yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +16 -8 lines
Change config_attach_pseudo() to take a cfdata * that contains the
necessary information to create the pseudo-device instance.  Pseudo-device
device's will reference this cfdata, just as normal devices reference
their corresponding cfdata.

Welcome to 2.99.10.

Revision 1.85.2.5: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:35:11 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.4: preferred, colored
Changes since revision 1.85.2.4: +2 -2 lines
Fix the sync with head I botched.

Revision 1.85.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:53:03 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.3: preferred, colored
Changes since revision 1.85.2.3: +2 -2 lines
Sync with HEAD.

Revision 1.85.2.3: download - view: text, markup, annotated - select for diffs
Fri Sep 3 12:45:39 2004 UTC (20 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.2: preferred, colored
Changes since revision 1.85.2.2: +25 -14 lines
Sync with HEAD

Revision 1.91: download - view: text, markup, annotated - select for diffs
Mon Aug 30 09:48:05 2004 UTC (20 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +25 -14 lines
split out the check whether a driver supports a given interface
attribure, and add a diagnostic assertion to config_search_loc()
which ensures that a supplied attribute name is correct

Revision 1.85.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 25 06:58:58 2004 UTC (20 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85.2.1: preferred, colored
Changes since revision 1.85.2.1: +199 -7 lines
Sync with HEAD.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Tue Aug 17 22:13:18 2004 UTC (20 years, 3 months ago) by drochner
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +199 -7 lines
Add some extensions to the autoconf framework to better support
loadable drivers and user controlled attach/detach of devices.
An outline was given in
http://mail-index.NetBSD.org/tech-kern/2004/08/11/0000.html
To cite the relevant parts:
-Add a "child detached" and a "rescan" method (both optional)
 to the device driver. (This is added to the "cfattach" for now
 because this is under the driver writer's control. Logically
 it belongs more to the "cfdriver", but this is automatically
 generated now.)
 The "child detached" is called by the autoconf framework
 during config_detach(), after the child's ca_detach()
 function was called but before the device data structure
 is freed.
 The "rescan" is called explicitely, either after a driver LKM
 was loaded, or on user request (see the "control device" below).
-Add a field to the device instance where the "locators" (in
 terms of the autoconf framework), which describe the actual
 location of the device relatively to the parent bus, can be
 stored. This can be used by the "child detached" function
 for easier bookkeeping (no need to lookup by device instance
 pointer). (An idea for the future is to use this for generation
 of optimized kernel config files - like DEC's "doconfig".)
-Pass the locators tuple describing a device's location to
 various autoconf functions to support the previous. And since
 locators do only make sense in relation to an "interface
 attribute", pass this as well.
-Add helper functions to add/remove supplemental "cfdata"
 arrays. Needed for driver LKMs.

There is some code duplication which will hopefully resolved
when all "submatch"-style functions are changed to accept the
locator argument.
Some more cleanup can take place when config(8) issues more
information about locators, in particular the length and default
values. To be done later.

Revision 1.85.2.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:52:54 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +14 -103 lines
Sync with HEAD

Revision 1.89: download - view: text, markup, annotated - select for diffs
Tue Feb 17 05:03:16 2004 UTC (20 years, 9 months ago) by rtr
Branches: MAIN
CVS tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -97 lines
split off the evcnt code (which is unrelated to autoconfiguration)
into a separate file

approved by simonb@

Revision 1.88: download - view: text, markup, annotated - select for diffs
Mon Nov 17 10:07:58 2003 UTC (21 years ago) by keihan
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +3 -3 lines
www.netbsd.org -> www.NetBSD.org

Revision 1.87: download - view: text, markup, annotated - select for diffs
Thu Aug 7 16:31:52 2003 UTC (21 years, 4 months ago) by agc
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +3 -7 lines
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Fri Jul 4 00:24:30 2003 UTC (21 years, 5 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +12 -2 lines
Add a dev_propdb to hold device properties.  Properties are already being
used in an ad hoc way by a couple of eval board ports, so might as well
tidy it up a little and add some formality.  (And, yes, I need to use it
in another eval board port.)

Revision 1.85: download - view: text, markup, annotated - select for diffs
Tue Apr 29 00:56:52 2003 UTC (21 years, 7 months ago) by thorpej
Branches: MAIN
Branch point for: ktrace-lwp
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +6 -11 lines
Fix a logic botch that would cause some unwanted messages in the
AB_SILENT case.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sun Mar 16 08:10:00 2003 UTC (21 years, 9 months ago) by matt
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +4 -4 lines
Make cfroots const.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sun Feb 9 09:14:58 2003 UTC (21 years, 10 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -3 lines
const msgs[] some more

Revision 1.55.2.11: download - view: text, markup, annotated - select for diffs
Fri Jan 3 17:10:40 2003 UTC (21 years, 11 months ago) by thorpej
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.55.2.10: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.2.10: +51 -11 lines
Sync with HEAD.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Jan 2 00:12:16 2003 UTC (21 years, 11 months ago) by mrg
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, fvdl_fs64_base
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -3 lines
move #include <sys/reboot.h> with the rest of the <sys/...> headers.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Wed Jan 1 17:06:59 2003 UTC (21 years, 11 months ago) by augustss
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +3 -3 lines
Make it compile without USERCONF.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Tue Dec 31 23:59:11 2002 UTC (21 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +50 -10 lines
Add support for quiet and silent boots to the autoconfiguration
message machinery.

Quiet boots look like this (inspired by BSD/OS):
.
.
Found tlp0 at pci0
.
.
Found wd0 at wdc0
.
.

Silent boots look like this:
.
.
Detecting hardware...<twiddle>done.
.
.

NOTE: This requires cooperation on the part of all device drivers,
changes to which have not yet been checked in.

Revision 1.55.2.10: download - view: text, markup, annotated - select for diffs
Wed Dec 11 06:43:07 2002 UTC (22 years ago) by thorpej
Branches: nathanw_sa
Diff to: previous 1.55.2.9: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.9: +24 -0 lines
Sync with HEAD.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Nov 24 17:33:44 2002 UTC (22 years ago) by thorpej
Branches: MAIN
CVS tags: gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +26 -2 lines
Add an EVCNT_ATTACH_STATIC() macro which gathers static evcnts
into a link set, which are added to the list of event counters
at boot time.

Revision 1.55.2.9: download - view: text, markup, annotated - select for diffs
Mon Nov 11 22:13:55 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.8: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.8: +1 -1 lines
Catch up to -current

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Oct 20 02:27:00 2002 UTC (22 years, 1 month ago) by isaki
Branches: MAIN
CVS tags: kqueue-beforemerge, kqueue-aftermerge
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +3 -3 lines
x68k needs config_cfdriver_lookup() to initialize its console.
XXX ad-hoc way?

Revision 1.55.2.8: download - view: text, markup, annotated - select for diffs
Fri Oct 18 02:44:54 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.7: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.7: +528 -56 lines
Catch up to -current.

Revision 1.57.2.5: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:43:13 2002 UTC (22 years, 2 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.57.2.4: preferred, colored; branchpoint 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57.2.4: +325 -51 lines
sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.77: download - view: text, markup, annotated - select for diffs
Wed Oct 9 02:59:55 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +98 -11 lines
Implement config_attach_pseudo(), which creates an instance of
a pseudo-device which behaves like a normal device in the device
tree, including the capability to have children.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Fri Oct 4 01:50:53 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +140 -29 lines
Overhaul the way cfattach structures are looked up.  The cfdata entry
now carries the name of the attachment (e.g. "tlp_pci" or "audio"),
and cfattach structures are registered at boot time on a per-driver
basis.  The cfdriver and cfattach pointers are cached in the device
structure when attached.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Tue Oct 1 18:11:58 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
CVS tags: kqueue-base
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +68 -2 lines
Add a generic config finalization hook, to be called once all real
devices have been discovered.  All finalizer routines are iteratively
invoked until all of them report that they have done no work.

Use this hook to fix a latent bug in RAIDframe autoconfiguration of
RAID sets exposed by the rework of SCSI device discovery.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Mon Sep 30 17:36:33 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +26 -4 lines
Add a config_init() function to initialize the config data structures.
Normally this is called by configure(), but some ports (amiga, atari,
x68k) need to do this early because of how they find the console.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Fri Sep 27 20:42:12 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +6 -6 lines
Declare all cfattach structures const.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Fri Sep 27 15:37:45 2002 UTC (22 years, 2 months ago) by provos
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -3 lines
remove trailing \n in panic().  approved perry.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Fri Sep 27 06:30:05 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +3 -4 lines
Oops, missed one place to use the STREQ() macro.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Fri Sep 27 06:12:55 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +7 -3 lines
Skip pspec-less entries (root nodes) in cfparent_match().  This fixes
the "kernel crashes" component of PR #18433.

Revision 1.69: download - view: text, markup, annotated - select for diffs
Fri Sep 27 05:45:03 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +20 -5 lines
Some ports (like Amiga) want to use the config machinery VERY early
(to initialize the console).  Support this when doing cfdriver lookup.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Sep 27 03:18:23 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +13 -2 lines
Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Fri Sep 27 02:24:33 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +91 -15 lines
Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver.  The cfdriver is then looked
up in a list which is built at run-time.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Thu Sep 26 04:07:35 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +71 -17 lines
Overhaul the way parent attachments are specified; instead of using
a vector of indices into the cfdata table to specify potential parents,
record the interface attributes that devices have and add a new "parent
spec" structure which lists the iattr, as well as optionally listing
specific parent device instances.

See:

    http://mail-index.netbsd.org/tech-kern/2002/09/25/0014.html

...for a detailed description.

While here, const poison some things, as suggested by Matt Thomas.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Mon Sep 23 23:16:06 2002 UTC (22 years, 2 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +56 -29 lines
Add support for multiple cfdata tables to the internals of the
autoconfiguration machinery, derived from PR #2112.

More work is left to do, including revamping how matches against
a candidate parent are done.

Revision 1.57.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 6 08:48:02 2002 UTC (22 years, 3 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.57.2.3: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.3: +3 -3 lines
sync kqueue branch with HEAD

Revision 1.55.2.7: download - view: text, markup, annotated - select for diffs
Thu Aug 1 02:46:23 2002 UTC (22 years, 4 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.6: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.6: +1 -1 lines
Catch up to -current.

Revision 1.63.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 15 10:36:37 2002 UTC (22 years, 5 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.63: preferred, colored; next MAIN 1.64: preferred, colored
Changes since revision 1.63: +3 -3 lines
catch up with -current.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Wed Jul 10 19:04:09 2002 UTC (22 years, 5 months ago) by drochner
Branches: MAIN
CVS tags: gehenna-devsw-base
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +3 -3 lines
fix off-by-one error in string len check

Revision 1.57.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:49:33 2002 UTC (22 years, 5 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.57.2.2: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.2: +5 -2 lines
catch up with -current on kqueue branch

Revision 1.55.2.6: download - view: text, markup, annotated - select for diffs
Wed Apr 17 00:06:19 2002 UTC (22 years, 8 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.5: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.5: +5 -2 lines
Catch up to -current.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Apr 15 05:30:12 2002 UTC (22 years, 8 months ago) by gmcgarry
Branches: MAIN
CVS tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Branch point for: gehenna-devsw
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +5 -2 lines
When searching for devices also skip those deleted by userconf.
Problem reported by uwe.

Revision 1.62.6.3: download - view: text, markup, annotated - select for diffs
Sat Apr 6 16:04:31 2002 UTC (22 years, 8 months ago) by eeh
Branches: eeh-devprop
Diff to: previous 1.62.6.2: preferred, colored; branchpoint 1.62: preferred, colored; next MAIN 1.63: preferred, colored
Changes since revision 1.62.6.2: +35 -5 lines
Add dev_dumprops() for debug and make dev_mdgetprop() conditional.

Revision 1.62.6.2: download - view: text, markup, annotated - select for diffs
Tue Mar 26 17:09:53 2002 UTC (22 years, 8 months ago) by eeh
Branches: eeh-devprop
Diff to: previous 1.62.6.1: preferred, colored; branchpoint 1.62: preferred, colored
Changes since revision 1.62.6.1: +28 -13 lines
Add locator properites in config_attach(), add a "cd-name" property to the
rest of the locators, and always allocate a combined device+softc.

Revision 1.62.6.1: download - view: text, markup, annotated - select for diffs
Fri Mar 22 18:29:52 2002 UTC (22 years, 8 months ago) by eeh
Branches: eeh-devprop
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +260 -37 lines
Add devprops implementation.

Revision 1.57.2.2: download - view: text, markup, annotated - select for diffs
Sat Mar 16 16:01:49 2002 UTC (22 years, 9 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.57.2.1: preferred, colored; branchpoint 1.57: preferred, colored
Changes since revision 1.57.2.1: +20 -2 lines
Catch up with -current.

Revision 1.55.2.5: download - view: text, markup, annotated - select for diffs
Thu Feb 28 04:14:45 2002 UTC (22 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.4: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.4: +20 -2 lines
Catch up to -current.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Fri Feb 15 11:18:26 2002 UTC (22 years, 10 months ago) by simonb
Branches: MAIN
CVS tags: newlock-base, newlock, ifpoll-base, eeh-devprop-base
Branch point for: eeh-devprop
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +20 -2 lines
Add a "show event" ddb command to show the event counters.

Revision 1.57.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 10 19:59:59 2002 UTC (22 years, 11 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +39 -29 lines
Sync kqueue branch with -current.

Revision 1.55.2.4: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:32:36 2002 UTC (22 years, 11 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.3: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.3: +39 -28 lines
Catch up to -current.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Mon Dec 10 00:33:04 2001 UTC (23 years ago) by thorpej
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +4 -4 lines
Don't compare an int against NULL.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Dec 5 16:12:42 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +5 -5 lines
Use NULL instead of 0 in a few places.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Sun Dec 2 02:40:57 2001 UTC (23 years ago) by augustss
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +39 -28 lines
Move the code that expands the cd_devs array into a subroutine.

Revision 1.55.2.3: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:16:39 2001 UTC (23 years, 1 month ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.2: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.2: +2 -3 lines
Catch up to -current.

Revision 1.57.6.1: download - view: text, markup, annotated - select for diffs
Mon Nov 12 21:18:51 2001 UTC (23 years, 1 month ago) by thorpej
Branches: thorpej-mips-cache
Diff to: previous 1.57: preferred, colored; next MAIN 1.58: preferred, colored
Changes since revision 1.57: +2 -3 lines
Sync the thorpej-mips-cache branch with -current.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon Nov 12 15:21:46 2001 UTC (23 years, 1 month ago) by lukem
Branches: MAIN
CVS tags: thorpej-mips-cache-base
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -3 lines
clean up whitespace

Revision 1.55.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 24 00:11:34 2001 UTC (23 years, 3 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55.2.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.2.1: +13 -2 lines
Catch up with -current.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sun Jul 1 02:56:20 2001 UTC (23 years, 5 months ago) by gmcgarry
Branches: MAIN
CVS tags: thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-mips-cache, kqueue
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +13 -2 lines
In-kernel device configuration manager - allows modification
of device locators at run-time.

Written by Mats O Jansson <moj@stacken.kth.se>.  Reworked by
Jun-ichiro itojun Hagino <itojun@netbsd.org>.

Revision 1.55.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:06:58 2001 UTC (23 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +7 -5 lines
Catch up to -current.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Mon May 28 16:40:31 2001 UTC (23 years, 6 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +7 -5 lines
Statically-initialize `allevents' so that events can be registered
very early (before main() is called).

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 20 18:09:06 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44: +170 -86 lines
Update thorpej_scsipi to -current as of a month ago

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Jul 8 18:11:02 2000 UTC (24 years, 5 months ago) by sommerfeld
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
Format paranoia

Revision 1.50.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:09:14 2000 UTC (24 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.50: preferred, colored; next MAIN 1.51: preferred, colored
Changes since revision 1.50: +100 -70 lines
Sync w/ netbsd-1-5-base.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Tue Jun 13 22:36:17 2000 UTC (24 years, 6 months ago) by cgd
Branches: MAIN
CVS tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +10 -7 lines
Replace my personal attribution string ("This product includes software
developed by Christopher G. Demetriou for the NetBSD Project.") with
a generic NetBSD one ("This product includes software developed for the
NetBSD Project.  See http://www.netbsd.org/ for information about NetBSD.")
so that this same set of terms can be used by others if they so desire.
(Eventually i'll be converting more/all of my code.)

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sun Jun 4 19:15:19 2000 UTC (24 years, 6 months ago) by cgd
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +66 -12 lines
Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).

Revision 1.52: download - view: text, markup, annotated - select for diffs
Fri Jun 2 01:48:50 2000 UTC (24 years, 6 months ago) by cgd
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +7 -7 lines
another mod of opportunity: const poison.  (cfprint_t should take
const char * as second arg, too, but that's Hard.)  also, convert use
of "(char *)0" to NULL.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Jun 2 01:31:54 2000 UTC (24 years, 6 months ago) by cgd
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +31 -58 lines
__P and K&R declarations -> ANSI protos + declarations.  tweak NetBSD IDs,
and __KERNEL_RCSID to subr_autoconf.c.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Tue Mar 28 17:30:10 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +22 -22 lines
Get rid of a lot of register declarations.
(Why isn't this done everywhere in the kernel already?)

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Feb 1 04:01:19 2000 UTC (24 years, 10 months ago) by danw
Branches: MAIN
CVS tags: chs-ubc2-newbase
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -3 lines
#define __HAVE_DEVICE_REGISTER on ports that have it, and check for
that, rather than a list of architecture defines, in config_attach

Revision 1.48: download - view: text, markup, annotated - select for diffs
Tue Jan 25 13:23:26 2000 UTC (24 years, 10 months ago) by enami
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +7 -4 lines
In the diagnostic check in config_detach, inform the name of parent and
its child who shouldn't be exist.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Jan 24 18:03:19 2000 UTC (24 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +30 -1 lines
Add a `config_pending' semaphore to block mounting of the root file system
until all device driver discovery threads have had a chance to do their
work.  This in turn blocks initproc's exec of init(8) until root is
mounted and process start times and CWD info has been fixed up.

Addresses kern/9247.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Tue Jan 18 07:45:04 2000 UTC (24 years, 10 months ago) by cgd
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +26 -1 lines
use the old cloning-device cf_unit increment behaviour, if
__BROKEN_CONFIG_UNIT_USAGE is defined.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Dec 30 01:03:43 1999 UTC (24 years, 11 months ago) by cgd
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +12 -14 lines
avoid 'marching unit numbers' for cloning devices.  (e.g., previously,
if you com* at pcmcia?, and com3 and com4 as pcmcia cards, and removed
and reinserted the card that was com3, it would become com5.  if you then
removed and reinserted com4, it would become com6.  etc.)  Now, instead
of incrementing FSTATE_STAR configuration entries for a driver when
a cloning instance is attached, leave it alone, and scan the device softc
array (starting at the first cloning unit number) for units which are
available for use.  This wastes a tiny bit of time (can require a linear
scan of the softc table for the device), but device attachment should be
relatively infrequent and the number of units of each type of device
is never particularly large anyway.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Thu Sep 23 15:14:57 1999 UTC (25 years, 2 months ago) by minoura
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999
Branch point for: thorpej_scsipi
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
First step toward network boot.
By Takeshi Nakayama <tn@catvmics.ne.jp>.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Sep 17 20:11:56 1999 UTC (25 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +21 -14 lines
- Centralize the declaration and clearing of `cold'.
- Call configure() after setting up proc0.
- Call initclocks() from configure(), after cpu_configure().  Once the
  clocks are running, clear `cold'.  Then run interrupt-driven
  autoconfiguration.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Sep 15 19:37:08 1999 UTC (25 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +64 -12 lines
Add a mechanism to defer configuration of children until interrupts
are enabled.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed Sep 15 18:10:34 1999 UTC (25 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +12 -4 lines
Rename the machine-dependent autoconfiguration entry point `cpu_configure()',
and rename config_init() to configure() and call cpu_configure() from there.

Revision 1.37.6.1: download - view: text, markup, annotated - select for diffs
Mon Jun 21 01:24:03 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37: +3 -2 lines
Sync w/ -current.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sun Jun 20 00:51:37 1999 UTC (25 years, 5 months ago) by ragge
Branches: MAIN
CVS tags: chs-ubc2-base
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -2 lines
Add vax to user of device_register.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Apr 21 02:37:07 1999 UTC (25 years, 7 months ago) by mrg
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -2 lines
revert previous.  oops.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Apr 21 02:31:50 1999 UTC (25 years, 7 months ago) by mrg
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +3 -2 lines
properly test the msgsz as "msgsz - len".  from PR#7386

Revision 1.37: download - view: text, markup, annotated - select for diffs
Thu Dec 3 23:50:39 1998 UTC (26 years ago) by pk
Branches: MAIN
CVS tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, kenh-if-detach-base, kenh-if-detach, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +2 -2 lines
Enable `device_register()' for the sparc.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Nov 18 18:40:54 1998 UTC (26 years ago) by thorpej
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +2 -2 lines
Oops, fix uninitialzed variable in last.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Nov 18 18:40:08 1998 UTC (26 years ago) by thorpej
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +3 -4 lines
Be a bit more precise about how we allow no deactivation support in
config_detach().

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Nov 18 18:38:07 1998 UTC (26 years ago) by thorpej
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +7 -3 lines
If the ca_activate entry point fails, make sure to restore the old
dv_flags.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Nov 17 08:38:07 1998 UTC (26 years, 1 month ago) by thorpej
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +172 -1 lines
Implement config_detach(), mostly from Chris Demetriou, modified slightly
by Ken Hornstein and myself.

Add flags to struct device, and define one as "active".  Devices are
initially active from config_attach().  Their active state may be changed
via config_activate() and config_deactivate().

These new functions assume that the device being manipulated will recursively
perform the action on its children.

Together, config_deactivate() and config_detach() may be used to implement
interrupt-driven device detachment.  config_deactivate() will take care of
things that need to be performed at interrupt time, and config_detach()
(which must run in a valid thread context) finishes the job, which may
block.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Aug 31 22:28:08 1998 UTC (26 years, 3 months ago) by cgd
Branches: MAIN
CVS tags: chs-ubc-base, chs-ubc
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +1 -235 lines
kill the last remnants of __BROKEN_INDIRECT_CONFIG.  (only the pica port
used it, and it's non-working and apparently slated for replacement.)

Revision 1.29.2.1: download - view: text, markup, annotated - select for diffs
Sat Aug 8 03:06:56 1998 UTC (26 years, 4 months ago) by eeh
Branches: eeh-paddr_t
Diff to: previous 1.29: preferred, colored; next MAIN 1.30: preferred, colored
Changes since revision 1.29: +5 -5 lines
Revert cdevsw mmap routines to return int.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue Aug 4 04:03:14 1998 UTC (26 years, 4 months ago) by perry
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +11 -11 lines
Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
  bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)

Revision 1.30: download - view: text, markup, annotated - select for diffs
Fri Jul 31 22:50:51 1998 UTC (26 years, 4 months ago) by perry
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +5 -5 lines
fix sizeofs so they comply with the KNF style guide. yes, it is pedantic.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Jun 9 18:46:12 1998 UTC (26 years, 6 months ago) by thorpej
Branches: MAIN
CVS tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +65 -1 lines
Implement config_defer(), a generic mechanism to defer the configuration
of a device until all of its parent's children have been attached.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sun Mar 1 02:22:31 1998 UTC (26 years, 9 months ago) by fvdl
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
Merge with Lite2 + local changes

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Sun Mar 1 02:13:01 1998 UTC (26 years, 9 months ago) by fvdl
Branches: netbsd, CSRG
CVS tags: lite-2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +8 -5 lines
Import 4.4BSD-Lite2

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Sun Mar 1 02:09:44 1998 UTC (26 years, 9 months ago) by fvdl
Branches: netbsd, CSRG
CVS tags: lite-1, date-03-may-96
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +30 -4 lines
Import 4.4BSD-Lite for reference

Revision 1.26.10.1: download - view: text, markup, annotated - select for diffs
Mon Sep 22 06:33:47 1997 UTC (27 years, 2 months ago) by thorpej
Branches: marc-pcmcia
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +3 -3 lines
Update marc-pcmcia branch from trunk.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sat Sep 20 14:16:43 1997 UTC (27 years, 2 months ago) by drochner
Branches: MAIN
CVS tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, marc-pcmcia-base
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
Call device_register() on i386 too.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Tue Dec 17 08:59:15 1996 UTC (28 years ago) by thorpej
Branches: MAIN
CVS tags: thorpej-signal-base, thorpej-signal, thorpej-setroot, mrg-vm-swap, marc-pcmcia-bp, is-newarp-before-merge, is-newarp-base, is-newarp, bouyer-scsipi
Branch point for: marc-pcmcia
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -3 lines
Call device_register() if __alpha__ || hp300

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Dec 5 00:09:10 1996 UTC (28 years ago) by cgd
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +165 -7 lines
Check for a new definition, __BROKEN_INDIRECT_CONFIG, and if it is _not_
defined:
	define match functions to take a struct cfdata * as their second
	argument, config_search() to take a struct cfdata * as its second
	argument, and config_{root,}search() to return struct cfdata *.

	remove 'cd_indirect' cfdriver element.

	remove config_scan().

	remove config_make_softc() as a seperate function, reintegrating
	its functionality into config_attach().

Ports will define __BROKEN_INDIRECT_CONFIG until their drivers prototypes
are updated to work with the new definitions, and until it is sure that
their indirect-config drivers do not assume that they have a softc
in their match routine.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Oct 13 02:32:37 1996 UTC (28 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +5 -5 lines
backout previous kprintf change

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Oct 10 22:46:23 1996 UTC (28 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +5 -5 lines
printf -> kprintf, sprintf -> ksprintf

Revision 1.21.4.1: download - view: text, markup, annotated - select for diffs
Thu Jun 13 18:49:07 1996 UTC (28 years, 6 months ago) by cgd
Branches: netbsd-1-2
CVS tags: netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA
Diff to: previous 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21: +4 -1 lines
pull up from trunk:
>#ifdef __alpha__, call a machine-dependent function with new device
>structure and 'aux', right before ca_attach is called for the
>newly-attached device.  This allows the alpha port to do root device
>autodetection without modifying every bus and device driver which could
>be in the 'boot path.'  In the long run, it may make sense to make
>this machine-independent.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Thu Jun 13 04:50:29 1996 UTC (28 years, 6 months ago) by cgd
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +4 -1 lines
#ifdef __alpha__, call a machine-dependent function with new device
structure and 'aux', right before ca_attach is called for the
newly-attached device.  This allows the alpha port to do root device
autodetection without modifying every bus and device driver which could
be in the 'boot path.'  In the long run, it may make sense to make
this machine-independent.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Apr 4 06:06:18 1996 UTC (28 years, 8 months ago) by cgd
Branches: MAIN
CVS tags: netbsd-1-2-base
Branch point for: netbsd-1-2
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +11 -15 lines
Make config_found_sm() (and therefore config_found()) and config_rootfound()
return a struct device * of attached device, or NULL if device attach failed,
rather than 1/0 for success/failure, so that code that bus code which needs
to know what the child device is doesn't have to open-code a hacked variant
of config_found().  Make config_attach() return struct device *, rather than
void, to facilitate that.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Thu Apr 4 00:25:49 1996 UTC (28 years, 8 months ago) by cgd
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +17 -7 lines
change 'struct device' and 'struct evcnt' lists (alldevs and allevents) to
be TAILQ's.  TAILQ_HEAD's of those structs are now 'struct devicelist' and
'struct evcntlist', respectively.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun Mar 17 01:00:43 1996 UTC (28 years, 9 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +19 -11 lines
New device attachment scheme:

	- split softc size and match/attach out from cfdriver into
	  a new struct cfattach.

	- new "attach" directive for files.*.  May specify the name of
	  the cfattach structure, so that devices may be easily attached
	  to parents with different autoconfiguration semantics.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Feb 27 21:45:46 1996 UTC (28 years, 9 months ago) by cgd
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +7 -5 lines
Replace config_found() with config_found_sm(), which adds a cfmatch_t to the
argument list.  This allows easy 'submatching', which will eliminate a fair
bit of slightly tricky duplicated code from various busses.  config_found()
is now a #define in sys/device.h, which invokes config_found_sm().

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sun Feb 4 02:16:35 1996 UTC (28 years, 10 months ago) by christos
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +5 -2 lines
First pass at prototyping

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Nov 4 06:40:11 1994 UTC (30 years, 1 month ago) by mycroft
Branches: MAIN
CVS tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +53 -12 lines
Add a new function config_scan(), which just calls a particular function
with each plausibly cfdata, ignoring the priority mechanism completely.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Nov 4 03:12:20 1994 UTC (30 years, 1 month ago) by mycroft
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +6 -13 lines
Export struct matchinfo and mapply().

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Nov 4 03:07:17 1994 UTC (30 years, 1 month ago) by mycroft
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +11 -12 lines
Calculate indirectness earlier, and stor it in the struct matchinfo.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri Nov 4 00:14:04 1994 UTC (30 years, 1 month ago) by mycroft
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +11 -8 lines
config_make_softc() needs pointer to parent; and fix a couple of other bogons.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Nov 3 22:01:09 1994 UTC (30 years, 1 month ago) by mycroft
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +88 -48 lines
If cd_indirect is set in the parent, create a softc early and pass it to the
probe routine.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Oct 30 21:47:46 1994 UTC (30 years, 1 month ago) by cgd
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +2 -1 lines
be more careful with types, also pull in headers where necessary.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Oct 7 09:07:56 1994 UTC (30 years, 2 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +16 -23 lines
Simplify the code to expand the dev array slightly, and make sure the size is
a power of 2.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Jun 29 06:32:54 1994 UTC (30 years, 5 months ago) by cgd
Branches: MAIN
CVS tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -2 lines
New RCS ID's, take two.  they're more aesthecially pleasant, and use 'NetBSD'

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri May 20 04:31:22 1994 UTC (30 years, 7 months ago) by cgd
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -2 lines
reorg derivations, slightly.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri May 20 04:15:04 1994 UTC (30 years, 7 months ago) by glass
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +32 -6 lines
update to 4.4-lite + local changes

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu May 12 14:15:03 1994 UTC (30 years, 7 months ago) by glass
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +5 -5 lines
slightly more optimal fix from torek himself

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu May 12 05:21:45 1994 UTC (30 years, 7 months ago) by glass
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +6 -4 lines
fix chopps, et al discovered bug in allocating cd_devs array

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Dec 18 04:21:24 1993 UTC (31 years ago) by mycroft
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -4 lines
Canonicalize all #includes.

Revision 1.3.2.3: download - view: text, markup, annotated - select for diffs
Mon Nov 29 06:07:53 1993 UTC (31 years ago) by mycroft
Branches: magnum
Diff to: previous 1.3.2.2: preferred, colored; branchpoint 1.3: preferred, colored; next MAIN 1.4: preferred, colored
Changes since revision 1.3.2.2: +20 -1 lines
Implement dk_establish().

Revision 1.3.2.2: download - view: text, markup, annotated - select for diffs
Sun Nov 14 21:07:04 1993 UTC (31 years, 1 month ago) by mycroft
Branches: magnum
Diff to: previous 1.3.2.1: preferred, colored; branchpoint 1.3: preferred, colored
Changes since revision 1.3.2.1: +4 -4 lines
Canonicalize all #includes.

Revision 1.3.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 14 18:24:21 1993 UTC (31 years, 3 months ago) by mycroft
Branches: magnum
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -2 lines
init_main.c:  clock changes from 4.4; initclocks() is called after vfsinit().
No startrtclock() or enablertclock().  Some pseudo-device cruft, but this needs
to be updated.
kern_clock.c:  from 4.4: gatherstats() --> statclock().  statclock(),
hardclock(), and softclock() take a `struct clockframe *'.  New initclocks(),
harclock(), statclock(), startprofclock(), and stopprofclock().
kern_synch.c:  from 4.4: machine-independent swtch(), which is now where
process time is integrated.  Calls cpu_swtch() with the current process as an
arg.
subr_autoconf.c:  Fix typo.
subr_prf.c:  msgbufp and msgbufmapped are define in machdep.c
tty.c:  Make TIOCHPCL #ifdef COMPAT_43.
Incorporate changes from main branch.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sun Aug 15 23:04:50 1993 UTC (31 years, 4 months ago) by glass
Branches: MAIN
CVS tags: to_lamp_cvs, magnum-base, first_uplaod
Branch point for: magnum
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +21 -8 lines
runs up to and including configure().
todo: exceptions, interrupt support, make isrs affect vector table
kernel/user stacks

Revision 1.2: download - view: text, markup, annotated - select for diffs
Fri Aug 13 22:00:55 1993 UTC (31 years, 4 months ago) by glass
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +4 -4 lines
baseline revision

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri Aug 13 13:19:59 1993 UTC (31 years, 4 months ago) by glass
Branches: MAIN
snapshot of intergration of torek's config

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>