1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-21 15:45:02 +00:00

Add a devd(8) event that is sent after the system resumes. This can be

used by utilities to reset moused(8), for example.  The syntax is:

    !system=kern subsystem=power type=resume

Note that it would be nice to have notification of suspend, but it's more
difficult since there would have to be a method of doing request/ack
to userland and automatically timing out if no response.  apm(4) has a
similar mechanism.

MFC after:	2 weeks
This commit is contained in:
Nate Lawson 2006-01-22 01:06:25 +00:00
parent 899cff457e
commit a2b31c5b4f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154662

View File

@ -3597,6 +3597,18 @@ bus_child_location_str(device_t child, char *buf, size_t buflen)
return (BUS_CHILD_LOCATION_STR(parent, child, buf, buflen));
}
/* Resume all devices and then notify userland that we're up again. */
static int
root_resume(device_t dev)
{
int error;
error = bus_generic_resume(dev);
if (error == 0)
devctl_notify("kern", "power", "resume", NULL);
return (error);
}
static int
root_print_child(device_t dev, device_t child)
{
@ -3635,7 +3647,7 @@ static kobj_method_t root_methods[] = {
/* Device interface */
KOBJMETHOD(device_shutdown, bus_generic_shutdown),
KOBJMETHOD(device_suspend, bus_generic_suspend),
KOBJMETHOD(device_resume, bus_generic_resume),
KOBJMETHOD(device_resume, root_resume),
/* Bus interface */
KOBJMETHOD(bus_print_child, root_print_child),