Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
apm_32.c File Reference
#include <linux/module.h>
#include <linux/poll.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/timer.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/miscdevice.h>
#include <linux/apm_bios.h>
#include <linux/init.h>
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/capability.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/freezer.h>
#include <linux/smp.h>
#include <linux/dmi.h>
#include <linux/suspend.h>
#include <linux/kthread.h>
#include <linux/jiffies.h>
#include <linux/acpi.h>
#include <linux/syscore_ops.h>
#include <linux/i8253.h>
#include <asm/uaccess.h>
#include <asm/desc.h>
#include <asm/olpc.h>
#include <asm/paravirt.h>
#include <asm/reboot.h>
#include <asm/apm.h>

Go to the source code of this file.

Data Structures

struct  apm_user
 
struct  lookup_t
 
struct  apm_bios_call
 

Macros

#define pr_fmt(fmt)   "apm: " fmt
 
#define APM_MINOR_DEV   134
 
#define ALWAYS_CALL_BUSY   1
 
#define APM_ZERO_SEGS
 
#define APM_CHECK_TIMEOUT   (HZ)
 
#define DEFAULT_BOUNCE_INTERVAL   (3 * HZ)
 
#define APM_MAX_EVENTS   20
 
#define APM_BIOS_MAGIC   0x4101
 
#define DEFAULT_IDLE_THRESHOLD   100
 
#define DEFAULT_IDLE_PERIOD   (100 / 3)
 
#define NR_APM_EVENT_NAME   ARRAY_SIZE(apm_event_name)
 
#define ERROR_COUNT   ARRAY_SIZE(error_table)
 
#define apm_irq_save(flags)   do { flags = __apm_irq_save(); } while (0)
 
#define APM_DECL_SEGS   unsigned int saved_fs; unsigned int saved_gs;
 
#define APM_DO_SAVE_SEGS   savesegment(fs, saved_fs); savesegment(gs, saved_gs)
 
#define APM_DO_RESTORE_SEGS   loadsegment(fs, saved_fs); loadsegment(gs, saved_gs)
 
#define IDLE_CALC_LIMIT   (HZ * 100)
 
#define IDLE_LEAKY_MAX   16
 

Typedefs

typedef struct lookup_t lookup_t
 

Functions

 __setup ("apm=", apm_setup)
 
 module_init (apm_init)
 
 module_exit (apm_exit)
 
 MODULE_AUTHOR ("Stephen Rothwell")
 
 MODULE_DESCRIPTION ("Advanced Power Management")
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug, bool, 0644)
 
 MODULE_PARM_DESC (debug,"Enable debug mode")
 
 module_param (power_off, bool, 0444)
 
 MODULE_PARM_DESC (power_off,"Enable power off")
 
 module_param (bounce_interval, int, 0444)
 
 MODULE_PARM_DESC (bounce_interval,"Set the number of ticks to ignore suspend bounces")
 
 module_param (allow_ints, bool, 0444)
 
 MODULE_PARM_DESC (allow_ints,"Allow interrupts during BIOS calls")
 
 module_param (broken_psr, bool, 0444)
 
 MODULE_PARM_DESC (broken_psr,"BIOS has a broken GetPowerStatus call")
 
 module_param (realmode_power_off, bool, 0444)
 
 MODULE_PARM_DESC (realmode_power_off,"Switch to real mode before powering off")
 
 module_param (idle_threshold, int, 0444)
 
 MODULE_PARM_DESC (idle_threshold,"System idle percentage above which to make APM BIOS idle calls")
 
 module_param (idle_period, int, 0444)
 
 MODULE_PARM_DESC (idle_period,"Period (in sec/100) over which to caculate the idle percentage")
 
 module_param (smp, bool, 0444)
 
 MODULE_PARM_DESC (smp,"Set this to enable APM use on an SMP platform. Use with caution on older systems")
 
 MODULE_ALIAS_MISCDEV (APM_MINOR_DEV)
 

Macro Definition Documentation

#define ALWAYS_CALL_BUSY   1

Definition at line 295 of file apm_32.c.

#define APM_BIOS_MAGIC   0x4101

Definition at line 357 of file apm_32.c.

#define APM_CHECK_TIMEOUT   (HZ)

Definition at line 322 of file apm_32.c.

#define APM_DECL_SEGS   unsigned int saved_fs; unsigned int saved_gs;

Definition at line 540 of file apm_32.c.

#define APM_DO_RESTORE_SEGS   loadsegment(fs, saved_fs); loadsegment(gs, saved_gs)

Definition at line 544 of file apm_32.c.

#define APM_DO_SAVE_SEGS   savesegment(fs, saved_fs); savesegment(gs, saved_gs)

Definition at line 542 of file apm_32.c.

#define apm_irq_save (   flags)    do { flags = __apm_irq_save(); } while (0)

Definition at line 528 of file apm_32.c.

#define APM_MAX_EVENTS   20

Definition at line 332 of file apm_32.c.

#define APM_MINOR_DEV   134

Definition at line 250 of file apm_32.c.

#define APM_ZERO_SEGS

Definition at line 302 of file apm_32.c.

#define DEFAULT_BOUNCE_INTERVAL   (3 * HZ)

Definition at line 327 of file apm_32.c.

#define DEFAULT_IDLE_PERIOD   (100 / 3)

Definition at line 368 of file apm_32.c.

#define DEFAULT_IDLE_THRESHOLD   100

Definition at line 366 of file apm_32.c.

#define ERROR_COUNT   ARRAY_SIZE(error_table)

Definition at line 471 of file apm_32.c.

#define IDLE_CALC_LIMIT   (HZ * 100)

Definition at line 884 of file apm_32.c.

#define IDLE_LEAKY_MAX   16

Definition at line 885 of file apm_32.c.

#define NR_APM_EVENT_NAME   ARRAY_SIZE(apm_event_name)

Definition at line 440 of file apm_32.c.

#define pr_fmt (   fmt)    "apm: " fmt

Definition at line 204 of file apm_32.c.

Typedef Documentation

Function Documentation

__setup ( )
MODULE_ALIAS_MISCDEV ( APM_MINOR_DEV  )
MODULE_AUTHOR ( "Stephen Rothwell"  )
MODULE_DESCRIPTION ( "Advanced Power Management"  )
module_exit ( apm_exit  )
module_init ( apm_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
bool  ,
0644   
)
module_param ( power_off  ,
bool  ,
0444   
)
module_param ( bounce_interval  ,
int  ,
0444   
)
module_param ( allow_ints  ,
bool  ,
0444   
)
module_param ( broken_psr  ,
bool  ,
0444   
)
module_param ( realmode_power_off  ,
bool  ,
0444   
)
module_param ( idle_threshold  ,
int  ,
0444   
)
module_param ( idle_period  ,
int  ,
0444   
)
module_param ( smp  ,
bool  ,
0444   
)
MODULE_PARM_DESC ( debug  ,
"Enable debug mode  
)
MODULE_PARM_DESC ( power_off  ,
"Enable power off"   
)
MODULE_PARM_DESC ( bounce_interval  ,
"Set the number of ticks to ignore suspend bounces"   
)
MODULE_PARM_DESC ( allow_ints  ,
"Allow interrupts during BIOS calls"   
)
MODULE_PARM_DESC ( broken_psr  ,
"BIOS has a broken GetPowerStatus call"   
)
MODULE_PARM_DESC ( realmode_power_off  ,
"Switch to real mode before powering off"   
)
MODULE_PARM_DESC ( idle_threshold  ,
"System idle percentage above which to make APM BIOS idle calls"   
)
MODULE_PARM_DESC ( idle_period  ,
"Period (in sec/100) over which to caculate the idle percentage"   
)
MODULE_PARM_DESC ( smp  ,
"Set this to enable APM use on an SMP platform. Use with caution on older systems"   
)

Variable Documentation

unsigned long offset

Definition at line 374 of file apm_32.c.

unsigned short segment

Definition at line 375 of file apm_32.c.