unsigned long offset;
unsigned short segment;
} apm_bios_entry;
+#ifdef CONFIG_APM_CPU_IDLE
static int clock_slowed;
static int idle_threshold __read_mostly = DEFAULT_IDLE_THRESHOLD;
static int idle_period __read_mostly = DEFAULT_IDLE_PERIOD;
static int set_pm_idle;
+#endif
static int suspends_pending;
static int standbys_pending;
static int ignore_sys_suspend;
return set_power_state(APM_DEVICE_ALL, state);
}
+#ifdef CONFIG_APM_CPU_IDLE
/**
* apm_do_idle - perform power saving
*
local_irq_enable();
}
+#endif
/**
* apm_power_off - ask the BIOS to power off
if ((strncmp(str, "bounce-interval=", 16) == 0) ||
(strncmp(str, "bounce_interval=", 16) == 0))
bounce_interval = simple_strtol(str + 16, NULL, 0);
+#ifdef CONFIG_APM_CPU_IDLE
if ((strncmp(str, "idle-threshold=", 15) == 0) ||
(strncmp(str, "idle_threshold=", 15) == 0))
idle_threshold = simple_strtol(str + 15, NULL, 0);
if ((strncmp(str, "idle-period=", 12) == 0) ||
(strncmp(str, "idle_period=", 12) == 0))
idle_period = simple_strtol(str + 12, NULL, 0);
+#endif
invert = (strncmp(str, "no-", 3) == 0) ||
(strncmp(str, "no_", 3) == 0);
if (invert)
if (misc_register(&apm_device))
printk(KERN_WARNING "apm: Could not register misc device.\n");
+#ifdef CONFIG_APM_CPU_IDLE
if (HZ != 100)
idle_period = (idle_period * HZ) / 100;
if (idle_threshold < 100) {
pm_idle = apm_cpu_idle;
set_pm_idle = 1;
}
+#endif
return 0;
}
{
int error;
+#ifdef CONFIG_APM_CPU_IDLE
if (set_pm_idle) {
pm_idle = original_pm_idle;
/*
*/
cpu_idle_wait();
}
+#endif
if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0)
&& (apm_info.connection_version > 0x0100)) {
error = apm_engage_power_management(APM_DEVICE_ALL, 0);
module_param(realmode_power_off, bool, 0444);
MODULE_PARM_DESC(realmode_power_off,
"Switch to real mode before powering off");
+#ifdef CONFIG_APM_CPU_IDLE
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");
+#endif
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");