summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sensors.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Convert infinite sleeps to {m,t}sleep_nsec(9).mpi2019-12-191-2/+2
| | | | ok visa@
* Correct wakeup() dance in sensor_task_work()deraadt2017-04-091-3/+5
| | | | Problem noticed by krw
* Sensors are run as callbacks inside tasks. During suspend a sensorderaadt2017-04-081-2/+23
| | | | | | | | | could be running inside a driver that will be force-detached, or due to tsleep end up disrupting the softstate/hardstate contract. At suspend time, quisce all these callbacks by waiting for completion. This issue has never been observed for real, but may be implicated in suspend/resume failures. ok kettenis guenther mlarkin
* 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@
* we want to defer work traditionally (in openbsd) handled in andlg2015-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | interrupt context to a taskq running in a thread. however, there is a concern that if we do that then we allow accidental use of sleeping APIs in this work, which will make it harder to move the work back to interrupts in the future. guenther and kettenis came up with the idea of marking a proc with CANTSLEEP which the sleep paths can check and panic on. this builds on that so you create taskqs that run with CANTSLEEP set except when they need to sleep for more tasks to run. the taskq_create api is changed to take a flags argument so users can specify CANTSLEEP. MPSAFE is also passed via this flags field now. this means archs that defined IPL_MPSAFE to 0 can now create mpsafe taskqs too. lots of discussion at s2k15 ok guenther@ miod@ mpi@ tedu@ pelikan@
* remove the second void * argument on tasks.dlg2015-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* prefer sizeof(*ptr) to sizeof(struct) for malloc and freetedu2014-11-141-3/+3
|
* some systems install sensors where numbering introduces a gap whichjasper2014-11-081-2/+2
| | | | | | | falsely triggered the added panic. revert the panic for now while a better solution is being worked on as reported by Bjorn Ketelaars on misc@ via jsing@
* panic when a sensordev gets installed twice, instead of blowing up amazinglyjasper2014-11-041-2/+2
| | | | | | later on ok deraadt@
* add a few sizes to freetedu2014-11-011-2/+2
|
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* use a separate task queue for sensors;mikeb2013-12-091-2/+7
| | | | with input from and ok kettenis, deraadt
* move kernel sensor tasks from using workqs to tasks. while heredlg2013-11-041-51/+34
| | | | | | whack the locking and task cancellation. sensor updates tested locally, and by mpi@ on ugold(4). ok mpi@
* sys/param.h gets you sys/types.h automaticallyderaadt2013-03-281-2/+1
|
* Get rid of MAXSENSORDEVICES. Gaps in sensordev lists are now handledderaadt2010-04-201-17/+24
| | | | | | | by returning ENXIO instead of ENOENT, to essentially indicate hotplug sensor that has gone away. Accessing beyond the end of the sensordev list still returns ENOENT, so that you can see there are no further devices. ok kettenis oga
* timeout_add -> timeout_add_msecblambert2009-08-031-2/+2
| | | | ok dlg@
* Convert timeout_add() calls using multiples of hz to timeout_add_sec()blambert2008-09-101-2/+2
| | | | | | | Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
* fix a memory leak that was introduced in r1.20 on 2007-06-24T05Z; ok dlgcnst2007-07-031-2/+3
|
* rework sensor tasks to use the kernels generic workq rather than a specialdlg2007-06-241-88/+72
| | | | | | | | | kernel thread of its own. the api has changed (which will be fixed in the manpage shortly) so all the users of sensor tasks that i can find have been fixed too. noone tested, so its going in to force people to run with it. "put it in" deraadt@
* perhaps it made art's head hurt because it is wrong. triggers NULLderaadt2007-06-041-65/+50
| | | | deref in sensor_task_work(); found by krw, dlg should talk to him
* rework the sensor task handling to run in the kernels generic workq.dlg2007-06-011-50/+65
| | | | | | | apologies to art for abusing timeouts so badly. apologies to tedu for making his head hurt. tested by and ok tedu@
* split userland & kernel struct sensor/sensordev so that the additionderaadt2007-03-221-18/+18
| | | | | | of new fields in the future is less disruptive. This is done similar to how struct proc is handled for ps(1). ok jmc (man page changes) tested fkr simon, and more suggestions from millert
* kernel code implimemting the new two-level sensor api; written byderaadt2006-12-231-21/+94
| | | | Constantine A. Murenin
* force a new sensor task to be run as soon as possible. previously it useddlg2006-11-061-2/+3
| | | | | | | | to have to wait its timeout before the first run, which led to some weird values or states being visible after boot, but before the first update. for jolan@
* Remove device id from hotplug events.mk2006-05-281-3/+3
| | | | ok henning
* intrducing device type DV_SENSOR turned out to be a bad idea as ithenning2006-05-281-3/+3
| | | | | | affects way more than just hotplug messages. remove DV_SENSOR and use DV_DULL for the moment. proper solution coming. discussed with deraadt mk jason
* need <sys/device.h> or it doesn't compile on sparc64jason2006-05-281-1/+2
|
* Include device id in hotplug events. This will be used by ntpd to checkmk2006-05-281-3/+3
| | | | | | sensors on attach/detach. hotplugd changes following in a minute. ok henning.
* unbreak, of course this needs to included sys/hotplug.h toohenning2006-05-281-1/+2
|
* Make sensor add/remove create hotplug events (after much prodding from henning). Idea from mbalmer. 'in it goes!' deraadt.mk2006-05-271-1/+10
|
* sensors_head is only used in kern_sensors.c, so its unnecessay to declaredlg2006-03-121-2/+2
| | | | | | it in sensors.h. from Constantine A. Murenin
* get rid of the sensors globals. theyre were only used by sysctl fordlg2006-01-281-9/+22
| | | | | | | | | | locating and finding the correct sensor to spit out. instead provide a a sensor_get function that wraps up the access to the vars. theyre now safe inside kern_sensors.c. theres also a touch of whitespace tweaking ok grange@
* Replace SENSOR_ADD() macro with a pair of functionsgrange2006-01-191-1/+34
| | | | | | | sensor_add()/sensor_del() so that sensors can be attached and detached dynamicaly. ok kettenis@ deraadt@ dlg@
* rename the sensor globals to names that are not obvious to avoiddlg2005-11-211-3/+3
| | | | | | | | | collisions with local variable names someone might make. this has bitten me twice now and caused me to lose about 4 hours scratching my head when nsensors just magically corrupts and gets bigger. at least my ram isnt screwed. ok marco@
* shorten this a bit through better use of TAILQ macros.dlg2005-11-131-13/+5
| | | | mostly ok otto@ (ive since fixed the chunk he was worried about)
* the tasklist can be modified while the kthread is sleeping, so refetchdlg2005-11-101-5/+5
| | | | | | | | the first element before iterating through the rest of them. stylistic guidance from angela pascoe. mark all tasks using the same argument as not running anymore, rather than just the first one we bump into.
* first go at a generic kthread for sensors to be run out of. its a bitdlg2005-11-101-1/+125
| | | | | hairy at the moment, but its going into the tree so it can be worked on and used.
* split the sensors stuff out into a source file of its own.dlg2005-11-101-0/+28
tested on GENERIC and RAMDISK_CD to see if the small_kernel stuff stays happy