summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_autoconf.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* free(9) sizes for softcs.mpi2018-12-051-6/+8
| | | | ok tedu@
* Change a bunch of (<blah> *)0 to NULL.krw2016-03-141-2/+2
| | | | ok beck@ deraadt@
* Simple free(9) sizes, from Matthieu <naabed AT poolp DOT org>.mpi2015-12-201-3/+3
|
* Replace mountroothook_establish(9) by config_mountroot(9) a narrower APImpi2015-12-111-3/+55
| | | | | | similar to config_defer(9). ok mikeb@, deraadt@
* back out refcnt for dv_ref, there's too many hand crafted devices alldlg2015-09-111-4/+4
| | | | | | over the tree. much encouragement from l2k15
* use refcnts for the device reference counts as an example of howdlg2015-09-111-4/+4
| | | | refcnt(9) can be used.
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* you need atomic.h to do atomic things.dlg2015-02-091-1/+2
| | | | pointed out by deraadt@
* use atomic ops to increment and decrement the device ref count indlg2015-02-091-4/+3
| | | | | | device_ref and device_unref. ok guenther@ deraadt@
* bring back r1.80:dlg2015-01-221-2/+5
| | | | | | | | | | pass the size of the softc to free. this time we only dereference the cfattach structure if we actually need it once the refcount has dropped to 0. tested by krw@ who found the original panic r1.80 was backed out for. putting this in again so i can find out when else will break.
* back it out properlyderaadt2015-01-191-3/+1
|
* never tested with a make releasederaadt2015-01-191-2/+2
|
* pass the size of the softc to free.dlg2015-01-191-2/+4
| | | | ok deraadt@
* Introduce config_suspend_all(9) a function that invokes config_suspend(9)kettenis2014-09-181-1/+51
| | | | | | | | | | | | | on all relevant device hierarchies in the appropriate order. For now this means mpath(4) and mainbus(4), doing mpath(4) before mainbus(4) when suspending or powering down and doing mpath(4) after mainbus(4) when resuming such that mpath(4) can realy on the underlying hardware being in a functional state. Fixes problems with unflushed disk caches on machines where mpath(4) takes control of some of your disks. ok dlg@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* use mallocarray where arguments are multipled. ok deraadttedu2014-07-131-2/+2
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-7/+7
| | | | after discussions with beck deraadt kettenis.
* Change config_deactivate(9) to always unset the DVF_ACTIVE flag sompi2014-07-121-12/+6
| | | | | | | | | | | that drivers can check for this flag to know they have to stop doing any hardware access and release their reference. While here makes the ca_activate() function optional and propagates DVACT_DEACTIVATE to the children of a device that do not implement this interface like it is done during suspend/resume. ok uebayasi@, deraadt@
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-03-291-2/+2
| | | | ok dlg@ mpi@ deraadt@
* get rid of the assumption that the head of the alldevs list is thedlg2014-03-131-1/+11
| | | | | | | | | | | "mainbus" device. this breaks when mpath is enabled because it attaches before mainbus and therefore takes the head position. have autoconf provide device_mainbus() which looks up mainbus_cd, and use that instead. discussed with deraadt who just wants mpath stuff to move forward despite there being many ways to shine this particular turd.
* printf(variable) --> printf("%s", variable)guenther2013-12-121-2/+2
| | | | ok deraadt@
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-4/+9
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* msgs can be constderaadt2013-11-291-2/+2
|
* get rid of the goop for maintaining multiple cftables since theresdlg2013-11-271-57/+44
| | | | | | | | no current code there to add or remove them. such code was put in 17 years ago, disabled 14 years ago, and removed 11 years ago, so i suspect we dont really need it or the goop to support it. very ok miod@
* compare pointers to NULLdlg2013-11-261-3/+3
|
* Enforce ca_activate tree-walks over the entire heirarchy for all events,deraadt2013-05-301-7/+4
| | | | | | cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
* Revamp the sequences for suspend/hibernate -> resume so that the codederaadt2012-10-081-1/+4
| | | | | | | | | | paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-22/+1
| | | | | | | | that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
* serialize attach and detach of device sub-trees -- only one devicederaadt2011-06-201-3/+36
| | | | | | | | | | | sub-tree may attach or detach at a time. attach and detach will sleep against each other. this is fixing (working around?) some bizzare corner cases that have been seen (but not fully diagnosed) where the device trees, disk registration subsystem, and other things could get messed up. one could argue though that this serialization is a very good thing; it is easier than adding piles of locks in various other places. ok matthew jsing
* Add a few KASSERTs to config_attach() for sanity to make sure we don'tmatthew2011-06-011-3/+13
| | | | | | | | | | | try to reuse device unit numbers and to check that the device pointer array is allocated and large enough. Also, improve the panic message generated by config_detach() when we detect that we're detaching a device that still has children. Discussed with deraadt@ while trying to brainstorm ways that interleaving config_attach and config_detach could blow up.
* remove a useless commentderaadt2010-09-081-2/+1
|
* Add DVACT_QUIECE support. This is called before splhigh() and beforederaadt2010-08-311-4/+5
| | | | | | | | DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
* Silence the activation debug reporting. We are starting to get worriedderaadt2010-06-301-1/+3
| | | | | | | | that there are interactions when we print in the various (saved, post-saved, pre-restored, and restored) vga states, especially with how intel drm is getting involved. If your machine has issues, you may want to activate these messages again to help debug things better. ok mlarkin
* Remove leftover debug printf in config_activate_children(); ok deraadtmiod2010-02-281-3/+1
|
* Make config_activate_children() more useable as a suspend-and-resumederaadt2009-11-231-73/+62
| | | | | device tree walker, and add config_suspend() as well. ok mlarkin pirofti, discussion with kettenis
* Add basic suspend/resume autoconf functionality.pirofti2009-11-221-1/+43
| | | | Okay deraadt@, kettenis@, mlarkin@.
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-2/+2
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* Allow devices attaching at root (such as softraid) to be disabled in UKC.miod2008-08-201-3/+6
| | | | ok marco@ deraadt@
* Since the devices that we detach may have children we cannot rely on thekettenis2007-11-231-6/+4
| | | | | | | | "previous" device still being there, so if we detach a device, we really have to start from scratch again (like the comment on this code actually says we should). Simplifies the code as a bonus. ok dlg@, deraadt@
* get rid of the unused cond_predicate_t typedef.dlg2007-10-291-3/+1
| | | | ok miod@ deraadt@ krw@
* Use M_ZERO in a few more places to shave bytes from the kernel.art2007-09-071-5/+4
| | | | eyeballed and ok dlg@
* the (root) stuff is ugly, so print "at root", so it looks more likederaadt2007-05-301-2/+2
| | | | | regular things. everyone here buys it, and i'm 90% sure miod will be ok with it
* kill __HAVE_DEVICE_REGISTER by requiring all architectures to have aderaadt2007-05-151-3/+1
| | | | | | | device_register() function -- even if it does nothing. reduces the cpp-based blather different between architectures idea ok'd by miod; tested on all architectures (except a few miod will need to cleanup because he has them)
* evcnt_attach() is no longer used; ok miodderaadt2007-05-091-23/+1
|
* Remove device id from hotplug events.mk2006-05-281-7/+7
| | | | ok henning
* more fallout from the sensors: Every single ramdisk got broken.deraadt2006-05-281-3/+4
|
* Include device id in hotplug events. This will be used by ntpd to checkmk2006-05-281-6/+7
| | | | | | sensors on attach/detach. hotplugd changes following in a minute. ok henning.
* cf_unit should have a value between 0 and cd_ndevs. So set cf_unit to 0 whenkrw2006-05-171-1/+2
| | | | | | cd_ndevs is set to 0. "No kidding!" deraadt@ "Seems to make sense to me." beck@ "Seems right." miod@
* Detach children devices in reverse order. This gives better display, andkrw2006-05-171-5/+8
| | | | | | allows cf_unit to be decremented correctly. 'put it in' deraadt@ "i think it's good' tedu@
* When assigning a unit number, treat running off the end of thekrw2006-05-141-1/+2
| | | | | | | | | | | cd_devs[] array the same as finding a NULL entry. Fixes inconsistant assignment of unit numbers to media slots on the Neodio 8-in-1 USB card reader donated by Manuel Pata. Previously the unit numbers would vary depending on whether it had attached an even or odd number of times. 'reads ok' marco@ ok miod@