File: apm.c.patch

package info (click to toggle)
nvram-wakeup 1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,068 kB
  • sloc: ansic: 1,943; sh: 309; ruby: 190; makefile: 102
file content (37 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- arch/i386/kernel/apm.c
+++ arch/i386/kernel/apm.c      Wed Aug 14 09:50:40 2002
@@ -383,6 +383,7 @@
 static int                     allow_ints;
 #endif
 static int                     broken_psr;
+static int                     nvram_off;

 static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
 static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
@@ -1769,6 +1770,8 @@
        if (power_off)
                pm_power_off = apm_power_off;
        register_sysrq_key('o', &sysrq_poweroff_op);
+       if (nvram_off)
+               apm_power_off();

        if (smp_num_cpus == 1) {
 #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT)
@@ -1797,6 +1800,9 @@
                if ((strncmp(str, "bounce-interval=", 16) == 0) ||
                    (strncmp(str, "bounce_interval=", 16) == 0))
                        bounce_interval = simple_strtol(str + 16, NULL, 0);
+               if ((strncmp(str, "nvram_off", 9) == 0) ||
+                   (strncmp(str, "nvram-off", 9) == 0))
+                       nvram_off = 1;
                invert = (strncmp(str, "no-", 3) == 0);
                if (invert)
                        str += 3;
@@ -2013,5 +2019,7 @@
 MODULE_PARM(realmode_power_off, "i");
 MODULE_PARM_DESC(realmode_power_off,
                "Switch to real mode before powering off");
+MODULE_PARM(nvram_off, "i");
+MODULE_PARM_DESC(nvram_off, "Used by nvram-wakeup for immediat power off (no boot)");

 EXPORT_NO_SYMBOLS;