diff options
| author | 2009-02-26 17:19:47 +0000 | |
|---|---|---|
| committer | 2009-02-26 17:19:47 +0000 | |
| commit | 7939ba9c68018505e6bbb9eaf69e62efc397078b (patch) | |
| tree | 4875ff68a2f4057871f94f07ddb2ae8198d3a3a5 /sys/arch/sparc/dev/tctrl.c | |
| parent | bulk updates are sent from a timeout which walks over the state tree and (diff) | |
| download | wireguard-openbsd-7939ba9c68018505e6bbb9eaf69e62efc397078b.tar.xz wireguard-openbsd-7939ba9c68018505e6bbb9eaf69e62efc397078b.zip | |
Add a two new ioctls to the apm(4) interface.
APM_IOC_{SUSPEND,STANDBY}_REQ: This is to fix an issue with apm suspend
where a call to zzz suspended the machine immediately, not giving anyone
listening for apm events (other than apmd) a chance to deal with the
upcoming change. This hit X hard since the introduction of drm, since it
needs to have time to idle the 3d engine and otherwise get the device
into a recoverable state. Such things are needed until we support
modesetting in the kernel.
Now, instead of forcing a suspend, using ioctl sends out an event similar
to if you had put the lid down, giving all userland applications a
chance to reply.
tested by sthen@ and beck@, especial thanks to sthen for sitting there
while I tried to debug this remotely, I owe him beer.
Prompted by and ok deraadt@
Diffstat (limited to 'sys/arch/sparc/dev/tctrl.c')
| -rw-r--r-- | sys/arch/sparc/dev/tctrl.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/sparc/dev/tctrl.c b/sys/arch/sparc/dev/tctrl.c index 82b10e1e7de..5fc11d2ed3d 100644 --- a/sys/arch/sparc/dev/tctrl.c +++ b/sys/arch/sparc/dev/tctrl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tctrl.c,v 1.19 2008/06/26 05:42:13 ray Exp $ */ +/* $OpenBSD: tctrl.c,v 1.20 2009/02/26 17:19:47 oga Exp $ */ /* $NetBSD: tctrl.c,v 1.2 1999/08/11 00:46:06 matt Exp $ */ /*- @@ -1112,7 +1112,18 @@ apmioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) else power->ac_state = APM_AC_OFF; break; - + case APM_IOC_STANDBY_REQ: + if ((flag & FWRITE) == 0) + error = EBADF; + else + error = EOPNOTSUPP; /* XXX */ + break; + case APM_IOC_SUSPEND_REQ: + if ((flag & FWRITE) == 0) + error = EBADF; + else + error = EOPNOTSUPP; /* XXX */ + break; default: error = ENOTTY; } |
