simple userspace pm interface
Subsystems (3)
Here is a patch to deal with PM events (e.g. button presses) in a system independent way. Could people with the applicable hardware test out or comment on the changes?
The files affected are
arch/i386/kernel/apm.c arch/mips/sgi/kernel/reset.c arch/mips64/sgi-ip22/ip22-reset.c arch/sparc64/kernel/power.c drivers/acpi/driver.c drivers/char/nwbutton.c drivers/char/nwbutton.h
There are many power management and button press drivers in the kernel. They all tend to have their own interface to distribute events to userspace. This is bad, because it means duplicated code, and requires arch specific userspace whatnots, which should not be necessary.
Specifically, at the moment, the following approaches are taken by various subsystems:
- launch /sbin/shutdown
- signal init
- do nothing
And there 3 or so different special devices that userspace can read to see events. After this patch there are only 2 that I know of (ACPI and /dev/boxevent, perhaps the ACPI stuff could also be removed, I didn't look).
The patch converts the PM drivers I found to use a single interface. (Only APM is tested because nobody has given me e.g. a SPARC box: i.e. the patch is just a suggestion.)
The kernel interface is very simple. Each driver just does
#include <linux/boxevent.h>
void button_interrupt() {
boxevent(BUTTONEVENT_OFF,"TurboSnail","button pressed");
}and the event is exported to any number of userspace listeners on /dev/boxevent. Thereby writing a new power button driver does not involve having to deal with all the baggage of device nodes, etc.
You can create /dev/boxevent with mknod boxevent c 10 137
You can see what events occur simply by "cat"ing it to the console. The format is very simple.
<event> <WS> <subsystem> <WS> <description> <LF>
Where <event> is one of the strings OFF,SLEEP,WAKE,EMERGENCY,NOTIFY (if a reader does not read events quickly enough, it will get a MSGFLOOD event), <WS> is a space character, <subsystem> is a word denoting the kernel pm interface responsible for generating the event, <description> is an arbitrary string. <LF> is a newline character \n.
This is flexible. It means a reasonable default behaviour can be suggested by the kernel (OFF,SLEEP,etc.) for events that userspace doesn't know about, but userspace can choose fine grained policy and provide helpful error messages based on the exact event name by checking the description.
In fact, here is the "daemon" I use
#! /bin/perl
use Sys::Syslog qw(:DEFAULT setlogsock);
sub do_off {
system("/sbin/shutdown -p now");
exit(0);
}
sub do_overflow {
setlogsock("unix");
openlog("boxd","cons","daemon");
syslog('err',"messages arriving too fast");
closelog();
}while(<>){
if(/MSGFLOOD/) {
do_overflow();
next
}
if(/^SLEEP APM user suspend/){
do_off();
next
}
if(/^OFF/){
do_off();
next
}
}The patch against 2.4.4 is attached.
arch/i386/kernel/apm.c +68 -270
@@ -148,6 +148,9 @@* 1.14: Make connection version persist across module unload/load. * Enable and engage power management earlier. * Disengage power management on module unload. +* 1.15: Move most of the /dev/apm_bios stuff to drivers/char/boxevent.c +* Reject all events by default +* (John Fremlin <[email protected]>) * * APM 1.1 Reference: *
@@ -186,6 +189,7 @@#include <linux/pm.h> #include <linux/kernel.h> #include <linux/smp_lock.h> +#include <linux/boxevent.h> #include <asm/system.h> #include <asm/uaccess.h>
@@ -301,10 +305,6 @@ int suser: 1; int suspend_wait: 1;int suspend_result; -int suspends_pending; -int standbys_pending; -int suspends_read; -int standbys_read;int event_head;int event_tail;apm_event_t events[APM_MAX_EVENTS ];
@@ -325,8 +325,7 @@#ifdef CONFIG_APM_CPU_IDLE static int clock_slowed;#endif -static int suspends_pending; -static int standbys_pending; +static int suspend_launched;static int waiting_for_resume;static int ignore_normal_resume;static int bounce_interval =DEFAULT_BOUNCE_INTERVAL ;
@@ -352,7 +351,7 @@static DECLARE_WAIT_QUEUE_HEAD (apm_suspend_waitqueue);static struct apm_user * user_list; -static char driver_version[] ="1.14" ;/* no spaces */ +static char driver_version[] ="1.15" ;/* no spaces */ static char * apm_event_name[] = {"system standby" ,
@@ -579,56 +578,6 @@ clock_slowed = 0; } } - -#if 0 -extern int hlt_counter; - -/* -* If no process has been interested in this -* CPU for some time, we want to wake up the -* power management thread - we probably want -* to conserve power. -*/ -#define HARD_IDLE_TIMEOUT (HZ/3) - -/* This should wake up kapmd and ask it to slow the CPU */ -#define powermanagement_idle () do { } while (0) - -/* -* This is the idle thing. -*/ -static void apm_cpu_idle (void ) -{ -unsigned int start_idle; - - start_idle = jiffies; -while (1 ) { -if (!current->need_resched) { -if (jiffies - start_idle <HARD_IDLE_TIMEOUT ) { -if (!current_cpu_data.hlt_works_ok) -continue ; -if (hlt_counter) -continue ; -__cli (); -if (!current->need_resched) -safe_halt (); -else -__sti (); -continue ; - } - -/* -* Ok, do some power management - we've been idle for too long -*/ -powermanagement_idle (); - } - -schedule (); -check_pgt_cache (); - start_idle = jiffies; - } -} -#endif #endif #ifdef CONFIG_SMP
@@ -791,54 +740,6 @@ }#endif -static int queue_empty (struct apm_user *as) -{ -return as->event_head == as->event_tail; -} - -static apm_event_t get_queued_event (struct apm_user *as) -{ - as->event_tail = (as->event_tail +1 ) %APM_MAX_EVENTS ; -return as->events[as->event_tail]; -} - -static void queue_event (apm_event_t event,struct apm_user *sender) -{ -struct apm_user * as; - -if (user_list ==NULL ) -return ; -for (as = user_list; as !=NULL ; as = as->next) { -if (as == sender) -continue ; - as->event_head = (as->event_head +1 ) %APM_MAX_EVENTS ; -if (as->event_head == as->event_tail) { -static int notified; - -if (notified++ ==0 ) -printk (KERN_ERR "apm: an event queue overflowed\n" ); - as->event_tail = (as->event_tail +1 ) %APM_MAX_EVENTS ; - } - as->events[as->event_head] = event; -if (!as->suser) -continue ; -switch (event) { -case APM_SYS_SUSPEND : -case APM_USER_SUSPEND : - as->suspends_pending++; - suspends_pending++; -break ; - -case APM_SYS_STANDBY : -case APM_USER_STANDBY : - as->standbys_pending++; - standbys_pending++; -break ; - } - } -wake_up_interruptible (&apm_waitqueue); -} -static void set_time (void ) {unsigned long flags;
@@ -898,8 +799,6 @@printk (KERN_CRIT "apm: Critical suspend was vetoed, expect armageddon\n" );return 0 ; } -if (apm_info.connection_version >0x100 ) -apm_set_power_state (APM_STATE_REJECT );return 0 ; }break ;
@@ -913,6 +812,44 @@return 1 ; } +static void announce_event (apm_event_t event) +{ +char *type =BOXEVENT_NOTIFY ; +char *name; + +if (event <=NR_APM_EVENT_NAME ) + name = apm_event_name[event -1 ]; +else name ="unknown event" ; + +switch (event){ +case APM_SYS_STANDBY : +case APM_USER_STANDBY : +case APM_SYS_SUSPEND : +case APM_USER_SUSPEND : +case APM_CRITICAL_SUSPEND : + type =BOXEVENT_SLEEP ; +break ; +case APM_NORMAL_RESUME : +case APM_CRITICAL_RESUME : +case APM_STANDBY_RESUME : + type =BOXEVENT_WAKE ; +break ; +case APM_CAPABILITY_CHANGE : + type =BOXEVENT_WAKE ; +break ; +case APM_LOW_BATTERY : + type =BOXEVENT_EMERGENCY ; +break ; +case APM_POWER_STATUS_CHANGE : + type =BOXEVENT_POWERCHANGE ; +break ; +default : + type =BOXEVENT_NOTIFY ; + } +boxevent (type,"APM" ,name); +} + +static int suspend (void ) {int err;
@@ -929,12 +866,13 @@apm_error ("suspend" , err);send_event (APM_NORMAL_RESUME );sti (); -queue_event (APM_NORMAL_RESUME ,NULL ); +announce_event (APM_NORMAL_RESUME );for (as = user_list; as !=NULL ; as = as->next) { as->suspend_wait =0 ; as->suspend_result = ((err ==APM_SUCCESS ) ?0 : -EIO ); } ignore_normal_resume =1 ; + suspend_launched =0 ;wake_up_interruptible (&apm_suspend_waitqueue);return err; }
@@ -989,46 +927,16 @@if (ignore_normal_resume && (event !=APM_NORMAL_RESUME )) ignore_normal_resume =0 ; +announce_event (event); +switch (event) {case APM_SYS_STANDBY :case APM_USER_STANDBY : -if (send_event (event)) { -queue_event (event,NULL ); -if (standbys_pending <=0 ) -standby (); - } -break ; -case APM_USER_SUSPEND : -#ifdef CONFIG_APM_IGNORE_USER_SUSPEND +case APM_SYS_SUSPEND :if (apm_info.connection_version >0x100 )apm_set_power_state (APM_STATE_REJECT );break ; -#endif -case APM_SYS_SUSPEND : -if (ignore_bounce) { -if (apm_info.connection_version >0x100 ) -apm_set_power_state (APM_STATE_REJECT ); -break ; - } -/* -* If we are already processing a SUSPEND, -* then further SUSPEND events from the BIOS -* will be ignored. We also return here to -* cope with the fact that the Thinkpads keep -* sending a SUSPEND event until something else -* happens! -*/ -if (waiting_for_resume) -return ; -if (send_event (event)) { -queue_event (event,NULL ); - waiting_for_resume =1 ; -if (suspends_pending <=0 ) - (void )suspend (); - } -break ; -case APM_NORMAL_RESUME :case APM_CRITICAL_RESUME :case APM_STANDBY_RESUME :
@@ -1039,7 +947,6 @@ || (ignore_normal_resume == 0)) {set_time ();send_event (event); -queue_event (event,NULL ); }break ;
@@ -1047,7 +954,6 @@case APM_LOW_BATTERY :case APM_POWER_STATUS_CHANGE :send_event (event); -queue_event (event,NULL );break ;case APM_UPDATE_TIME :
@@ -1055,7 +961,9 @@break ;case APM_CRITICAL_SUSPEND : + suspend_launched =1 ;send_event (event); +/* * We can only hope it worked - we are not allowed * to reject a critical suspend.
@@ -1068,20 +976,6 @@static void apm_event_handler (void ) { -static int pending_count =4 ; -int err; - -if ((standbys_pending >0 ) || (suspends_pending >0 )) { -if ((apm_info.connection_version >0x100 ) && (pending_count-- <=0 )) { - pending_count =4 ; -if (debug) -printk (KERN_DEBUG "apm: setting state busy\n" ); - err =apm_set_power_state (APM_STATE_BUSY ); -if (err) -apm_error ("busy" , err); - } - }else - pending_count =4 ;check_events (); }
@@ -1146,78 +1040,10 @@return 0 ; } -static ssize_t do_read (struct file *fp,char *buf,size_t count,loff_t *ppos) -{ -struct apm_user * as; -int i; -apm_event_t event; -DECLARE_WAITQUEUE (wait, current); - - as = fp->private_data; -if (check_apm_user (as,"read" )) -return -EIO ; -if (count <sizeof (apm_event_t)) -return -EINVAL ; -if (queue_empty (as)) { -if (fp->f_flags &O_NONBLOCK ) -return -EAGAIN ; -add_wait_queue (&apm_waitqueue, &wait); -repeat: -set_current_state (TASK_INTERRUPTIBLE ); -if (queue_empty (as) && !signal_pending (current)) { -schedule (); - goto repeat; - } -set_current_state (TASK_RUNNING ); -remove_wait_queue (&apm_waitqueue, &wait); - } - i = count; -while ((i >=sizeof (event)) && !queue_empty (as)) { - event =get_queued_event (as); -if (copy_to_user (buf, &event,sizeof (event))) { -if (i < count) -break ; -return -EFAULT ; - } -switch (event) { -case APM_SYS_SUSPEND : -case APM_USER_SUSPEND : - as->suspends_read++; -break ; - -case APM_SYS_STANDBY : -case APM_USER_STANDBY : - as->standbys_read++; -break ; - } - buf +=sizeof (event); - i -=sizeof (event); - } -if (i < count) -return count - i; -if (signal_pending (current)) -return -ERESTARTSYS ; -return 0 ; -} - -static unsigned int do_poll (struct file *fp,poll_table * wait) -{ -struct apm_user * as; - - as = fp->private_data; -if (check_apm_user (as,"poll" )) -return 0 ; -poll_wait (fp, &apm_waitqueue, wait); -if (!queue_empty (as)) -return POLLIN |POLLRDNORM ; -return 0 ; -} -static int do_ioctl (struct inode * inode,struct file *filp,u_int cmd,u_long arg) {struct apm_user * as; -DECLARE_WAITQUEUE (wait, current); as = filp->private_data;if (check_apm_user (as,"ioctl" ))
@@ -1226,43 +1052,27 @@return -EPERM ;switch (cmd) {case APM_IOC_STANDBY : -if (as->standbys_read >0 ) { - as->standbys_read--; - as->standbys_pending--; - standbys_pending--; - }else if (!send_event (APM_USER_STANDBY )) +if (!send_event (APM_USER_STANDBY ))return -EAGAIN ; -else -queue_event (APM_USER_STANDBY , as); -if (standbys_pending <=0 ) -standby (); +standby ();break ;case APM_IOC_SUSPEND : -if (as->suspends_read >0 ) { - as->suspends_read--; - as->suspends_pending--; - suspends_pending--; - }else if (!send_event (APM_USER_SUSPEND )) -return -EAGAIN ; -else -queue_event (APM_USER_SUSPEND , as); -if (suspends_pending <=0 ) { -if (suspend () !=APM_SUCCESS ) -return -EIO ; - }else { +if (suspend_launched) { as->suspend_wait =1 ; -add_wait_queue (&apm_suspend_waitqueue, &wait); -while (1 ) { -set_current_state (TASK_INTERRUPTIBLE ); -if ((as->suspend_wait ==0 ) - ||signal_pending (current)) -break ; -schedule (); +if (wait_event_interruptible (apm_suspend_waitqueue, + as->suspend_wait ==0 )) { + as->suspend_wait =0 ; +return -ERESTARTSYS ; } -set_current_state (TASK_RUNNING ); -remove_wait_queue (&apm_suspend_waitqueue, &wait); +return as->suspend_result; } + + suspend_launched =1 ; +if (!send_event (APM_USER_SUSPEND )) +return -EAGAIN ; +if (suspend () !=APM_SUCCESS ) +return -EIO ;break ;default :return -EINVAL ;
@@ -1279,16 +1089,7 @@return 0 ; filp->private_data =NULL ;lock_kernel (); -if (as->standbys_pending >0 ) { - standbys_pending -= as->standbys_pending; -if (standbys_pending <=0 ) -standby (); - } -if (as->suspends_pending >0 ) { - suspends_pending -= as->suspends_pending; -if (suspends_pending <=0 ) - (void )suspend (); - } +if (user_list == as) user_list = as->next;else {
@@ -1320,11 +1121,10 @@ } as->magic =APM_BIOS_MAGIC ; as->event_tail = as->event_head =0 ; - as->suspends_pending = as->standbys_pending =0 ; - as->suspends_read = as->standbys_read =0 ; +/* * XXX - this is a tiny bit broken, when we consider BSD -* process accounting. If the device is opened by root, we +* process accounting. If the device is opened by root, we * instantly flag that we used superuser privs. Who knows, * we might close the device immediately without doing a * privileged operation -- cevans
@@ -1578,8 +1378,6 @@static struct file_operations apm_bios_fops = { owner:THIS_MODULE , - read: do_read, - poll: do_poll, ioctl: do_ioctl, open: do_open, release: do_release,
arch/mips/sgi/kernel/reset.c +11 -29
@@ -7,11 +7,14 @@* for more details. * * Copyright (C) 1997, 1998 by Ralf Baechle +* +* 2001 May 7 Mangled to use new boxevent interface by John Fremlin */ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/notifier.h> #include <linux/timer.h> +#include <linux/boxevent.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/system.h>
@@ -21,22 +24,14 @@#include <asm/sgi/sgint23.h> /* -* Just powerdown if init hasn't done after POWERDOWN_TIMEOUT seconds. -* I'm not shure if this feature is a good idea, for now it's here just to -* make the power button make behave just like under IRIX. -*/ -#define POWERDOWN_TIMEOUT 120 - -/* * Blink frequency during reboot grace period and when paniced. */ -#define POWERDOWN_FREQ (HZ / 4)#define PANIC_FREQ (HZ / 8)static unsigned char sgi_volume; -static struct timer_list power_timer, blink_timer, debounce_timer, volume_timer; -static int shuting_down, has_paniced; +static struct timer_list blink_timer, debounce_timer, volume_timer; +static int has_paniced;static void sgi_machine_restart (char *command) __attribute__((noreturn));static void sgi_machine_halt (void ) __attribute__((noreturn));
@@ -45,15 +40,11 @@/* XXX How to pass the reboot command to the firmware??? */ static void sgi_machine_restart (char *command) { -if (shuting_down) -sgi_machine_power_off ();prom_reboot (); }static void sgi_machine_halt (void ) { -if (shuting_down) -sgi_machine_power_off ();prom_imode (); }
@@ -113,20 +104,7 @@ {if (has_paniced)return ; - -if (shuting_down ||kill_proc (1 ,SIGINT ,1 )) { -/* No init process or button pressed twice. */ -sgi_machine_power_off (); - } - - shuting_down =1 ; - blink_timer.data =POWERDOWN_FREQ ; -blink_timeout (POWERDOWN_FREQ ); - -init_timer (&power_timer); - power_timer.function = power_timeout; - power_timer.expires = jiffies +POWERDOWN_TIMEOUT *HZ ; -add_timer (&power_timer); +boxevent (BOXEVENT_OFF ,"MIPS" ,"button pressed" ); }void inline sgi_volume_set (unsigned char volume)
@@ -146,9 +124,11 @@ {del_timer (&volume_timer); +boxevent (BOXEVENT_NOTIFY ,"MIPS" ,"volume up button pressed" ); +if (sgi_volume <0xff ) sgi_volume++; - + hpc3c0->pbus_extregs[2 ][0 ] = sgi_volume; hpc3c0->pbus_extregs[2 ][1 ] = sgi_volume;
@@ -163,6 +143,8 @@ {del_timer (&volume_timer); +boxevent (BOXEVENT_NOTIFY ,"MIPS" ,"volume down button pressed" ); +if (sgi_volume >0 ) sgi_volume--;
arch/mips64/sgi-ip22/ip22-reset.c +10 -33
101 lines not on this page · raw message
arch/sparc64/kernel/power.c +3 -35
@@ -10,10 +10,9 @@#include <linux/sched.h> #include <linux/signal.h> #include <linux/delay.h> +#include <linux/boxevent.h> #include <asm/ebus.h> - -#define __KERNEL_SYSCALLS__#include <linux/unistd.h> #ifdef CONFIG_PCI
@@ -26,10 +25,7 @@static void power_handler (int irq,void *dev_id,struct pt_regs *regs) { -if (button_pressed ==0 ) { -wake_up (&powerd_wait); - button_pressed =1 ; - } +boxevent_intr (BOXEVENT_OFF ,"SPARC-PCI" ,"button pressed" ); }#endif /* CONFIG_PCI */
@@ -52,30 +48,6 @@ }#ifdef CONFIG_PCI -static int powerd (void *__unused) -{ -static char *envp[] = {"HOME=/" ,"TERM=linux" ,"PATH=/sbin:/usr/sbin:/bin:/usr/bin" ,NULL }; -char *argv[] = {"/sbin/shutdown" ,"-h" ,"now" ,NULL }; - -daemonize (); -sprintf (current->comm,"powerd" ); - -again: -while (button_pressed ==0 ) { -spin_lock_irq (¤t->sigmask_lock); -flush_signals (current); -spin_unlock_irq (¤t->sigmask_lock); -interruptible_sleep_on (&powerd_wait); - } - -/* Ok, down we go... */ -if (execve ("/sbin/shutdown" , argv, envp) <0 ) { -printk ("powerd: shutdown execution failed\n" ); - button_pressed =0 ; - goto again; - } -return 0 ; -}void __init power_init (void ) {
@@ -93,11 +65,7 @@ found: power_reg = (unsigned long )ioremap (edev->resource[0 ].start,0x4 );printk ("power: Control reg at %016lx ... " , power_reg); -if (kernel_thread (powerd,0 ,CLONE_FS ) <0 ) { -printk ("Failed to start power daemon.\n" ); -return ; - } -printk ("powerd running.\n" ); +if (edev->irqs[0 ] !=0 ) { if (request_irq(edev->irqs[0], power_handler, SA_SHIRQ, "power",
drivers/acpi/driver.c +5 -0
@@ -21,6 +21,8 @@* Changes * David Woodhouse <[email protected]> 2000-12-6 * - Fix interruptible_sleep_on() races +* John Fremlin 2001-05-07 +* - Mangled to use new boxevent interface */ #include <linux/config.h>
@@ -33,6 +35,7 @@#include <linux/sysctl.h> #include <linux/pm.h> #include <linux/acpi.h> +#include <linux/boxevent.h> #include <asm/uaccess.h> #include "acpi.h" #include "driver.h"
@@ -163,9 +166,11 @@switch (event) {case ACPI_EVENT_POWER_BUTTON : +boxevent (BOXEVENT_OFF ,"ACPI" ,"power button pressed" ); mask =ACPI_PWRBTN ;break ;case ACPI_EVENT_SLEEP_BUTTON : +boxevent (BOXEVENT_SLEEP ,"ACPI" ,"sleep button pressed" ); mask =ACPI_SLPBTN ;break ;default :
drivers/char/Config.in +2 -3
@@ -150,9 +150,6 @@ if [ "$CONFIG_ARCH_NETWINDER" = "y" ]; then tristate 'NetWinder thermometer support' CONFIG_DS1620 tristate 'NetWinder Button' CONFIG_NWBUTTON - if [ "$CONFIG_NWBUTTON" != "n" ]; then - bool ' Reboot Using Button' CONFIG_NWBUTTON_REBOOT - fi tristate 'NetWinder flash support' CONFIG_NWFLASH fi
@@ -187,6 +184,8 @@ bool ' Generic SiS support' CONFIG_AGP_SIS bool ' ALI chipset support' CONFIG_AGP_ALI fi + +tristate '/dev/boxevent (userspace async event interface)' CONFIG_BOXEVENT source drivers/char/drm/Config.in
drivers/char/Makefile +2 -0
@@ -179,6 +179,8 @@ obj-$(CONFIG_QIC02_TAPE) += tpqic02.o +obj-$(CONFIG_BOXEVENT) += boxevent.o + subdir-$(CONFIG_FTAPE) += ftape subdir-$(CONFIG_DRM) += drm subdir-$(CONFIG_PCMCIA) += pcmcia
drivers/char/boxevent.c +291 -0
291 lines not on this page · raw message
drivers/char/nwbutton.c +10 -65
130 lines not on this page · raw message
drivers/char/nwbutton.h +0 -2
@@ -10,10 +10,8 @@/* Various defines: */ -#define NUM_PRESSES_REBOOT 2/* How many presses to activate shutdown */ #define BUTTON_DELAY 30/* How many jiffies for sequence to end */ #define VERSION "0.3"/* Driver version number */ -#define BUTTON_MINOR 158/* Major 10, Minor 158, /dev/nwbutton */ /* Structure definitions: */
include/linux/boxevent.h +34 -0
@@ -0,0 +1,34 @@ +/* (C) 2001 John Fremlin */ + +#ifndef _LINUX_BOXEVENT_H_ +#define _LINUX_BOXEVENT_H_ + +#define BOXEVENT_NOTIFY "NOTIFY" +#define BOXEVENT_SLEEP "SLEEP" +#define BOXEVENT_OFF "OFF" +#define BOXEVENT_WAKE "WAKE" +#define BOXEVENT_EMERGENCY "EMERGENCY" +#define BOXEVENT_POWERCHANGE BOXEVENT_NOTIFY + +#define BOXEVENT_FLOOD "MSGFLOOD" +/* only generated if a buffer +* internal to the pm event +* system overflows +*/ +#ifdef __KERNEL__ +#include <linux/config.h> + +#ifdef CONFIG_BOXEVENT +void boxevent (const char * event_type, +const char * subsystem, +const char * desc); +#else +static inline void boxevent (const char * event_type, +const char * subsystem, +const char * desc) +{ +} +#endif +#endif + +#endif
include/linux/miscdevice.h +1 -0
@@ -17,6 +17,7 @@#define TEMP_MINOR 131/* Temperature Sensor */ #define RTC_MINOR 135#define EFI_RTC_MINOR 136/* EFI Time services */ +#define BOXEVENT_MINOR 137#define SUN_OPENPROM_MINOR 139#define NVRAM_MINOR 144#define I2O_MINOR 166
Signature · 3 lines
-- http://ape.n3.net