Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * acpi.h - ACPI Interface |
| 3 | * |
| 4 | * Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> |
| 5 | * |
| 6 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 23 | */ |
| 24 | |
| 25 | #ifndef _LINUX_ACPI_H |
| 26 | #define _LINUX_ACPI_H |
| 27 | |
David Mosberger | 3f5948f | 2005-06-06 15:50:09 -0700 | [diff] [blame] | 28 | |
Len Brown | 25be5e6 | 2005-05-27 04:21:50 -0400 | [diff] [blame] | 29 | #ifdef CONFIG_ACPI |
| 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #ifndef _LINUX |
| 32 | #define _LINUX |
| 33 | #endif |
| 34 | |
| 35 | #include <linux/list.h> |
| 36 | |
| 37 | #include <acpi/acpi.h> |
| 38 | #include <acpi/acpi_bus.h> |
| 39 | #include <acpi/acpi_drivers.h> |
Yasunori Goto | 762834e | 2006-06-23 02:03:19 -0700 | [diff] [blame] | 40 | #include <acpi/acpi_numa.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | #include <asm/acpi.h> |
| 42 | |
| 43 | |
Len Brown | 888ba6c | 2005-08-24 12:07:20 -0400 | [diff] [blame] | 44 | #ifdef CONFIG_ACPI |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | enum acpi_irq_model_id { |
| 47 | ACPI_IRQ_MODEL_PIC = 0, |
| 48 | ACPI_IRQ_MODEL_IOAPIC, |
| 49 | ACPI_IRQ_MODEL_IOSAPIC, |
John Keller | 3948ec9 | 2006-12-22 11:50:04 -0600 | [diff] [blame] | 50 | ACPI_IRQ_MODEL_PLATFORM, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | ACPI_IRQ_MODEL_COUNT |
| 52 | }; |
| 53 | |
| 54 | extern enum acpi_irq_model_id acpi_irq_model; |
| 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | typedef struct { |
| 57 | u8 type; |
| 58 | u8 length; |
| 59 | } __attribute__ ((packed)) acpi_table_entry_header; |
| 60 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | /* Multiple APIC Description Table (MADT) */ |
| 62 | |
| 63 | struct acpi_table_madt { |
| 64 | struct acpi_table_header header; |
| 65 | u32 lapic_address; |
| 66 | struct { |
| 67 | u32 pcat_compat:1; |
| 68 | u32 reserved:31; |
| 69 | } flags; |
| 70 | } __attribute__ ((packed)); |
| 71 | |
| 72 | enum acpi_madt_entry_id { |
| 73 | ACPI_MADT_LAPIC = 0, |
| 74 | ACPI_MADT_IOAPIC, |
| 75 | ACPI_MADT_INT_SRC_OVR, |
| 76 | ACPI_MADT_NMI_SRC, |
| 77 | ACPI_MADT_LAPIC_NMI, |
| 78 | ACPI_MADT_LAPIC_ADDR_OVR, |
| 79 | ACPI_MADT_IOSAPIC, |
| 80 | ACPI_MADT_LSAPIC, |
| 81 | ACPI_MADT_PLAT_INT_SRC, |
| 82 | ACPI_MADT_ENTRY_COUNT |
| 83 | }; |
| 84 | |
| 85 | typedef struct { |
| 86 | u16 polarity:2; |
| 87 | u16 trigger:2; |
| 88 | u16 reserved:12; |
| 89 | } __attribute__ ((packed)) acpi_interrupt_flags; |
| 90 | |
| 91 | struct acpi_table_lapic { |
| 92 | acpi_table_entry_header header; |
| 93 | u8 acpi_id; |
| 94 | u8 id; |
| 95 | struct { |
| 96 | u32 enabled:1; |
| 97 | u32 reserved:31; |
| 98 | } flags; |
| 99 | } __attribute__ ((packed)); |
| 100 | |
| 101 | struct acpi_table_ioapic { |
| 102 | acpi_table_entry_header header; |
| 103 | u8 id; |
| 104 | u8 reserved; |
| 105 | u32 address; |
| 106 | u32 global_irq_base; |
| 107 | } __attribute__ ((packed)); |
| 108 | |
| 109 | struct acpi_table_int_src_ovr { |
| 110 | acpi_table_entry_header header; |
| 111 | u8 bus; |
| 112 | u8 bus_irq; |
| 113 | u32 global_irq; |
| 114 | acpi_interrupt_flags flags; |
| 115 | } __attribute__ ((packed)); |
| 116 | |
| 117 | struct acpi_table_nmi_src { |
| 118 | acpi_table_entry_header header; |
| 119 | acpi_interrupt_flags flags; |
| 120 | u32 global_irq; |
| 121 | } __attribute__ ((packed)); |
| 122 | |
| 123 | struct acpi_table_lapic_nmi { |
| 124 | acpi_table_entry_header header; |
| 125 | u8 acpi_id; |
| 126 | acpi_interrupt_flags flags; |
| 127 | u8 lint; |
| 128 | } __attribute__ ((packed)); |
| 129 | |
| 130 | struct acpi_table_lapic_addr_ovr { |
| 131 | acpi_table_entry_header header; |
| 132 | u8 reserved[2]; |
| 133 | u64 address; |
| 134 | } __attribute__ ((packed)); |
| 135 | |
| 136 | struct acpi_table_iosapic { |
| 137 | acpi_table_entry_header header; |
| 138 | u8 id; |
| 139 | u8 reserved; |
| 140 | u32 global_irq_base; |
| 141 | u64 address; |
| 142 | } __attribute__ ((packed)); |
| 143 | |
| 144 | struct acpi_table_lsapic { |
| 145 | acpi_table_entry_header header; |
| 146 | u8 acpi_id; |
| 147 | u8 id; |
| 148 | u8 eid; |
| 149 | u8 reserved[3]; |
| 150 | struct { |
| 151 | u32 enabled:1; |
| 152 | u32 reserved:31; |
| 153 | } flags; |
| 154 | } __attribute__ ((packed)); |
| 155 | |
| 156 | struct acpi_table_plat_int_src { |
| 157 | acpi_table_entry_header header; |
| 158 | acpi_interrupt_flags flags; |
| 159 | u8 type; /* See acpi_interrupt_type */ |
| 160 | u8 id; |
| 161 | u8 eid; |
| 162 | u8 iosapic_vector; |
| 163 | u32 global_irq; |
Ashok Raj | 55e59c5 | 2005-03-31 22:51:10 -0500 | [diff] [blame] | 164 | struct { |
| 165 | u32 cpei_override_flag:1; |
| 166 | u32 reserved:31; |
| 167 | } plint_flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | } __attribute__ ((packed)); |
| 169 | |
| 170 | enum acpi_interrupt_id { |
| 171 | ACPI_INTERRUPT_PMI = 1, |
| 172 | ACPI_INTERRUPT_INIT, |
| 173 | ACPI_INTERRUPT_CPEI, |
| 174 | ACPI_INTERRUPT_COUNT |
| 175 | }; |
| 176 | |
| 177 | #define ACPI_SPACE_MEM 0 |
| 178 | |
| 179 | struct acpi_gen_regaddr { |
| 180 | u8 space_id; |
| 181 | u8 bit_width; |
| 182 | u8 bit_offset; |
| 183 | u8 resv; |
| 184 | u32 addrl; |
| 185 | u32 addrh; |
| 186 | } __attribute__ ((packed)); |
| 187 | |
| 188 | struct acpi_table_hpet { |
| 189 | struct acpi_table_header header; |
| 190 | u32 id; |
| 191 | struct acpi_gen_regaddr addr; |
| 192 | u8 number; |
| 193 | u16 min_tick; |
| 194 | u8 page_protect; |
| 195 | } __attribute__ ((packed)); |
| 196 | |
| 197 | /* |
| 198 | * Simple Boot Flags |
| 199 | * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx |
| 200 | */ |
| 201 | struct acpi_table_sbf |
| 202 | { |
| 203 | u8 sbf_signature[4]; |
| 204 | u32 sbf_len; |
| 205 | u8 sbf_revision; |
| 206 | u8 sbf_csum; |
| 207 | u8 sbf_oemid[6]; |
| 208 | u8 sbf_oemtable[8]; |
| 209 | u8 sbf_revdata[4]; |
| 210 | u8 sbf_creator[4]; |
| 211 | u8 sbf_crearev[4]; |
| 212 | u8 sbf_cmos; |
| 213 | u8 sbf_spare[3]; |
| 214 | } __attribute__ ((packed)); |
| 215 | |
| 216 | /* |
| 217 | * System Resource Affinity Table (SRAT) |
| 218 | * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx |
| 219 | */ |
| 220 | |
| 221 | struct acpi_table_srat { |
| 222 | struct acpi_table_header header; |
| 223 | u32 table_revision; |
| 224 | u64 reserved; |
| 225 | } __attribute__ ((packed)); |
| 226 | |
| 227 | enum acpi_srat_entry_id { |
| 228 | ACPI_SRAT_PROCESSOR_AFFINITY = 0, |
| 229 | ACPI_SRAT_MEMORY_AFFINITY, |
| 230 | ACPI_SRAT_ENTRY_COUNT |
| 231 | }; |
| 232 | |
| 233 | struct acpi_table_processor_affinity { |
| 234 | acpi_table_entry_header header; |
| 235 | u8 proximity_domain; |
| 236 | u8 apic_id; |
| 237 | struct { |
| 238 | u32 enabled:1; |
| 239 | u32 reserved:31; |
| 240 | } flags; |
| 241 | u8 lsapic_eid; |
| 242 | u8 reserved[7]; |
| 243 | } __attribute__ ((packed)); |
| 244 | |
| 245 | struct acpi_table_memory_affinity { |
| 246 | acpi_table_entry_header header; |
| 247 | u8 proximity_domain; |
| 248 | u8 reserved1[5]; |
| 249 | u32 base_addr_lo; |
| 250 | u32 base_addr_hi; |
| 251 | u32 length_lo; |
| 252 | u32 length_hi; |
| 253 | u32 memory_type; /* See acpi_address_range_id */ |
| 254 | struct { |
| 255 | u32 enabled:1; |
| 256 | u32 hot_pluggable:1; |
| 257 | u32 reserved:30; |
| 258 | } flags; |
| 259 | u64 reserved2; |
| 260 | } __attribute__ ((packed)); |
| 261 | |
| 262 | enum acpi_address_range_id { |
| 263 | ACPI_ADDRESS_RANGE_MEMORY = 1, |
| 264 | ACPI_ADDRESS_RANGE_RESERVED = 2, |
| 265 | ACPI_ADDRESS_RANGE_ACPI = 3, |
| 266 | ACPI_ADDRESS_RANGE_NVS = 4, |
| 267 | ACPI_ADDRESS_RANGE_COUNT |
| 268 | }; |
| 269 | |
| 270 | /* |
| 271 | * System Locality Information Table (SLIT) |
| 272 | * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf |
| 273 | */ |
| 274 | |
| 275 | struct acpi_table_slit { |
| 276 | struct acpi_table_header header; |
| 277 | u64 localities; |
| 278 | u8 entry[1]; /* real size = localities^2 */ |
| 279 | } __attribute__ ((packed)); |
| 280 | |
| 281 | /* Smart Battery Description Table (SBST) */ |
| 282 | |
| 283 | struct acpi_table_sbst { |
| 284 | struct acpi_table_header header; |
| 285 | u32 warning; /* Warn user */ |
| 286 | u32 low; /* Critical sleep */ |
| 287 | u32 critical; /* Critical shutdown */ |
| 288 | } __attribute__ ((packed)); |
| 289 | |
| 290 | /* Embedded Controller Boot Resources Table (ECDT) */ |
| 291 | |
| 292 | struct acpi_table_ecdt { |
| 293 | struct acpi_table_header header; |
| 294 | struct acpi_generic_address ec_control; |
| 295 | struct acpi_generic_address ec_data; |
| 296 | u32 uid; |
| 297 | u8 gpe_bit; |
| 298 | char ec_id[0]; |
| 299 | } __attribute__ ((packed)); |
| 300 | |
| 301 | /* PCI MMCONFIG */ |
| 302 | |
Greg Kroah-Hartman | 5454939 | 2005-06-23 17:35:56 -0700 | [diff] [blame] | 303 | /* Defined in PCI Firmware Specification 3.0 */ |
| 304 | struct acpi_table_mcfg_config { |
| 305 | u32 base_address; |
| 306 | u32 base_reserved; |
| 307 | u16 pci_segment_group_number; |
| 308 | u8 start_bus_number; |
| 309 | u8 end_bus_number; |
| 310 | u8 reserved[4]; |
| 311 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | struct acpi_table_mcfg { |
| 313 | struct acpi_table_header header; |
| 314 | u8 reserved[8]; |
Greg Kroah-Hartman | 5454939 | 2005-06-23 17:35:56 -0700 | [diff] [blame] | 315 | struct acpi_table_mcfg_config config[0]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | } __attribute__ ((packed)); |
| 317 | |
| 318 | /* Table Handlers */ |
| 319 | |
| 320 | enum acpi_table_id { |
| 321 | ACPI_TABLE_UNKNOWN = 0, |
| 322 | ACPI_APIC, |
| 323 | ACPI_BOOT, |
| 324 | ACPI_DBGP, |
| 325 | ACPI_DSDT, |
| 326 | ACPI_ECDT, |
| 327 | ACPI_ETDT, |
| 328 | ACPI_FADT, |
| 329 | ACPI_FACS, |
| 330 | ACPI_OEMX, |
| 331 | ACPI_PSDT, |
| 332 | ACPI_SBST, |
| 333 | ACPI_SLIT, |
| 334 | ACPI_SPCR, |
| 335 | ACPI_SRAT, |
| 336 | ACPI_SSDT, |
| 337 | ACPI_SPMI, |
| 338 | ACPI_HPET, |
| 339 | ACPI_MCFG, |
| 340 | ACPI_TABLE_COUNT |
| 341 | }; |
| 342 | |
Alexey Starikovskiy | ceb6c46 | 2007-02-02 19:48:22 +0300 | [diff] [blame^] | 343 | typedef int (*acpi_table_handler) (struct acpi_table_header *header); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | |
| 345 | extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT]; |
| 346 | |
| 347 | typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end); |
| 348 | |
| 349 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); |
| 350 | unsigned long acpi_find_rsdp (void); |
| 351 | int acpi_boot_init (void); |
| 352 | int acpi_boot_table_init (void); |
| 353 | int acpi_numa_init (void); |
| 354 | |
| 355 | int acpi_table_init (void); |
Alexey Starikovskiy | ceb6c46 | 2007-02-02 19:48:22 +0300 | [diff] [blame^] | 356 | int acpi_table_parse (char *id, acpi_table_handler handler); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 357 | int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); |
| 358 | int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); |
Alexey Starikovskiy | ceb6c46 | 2007-02-02 19:48:22 +0300 | [diff] [blame^] | 359 | int acpi_parse_mcfg (struct acpi_table_header *header); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 360 | void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); |
| 361 | void acpi_table_print_madt_entry (acpi_table_entry_header *madt); |
| 362 | void acpi_table_print_srat_entry (acpi_table_entry_header *srat); |
| 363 | |
| 364 | /* the following four functions are architecture-dependent */ |
Yasunori Goto | 762834e | 2006-06-23 02:03:19 -0700 | [diff] [blame] | 365 | #ifdef CONFIG_HAVE_ARCH_PARSE_SRAT |
| 366 | #define NR_NODE_MEMBLKS MAX_NUMNODES |
| 367 | #define acpi_numa_slit_init(slit) do {} while (0) |
| 368 | #define acpi_numa_processor_affinity_init(pa) do {} while (0) |
| 369 | #define acpi_numa_memory_affinity_init(ma) do {} while (0) |
| 370 | #define acpi_numa_arch_fixup() do {} while (0) |
| 371 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 372 | void acpi_numa_slit_init (struct acpi_table_slit *slit); |
| 373 | void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); |
| 374 | void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); |
| 375 | void acpi_numa_arch_fixup(void); |
Yasunori Goto | 762834e | 2006-06-23 02:03:19 -0700 | [diff] [blame] | 376 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | |
| 378 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
| 379 | /* Arch dependent functions for cpu hotplug support */ |
| 380 | int acpi_map_lsapic(acpi_handle handle, int *pcpu); |
| 381 | int acpi_unmap_lsapic(int cpu); |
| 382 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
| 383 | |
Kenji Kaneshige | b1bb248 | 2005-04-28 00:25:58 -0700 | [diff] [blame] | 384 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |
| 385 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); |
| 386 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 387 | extern int acpi_mp_config; |
| 388 | |
Greg Kroah-Hartman | 5454939 | 2005-06-23 17:35:56 -0700 | [diff] [blame] | 389 | extern struct acpi_table_mcfg_config *pci_mmcfg_config; |
| 390 | extern int pci_mmcfg_config_num; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 391 | |
Pavel Machek | c255d84 | 2006-02-20 18:27:58 -0800 | [diff] [blame] | 392 | extern int sbf_port; |
| 393 | extern unsigned long acpi_video_flags; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | |
Len Brown | 888ba6c | 2005-08-24 12:07:20 -0400 | [diff] [blame] | 395 | #else /* !CONFIG_ACPI */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 396 | |
| 397 | #define acpi_mp_config 0 |
| 398 | |
Len Brown | 888ba6c | 2005-08-24 12:07:20 -0400 | [diff] [blame] | 399 | #endif /* !CONFIG_ACPI */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 400 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 401 | int acpi_register_gsi (u32 gsi, int triggering, int polarity); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); |
| 403 | |
| 404 | /* |
| 405 | * This function undoes the effect of one call to acpi_register_gsi(). |
| 406 | * If this matches the last registration, any IRQ resources for gsi |
| 407 | * are freed. |
| 408 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 409 | void acpi_unregister_gsi (u32 gsi); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | |
Len Brown | 6153df7b | 2005-08-25 12:27:09 -0400 | [diff] [blame] | 411 | #ifdef CONFIG_ACPI |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 412 | |
| 413 | struct acpi_prt_entry { |
| 414 | struct list_head node; |
| 415 | struct acpi_pci_id id; |
| 416 | u8 pin; |
| 417 | struct { |
| 418 | acpi_handle handle; |
| 419 | u32 index; |
| 420 | } link; |
| 421 | u32 irq; |
| 422 | }; |
| 423 | |
| 424 | struct acpi_prt_list { |
| 425 | int count; |
| 426 | struct list_head entries; |
| 427 | }; |
| 428 | |
| 429 | struct pci_dev; |
| 430 | |
| 431 | int acpi_pci_irq_enable (struct pci_dev *dev); |
David Shaohua Li | c9c3e45 | 2005-04-01 00:07:31 -0500 | [diff] [blame] | 432 | void acpi_penalize_isa_irq(int irq, int active); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 433 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 434 | void acpi_pci_irq_disable (struct pci_dev *dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 435 | |
| 436 | struct acpi_pci_driver { |
| 437 | struct acpi_pci_driver *next; |
| 438 | int (*add)(acpi_handle handle); |
| 439 | void (*remove)(acpi_handle handle); |
| 440 | }; |
| 441 | |
| 442 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); |
| 443 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); |
| 444 | |
Len Brown | 6153df7b | 2005-08-25 12:27:09 -0400 | [diff] [blame] | 445 | #endif /* CONFIG_ACPI */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | |
| 447 | #ifdef CONFIG_ACPI_EC |
| 448 | |
| 449 | extern int ec_read(u8 addr, u8 *val); |
| 450 | extern int ec_write(u8 addr, u8 val); |
Lennart Poettering | d7a76e4 | 2006-09-05 12:12:24 -0400 | [diff] [blame] | 451 | extern int ec_transaction(u8 command, |
| 452 | const u8 *wdata, unsigned wdata_len, |
| 453 | u8 *rdata, unsigned rdata_len); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 454 | |
| 455 | #endif /*CONFIG_ACPI_EC*/ |
| 456 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 457 | extern int acpi_blacklisted(void); |
| 458 | extern void acpi_bios_year(char *s); |
| 459 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 460 | #define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */ |
| 461 | #ifdef CONFIG_ACPI |
| 462 | |
| 463 | /* |
| 464 | * Set highest legal C-state |
| 465 | * 0: C0 okay, but not C1 |
| 466 | * 1: C1 okay, but not C2 |
| 467 | * 2: C2 okay, but not C3 etc. |
| 468 | */ |
| 469 | |
| 470 | extern unsigned int max_cstate; |
| 471 | |
| 472 | static inline unsigned int acpi_get_cstate_limit(void) |
| 473 | { |
| 474 | return max_cstate; |
| 475 | } |
| 476 | static inline void acpi_set_cstate_limit(unsigned int new_limit) |
| 477 | { |
| 478 | max_cstate = new_limit; |
| 479 | return; |
| 480 | } |
| 481 | #else |
| 482 | static inline unsigned int acpi_get_cstate_limit(void) { return 0; } |
| 483 | static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; } |
| 484 | #endif |
| 485 | |
| 486 | #ifdef CONFIG_ACPI_NUMA |
| 487 | int acpi_get_pxm(acpi_handle handle); |
Yasunori Goto | 1e3590e | 2006-06-27 02:53:31 -0700 | [diff] [blame] | 488 | int acpi_get_node(acpi_handle *handle); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 489 | #else |
| 490 | static inline int acpi_get_pxm(acpi_handle handle) |
| 491 | { |
| 492 | return 0; |
| 493 | } |
Yasunori Goto | 1e3590e | 2006-06-27 02:53:31 -0700 | [diff] [blame] | 494 | static inline int acpi_get_node(acpi_handle *handle) |
| 495 | { |
| 496 | return 0; |
| 497 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | #endif |
Yasunori Goto | 1e3590e | 2006-06-27 02:53:31 -0700 | [diff] [blame] | 499 | extern int acpi_paddr_to_node(u64 start_addr, u64 size); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 500 | |
| 501 | extern int pnpacpi_disabled; |
| 502 | |
Andrew Morton | 53de49f | 2005-07-30 04:18:00 -0400 | [diff] [blame] | 503 | #else /* CONFIG_ACPI */ |
| 504 | |
| 505 | static inline int acpi_boot_init(void) |
| 506 | { |
| 507 | return 0; |
| 508 | } |
| 509 | |
| 510 | static inline int acpi_boot_table_init(void) |
| 511 | { |
| 512 | return 0; |
| 513 | } |
| 514 | |
Len Brown | 25be5e6 | 2005-05-27 04:21:50 -0400 | [diff] [blame] | 515 | #endif /* CONFIG_ACPI */ |
| 516 | #endif /*_LINUX_ACPI_H*/ |