diff options
author | Alan Cox <alan@linux.intel.com> | 2009-09-19 13:13:24 -0700 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 13:13:24 -0700 |
commit | 8b92e87d39bfd046e7581e1fe0f40eac40f88608 (patch) | |
tree | b558f69f2a9875ea6029546f9f70d268fd3ebaf6 /include | |
parent | 4455e344959a217ffc28de2ab1af87541322b343 (diff) | |
download | linux-3.10-8b92e87d39bfd046e7581e1fe0f40eac40f88608.tar.gz linux-3.10-8b92e87d39bfd046e7581e1fe0f40eac40f88608.tar.bz2 linux-3.10-8b92e87d39bfd046e7581e1fe0f40eac40f88608.zip |
vt: add an event interface
This is needed and requested in various forms for ConsoleKit, screenblank
handling and the like so do the job with a single interface. Also build the
interface so that unlike VT_WAITACTIVE and friends it won't miss events.
FIXME: Should this be a waitactive ioctl or a new device file you can poll
and read events from. We need the code anyway to fix up the existing broken
wait for console switch logic but the ConsoleKit people would prefer the
new device to the ioctl we have here
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/vt.h | 14 | ||||
-rw-r--r-- | include/linux/vt_kern.h | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/vt.h b/include/linux/vt.h index 02c1c028877..89c03a11e19 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h @@ -74,4 +74,18 @@ struct vt_consize { #define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ #define VT_GETHIFONTMASK 0x560D /* return hi font mask */ +struct vt_event { + unsigned int event; +#define VT_EVENT_SWITCH 0x0001 /* Console switch */ +#define VT_EVENT_BLANK 0x0002 /* Screen blank */ +#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */ +#define VT_EVENT_RESIZE 0x0008 /* Resize display */ +#define VT_MAX_EVENT 0x000F + unsigned int old; /* Old console */ + unsigned int new; /* New console (if changing) */ + unsigned int pad[4]; /* Padding for expansion */ +}; + +#define VT_WAITEVENT 0x560E /* Wait for an event */ + #endif /* _LINUX_VT_H */ diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 2f1113467f7..f8c797d57c8 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h @@ -91,7 +91,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); #endif /* vt.c */ -int vt_waitactive(int vt); +void vt_event_post(unsigned int event, unsigned int old, unsigned int new); +int vt_waitactive(int n); void change_console(struct vc_data *new_vc); void reset_vc(struct vc_data *vc); extern int unbind_con_driver(const struct consw *csw, int first, int last, |