2 * acpi.h - ACPI driver interface
4 * Copyright (C) 1999 Andrew Henroid
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/types.h>
25 #include <linux/ioctl.h>
27 #include <linux/sched.h>
28 #include <linux/wait.h>
29 #endif /* __KERNEL__ */
35 ACPI_D0, /* fully-on */
36 ACPI_D1, /* partial-on */
37 ACPI_D2, /* partial-on */
38 ACPI_D3, /* fully-off */
42 ACPI_S0, /* working state */
43 ACPI_S1, /* power-on suspend */
44 ACPI_S2, /* suspend to ram, with devices */
45 ACPI_S3, /* suspend to ram */
46 ACPI_S4, /* suspend to disk */
47 ACPI_S5, /* soft-off */
51 #define ACPI_BIOS_ROM_BASE (0x0e0000)
52 #define ACPI_BIOS_ROM_END (0x100000)
54 /* Table signatures */
55 #define ACPI_RSDP1_SIG 0x20445352 /* 'RSD ' */
56 #define ACPI_RSDP2_SIG 0x20525450 /* 'PTR ' */
57 #define ACPI_RSDT_SIG 0x54445352 /* 'RSDT' */
58 #define ACPI_FADT_SIG 0x50434146 /* 'FACP' */
59 #define ACPI_DSDT_SIG 0x54445344 /* 'DSDT' */
60 #define ACPI_FACS_SIG 0x53434146 /* 'FACS' */
62 #define ACPI_SIG_LEN 4
63 #define ACPI_FADT_SIGNATURE "FACP"
65 /* PM1_STS/EN flags */
66 #define ACPI_TMR 0x0001
67 #define ACPI_BM 0x0010
68 #define ACPI_GBL 0x0020
69 #define ACPI_PWRBTN 0x0100
70 #define ACPI_SLPBTN 0x0200
71 #define ACPI_RTC 0x0400
72 #define ACPI_WAK 0x8000
75 #define ACPI_SCI_EN 0x0001
76 #define ACPI_BM_RLD 0x0002
77 #define ACPI_GBL_RLS 0x0004
78 #define ACPI_SLP_TYP0 0x0400
79 #define ACPI_SLP_TYP1 0x0800
80 #define ACPI_SLP_TYP2 0x1000
81 #define ACPI_SLP_EN 0x2000
83 #define ACPI_SLP_TYP_MASK 0x1c00
84 #define ACPI_SLP_TYP_SHIFT 10
87 #define ACPI_TMR_VAL_EXT 0x00000100
88 #define ACPI_TMR_MASK 0x00ffffff
89 #define ACPI_TMR_HZ 3579545 /* 3.58 MHz */
90 #define ACPI_TMR_KHZ (ACPI_TMR_HZ / 1000)
92 #define ACPI_MICROSEC_TO_TMR_TICKS(val) \
93 (((val) * (ACPI_TMR_KHZ)) / 1000)
96 #define ACPI_ARB_DIS 0x01
99 #define ACPI_WBINVD 0x00000001
100 #define ACPI_WBINVD_FLUSH 0x00000002
101 #define ACPI_PROC_C1 0x00000004
102 #define ACPI_P_LVL2_UP 0x00000008
103 #define ACPI_PWR_BUTTON 0x00000010
104 #define ACPI_SLP_BUTTON 0x00000020
105 #define ACPI_FIX_RTC 0x00000040
106 #define ACPI_RTC_64 0x00000080
107 #define ACPI_TMR_VAL_EXT 0x00000100
108 #define ACPI_DCK_CAP 0x00000200
110 /* FADT BOOT_ARCH flags */
111 #define FADT_BOOT_ARCH_LEGACY_DEVICES 0x0001
112 #define FADT_BOOT_ARCH_KBD_CONTROLLER 0x0002
115 #define ACPI_S4BIOS 0x00000001
117 /* processor block offsets */
118 #define ACPI_P_CNT 0x00000000
119 #define ACPI_P_LVL2 0x00000004
120 #define ACPI_P_LVL3 0x00000005
122 /* C-state latencies (microseconds) */
123 #define ACPI_MAX_P_LVL2_LAT 100
124 #define ACPI_MAX_P_LVL3_LAT 1000
125 #define ACPI_INFINITE_LAT (~0UL)
128 * Sysctl declarations
165 #define ACPI_SLP_TYP_DISABLED (~0UL)
169 /* routines for saving/restoring kernel state */
170 FASTCALL(extern unsigned long acpi_save_state_mem(unsigned long return_point));
171 FASTCALL(extern int acpi_save_state_disk(unsigned long return_point));
172 extern void acpi_restore_state(void);
174 extern unsigned long acpi_wakeup_address;
176 #endif /* __KERNEL__ */
180 #endif /* _LINUX_ACPI_H */