diff options
author | Len Brown <len.brown@intel.com> | 2005-08-05 00:44:28 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-08-05 00:45:14 -0400 |
commit | 4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch) | |
tree | 5b5b7d296ea58786f53b95e5eac9565ff66890b0 /arch | |
parent | c65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff) |
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 530 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/earlyquirk.c | 40 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/sleep.c | 35 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi-ext.c | 37 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 324 | ||||
-rw-r--r-- | arch/x86_64/kernel/acpi/sleep.c | 17 |
6 files changed, 496 insertions, 487 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 55c0fbd68956..98d119c66379 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -40,19 +40,25 @@ | |||
40 | 40 | ||
41 | #ifdef CONFIG_X86_64 | 41 | #ifdef CONFIG_X86_64 |
42 | 42 | ||
43 | static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) { } | 43 | static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
44 | { | ||
45 | } | ||
44 | extern void __init clustered_apic_check(void); | 46 | extern void __init clustered_apic_check(void); |
45 | static inline int ioapic_setup_disabled(void) { return 0; } | 47 | static inline int ioapic_setup_disabled(void) |
48 | { | ||
49 | return 0; | ||
50 | } | ||
51 | |||
46 | #include <asm/proto.h> | 52 | #include <asm/proto.h> |
47 | 53 | ||
48 | #else /* X86 */ | 54 | #else /* X86 */ |
49 | 55 | ||
50 | #ifdef CONFIG_X86_LOCAL_APIC | 56 | #ifdef CONFIG_X86_LOCAL_APIC |
51 | #include <mach_apic.h> | 57 | #include <mach_apic.h> |
52 | #include <mach_mpparse.h> | 58 | #include <mach_mpparse.h> |
53 | #endif /* CONFIG_X86_LOCAL_APIC */ | 59 | #endif /* CONFIG_X86_LOCAL_APIC */ |
54 | 60 | ||
55 | #endif /* X86 */ | 61 | #endif /* X86 */ |
56 | 62 | ||
57 | #define BAD_MADT_ENTRY(entry, end) ( \ | 63 | #define BAD_MADT_ENTRY(entry, end) ( \ |
58 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ | 64 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ |
@@ -62,7 +68,7 @@ static inline int ioapic_setup_disabled(void) { return 0; } | |||
62 | 68 | ||
63 | #ifdef CONFIG_ACPI_PCI | 69 | #ifdef CONFIG_ACPI_PCI |
64 | int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ | 70 | int acpi_noirq __initdata; /* skip ACPI IRQ initialization */ |
65 | int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ | 71 | int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */ |
66 | #else | 72 | #else |
67 | int acpi_noirq __initdata = 1; | 73 | int acpi_noirq __initdata = 1; |
68 | int acpi_pci_disabled __initdata = 1; | 74 | int acpi_pci_disabled __initdata = 1; |
@@ -88,7 +94,7 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; | |||
88 | 94 | ||
89 | #define MAX_MADT_ENTRIES 256 | 95 | #define MAX_MADT_ENTRIES 256 |
90 | u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] = | 96 | u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] = |
91 | { [0 ... MAX_MADT_ENTRIES-1] = 0xff }; | 97 | {[0...MAX_MADT_ENTRIES - 1] = 0xff }; |
92 | EXPORT_SYMBOL(x86_acpiid_to_apicid); | 98 | EXPORT_SYMBOL(x86_acpiid_to_apicid); |
93 | 99 | ||
94 | /* -------------------------------------------------------------------------- | 100 | /* -------------------------------------------------------------------------- |
@@ -99,7 +105,7 @@ EXPORT_SYMBOL(x86_acpiid_to_apicid); | |||
99 | * The default interrupt routing model is PIC (8259). This gets | 105 | * The default interrupt routing model is PIC (8259). This gets |
100 | * overriden if IOAPICs are enumerated (below). | 106 | * overriden if IOAPICs are enumerated (below). |
101 | */ | 107 | */ |
102 | enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; | 108 | enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; |
103 | 109 | ||
104 | #ifdef CONFIG_X86_64 | 110 | #ifdef CONFIG_X86_64 |
105 | 111 | ||
@@ -107,7 +113,7 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; | |||
107 | char *__acpi_map_table(unsigned long phys_addr, unsigned long size) | 113 | char *__acpi_map_table(unsigned long phys_addr, unsigned long size) |
108 | { | 114 | { |
109 | if (!phys_addr || !size) | 115 | if (!phys_addr || !size) |
110 | return NULL; | 116 | return NULL; |
111 | 117 | ||
112 | if (phys_addr < (end_pfn_map << PAGE_SHIFT)) | 118 | if (phys_addr < (end_pfn_map << PAGE_SHIFT)) |
113 | return __va(phys_addr); | 119 | return __va(phys_addr); |
@@ -134,8 +140,8 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) | |||
134 | unsigned long base, offset, mapped_size; | 140 | unsigned long base, offset, mapped_size; |
135 | int idx; | 141 | int idx; |
136 | 142 | ||
137 | if (phys + size < 8*1024*1024) | 143 | if (phys + size < 8 * 1024 * 1024) |
138 | return __va(phys); | 144 | return __va(phys); |
139 | 145 | ||
140 | offset = phys & (PAGE_SIZE - 1); | 146 | offset = phys & (PAGE_SIZE - 1); |
141 | mapped_size = PAGE_SIZE - offset; | 147 | mapped_size = PAGE_SIZE - offset; |
@@ -154,7 +160,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) | |||
154 | mapped_size += PAGE_SIZE; | 160 | mapped_size += PAGE_SIZE; |
155 | } | 161 | } |
156 | 162 | ||
157 | return ((unsigned char *) base + offset); | 163 | return ((unsigned char *)base + offset); |
158 | } | 164 | } |
159 | #endif | 165 | #endif |
160 | 166 | ||
@@ -172,7 +178,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) | |||
172 | if (!phys_addr || !size) | 178 | if (!phys_addr || !size) |
173 | return -EINVAL; | 179 | return -EINVAL; |
174 | 180 | ||
175 | mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size); | 181 | mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size); |
176 | if (!mcfg) { | 182 | if (!mcfg) { |
177 | printk(KERN_WARNING PREFIX "Unable to map MCFG\n"); | 183 | printk(KERN_WARNING PREFIX "Unable to map MCFG\n"); |
178 | return -ENODEV; | 184 | return -ENODEV; |
@@ -209,20 +215,17 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) | |||
209 | 215 | ||
210 | return 0; | 216 | return 0; |
211 | } | 217 | } |
212 | #endif /* CONFIG_PCI_MMCONFIG */ | 218 | #endif /* CONFIG_PCI_MMCONFIG */ |
213 | 219 | ||
214 | #ifdef CONFIG_X86_LOCAL_APIC | 220 | #ifdef CONFIG_X86_LOCAL_APIC |
215 | static int __init | 221 | static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) |
216 | acpi_parse_madt ( | ||
217 | unsigned long phys_addr, | ||
218 | unsigned long size) | ||
219 | { | 222 | { |
220 | struct acpi_table_madt *madt = NULL; | 223 | struct acpi_table_madt *madt = NULL; |
221 | 224 | ||
222 | if (!phys_addr || !size) | 225 | if (!phys_addr || !size) |
223 | return -EINVAL; | 226 | return -EINVAL; |
224 | 227 | ||
225 | madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size); | 228 | madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size); |
226 | if (!madt) { | 229 | if (!madt) { |
227 | printk(KERN_WARNING PREFIX "Unable to map MADT\n"); | 230 | printk(KERN_WARNING PREFIX "Unable to map MADT\n"); |
228 | return -ENODEV; | 231 | return -ENODEV; |
@@ -232,22 +235,20 @@ acpi_parse_madt ( | |||
232 | acpi_lapic_addr = (u64) madt->lapic_address; | 235 | acpi_lapic_addr = (u64) madt->lapic_address; |
233 | 236 | ||
234 | printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", | 237 | printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", |
235 | madt->lapic_address); | 238 | madt->lapic_address); |
236 | } | 239 | } |
237 | 240 | ||
238 | acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); | 241 | acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); |
239 | 242 | ||
240 | return 0; | 243 | return 0; |
241 | } | 244 | } |
242 | 245 | ||
243 | |||
244 | static int __init | 246 | static int __init |
245 | acpi_parse_lapic ( | 247 | acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end) |
246 | acpi_table_entry_header *header, const unsigned long end) | ||
247 | { | 248 | { |
248 | struct acpi_table_lapic *processor = NULL; | 249 | struct acpi_table_lapic *processor = NULL; |
249 | 250 | ||
250 | processor = (struct acpi_table_lapic*) header; | 251 | processor = (struct acpi_table_lapic *)header; |
251 | 252 | ||
252 | if (BAD_MADT_ENTRY(processor, end)) | 253 | if (BAD_MADT_ENTRY(processor, end)) |
253 | return -EINVAL; | 254 | return -EINVAL; |
@@ -260,20 +261,19 @@ acpi_parse_lapic ( | |||
260 | 261 | ||
261 | x86_acpiid_to_apicid[processor->acpi_id] = processor->id; | 262 | x86_acpiid_to_apicid[processor->acpi_id] = processor->id; |
262 | 263 | ||
263 | mp_register_lapic ( | 264 | mp_register_lapic(processor->id, /* APIC ID */ |
264 | processor->id, /* APIC ID */ | 265 | processor->flags.enabled); /* Enabled? */ |
265 | processor->flags.enabled); /* Enabled? */ | ||
266 | 266 | ||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int __init | 270 | static int __init |
271 | acpi_parse_lapic_addr_ovr ( | 271 | acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, |
272 | acpi_table_entry_header *header, const unsigned long end) | 272 | const unsigned long end) |
273 | { | 273 | { |
274 | struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; | 274 | struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; |
275 | 275 | ||
276 | lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header; | 276 | lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header; |
277 | 277 | ||
278 | if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) | 278 | if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) |
279 | return -EINVAL; | 279 | return -EINVAL; |
@@ -284,12 +284,11 @@ acpi_parse_lapic_addr_ovr ( | |||
284 | } | 284 | } |
285 | 285 | ||
286 | static int __init | 286 | static int __init |
287 | acpi_parse_lapic_nmi ( | 287 | acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) |
288 | acpi_table_entry_header *header, const unsigned long end) | ||
289 | { | 288 | { |
290 | struct acpi_table_lapic_nmi *lapic_nmi = NULL; | 289 | struct acpi_table_lapic_nmi *lapic_nmi = NULL; |
291 | 290 | ||
292 | lapic_nmi = (struct acpi_table_lapic_nmi*) header; | 291 | lapic_nmi = (struct acpi_table_lapic_nmi *)header; |
293 | 292 | ||
294 | if (BAD_MADT_ENTRY(lapic_nmi, end)) | 293 | if (BAD_MADT_ENTRY(lapic_nmi, end)) |
295 | return -EINVAL; | 294 | return -EINVAL; |
@@ -302,37 +301,32 @@ acpi_parse_lapic_nmi ( | |||
302 | return 0; | 301 | return 0; |
303 | } | 302 | } |
304 | 303 | ||
305 | 304 | #endif /*CONFIG_X86_LOCAL_APIC */ | |
306 | #endif /*CONFIG_X86_LOCAL_APIC*/ | ||
307 | 305 | ||
308 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) | 306 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) |
309 | 307 | ||
310 | static int __init | 308 | static int __init |
311 | acpi_parse_ioapic ( | 309 | acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end) |
312 | acpi_table_entry_header *header, const unsigned long end) | ||
313 | { | 310 | { |
314 | struct acpi_table_ioapic *ioapic = NULL; | 311 | struct acpi_table_ioapic *ioapic = NULL; |
315 | 312 | ||
316 | ioapic = (struct acpi_table_ioapic*) header; | 313 | ioapic = (struct acpi_table_ioapic *)header; |
317 | 314 | ||
318 | if (BAD_MADT_ENTRY(ioapic, end)) | 315 | if (BAD_MADT_ENTRY(ioapic, end)) |
319 | return -EINVAL; | 316 | return -EINVAL; |
320 | 317 | ||
321 | acpi_table_print_madt_entry(header); | 318 | acpi_table_print_madt_entry(header); |
322 | 319 | ||
323 | mp_register_ioapic ( | 320 | mp_register_ioapic(ioapic->id, |
324 | ioapic->id, | 321 | ioapic->address, ioapic->global_irq_base); |
325 | ioapic->address, | 322 | |
326 | ioapic->global_irq_base); | ||
327 | |||
328 | return 0; | 323 | return 0; |
329 | } | 324 | } |
330 | 325 | ||
331 | /* | 326 | /* |
332 | * Parse Interrupt Source Override for the ACPI SCI | 327 | * Parse Interrupt Source Override for the ACPI SCI |
333 | */ | 328 | */ |
334 | static void | 329 | static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) |
335 | acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | ||
336 | { | 330 | { |
337 | if (trigger == 0) /* compatible SCI trigger is level */ | 331 | if (trigger == 0) /* compatible SCI trigger is level */ |
338 | trigger = 3; | 332 | trigger = 3; |
@@ -348,7 +342,7 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | |||
348 | polarity = acpi_sci_flags.polarity; | 342 | polarity = acpi_sci_flags.polarity; |
349 | 343 | ||
350 | /* | 344 | /* |
351 | * mp_config_acpi_legacy_irqs() already setup IRQs < 16 | 345 | * mp_config_acpi_legacy_irqs() already setup IRQs < 16 |
352 | * If GSI is < 16, this will update its flags, | 346 | * If GSI is < 16, this will update its flags, |
353 | * else it will create a new mp_irqs[] entry. | 347 | * else it will create a new mp_irqs[] entry. |
354 | */ | 348 | */ |
@@ -363,12 +357,12 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | |||
363 | } | 357 | } |
364 | 358 | ||
365 | static int __init | 359 | static int __init |
366 | acpi_parse_int_src_ovr ( | 360 | acpi_parse_int_src_ovr(acpi_table_entry_header * header, |
367 | acpi_table_entry_header *header, const unsigned long end) | 361 | const unsigned long end) |
368 | { | 362 | { |
369 | struct acpi_table_int_src_ovr *intsrc = NULL; | 363 | struct acpi_table_int_src_ovr *intsrc = NULL; |
370 | 364 | ||
371 | intsrc = (struct acpi_table_int_src_ovr*) header; | 365 | intsrc = (struct acpi_table_int_src_ovr *)header; |
372 | 366 | ||
373 | if (BAD_MADT_ENTRY(intsrc, end)) | 367 | if (BAD_MADT_ENTRY(intsrc, end)) |
374 | return -EINVAL; | 368 | return -EINVAL; |
@@ -377,33 +371,30 @@ acpi_parse_int_src_ovr ( | |||
377 | 371 | ||
378 | if (intsrc->bus_irq == acpi_fadt.sci_int) { | 372 | if (intsrc->bus_irq == acpi_fadt.sci_int) { |
379 | acpi_sci_ioapic_setup(intsrc->global_irq, | 373 | acpi_sci_ioapic_setup(intsrc->global_irq, |
380 | intsrc->flags.polarity, intsrc->flags.trigger); | 374 | intsrc->flags.polarity, |
375 | intsrc->flags.trigger); | ||
381 | return 0; | 376 | return 0; |
382 | } | 377 | } |
383 | 378 | ||
384 | if (acpi_skip_timer_override && | 379 | if (acpi_skip_timer_override && |
385 | intsrc->bus_irq == 0 && intsrc->global_irq == 2) { | 380 | intsrc->bus_irq == 0 && intsrc->global_irq == 2) { |
386 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); | 381 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); |
387 | return 0; | 382 | return 0; |
388 | } | 383 | } |
389 | 384 | ||
390 | mp_override_legacy_irq ( | 385 | mp_override_legacy_irq(intsrc->bus_irq, |
391 | intsrc->bus_irq, | 386 | intsrc->flags.polarity, |
392 | intsrc->flags.polarity, | 387 | intsrc->flags.trigger, intsrc->global_irq); |
393 | intsrc->flags.trigger, | ||
394 | intsrc->global_irq); | ||
395 | 388 | ||
396 | return 0; | 389 | return 0; |
397 | } | 390 | } |
398 | 391 | ||
399 | |||
400 | static int __init | 392 | static int __init |
401 | acpi_parse_nmi_src ( | 393 | acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) |
402 | acpi_table_entry_header *header, const unsigned long end) | ||
403 | { | 394 | { |
404 | struct acpi_table_nmi_src *nmi_src = NULL; | 395 | struct acpi_table_nmi_src *nmi_src = NULL; |
405 | 396 | ||
406 | nmi_src = (struct acpi_table_nmi_src*) header; | 397 | nmi_src = (struct acpi_table_nmi_src *)header; |
407 | 398 | ||
408 | if (BAD_MADT_ENTRY(nmi_src, end)) | 399 | if (BAD_MADT_ENTRY(nmi_src, end)) |
409 | return -EINVAL; | 400 | return -EINVAL; |
@@ -415,7 +406,7 @@ acpi_parse_nmi_src ( | |||
415 | return 0; | 406 | return 0; |
416 | } | 407 | } |
417 | 408 | ||
418 | #endif /* CONFIG_X86_IO_APIC */ | 409 | #endif /* CONFIG_X86_IO_APIC */ |
419 | 410 | ||
420 | #ifdef CONFIG_ACPI_BUS | 411 | #ifdef CONFIG_ACPI_BUS |
421 | 412 | ||
@@ -433,8 +424,7 @@ acpi_parse_nmi_src ( | |||
433 | * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0) | 424 | * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0) |
434 | */ | 425 | */ |
435 | 426 | ||
436 | void __init | 427 | void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) |
437 | acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | ||
438 | { | 428 | { |
439 | unsigned int mask = 1 << irq; | 429 | unsigned int mask = 1 << irq; |
440 | unsigned int old, new; | 430 | unsigned int old, new; |
@@ -454,10 +444,10 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | |||
454 | * routing tables.. | 444 | * routing tables.. |
455 | */ | 445 | */ |
456 | switch (trigger) { | 446 | switch (trigger) { |
457 | case 1: /* Edge - clear */ | 447 | case 1: /* Edge - clear */ |
458 | new &= ~mask; | 448 | new &= ~mask; |
459 | break; | 449 | break; |
460 | case 3: /* Level - set */ | 450 | case 3: /* Level - set */ |
461 | new |= mask; | 451 | new |= mask; |
462 | break; | 452 | break; |
463 | } | 453 | } |
@@ -470,14 +460,13 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | |||
470 | outb(new >> 8, 0x4d1); | 460 | outb(new >> 8, 0x4d1); |
471 | } | 461 | } |
472 | 462 | ||
473 | 463 | #endif /* CONFIG_ACPI_BUS */ | |
474 | #endif /* CONFIG_ACPI_BUS */ | ||
475 | 464 | ||
476 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) | 465 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) |
477 | { | 466 | { |
478 | #ifdef CONFIG_X86_IO_APIC | 467 | #ifdef CONFIG_X86_IO_APIC |
479 | if (use_pci_vector() && !platform_legacy_irq(gsi)) | 468 | if (use_pci_vector() && !platform_legacy_irq(gsi)) |
480 | *irq = IO_APIC_VECTOR(gsi); | 469 | *irq = IO_APIC_VECTOR(gsi); |
481 | else | 470 | else |
482 | #endif | 471 | #endif |
483 | *irq = gsi; | 472 | *irq = gsi; |
@@ -501,7 +490,7 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) | |||
501 | extern void eisa_set_level_irq(unsigned int irq); | 490 | extern void eisa_set_level_irq(unsigned int irq); |
502 | 491 | ||
503 | if (edge_level == ACPI_LEVEL_SENSITIVE) | 492 | if (edge_level == ACPI_LEVEL_SENSITIVE) |
504 | eisa_set_level_irq(gsi); | 493 | eisa_set_level_irq(gsi); |
505 | } | 494 | } |
506 | #endif | 495 | #endif |
507 | 496 | ||
@@ -513,60 +502,58 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) | |||
513 | acpi_gsi_to_irq(plat_gsi, &irq); | 502 | acpi_gsi_to_irq(plat_gsi, &irq); |
514 | return irq; | 503 | return irq; |
515 | } | 504 | } |
505 | |||
516 | EXPORT_SYMBOL(acpi_register_gsi); | 506 | EXPORT_SYMBOL(acpi_register_gsi); |
517 | 507 | ||
518 | /* | 508 | /* |
519 | * ACPI based hotplug support for CPU | 509 | * ACPI based hotplug support for CPU |
520 | */ | 510 | */ |
521 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 511 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
522 | int | 512 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) |
523 | acpi_map_lsapic(acpi_handle handle, int *pcpu) | ||
524 | { | 513 | { |
525 | /* TBD */ | 514 | /* TBD */ |
526 | return -EINVAL; | 515 | return -EINVAL; |
527 | } | 516 | } |
528 | EXPORT_SYMBOL(acpi_map_lsapic); | ||
529 | 517 | ||
518 | EXPORT_SYMBOL(acpi_map_lsapic); | ||
530 | 519 | ||
531 | int | 520 | int acpi_unmap_lsapic(int cpu) |
532 | acpi_unmap_lsapic(int cpu) | ||
533 | { | 521 | { |
534 | /* TBD */ | 522 | /* TBD */ |
535 | return -EINVAL; | 523 | return -EINVAL; |
536 | } | 524 | } |
525 | |||
537 | EXPORT_SYMBOL(acpi_unmap_lsapic); | 526 | EXPORT_SYMBOL(acpi_unmap_lsapic); |
538 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 527 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
539 | 528 | ||
540 | int | 529 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) |
541 | acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) | ||
542 | { | 530 | { |
543 | /* TBD */ | 531 | /* TBD */ |
544 | return -EINVAL; | 532 | return -EINVAL; |
545 | } | 533 | } |
534 | |||
546 | EXPORT_SYMBOL(acpi_register_ioapic); | 535 | EXPORT_SYMBOL(acpi_register_ioapic); |
547 | 536 | ||
548 | int | 537 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) |
549 | acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) | ||
550 | { | 538 | { |
551 | /* TBD */ | 539 | /* TBD */ |
552 | return -EINVAL; | 540 | return -EINVAL; |
553 | } | 541 | } |
542 | |||
554 | EXPORT_SYMBOL(acpi_unregister_ioapic); | 543 | EXPORT_SYMBOL(acpi_unregister_ioapic); |
555 | 544 | ||
556 | static unsigned long __init | 545 | static unsigned long __init |
557 | acpi_scan_rsdp ( | 546 | acpi_scan_rsdp(unsigned long start, unsigned long length) |
558 | unsigned long start, | ||
559 | unsigned long length) | ||
560 | { | 547 | { |
561 | unsigned long offset = 0; | 548 | unsigned long offset = 0; |
562 | unsigned long sig_len = sizeof("RSD PTR ") - 1; | 549 | unsigned long sig_len = sizeof("RSD PTR ") - 1; |
563 | 550 | ||
564 | /* | 551 | /* |
565 | * Scan all 16-byte boundaries of the physical memory region for the | 552 | * Scan all 16-byte boundaries of the physical memory region for the |
566 | * RSDP signature. | 553 | * RSDP signature. |
567 | */ | 554 | */ |
568 | for (offset = 0; offset < length; offset += 16) { | 555 | for (offset = 0; offset < length; offset += 16) { |
569 | if (strncmp((char *) (start + offset), "RSD PTR ", sig_len)) | 556 | if (strncmp((char *)(start + offset), "RSD PTR ", sig_len)) |
570 | continue; | 557 | continue; |
571 | return (start + offset); | 558 | return (start + offset); |
572 | } | 559 | } |
@@ -579,20 +566,19 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size) | |||
579 | struct acpi_table_sbf *sb; | 566 | struct acpi_table_sbf *sb; |
580 | 567 | ||
581 | if (!phys_addr || !size) | 568 | if (!phys_addr || !size) |
582 | return -EINVAL; | 569 | return -EINVAL; |
583 | 570 | ||
584 | sb = (struct acpi_table_sbf *) __acpi_map_table(phys_addr, size); | 571 | sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size); |
585 | if (!sb) { | 572 | if (!sb) { |
586 | printk(KERN_WARNING PREFIX "Unable to map SBF\n"); | 573 | printk(KERN_WARNING PREFIX "Unable to map SBF\n"); |
587 | return -ENODEV; | 574 | return -ENODEV; |
588 | } | 575 | } |
589 | 576 | ||
590 | sbf_port = sb->sbf_cmos; /* Save CMOS port */ | 577 | sbf_port = sb->sbf_cmos; /* Save CMOS port */ |
591 | 578 | ||
592 | return 0; | 579 | return 0; |
593 | } | 580 | } |
594 | 581 | ||
595 | |||
596 | #ifdef CONFIG_HPET_TIMER | 582 | #ifdef CONFIG_HPET_TIMER |
597 | 583 | ||
598 | static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | 584 | static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) |
@@ -602,7 +588,7 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | |||
602 | if (!phys || !size) | 588 | if (!phys || !size) |
603 | return -EINVAL; | 589 | return -EINVAL; |
604 | 590 | ||
605 | hpet_tbl = (struct acpi_table_hpet *) __acpi_map_table(phys, size); | 591 | hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size); |
606 | if (!hpet_tbl) { | 592 | if (!hpet_tbl) { |
607 | printk(KERN_WARNING PREFIX "Unable to map HPET\n"); | 593 | printk(KERN_WARNING PREFIX "Unable to map HPET\n"); |
608 | return -ENODEV; | 594 | return -ENODEV; |
@@ -613,22 +599,21 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | |||
613 | "memory.\n"); | 599 | "memory.\n"); |
614 | return -1; | 600 | return -1; |
615 | } | 601 | } |
616 | |||
617 | #ifdef CONFIG_X86_64 | 602 | #ifdef CONFIG_X86_64 |
618 | vxtime.hpet_address = hpet_tbl->addr.addrl | | 603 | vxtime.hpet_address = hpet_tbl->addr.addrl | |
619 | ((long) hpet_tbl->addr.addrh << 32); | 604 | ((long)hpet_tbl->addr.addrh << 32); |
620 | 605 | ||
621 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", | 606 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", |
622 | hpet_tbl->id, vxtime.hpet_address); | 607 | hpet_tbl->id, vxtime.hpet_address); |
623 | #else /* X86 */ | 608 | #else /* X86 */ |
624 | { | 609 | { |
625 | extern unsigned long hpet_address; | 610 | extern unsigned long hpet_address; |
626 | 611 | ||
627 | hpet_address = hpet_tbl->addr.addrl; | 612 | hpet_address = hpet_tbl->addr.addrl; |
628 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", | 613 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", |
629 | hpet_tbl->id, hpet_address); | 614 | hpet_tbl->id, hpet_address); |
630 | } | 615 | } |
631 | #endif /* X86 */ | 616 | #endif /* X86 */ |
632 | 617 | ||
633 | return 0; | 618 | return 0; |
634 | } | 619 | } |
@@ -644,12 +629,11 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) | |||
644 | { | 629 | { |
645 | struct fadt_descriptor_rev2 *fadt = NULL; | 630 | struct fadt_descriptor_rev2 *fadt = NULL; |
646 | 631 | ||
647 | fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size); | 632 | fadt = (struct fadt_descriptor_rev2 *)__acpi_map_table(phys, size); |
648 | if(!fadt) { | 633 | if (!fadt) { |
649 | printk(KERN_WARNING PREFIX "Unable to map FADT\n"); | 634 | printk(KERN_WARNING PREFIX "Unable to map FADT\n"); |
650 | return 0; | 635 | return 0; |
651 | } | 636 | } |
652 | |||
653 | #ifdef CONFIG_ACPI_INTERPRETER | 637 | #ifdef CONFIG_ACPI_INTERPRETER |
654 | /* initialize sci_int early for INT_SRC_OVR MADT parsing */ | 638 | /* initialize sci_int early for INT_SRC_OVR MADT parsing */ |
655 | acpi_fadt.sci_int = fadt->sci_int; | 639 | acpi_fadt.sci_int = fadt->sci_int; |
@@ -658,14 +642,16 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) | |||
658 | #ifdef CONFIG_ACPI_BUS | 642 | #ifdef CONFIG_ACPI_BUS |
659 | /* initialize rev and apic_phys_dest_mode for x86_64 genapic */ | 643 | /* initialize rev and apic_phys_dest_mode for x86_64 genapic */ |
660 | acpi_fadt.revision = fadt->revision; | 644 | acpi_fadt.revision = fadt->revision; |
661 | acpi_fadt.force_apic_physical_destination_mode = fadt->force_apic_physical_destination_mode; | 645 | acpi_fadt.force_apic_physical_destination_mode = |
646 | fadt->force_apic_physical_destination_mode; | ||
662 | #endif | 647 | #endif |
663 | 648 | ||
664 | #ifdef CONFIG_X86_PM_TIMER | 649 | #ifdef CONFIG_X86_PM_TIMER |
665 | /* detect the location of the ACPI PM Timer */ | 650 | /* detect the location of the ACPI PM Timer */ |
666 | if (fadt->revision >= FADT2_REVISION_ID) { | 651 | if (fadt->revision >= FADT2_REVISION_ID) { |
667 | /* FADT rev. 2 */ | 652 | /* FADT rev. 2 */ |
668 | if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO) | 653 | if (fadt->xpm_tmr_blk.address_space_id != |
654 | ACPI_ADR_SPACE_SYSTEM_IO) | ||
669 | return 0; | 655 | return 0; |
670 | 656 | ||
671 | pmtmr_ioport = fadt->xpm_tmr_blk.address; | 657 | pmtmr_ioport = fadt->xpm_tmr_blk.address; |
@@ -674,16 +660,15 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) | |||
674 | pmtmr_ioport = fadt->V1_pm_tmr_blk; | 660 | pmtmr_ioport = fadt->V1_pm_tmr_blk; |
675 | } | 661 | } |
676 | if (pmtmr_ioport) | 662 | if (pmtmr_ioport) |
677 | printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport); | 663 | printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", |
664 | pmtmr_ioport); | ||
678 | #endif | 665 | #endif |
679 | return 0; | 666 | return 0; |
680 | } | 667 | } |
681 | 668 | ||
682 | 669 | unsigned long __init acpi_find_rsdp(void) | |
683 | unsigned long __init | ||
684 | acpi_find_rsdp (void) | ||
685 | { | 670 | { |
686 | unsigned long rsdp_phys = 0; | 671 | unsigned long rsdp_phys = 0; |
687 | 672 | ||
688 | if (efi_enabled) { | 673 | if (efi_enabled) { |
689 | if (efi.acpi20) | 674 | if (efi.acpi20) |
@@ -695,9 +680,9 @@ acpi_find_rsdp (void) | |||
695 | * Scan memory looking for the RSDP signature. First search EBDA (low | 680 | * Scan memory looking for the RSDP signature. First search EBDA (low |
696 | * memory) paragraphs and then search upper memory (E0000-FFFFF). | 681 | * memory) paragraphs and then search upper memory (E0000-FFFFF). |
697 | */ | 682 | */ |
698 | rsdp_phys = acpi_scan_rsdp (0, 0x400); | 683 | rsdp_phys = acpi_scan_rsdp(0, 0x400); |
699 | if (!rsdp_phys) | 684 | if (!rsdp_phys) |
700 | rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000); | 685 | rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000); |
701 | 686 | ||
702 | return rsdp_phys; | 687 | return rsdp_phys; |
703 | } | 688 | } |
@@ -707,8 +692,7 @@ acpi_find_rsdp (void) | |||
707 | * Parse LAPIC entries in MADT | 692 | * Parse LAPIC entries in MADT |
708 | * returns 0 on success, < 0 on error | 693 | * returns 0 on success, < 0 on error |
709 | */ | 694 | */ |
710 | static int __init | 695 | static int __init acpi_parse_madt_lapic_entries(void) |
711 | acpi_parse_madt_lapic_entries(void) | ||
712 | { | 696 | { |
713 | int count; | 697 | int count; |
714 | 698 | ||
@@ -717,28 +701,31 @@ acpi_parse_madt_lapic_entries(void) | |||
717 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). | 701 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). |
718 | */ | 702 | */ |
719 | 703 | ||
720 | count = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0); | 704 | count = |
705 | acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, | ||
706 | acpi_parse_lapic_addr_ovr, 0); | ||
721 | if (count < 0) { | 707 | if (count < 0) { |
722 | printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); | 708 | printk(KERN_ERR PREFIX |
709 | "Error parsing LAPIC address override entry\n"); | ||
723 | return count; | 710 | return count; |
724 | } | 711 | } |
725 | 712 | ||
726 | mp_register_lapic_address(acpi_lapic_addr); | 713 | mp_register_lapic_address(acpi_lapic_addr); |
727 | 714 | ||
728 | count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic, | 715 | count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic, |
729 | MAX_APICS); | 716 | MAX_APICS); |
730 | if (!count) { | 717 | if (!count) { |
731 | printk(KERN_ERR PREFIX "No LAPIC entries present\n"); | 718 | printk(KERN_ERR PREFIX "No LAPIC entries present\n"); |
732 | /* TBD: Cleanup to allow fallback to MPS */ | 719 | /* TBD: Cleanup to allow fallback to MPS */ |
733 | return -ENODEV; | 720 | return -ENODEV; |
734 | } | 721 | } else if (count < 0) { |
735 | else if (count < 0) { | ||
736 | printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n"); | 722 | printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n"); |
737 | /* TBD: Cleanup to allow fallback to MPS */ | 723 | /* TBD: Cleanup to allow fallback to MPS */ |
738 | return count; | 724 | return count; |
739 | } | 725 | } |
740 | 726 | ||
741 | count = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0); | 727 | count = |
728 | acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0); | ||
742 | if (count < 0) { | 729 | if (count < 0) { |
743 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 730 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
744 | /* TBD: Cleanup to allow fallback to MPS */ | 731 | /* TBD: Cleanup to allow fallback to MPS */ |
@@ -746,15 +733,14 @@ acpi_parse_madt_lapic_entries(void) | |||
746 | } | 733 | } |
747 | return 0; | 734 | return 0; |
748 | } | 735 | } |
749 | #endif /* CONFIG_X86_LOCAL_APIC */ | 736 | #endif /* CONFIG_X86_LOCAL_APIC */ |
750 | 737 | ||
751 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) | 738 | #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER) |
752 | /* | 739 | /* |
753 | * Parse IOAPIC related entries in MADT | 740 | * Parse IOAPIC related entries in MADT |
754 | * returns 0 on success, < 0 on error | 741 | * returns 0 on success, < 0 on error |
755 | */ | 742 | */ |
756 | static int __init | 743 | static int __init acpi_parse_madt_ioapic_entries(void) |
757 | acpi_parse_madt_ioapic_entries(void) | ||
758 | { | 744 | { |
759 | int count; | 745 | int count; |
760 | 746 | ||
@@ -766,30 +752,34 @@ acpi_parse_madt_ioapic_entries(void) | |||
766 | */ | 752 | */ |
767 | if (acpi_disabled || acpi_noirq) { | 753 | if (acpi_disabled || acpi_noirq) { |
768 | return -ENODEV; | 754 | return -ENODEV; |
769 | } | 755 | } |
770 | 756 | ||
771 | /* | 757 | /* |
772 | * if "noapic" boot option, don't look for IO-APICs | 758 | * if "noapic" boot option, don't look for IO-APICs |
773 | */ | 759 | */ |
774 | if (skip_ioapic_setup) { | 760 | if (skip_ioapic_setup) { |
775 | printk(KERN_INFO PREFIX "Skipping IOAPIC probe " | 761 | printk(KERN_INFO PREFIX "Skipping IOAPIC probe " |
776 | "due to 'noapic' option.\n"); | 762 | "due to 'noapic' option.\n"); |
777 | return -ENODEV; | 763 | return -ENODEV; |
778 | } | 764 | } |
779 | 765 | ||
780 | count = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS); | 766 | count = |
767 | acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, | ||
768 | MAX_IO_APICS); | ||
781 | if (!count) { | 769 | if (!count) { |
782 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); | 770 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); |
783 | return -ENODEV; | 771 | return -ENODEV; |
784 | } | 772 | } else if (count < 0) { |
785 | else if (count < 0) { | ||
786 | printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n"); | 773 | printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n"); |
787 | return count; | 774 | return count; |
788 | } | 775 | } |
789 | 776 | ||
790 | count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS); | 777 | count = |
778 | acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, | ||
779 | NR_IRQ_VECTORS); | ||
791 | if (count < 0) { | 780 | if (count < 0) { |
792 | printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); | 781 | printk(KERN_ERR PREFIX |
782 | "Error parsing interrupt source overrides entry\n"); | ||
793 | /* TBD: Cleanup to allow fallback to MPS */ | 783 | /* TBD: Cleanup to allow fallback to MPS */ |
794 | return count; | 784 | return count; |
795 | } | 785 | } |
@@ -804,7 +794,9 @@ acpi_parse_madt_ioapic_entries(void) | |||
804 | /* Fill in identity legacy mapings where no override */ | 794 | /* Fill in identity legacy mapings where no override */ |
805 | mp_config_acpi_legacy_irqs(); | 795 | mp_config_acpi_legacy_irqs(); |
806 | 796 | ||
807 | count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS); | 797 | count = |
798 | acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, | ||
799 | NR_IRQ_VECTORS); | ||
808 | if (count < 0) { | 800 | if (count < 0) { |
809 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); | 801 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); |
810 | /* TBD: Cleanup to allow fallback to MPS */ | 802 | /* TBD: Cleanup to allow fallback to MPS */ |
@@ -818,11 +810,9 @@ static inline int acpi_parse_madt_ioapic_entries(void) | |||
818 | { | 810 | { |
819 | return -1; | 811 | return -1; |
820 | } | 812 | } |
821 | #endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */ | 813 | #endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */ |
822 | |||
823 | 814 | ||
824 | static void __init | 815 | static void __init acpi_process_madt(void) |
825 | acpi_process_madt(void) | ||
826 | { | 816 | { |
827 | #ifdef CONFIG_X86_LOCAL_APIC | 817 | #ifdef CONFIG_X86_LOCAL_APIC |
828 | int count, error; | 818 | int count, error; |
@@ -854,7 +844,8 @@ acpi_process_madt(void) | |||
854 | /* | 844 | /* |
855 | * Dell Precision Workstation 410, 610 come here. | 845 | * Dell Precision Workstation 410, 610 come here. |
856 | */ | 846 | */ |
857 | printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n"); | 847 | printk(KERN_ERR PREFIX |
848 | "Invalid BIOS MADT, disabling ACPI\n"); | ||
858 | disable_acpi(); | 849 | disable_acpi(); |
859 | } | 850 | } |
860 | } | 851 | } |
@@ -891,7 +882,7 @@ static int __init disable_acpi_pci(struct dmi_system_id *d) | |||
891 | static int __init dmi_disable_acpi(struct dmi_system_id *d) | 882 | static int __init dmi_disable_acpi(struct dmi_system_id *d) |
892 | { | 883 | { |
893 | if (!acpi_force) { | 884 | if (!acpi_force) { |
894 | printk(KERN_NOTICE "%s detected: acpi off\n",d->ident); | 885 | printk(KERN_NOTICE "%s detected: acpi off\n", d->ident); |
895 | disable_acpi(); | 886 | disable_acpi(); |
896 | } else { | 887 | } else { |
897 | printk(KERN_NOTICE | 888 | printk(KERN_NOTICE |
@@ -906,7 +897,8 @@ static int __init dmi_disable_acpi(struct dmi_system_id *d) | |||
906 | static int __init force_acpi_ht(struct dmi_system_id *d) | 897 | static int __init force_acpi_ht(struct dmi_system_id *d) |
907 | { | 898 | { |
908 | if (!acpi_force) { | 899 | if (!acpi_force) { |
909 | printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident); | 900 | printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", |
901 | d->ident); | ||
910 | disable_acpi(); | 902 | disable_acpi(); |
911 | acpi_ht = 1; | 903 | acpi_ht = 1; |
912 | } else { | 904 | } else { |
@@ -925,155 +917,157 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
925 | * Boxes that need ACPI disabled | 917 | * Boxes that need ACPI disabled |
926 | */ | 918 | */ |
927 | { | 919 | { |
928 | .callback = dmi_disable_acpi, | 920 | .callback = dmi_disable_acpi, |
929 | .ident = "IBM Thinkpad", | 921 | .ident = "IBM Thinkpad", |
930 | .matches = { | 922 | .matches = { |
931 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | 923 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), |
932 | DMI_MATCH(DMI_BOARD_NAME, "2629H1G"), | 924 | DMI_MATCH(DMI_BOARD_NAME, "2629H1G"), |
933 | }, | 925 | }, |
934 | }, | 926 | }, |
935 | 927 | ||
936 | /* | 928 | /* |
937 | * Boxes that need acpi=ht | 929 | * Boxes that need acpi=ht |
938 | */ | 930 | */ |
939 | { | 931 | { |
940 | .callback = force_acpi_ht, | 932 | .callback = force_acpi_ht, |
941 | .ident = "FSC Primergy T850", | 933 | .ident = "FSC Primergy T850", |
942 | .matches = { | 934 | .matches = { |
943 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | 935 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), |
944 | DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), | 936 | DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), |
945 | }, | 937 | }, |
946 | }, | 938 | }, |
947 | { | 939 | { |
948 | .callback = force_acpi_ht, | 940 | .callback = force_acpi_ht, |
949 | .ident = "DELL GX240", | 941 | .ident = "DELL GX240", |
950 | .matches = { | 942 | .matches = { |
951 | DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"), | 943 | DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"), |
952 | DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"), | 944 | DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"), |
953 | }, | 945 | }, |
954 | }, | 946 | }, |
955 | { | 947 | { |
956 | .callback = force_acpi_ht, | 948 | .callback = force_acpi_ht, |
957 | .ident = "HP VISUALIZE NT Workstation", | 949 | .ident = "HP VISUALIZE NT Workstation", |
958 | .matches = { | 950 | .matches = { |
959 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | 951 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
960 | DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), | 952 | DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"), |
961 | }, | 953 | }, |
962 | }, | 954 | }, |
963 | { | 955 | { |
964 | .callback = force_acpi_ht, | 956 | .callback = force_acpi_ht, |
965 | .ident = "Compaq Workstation W8000", | 957 | .ident = "Compaq Workstation W8000", |
966 | .matches = { | 958 | .matches = { |
967 | DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), | 959 | DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), |
968 | DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), | 960 | DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"), |
969 | }, | 961 | }, |
970 | }, | 962 | }, |
971 | { | 963 | { |
972 | .callback = force_acpi_ht, | 964 | .callback = force_acpi_ht, |
973 | .ident = "ASUS P4B266", | 965 | .ident = "ASUS P4B266", |
974 | .matches = { | 966 | .matches = { |
975 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | 967 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), |
976 | DMI_MATCH(DMI_BOARD_NAME, "P4B266"), | 968 | DMI_MATCH(DMI_BOARD_NAME, "P4B266"), |
977 | }, | 969 | }, |
978 | }, | 970 | }, |
979 | { | 971 | { |
980 | .callback = force_acpi_ht, | 972 | .callback = force_acpi_ht, |
981 | .ident = "ASUS P2B-DS", | 973 | .ident = "ASUS P2B-DS", |
982 | .matches = { | 974 | .matches = { |
983 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | 975 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), |
984 | DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"), | 976 | DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"), |
985 | }, | 977 | }, |
986 | }, | 978 | }, |
987 | { | 979 | { |
988 | .callback = force_acpi_ht, | 980 | .callback = force_acpi_ht, |
989 | .ident = "ASUS CUR-DLS", | 981 | .ident = "ASUS CUR-DLS", |
990 | .matches = { | 982 | .matches = { |
991 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | 983 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), |
992 | DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"), | 984 | DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"), |
993 | }, | 985 | }, |
994 | }, | 986 | }, |
995 | { | 987 | { |
996 | .callback = force_acpi_ht, | 988 | .callback = force_acpi_ht, |
997 | .ident = "ABIT i440BX-W83977", | 989 | .ident = "ABIT i440BX-W83977", |
998 | .matches = { | 990 | .matches = { |
999 | DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"), | 991 | DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"), |
1000 | DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), | 992 | DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"), |
1001 | }, | 993 | }, |
1002 | }, | 994 | }, |
1003 | { | 995 | { |
1004 | .callback = force_acpi_ht, | 996 | .callback = force_acpi_ht, |
1005 | .ident = "IBM Bladecenter", | 997 | .ident = "IBM Bladecenter", |
1006 | .matches = { | 998 | .matches = { |
1007 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | 999 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), |
1008 | DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"), | 1000 | DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"), |
1009 | }, | 1001 | }, |
1010 | }, | 1002 | }, |
1011 | { | 1003 | { |
1012 | .callback = force_acpi_ht, | 1004 | .callback = force_acpi_ht, |
1013 | .ident = "IBM eServer xSeries 360", | 1005 | .ident = "IBM eServer xSeries 360", |
1014 | .matches = { | 1006 | .matches = { |
1015 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | 1007 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), |
1016 | DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"), | 1008 | DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"), |
1017 | }, | 1009 | }, |
1018 | }, | 1010 | }, |
1019 | { | 1011 | { |
1020 | .callback = force_acpi_ht, | 1012 | .callback = force_acpi_ht, |
1021 | .ident = "IBM eserver xSeries 330", | 1013 | .ident = "IBM eserver xSeries 330", |
1022 | .matches = { | 1014 | .matches = { |
1023 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | 1015 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), |
1024 | DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"), | 1016 | DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"), |
1025 | }, | 1017 | }, |
1026 | }, | 1018 | }, |
1027 | { | 1019 | { |
1028 | .callback = force_acpi_ht, | 1020 | .callback = force_acpi_ht, |
1029 | .ident = "IBM eserver xSeries 440", | 1021 | .ident = "IBM eserver xSeries 440", |
1030 | .matches = { | 1022 | .matches = { |
1031 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), | 1023 | DMI_MATCH(DMI_BOARD_VENDOR, "IBM"), |
1032 | DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), | 1024 | DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"), |
1033 | }, | 1025 | }, |
1034 | }, | 1026 | }, |
1035 | 1027 | ||
1036 | #ifdef CONFIG_ACPI_PCI | 1028 | #ifdef CONFIG_ACPI_PCI |
1037 | /* | 1029 | /* |
1038 | * Boxes that need ACPI PCI IRQ routing disabled | 1030 | * Boxes that need ACPI PCI IRQ routing disabled |
1039 | */ | 1031 | */ |
1040 | { | 1032 | { |
1041 | .callback = disable_acpi_irq, | 1033 | .callback = disable_acpi_irq, |
1042 | .ident = "ASUS A7V", | 1034 | .ident = "ASUS A7V", |
1043 | .matches = { | 1035 | .matches = { |
1044 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), | 1036 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"), |
1045 | DMI_MATCH(DMI_BOARD_NAME, "<A7V>"), | 1037 | DMI_MATCH(DMI_BOARD_NAME, "<A7V>"), |
1046 | /* newer BIOS, Revision 1011, does work */ | 1038 | /* newer BIOS, Revision 1011, does work */ |
1047 | DMI_MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"), | 1039 | DMI_MATCH(DMI_BIOS_VERSION, |
1048 | }, | 1040 | "ASUS A7V ACPI BIOS Revision 1007"), |
1049 | }, | 1041 | }, |
1042 | }, | ||
1050 | 1043 | ||
1051 | /* | 1044 | /* |
1052 | * Boxes that need ACPI PCI IRQ routing and PCI scan disabled | 1045 | * Boxes that need ACPI PCI IRQ routing and PCI scan disabled |
1053 | */ | 1046 | */ |
1054 | { /* _BBN 0 bug */ | 1047 | { /* _BBN 0 bug */ |
1055 | .callback = disable_acpi_pci, | 1048 | .callback = disable_acpi_pci, |
1056 | .ident = "ASUS PR-DLS", | 1049 | .ident = "ASUS PR-DLS", |
1057 | .matches = { | 1050 | .matches = { |
1058 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), | 1051 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), |
1059 | DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"), | 1052 | DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"), |
1060 | DMI_MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS Revision 1010"), | 1053 | DMI_MATCH(DMI_BIOS_VERSION, |
1061 | DMI_MATCH(DMI_BIOS_DATE, "03/21/2003") | 1054 | "ASUS PR-DLS ACPI BIOS Revision 1010"), |
1062 | }, | 1055 | DMI_MATCH(DMI_BIOS_DATE, "03/21/2003") |
1063 | }, | 1056 | }, |
1057 | }, | ||
1064 | { | 1058 | { |
1065 | .callback = disable_acpi_pci, | 1059 | .callback = disable_acpi_pci, |
1066 | .ident = "Acer TravelMate 36x Laptop", | 1060 | .ident = "Acer TravelMate 36x Laptop", |
1067 | .matches = { | 1061 | .matches = { |
1068 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | 1062 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
1069 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), | 1063 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), |
1070 | }, | 1064 | }, |
1071 | }, | 1065 | }, |
1072 | #endif | 1066 | #endif |
1073 | { } | 1067 | {} |
1074 | }; | 1068 | }; |
1075 | 1069 | ||
1076 | #endif /* __i386__ */ | 1070 | #endif /* __i386__ */ |
1077 | 1071 | ||
1078 | /* | 1072 | /* |
1079 | * acpi_boot_table_init() and acpi_boot_init() | 1073 | * acpi_boot_table_init() and acpi_boot_init() |
@@ -1098,8 +1092,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
1098 | * !0: failure | 1092 | * !0: failure |
1099 | */ | 1093 | */ |
1100 | 1094 | ||
1101 | int __init | 1095 | int __init acpi_boot_table_init(void) |
1102 | acpi_boot_table_init(void) | ||
1103 | { | 1096 | { |
1104 | int error; | 1097 | int error; |
1105 | 1098 | ||
@@ -1112,7 +1105,7 @@ acpi_boot_table_init(void) | |||
1112 | * One exception: acpi=ht continues far enough to enumerate LAPICs | 1105 | * One exception: acpi=ht continues far enough to enumerate LAPICs |
1113 | */ | 1106 | */ |
1114 | if (acpi_disabled && !acpi_ht) | 1107 | if (acpi_disabled && !acpi_ht) |
1115 | return 1; | 1108 | return 1; |
1116 | 1109 | ||
1117 | /* | 1110 | /* |
1118 | * Initialize the ACPI boot-time table parser. | 1111 | * Initialize the ACPI boot-time table parser. |
@@ -1122,7 +1115,6 @@ acpi_boot_table_init(void) | |||
1122 | disable_acpi(); | 1115 | disable_acpi(); |
1123 | return error; | 1116 | return error; |
1124 | } | 1117 | } |
1125 | |||
1126 | #ifdef __i386__ | 1118 | #ifdef __i386__ |
1127 | check_acpi_pci(); | 1119 | check_acpi_pci(); |
1128 | #endif | 1120 | #endif |
@@ -1146,7 +1138,6 @@ acpi_boot_table_init(void) | |||
1146 | return 0; | 1138 | return 0; |
1147 | } | 1139 | } |
1148 | 1140 | ||
1149 | |||
1150 | int __init acpi_boot_init(void) | 1141 | int __init acpi_boot_init(void) |
1151 | { | 1142 | { |
1152 | /* | 1143 | /* |
@@ -1154,7 +1145,7 @@ int __init acpi_boot_init(void) | |||
1154 | * One exception: acpi=ht continues far enough to enumerate LAPICs | 1145 | * One exception: acpi=ht continues far enough to enumerate LAPICs |
1155 | */ | 1146 | */ |
1156 | if (acpi_disabled && !acpi_ht) | 1147 | if (acpi_disabled && !acpi_ht) |
1157 | return 1; | 1148 | return 1; |
1158 | 1149 | ||
1159 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); | 1150 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); |
1160 | 1151 | ||
@@ -1172,4 +1163,3 @@ int __init acpi_boot_init(void) | |||
1172 | 1163 | ||
1173 | return 0; | 1164 | return 0; |
1174 | } | 1165 | } |
1175 | |||
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index 726a5ca4b165..f1b9d2a46dab 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c | |||
@@ -8,44 +8,44 @@ | |||
8 | #include <asm/pci-direct.h> | 8 | #include <asm/pci-direct.h> |
9 | #include <asm/acpi.h> | 9 | #include <asm/acpi.h> |
10 | 10 | ||
11 | static int __init check_bridge(int vendor, int device) | 11 | static int __init check_bridge(int vendor, int device) |
12 | { | 12 | { |
13 | /* According to Nvidia all timer overrides are bogus. Just ignore | 13 | /* According to Nvidia all timer overrides are bogus. Just ignore |
14 | them all. */ | 14 | them all. */ |
15 | if (vendor == PCI_VENDOR_ID_NVIDIA) { | 15 | if (vendor == PCI_VENDOR_ID_NVIDIA) { |
16 | acpi_skip_timer_override = 1; | 16 | acpi_skip_timer_override = 1; |
17 | } | 17 | } |
18 | return 0; | 18 | return 0; |
19 | } | 19 | } |
20 | 20 | ||
21 | void __init check_acpi_pci(void) | 21 | void __init check_acpi_pci(void) |
22 | { | 22 | { |
23 | int num,slot,func; | 23 | int num, slot, func; |
24 | 24 | ||
25 | /* Assume the machine supports type 1. If not it will | 25 | /* Assume the machine supports type 1. If not it will |
26 | always read ffffffff and should not have any side effect. */ | 26 | always read ffffffff and should not have any side effect. */ |
27 | 27 | ||
28 | /* Poor man's PCI discovery */ | 28 | /* Poor man's PCI discovery */ |
29 | for (num = 0; num < 32; num++) { | 29 | for (num = 0; num < 32; num++) { |
30 | for (slot = 0; slot < 32; slot++) { | 30 | for (slot = 0; slot < 32; slot++) { |
31 | for (func = 0; func < 8; func++) { | 31 | for (func = 0; func < 8; func++) { |
32 | u32 class; | 32 | u32 class; |
33 | u32 vendor; | 33 | u32 vendor; |
34 | class = read_pci_config(num,slot,func, | 34 | class = read_pci_config(num, slot, func, |
35 | PCI_CLASS_REVISION); | 35 | PCI_CLASS_REVISION); |
36 | if (class == 0xffffffff) | 36 | if (class == 0xffffffff) |
37 | break; | 37 | break; |
38 | 38 | ||
39 | if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) | 39 | if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) |
40 | continue; | 40 | continue; |
41 | 41 | ||
42 | vendor = read_pci_config(num, slot, func, | 42 | vendor = read_pci_config(num, slot, func, |
43 | PCI_VENDOR_ID); | 43 | PCI_VENDOR_ID); |
44 | 44 | ||
45 | if (check_bridge(vendor&0xffff, vendor >> 16)) | 45 | if (check_bridge(vendor & 0xffff, vendor >> 16)) |
46 | return; | 46 | return; |
47 | } | 47 | } |
48 | 48 | ||
49 | } | 49 | } |
50 | } | 50 | } |
51 | } | 51 | } |
diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c index c1af93032ff3..1cb2b186a3af 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/i386/kernel/acpi/sleep.c | |||
@@ -20,12 +20,13 @@ extern void zap_low_mappings(void); | |||
20 | 20 | ||
21 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); | 21 | extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long)); |
22 | 22 | ||
23 | static void init_low_mapping(pgd_t *pgd, int pgd_limit) | 23 | static void init_low_mapping(pgd_t * pgd, int pgd_limit) |
24 | { | 24 | { |
25 | int pgd_ofs = 0; | 25 | int pgd_ofs = 0; |
26 | 26 | ||
27 | while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { | 27 | while ((pgd_ofs < pgd_limit) |
28 | set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD)); | 28 | && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) { |
29 | set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD)); | ||
29 | pgd_ofs++, pgd++; | 30 | pgd_ofs++, pgd++; |
30 | } | 31 | } |
31 | flush_tlb_all(); | 32 | flush_tlb_all(); |
@@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit) | |||
37 | * Create an identity mapped page table and copy the wakeup routine to | 38 | * Create an identity mapped page table and copy the wakeup routine to |
38 | * low memory. | 39 | * low memory. |
39 | */ | 40 | */ |
40 | int acpi_save_state_mem (void) | 41 | int acpi_save_state_mem(void) |
41 | { | 42 | { |
42 | if (!acpi_wakeup_address) | 43 | if (!acpi_wakeup_address) |
43 | return 1; | 44 | return 1; |
44 | init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); | 45 | init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD); |
45 | memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); | 46 | memcpy((void *)acpi_wakeup_address, &wakeup_start, |
47 | &wakeup_end - &wakeup_start); | ||
46 | acpi_copy_wakeup_routine(acpi_wakeup_address); | 48 | acpi_copy_wakeup_routine(acpi_wakeup_address); |
47 | 49 | ||
48 | return 0; | 50 | return 0; |
@@ -51,7 +53,7 @@ int acpi_save_state_mem (void) | |||
51 | /* | 53 | /* |
52 | * acpi_restore_state - undo effects of acpi_save_state_mem | 54 | * acpi_restore_state - undo effects of acpi_save_state_mem |
53 | */ | 55 | */ |
54 | void acpi_restore_state_mem (void) | 56 | void acpi_restore_state_mem(void) |
55 | { | 57 | { |
56 | zap_low_mappings(); | 58 | zap_low_mappings(); |
57 | } | 59 | } |
@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void) | |||
67 | void __init acpi_reserve_bootmem(void) | 69 | void __init acpi_reserve_bootmem(void) |
68 | { | 70 | { |
69 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) { | 71 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) { |
70 | printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n"); | 72 | printk(KERN_ERR |
73 | "ACPI: Wakeup code way too big, S3 disabled.\n"); | ||
71 | return; | 74 | return; |
72 | } | 75 | } |
73 | 76 | ||
@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str) | |||
90 | return 1; | 93 | return 1; |
91 | } | 94 | } |
92 | 95 | ||
93 | |||
94 | __setup("acpi_sleep=", acpi_sleep_setup); | 96 | __setup("acpi_sleep=", acpi_sleep_setup); |
95 | 97 | ||
96 | |||
97 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) | 98 | static __init int reset_videomode_after_s3(struct dmi_system_id *d) |
98 | { | 99 | { |
99 | acpi_video_flags |= 2; | 100 | acpi_video_flags |= 2; |
@@ -101,14 +102,14 @@ static __init int reset_videomode_after_s3(struct dmi_system_id *d) | |||
101 | } | 102 | } |
102 | 103 | ||
103 | static __initdata struct dmi_system_id acpisleep_dmi_table[] = { | 104 | static __initdata struct dmi_system_id acpisleep_dmi_table[] = { |
104 | { /* Reset video mode after returning from ACPI S3 sleep */ | 105 | { /* Reset video mode after returning from ACPI S3 sleep */ |
105 | .callback = reset_videomode_after_s3, | 106 | .callback = reset_videomode_after_s3, |
106 | .ident = "Toshiba Satellite 4030cdt", | 107 | .ident = "Toshiba Satellite 4030cdt", |
107 | .matches = { | 108 | .matches = { |
108 | DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), | 109 | DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), |
109 | }, | 110 | }, |
110 | }, | 111 | }, |
111 | { } | 112 | {} |
112 | }; | 113 | }; |
113 | 114 | ||
114 | static int __init acpisleep_dmi_init(void) | 115 | static int __init acpisleep_dmi_init(void) |
diff --git a/arch/ia64/kernel/acpi-ext.c b/arch/ia64/kernel/acpi-ext.c index 2623df5e2633..13a5b3b49bf8 100644 --- a/arch/ia64/kernel/acpi-ext.c +++ b/arch/ia64/kernel/acpi-ext.c | |||
@@ -17,20 +17,20 @@ | |||
17 | #include <asm/acpi-ext.h> | 17 | #include <asm/acpi-ext.h> |
18 | 18 | ||
19 | struct acpi_vendor_descriptor { | 19 | struct acpi_vendor_descriptor { |
20 | u8 guid_id; | 20 | u8 guid_id; |
21 | efi_guid_t guid; | 21 | efi_guid_t guid; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct acpi_vendor_info { | 24 | struct acpi_vendor_info { |
25 | struct acpi_vendor_descriptor *descriptor; | 25 | struct acpi_vendor_descriptor *descriptor; |
26 | u8 *data; | 26 | u8 *data; |
27 | u32 length; | 27 | u32 length; |
28 | }; | 28 | }; |
29 | 29 | ||
30 | acpi_status | 30 | acpi_status |
31 | acpi_vendor_resource_match(struct acpi_resource *resource, void *context) | 31 | acpi_vendor_resource_match(struct acpi_resource *resource, void *context) |
32 | { | 32 | { |
33 | struct acpi_vendor_info *info = (struct acpi_vendor_info *) context; | 33 | struct acpi_vendor_info *info = (struct acpi_vendor_info *)context; |
34 | struct acpi_resource_vendor *vendor; | 34 | struct acpi_resource_vendor *vendor; |
35 | struct acpi_vendor_descriptor *descriptor; | 35 | struct acpi_vendor_descriptor *descriptor; |
36 | u32 length; | 36 | u32 length; |
@@ -38,8 +38,8 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context) | |||
38 | if (resource->id != ACPI_RSTYPE_VENDOR) | 38 | if (resource->id != ACPI_RSTYPE_VENDOR) |
39 | return AE_OK; | 39 | return AE_OK; |
40 | 40 | ||
41 | vendor = (struct acpi_resource_vendor *) &resource->data; | 41 | vendor = (struct acpi_resource_vendor *)&resource->data; |
42 | descriptor = (struct acpi_vendor_descriptor *) vendor->reserved; | 42 | descriptor = (struct acpi_vendor_descriptor *)vendor->reserved; |
43 | if (vendor->length <= sizeof(*info->descriptor) || | 43 | if (vendor->length <= sizeof(*info->descriptor) || |
44 | descriptor->guid_id != info->descriptor->guid_id || | 44 | descriptor->guid_id != info->descriptor->guid_id || |
45 | efi_guidcmp(descriptor->guid, info->descriptor->guid)) | 45 | efi_guidcmp(descriptor->guid, info->descriptor->guid)) |
@@ -50,21 +50,24 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context) | |||
50 | if (!info->data) | 50 | if (!info->data) |
51 | return AE_NO_MEMORY; | 51 | return AE_NO_MEMORY; |
52 | 52 | ||
53 | memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length); | 53 | memcpy(info->data, |
54 | vendor->reserved + sizeof(struct acpi_vendor_descriptor), | ||
55 | length); | ||
54 | info->length = length; | 56 | info->length = length; |
55 | return AE_CTRL_TERMINATE; | 57 | return AE_CTRL_TERMINATE; |
56 | } | 58 | } |
57 | 59 | ||
58 | acpi_status | 60 | acpi_status |
59 | acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id, | 61 | acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id, |
60 | u8 **data, u32 *length) | 62 | u8 ** data, u32 * length) |
61 | { | 63 | { |
62 | struct acpi_vendor_info info; | 64 | struct acpi_vendor_info info; |
63 | 65 | ||
64 | info.descriptor = id; | 66 | info.descriptor = id; |
65 | info.data = NULL; | 67 | info.data = NULL; |
66 | 68 | ||
67 | acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info); | 69 | acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, |
70 | &info); | ||
68 | if (!info.data) | 71 | if (!info.data) |
69 | return AE_NOT_FOUND; | 72 | return AE_NOT_FOUND; |
70 | 73 | ||
@@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id, | |||
75 | 78 | ||
76 | struct acpi_vendor_descriptor hp_ccsr_descriptor = { | 79 | struct acpi_vendor_descriptor hp_ccsr_descriptor = { |
77 | .guid_id = 2, | 80 | .guid_id = 2, |
78 | .guid = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad) | 81 | .guid = |
82 | EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, | ||
83 | 0x37, 0x0e, 0xad) | ||
79 | }; | 84 | }; |
80 | 85 | ||
81 | acpi_status | 86 | acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length) |
82 | hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length) | ||
83 | { | 87 | { |
84 | acpi_status status; | 88 | acpi_status status; |
85 | u8 *data; | 89 | u8 *data; |
86 | u32 length; | 90 | u32 length; |
87 | 91 | ||
88 | status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length); | 92 | status = |
93 | acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length); | ||
89 | 94 | ||
90 | if (ACPI_FAILURE(status) || length != 16) | 95 | if (ACPI_FAILURE(status) || length != 16) |
91 | return AE_NOT_FOUND; | 96 | return AE_NOT_FOUND; |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index d362ecf5381b..f3046bdd4b14 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -74,12 +74,11 @@ unsigned int acpi_cpei_override; | |||
74 | unsigned int acpi_cpei_phys_cpuid; | 74 | unsigned int acpi_cpei_phys_cpuid; |
75 | 75 | ||
76 | #define MAX_SAPICS 256 | 76 | #define MAX_SAPICS 256 |
77 | u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = | 77 | u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = {[0...MAX_SAPICS - 1] = -1 }; |
78 | { [0 ... MAX_SAPICS - 1] = -1 }; | 78 | |
79 | EXPORT_SYMBOL(ia64_acpiid_to_sapicid); | 79 | EXPORT_SYMBOL(ia64_acpiid_to_sapicid); |
80 | 80 | ||
81 | const char * | 81 | const char *acpi_get_sysname(void) |
82 | acpi_get_sysname (void) | ||
83 | { | 82 | { |
84 | #ifdef CONFIG_IA64_GENERIC | 83 | #ifdef CONFIG_IA64_GENERIC |
85 | unsigned long rsdp_phys; | 84 | unsigned long rsdp_phys; |
@@ -89,27 +88,29 @@ acpi_get_sysname (void) | |||
89 | 88 | ||
90 | rsdp_phys = acpi_find_rsdp(); | 89 | rsdp_phys = acpi_find_rsdp(); |
91 | if (!rsdp_phys) { | 90 | if (!rsdp_phys) { |
92 | printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n"); | 91 | printk(KERN_ERR |
92 | "ACPI 2.0 RSDP not found, default to \"dig\"\n"); | ||
93 | return "dig"; | 93 | return "dig"; |
94 | } | 94 | } |
95 | 95 | ||
96 | rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys); | 96 | rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys); |
97 | if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { | 97 | if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) { |
98 | printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); | 98 | printk(KERN_ERR |
99 | "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n"); | ||
99 | return "dig"; | 100 | return "dig"; |
100 | } | 101 | } |
101 | 102 | ||
102 | xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address); | 103 | xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address); |
103 | hdr = &xsdt->header; | 104 | hdr = &xsdt->header; |
104 | if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { | 105 | if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) { |
105 | printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); | 106 | printk(KERN_ERR |
107 | "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n"); | ||
106 | return "dig"; | 108 | return "dig"; |
107 | } | 109 | } |
108 | 110 | ||
109 | if (!strcmp(hdr->oem_id, "HP")) { | 111 | if (!strcmp(hdr->oem_id, "HP")) { |
110 | return "hpzx1"; | 112 | return "hpzx1"; |
111 | } | 113 | } else if (!strcmp(hdr->oem_id, "SGI")) { |
112 | else if (!strcmp(hdr->oem_id, "SGI")) { | ||
113 | return "sn2"; | 114 | return "sn2"; |
114 | } | 115 | } |
115 | 116 | ||
@@ -137,7 +138,7 @@ acpi_get_sysname (void) | |||
137 | 138 | ||
138 | /* Array to record platform interrupt vectors for generic interrupt routing. */ | 139 | /* Array to record platform interrupt vectors for generic interrupt routing. */ |
139 | int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = { | 140 | int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = { |
140 | [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1 | 141 | [0...ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1 |
141 | }; | 142 | }; |
142 | 143 | ||
143 | enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; | 144 | enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; |
@@ -146,8 +147,7 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC; | |||
146 | * Interrupt routing API for device drivers. Provides interrupt vector for | 147 | * Interrupt routing API for device drivers. Provides interrupt vector for |
147 | * a generic platform event. Currently only CPEI is implemented. | 148 | * a generic platform event. Currently only CPEI is implemented. |
148 | */ | 149 | */ |
149 | int | 150 | int acpi_request_vector(u32 int_type) |
150 | acpi_request_vector (u32 int_type) | ||
151 | { | 151 | { |
152 | int vector = -1; | 152 | int vector = -1; |
153 | 153 | ||
@@ -155,12 +155,12 @@ acpi_request_vector (u32 int_type) | |||
155 | /* corrected platform error interrupt */ | 155 | /* corrected platform error interrupt */ |
156 | vector = platform_intr_list[int_type]; | 156 | vector = platform_intr_list[int_type]; |
157 | } else | 157 | } else |
158 | printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n"); | 158 | printk(KERN_ERR |
159 | "acpi_request_vector(): invalid interrupt type\n"); | ||
159 | return vector; | 160 | return vector; |
160 | } | 161 | } |
161 | 162 | ||
162 | char * | 163 | char *__acpi_map_table(unsigned long phys_addr, unsigned long size) |
163 | __acpi_map_table (unsigned long phys_addr, unsigned long size) | ||
164 | { | 164 | { |
165 | return __va(phys_addr); | 165 | return __va(phys_addr); |
166 | } | 166 | } |
@@ -169,19 +169,18 @@ __acpi_map_table (unsigned long phys_addr, unsigned long size) | |||
169 | Boot-time Table Parsing | 169 | Boot-time Table Parsing |
170 | -------------------------------------------------------------------------- */ | 170 | -------------------------------------------------------------------------- */ |
171 | 171 | ||
172 | static int total_cpus __initdata; | 172 | static int total_cpus __initdata; |
173 | static int available_cpus __initdata; | 173 | static int available_cpus __initdata; |
174 | struct acpi_table_madt * acpi_madt __initdata; | 174 | struct acpi_table_madt *acpi_madt __initdata; |
175 | static u8 has_8259; | 175 | static u8 has_8259; |
176 | |||
177 | 176 | ||
178 | static int __init | 177 | static int __init |
179 | acpi_parse_lapic_addr_ovr ( | 178 | acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, |
180 | acpi_table_entry_header *header, const unsigned long end) | 179 | const unsigned long end) |
181 | { | 180 | { |
182 | struct acpi_table_lapic_addr_ovr *lapic; | 181 | struct acpi_table_lapic_addr_ovr *lapic; |
183 | 182 | ||
184 | lapic = (struct acpi_table_lapic_addr_ovr *) header; | 183 | lapic = (struct acpi_table_lapic_addr_ovr *)header; |
185 | 184 | ||
186 | if (BAD_MADT_ENTRY(lapic, end)) | 185 | if (BAD_MADT_ENTRY(lapic, end)) |
187 | return -EINVAL; | 186 | return -EINVAL; |
@@ -193,22 +192,23 @@ acpi_parse_lapic_addr_ovr ( | |||
193 | return 0; | 192 | return 0; |
194 | } | 193 | } |
195 | 194 | ||
196 | |||
197 | static int __init | 195 | static int __init |
198 | acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end) | 196 | acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end) |
199 | { | 197 | { |
200 | struct acpi_table_lsapic *lsapic; | 198 | struct acpi_table_lsapic *lsapic; |
201 | 199 | ||
202 | lsapic = (struct acpi_table_lsapic *) header; | 200 | lsapic = (struct acpi_table_lsapic *)header; |
203 | 201 | ||
204 | if (BAD_MADT_ENTRY(lsapic, end)) | 202 | if (BAD_MADT_ENTRY(lsapic, end)) |
205 | return -EINVAL; | 203 | return -EINVAL; |
206 | 204 | ||
207 | if (lsapic->flags.enabled) { | 205 | if (lsapic->flags.enabled) { |
208 | #ifdef CONFIG_SMP | 206 | #ifdef CONFIG_SMP |
209 | smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid; | 207 | smp_boot_data.cpu_phys_id[available_cpus] = |
208 | (lsapic->id << 8) | lsapic->eid; | ||
210 | #endif | 209 | #endif |
211 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = (lsapic->id << 8) | lsapic->eid; | 210 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = |
211 | (lsapic->id << 8) | lsapic->eid; | ||
212 | ++available_cpus; | 212 | ++available_cpus; |
213 | } | 213 | } |
214 | 214 | ||
@@ -216,13 +216,12 @@ acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end) | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | |||
220 | static int __init | 219 | static int __init |
221 | acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end) | 220 | acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) |
222 | { | 221 | { |
223 | struct acpi_table_lapic_nmi *lacpi_nmi; | 222 | struct acpi_table_lapic_nmi *lacpi_nmi; |
224 | 223 | ||
225 | lacpi_nmi = (struct acpi_table_lapic_nmi*) header; | 224 | lacpi_nmi = (struct acpi_table_lapic_nmi *)header; |
226 | 225 | ||
227 | if (BAD_MADT_ENTRY(lacpi_nmi, end)) | 226 | if (BAD_MADT_ENTRY(lacpi_nmi, end)) |
228 | return -EINVAL; | 227 | return -EINVAL; |
@@ -231,13 +230,12 @@ acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end) | |||
231 | return 0; | 230 | return 0; |
232 | } | 231 | } |
233 | 232 | ||
234 | |||
235 | static int __init | 233 | static int __init |
236 | acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end) | 234 | acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end) |
237 | { | 235 | { |
238 | struct acpi_table_iosapic *iosapic; | 236 | struct acpi_table_iosapic *iosapic; |
239 | 237 | ||
240 | iosapic = (struct acpi_table_iosapic *) header; | 238 | iosapic = (struct acpi_table_iosapic *)header; |
241 | 239 | ||
242 | if (BAD_MADT_ENTRY(iosapic, end)) | 240 | if (BAD_MADT_ENTRY(iosapic, end)) |
243 | return -EINVAL; | 241 | return -EINVAL; |
@@ -245,15 +243,14 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end) | |||
245 | return iosapic_init(iosapic->address, iosapic->global_irq_base); | 243 | return iosapic_init(iosapic->address, iosapic->global_irq_base); |
246 | } | 244 | } |
247 | 245 | ||
248 | |||
249 | static int __init | 246 | static int __init |
250 | acpi_parse_plat_int_src ( | 247 | acpi_parse_plat_int_src(acpi_table_entry_header * header, |
251 | acpi_table_entry_header *header, const unsigned long end) | 248 | const unsigned long end) |
252 | { | 249 | { |
253 | struct acpi_table_plat_int_src *plintsrc; | 250 | struct acpi_table_plat_int_src *plintsrc; |
254 | int vector; | 251 | int vector; |
255 | 252 | ||
256 | plintsrc = (struct acpi_table_plat_int_src *) header; | 253 | plintsrc = (struct acpi_table_plat_int_src *)header; |
257 | 254 | ||
258 | if (BAD_MADT_ENTRY(plintsrc, end)) | 255 | if (BAD_MADT_ENTRY(plintsrc, end)) |
259 | return -EINVAL; | 256 | return -EINVAL; |
@@ -267,8 +264,12 @@ acpi_parse_plat_int_src ( | |||
267 | plintsrc->iosapic_vector, | 264 | plintsrc->iosapic_vector, |
268 | plintsrc->eid, | 265 | plintsrc->eid, |
269 | plintsrc->id, | 266 | plintsrc->id, |
270 | (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, | 267 | (plintsrc->flags.polarity == |
271 | (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); | 268 | 1) ? IOSAPIC_POL_HIGH : |
269 | IOSAPIC_POL_LOW, | ||
270 | (plintsrc->flags.trigger == | ||
271 | 1) ? IOSAPIC_EDGE : | ||
272 | IOSAPIC_LEVEL); | ||
272 | 273 | ||
273 | platform_intr_list[plintsrc->type] = vector; | 274 | platform_intr_list[plintsrc->type] = vector; |
274 | if (acpi_madt_rev > 1) { | 275 | if (acpi_madt_rev > 1) { |
@@ -283,7 +284,6 @@ acpi_parse_plat_int_src ( | |||
283 | return 0; | 284 | return 0; |
284 | } | 285 | } |
285 | 286 | ||
286 | |||
287 | unsigned int can_cpei_retarget(void) | 287 | unsigned int can_cpei_retarget(void) |
288 | { | 288 | { |
289 | extern int cpe_vector; | 289 | extern int cpe_vector; |
@@ -322,29 +322,30 @@ unsigned int get_cpei_target_cpu(void) | |||
322 | } | 322 | } |
323 | 323 | ||
324 | static int __init | 324 | static int __init |
325 | acpi_parse_int_src_ovr ( | 325 | acpi_parse_int_src_ovr(acpi_table_entry_header * header, |
326 | acpi_table_entry_header *header, const unsigned long end) | 326 | const unsigned long end) |
327 | { | 327 | { |
328 | struct acpi_table_int_src_ovr *p; | 328 | struct acpi_table_int_src_ovr *p; |
329 | 329 | ||
330 | p = (struct acpi_table_int_src_ovr *) header; | 330 | p = (struct acpi_table_int_src_ovr *)header; |
331 | 331 | ||
332 | if (BAD_MADT_ENTRY(p, end)) | 332 | if (BAD_MADT_ENTRY(p, end)) |
333 | return -EINVAL; | 333 | return -EINVAL; |
334 | 334 | ||
335 | iosapic_override_isa_irq(p->bus_irq, p->global_irq, | 335 | iosapic_override_isa_irq(p->bus_irq, p->global_irq, |
336 | (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, | 336 | (p->flags.polarity == |
337 | (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); | 337 | 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, |
338 | (p->flags.trigger == | ||
339 | 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); | ||
338 | return 0; | 340 | return 0; |
339 | } | 341 | } |
340 | 342 | ||
341 | |||
342 | static int __init | 343 | static int __init |
343 | acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end) | 344 | acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) |
344 | { | 345 | { |
345 | struct acpi_table_nmi_src *nmi_src; | 346 | struct acpi_table_nmi_src *nmi_src; |
346 | 347 | ||
347 | nmi_src = (struct acpi_table_nmi_src*) header; | 348 | nmi_src = (struct acpi_table_nmi_src *)header; |
348 | 349 | ||
349 | if (BAD_MADT_ENTRY(nmi_src, end)) | 350 | if (BAD_MADT_ENTRY(nmi_src, end)) |
350 | return -EINVAL; | 351 | return -EINVAL; |
@@ -353,11 +354,9 @@ acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end) | |||
353 | return 0; | 354 | return 0; |
354 | } | 355 | } |
355 | 356 | ||
356 | static void __init | 357 | static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
357 | acpi_madt_oem_check (char *oem_id, char *oem_table_id) | ||
358 | { | 358 | { |
359 | if (!strncmp(oem_id, "IBM", 3) && | 359 | if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERMOW", 6))) { |
360 | (!strncmp(oem_table_id, "SERMOW", 6))) { | ||
361 | 360 | ||
362 | /* | 361 | /* |
363 | * Unfortunately ITC_DRIFT is not yet part of the | 362 | * Unfortunately ITC_DRIFT is not yet part of the |
@@ -370,19 +369,18 @@ acpi_madt_oem_check (char *oem_id, char *oem_table_id) | |||
370 | } | 369 | } |
371 | } | 370 | } |
372 | 371 | ||
373 | static int __init | 372 | static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) |
374 | acpi_parse_madt (unsigned long phys_addr, unsigned long size) | ||
375 | { | 373 | { |
376 | if (!phys_addr || !size) | 374 | if (!phys_addr || !size) |
377 | return -EINVAL; | 375 | return -EINVAL; |
378 | 376 | ||
379 | acpi_madt = (struct acpi_table_madt *) __va(phys_addr); | 377 | acpi_madt = (struct acpi_table_madt *)__va(phys_addr); |
380 | 378 | ||
381 | acpi_madt_rev = acpi_madt->header.revision; | 379 | acpi_madt_rev = acpi_madt->header.revision; |
382 | 380 | ||
383 | /* remember the value for reference after free_initmem() */ | 381 | /* remember the value for reference after free_initmem() */ |
384 | #ifdef CONFIG_ITANIUM | 382 | #ifdef CONFIG_ITANIUM |
385 | has_8259 = 1; /* Firmware on old Itanium systems is broken */ | 383 | has_8259 = 1; /* Firmware on old Itanium systems is broken */ |
386 | #else | 384 | #else |
387 | has_8259 = acpi_madt->flags.pcat_compat; | 385 | has_8259 = acpi_madt->flags.pcat_compat; |
388 | #endif | 386 | #endif |
@@ -396,19 +394,18 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size) | |||
396 | printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); | 394 | printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr); |
397 | 395 | ||
398 | acpi_madt_oem_check(acpi_madt->header.oem_id, | 396 | acpi_madt_oem_check(acpi_madt->header.oem_id, |
399 | acpi_madt->header.oem_table_id); | 397 | acpi_madt->header.oem_table_id); |
400 | 398 | ||
401 | return 0; | 399 | return 0; |
402 | } | 400 | } |
403 | 401 | ||
404 | |||
405 | #ifdef CONFIG_ACPI_NUMA | 402 | #ifdef CONFIG_ACPI_NUMA |
406 | 403 | ||
407 | #undef SLIT_DEBUG | 404 | #undef SLIT_DEBUG |
408 | 405 | ||
409 | #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) | 406 | #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32) |
410 | 407 | ||
411 | static int __initdata srat_num_cpus; /* number of cpus */ | 408 | static int __initdata srat_num_cpus; /* number of cpus */ |
412 | static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; | 409 | static u32 __devinitdata pxm_flag[PXM_FLAG_LEN]; |
413 | #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag)) | 410 | #define pxm_bit_set(bit) (set_bit(bit,(void *)pxm_flag)) |
414 | #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) | 411 | #define pxm_bit_test(bit) (test_bit(bit,(void *)pxm_flag)) |
@@ -421,15 +418,15 @@ static struct acpi_table_slit __initdata *slit_table; | |||
421 | * ACPI 2.0 SLIT (System Locality Information Table) | 418 | * ACPI 2.0 SLIT (System Locality Information Table) |
422 | * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf | 419 | * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf |
423 | */ | 420 | */ |
424 | void __init | 421 | void __init acpi_numa_slit_init(struct acpi_table_slit *slit) |
425 | acpi_numa_slit_init (struct acpi_table_slit *slit) | ||
426 | { | 422 | { |
427 | u32 len; | 423 | u32 len; |
428 | 424 | ||
429 | len = sizeof(struct acpi_table_header) + 8 | 425 | len = sizeof(struct acpi_table_header) + 8 |
430 | + slit->localities * slit->localities; | 426 | + slit->localities * slit->localities; |
431 | if (slit->header.length != len) { | 427 | if (slit->header.length != len) { |
432 | printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", | 428 | printk(KERN_ERR |
429 | "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n", | ||
433 | len, slit->header.length); | 430 | len, slit->header.length); |
434 | memset(numa_slit, 10, sizeof(numa_slit)); | 431 | memset(numa_slit, 10, sizeof(numa_slit)); |
435 | return; | 432 | return; |
@@ -438,19 +435,20 @@ acpi_numa_slit_init (struct acpi_table_slit *slit) | |||
438 | } | 435 | } |
439 | 436 | ||
440 | void __init | 437 | void __init |
441 | acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa) | 438 | acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) |
442 | { | 439 | { |
443 | /* record this node in proximity bitmap */ | 440 | /* record this node in proximity bitmap */ |
444 | pxm_bit_set(pa->proximity_domain); | 441 | pxm_bit_set(pa->proximity_domain); |
445 | 442 | ||
446 | node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid); | 443 | node_cpuid[srat_num_cpus].phys_id = |
444 | (pa->apic_id << 8) | (pa->lsapic_eid); | ||
447 | /* nid should be overridden as logical node id later */ | 445 | /* nid should be overridden as logical node id later */ |
448 | node_cpuid[srat_num_cpus].nid = pa->proximity_domain; | 446 | node_cpuid[srat_num_cpus].nid = pa->proximity_domain; |
449 | srat_num_cpus++; | 447 | srat_num_cpus++; |
450 | } | 448 | } |
451 | 449 | ||
452 | void __init | 450 | void __init |
453 | acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma) | 451 | acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma) |
454 | { | 452 | { |
455 | unsigned long paddr, size; | 453 | unsigned long paddr, size; |
456 | u8 pxm; | 454 | u8 pxm; |
@@ -487,8 +485,7 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma) | |||
487 | num_node_memblks++; | 485 | num_node_memblks++; |
488 | } | 486 | } |
489 | 487 | ||
490 | void __init | 488 | void __init acpi_numa_arch_fixup(void) |
491 | acpi_numa_arch_fixup (void) | ||
492 | { | 489 | { |
493 | int i, j, node_from, node_to; | 490 | int i, j, node_from, node_to; |
494 | 491 | ||
@@ -534,21 +531,24 @@ acpi_numa_arch_fixup (void) | |||
534 | for (i = 0; i < srat_num_cpus; i++) | 531 | for (i = 0; i < srat_num_cpus; i++) |
535 | node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; | 532 | node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid]; |
536 | 533 | ||
537 | printk(KERN_INFO "Number of logical nodes in system = %d\n", num_online_nodes()); | 534 | printk(KERN_INFO "Number of logical nodes in system = %d\n", |
538 | printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks); | 535 | num_online_nodes()); |
536 | printk(KERN_INFO "Number of memory chunks in system = %d\n", | ||
537 | num_node_memblks); | ||
539 | 538 | ||
540 | if (!slit_table) return; | 539 | if (!slit_table) |
540 | return; | ||
541 | memset(numa_slit, -1, sizeof(numa_slit)); | 541 | memset(numa_slit, -1, sizeof(numa_slit)); |
542 | for (i=0; i<slit_table->localities; i++) { | 542 | for (i = 0; i < slit_table->localities; i++) { |
543 | if (!pxm_bit_test(i)) | 543 | if (!pxm_bit_test(i)) |
544 | continue; | 544 | continue; |
545 | node_from = pxm_to_nid_map[i]; | 545 | node_from = pxm_to_nid_map[i]; |
546 | for (j=0; j<slit_table->localities; j++) { | 546 | for (j = 0; j < slit_table->localities; j++) { |
547 | if (!pxm_bit_test(j)) | 547 | if (!pxm_bit_test(j)) |
548 | continue; | 548 | continue; |
549 | node_to = pxm_to_nid_map[j]; | 549 | node_to = pxm_to_nid_map[j]; |
550 | node_distance(node_from, node_to) = | 550 | node_distance(node_from, node_to) = |
551 | slit_table->entry[i*slit_table->localities + j]; | 551 | slit_table->entry[i * slit_table->localities + j]; |
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
@@ -556,40 +556,43 @@ acpi_numa_arch_fixup (void) | |||
556 | printk("ACPI 2.0 SLIT locality table:\n"); | 556 | printk("ACPI 2.0 SLIT locality table:\n"); |
557 | for_each_online_node(i) { | 557 | for_each_online_node(i) { |
558 | for_each_online_node(j) | 558 | for_each_online_node(j) |
559 | printk("%03d ", node_distance(i,j)); | 559 | printk("%03d ", node_distance(i, j)); |
560 | printk("\n"); | 560 | printk("\n"); |
561 | } | 561 | } |
562 | #endif | 562 | #endif |
563 | } | 563 | } |
564 | #endif /* CONFIG_ACPI_NUMA */ | 564 | #endif /* CONFIG_ACPI_NUMA */ |
565 | 565 | ||
566 | /* | 566 | /* |
567 | * success: return IRQ number (>=0) | 567 | * success: return IRQ number (>=0) |
568 | * failure: return < 0 | 568 | * failure: return < 0 |
569 | */ | 569 | */ |
570 | int | 570 | int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low) |
571 | acpi_register_gsi (u32 gsi, int edge_level, int active_high_low) | ||
572 | { | 571 | { |
573 | if (has_8259 && gsi < 16) | 572 | if (has_8259 && gsi < 16) |
574 | return isa_irq_to_vector(gsi); | 573 | return isa_irq_to_vector(gsi); |
575 | 574 | ||
576 | return iosapic_register_intr(gsi, | 575 | return iosapic_register_intr(gsi, |
577 | (active_high_low == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW, | 576 | (active_high_low == |
578 | (edge_level == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL); | 577 | ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : |
578 | IOSAPIC_POL_LOW, | ||
579 | (edge_level == | ||
580 | ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : | ||
581 | IOSAPIC_LEVEL); | ||
579 | } | 582 | } |
583 | |||
580 | EXPORT_SYMBOL(acpi_register_gsi); | 584 | EXPORT_SYMBOL(acpi_register_gsi); |
581 | 585 | ||
582 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ | 586 | #ifdef CONFIG_ACPI_DEALLOCATE_IRQ |
583 | void | 587 | void acpi_unregister_gsi(u32 gsi) |
584 | acpi_unregister_gsi (u32 gsi) | ||
585 | { | 588 | { |
586 | iosapic_unregister_intr(gsi); | 589 | iosapic_unregister_intr(gsi); |
587 | } | 590 | } |
591 | |||
588 | EXPORT_SYMBOL(acpi_unregister_gsi); | 592 | EXPORT_SYMBOL(acpi_unregister_gsi); |
589 | #endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ | 593 | #endif /* CONFIG_ACPI_DEALLOCATE_IRQ */ |
590 | 594 | ||
591 | static int __init | 595 | static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size) |
592 | acpi_parse_fadt (unsigned long phys_addr, unsigned long size) | ||
593 | { | 596 | { |
594 | struct acpi_table_header *fadt_header; | 597 | struct acpi_table_header *fadt_header; |
595 | struct fadt_descriptor_rev2 *fadt; | 598 | struct fadt_descriptor_rev2 *fadt; |
@@ -597,11 +600,11 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size) | |||
597 | if (!phys_addr || !size) | 600 | if (!phys_addr || !size) |
598 | return -EINVAL; | 601 | return -EINVAL; |
599 | 602 | ||
600 | fadt_header = (struct acpi_table_header *) __va(phys_addr); | 603 | fadt_header = (struct acpi_table_header *)__va(phys_addr); |
601 | if (fadt_header->revision != 3) | 604 | if (fadt_header->revision != 3) |
602 | return -ENODEV; /* Only deal with ACPI 2.0 FADT */ | 605 | return -ENODEV; /* Only deal with ACPI 2.0 FADT */ |
603 | 606 | ||
604 | fadt = (struct fadt_descriptor_rev2 *) fadt_header; | 607 | fadt = (struct fadt_descriptor_rev2 *)fadt_header; |
605 | 608 | ||
606 | if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER)) | 609 | if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER)) |
607 | acpi_kbd_controller_present = 0; | 610 | acpi_kbd_controller_present = 0; |
@@ -613,22 +616,19 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size) | |||
613 | return 0; | 616 | return 0; |
614 | } | 617 | } |
615 | 618 | ||
616 | 619 | unsigned long __init acpi_find_rsdp(void) | |
617 | unsigned long __init | ||
618 | acpi_find_rsdp (void) | ||
619 | { | 620 | { |
620 | unsigned long rsdp_phys = 0; | 621 | unsigned long rsdp_phys = 0; |
621 | 622 | ||
622 | if (efi.acpi20) | 623 | if (efi.acpi20) |
623 | rsdp_phys = __pa(efi.acpi20); | 624 | rsdp_phys = __pa(efi.acpi20); |
624 | else if (efi.acpi) | 625 | else if (efi.acpi) |
625 | printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n"); | 626 | printk(KERN_WARNING PREFIX |
627 | "v1.0/r0.71 tables no longer supported\n"); | ||
626 | return rsdp_phys; | 628 | return rsdp_phys; |
627 | } | 629 | } |
628 | 630 | ||
629 | 631 | int __init acpi_boot_init(void) | |
630 | int __init | ||
631 | acpi_boot_init (void) | ||
632 | { | 632 | { |
633 | 633 | ||
634 | /* | 634 | /* |
@@ -646,31 +646,43 @@ acpi_boot_init (void) | |||
646 | 646 | ||
647 | /* Local APIC */ | 647 | /* Local APIC */ |
648 | 648 | ||
649 | if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0) | 649 | if (acpi_table_parse_madt |
650 | printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n"); | 650 | (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0) |
651 | printk(KERN_ERR PREFIX | ||
652 | "Error parsing LAPIC address override entry\n"); | ||
651 | 653 | ||
652 | if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1) | 654 | if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) |
653 | printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries\n"); | 655 | < 1) |
656 | printk(KERN_ERR PREFIX | ||
657 | "Error parsing MADT - no LAPIC entries\n"); | ||
654 | 658 | ||
655 | if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0) | 659 | if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) |
660 | < 0) | ||
656 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 661 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
657 | 662 | ||
658 | /* I/O APIC */ | 663 | /* I/O APIC */ |
659 | 664 | ||
660 | if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) | 665 | if (acpi_table_parse_madt |
661 | printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n"); | 666 | (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) |
667 | printk(KERN_ERR PREFIX | ||
668 | "Error parsing MADT - no IOSAPIC entries\n"); | ||
662 | 669 | ||
663 | /* System-Level Interrupt Routing */ | 670 | /* System-Level Interrupt Routing */ |
664 | 671 | ||
665 | if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0) | 672 | if (acpi_table_parse_madt |
666 | printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n"); | 673 | (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, |
674 | ACPI_MAX_PLATFORM_INTERRUPTS) < 0) | ||
675 | printk(KERN_ERR PREFIX | ||
676 | "Error parsing platform interrupt source entry\n"); | ||
667 | 677 | ||
668 | if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0) | 678 | if (acpi_table_parse_madt |
669 | printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); | 679 | (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0) |
680 | printk(KERN_ERR PREFIX | ||
681 | "Error parsing interrupt source overrides entry\n"); | ||
670 | 682 | ||
671 | if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0) | 683 | if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0) |
672 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); | 684 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); |
673 | skip_madt: | 685 | skip_madt: |
674 | 686 | ||
675 | /* | 687 | /* |
676 | * FADT says whether a legacy keyboard controller is present. | 688 | * FADT says whether a legacy keyboard controller is present. |
@@ -685,8 +697,9 @@ acpi_boot_init (void) | |||
685 | if (available_cpus == 0) { | 697 | if (available_cpus == 0) { |
686 | printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n"); | 698 | printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n"); |
687 | printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id()); | 699 | printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id()); |
688 | smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id(); | 700 | smp_boot_data.cpu_phys_id[available_cpus] = |
689 | available_cpus = 1; /* We've got at least one of these, no? */ | 701 | hard_smp_processor_id(); |
702 | available_cpus = 1; /* We've got at least one of these, no? */ | ||
690 | } | 703 | } |
691 | smp_boot_data.cpu_count = available_cpus; | 704 | smp_boot_data.cpu_count = available_cpus; |
692 | 705 | ||
@@ -695,8 +708,10 @@ acpi_boot_init (void) | |||
695 | if (srat_num_cpus == 0) { | 708 | if (srat_num_cpus == 0) { |
696 | int cpu, i = 1; | 709 | int cpu, i = 1; |
697 | for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++) | 710 | for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++) |
698 | if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id()) | 711 | if (smp_boot_data.cpu_phys_id[cpu] != |
699 | node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu]; | 712 | hard_smp_processor_id()) |
713 | node_cpuid[i++].phys_id = | ||
714 | smp_boot_data.cpu_phys_id[cpu]; | ||
700 | } | 715 | } |
701 | # endif | 716 | # endif |
702 | #endif | 717 | #endif |
@@ -704,12 +719,12 @@ acpi_boot_init (void) | |||
704 | build_cpu_to_node_map(); | 719 | build_cpu_to_node_map(); |
705 | #endif | 720 | #endif |
706 | /* Make boot-up look pretty */ | 721 | /* Make boot-up look pretty */ |
707 | printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); | 722 | printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, |
723 | total_cpus); | ||
708 | return 0; | 724 | return 0; |
709 | } | 725 | } |
710 | 726 | ||
711 | int | 727 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) |
712 | acpi_gsi_to_irq (u32 gsi, unsigned int *irq) | ||
713 | { | 728 | { |
714 | int vector; | 729 | int vector; |
715 | 730 | ||
@@ -730,11 +745,10 @@ acpi_gsi_to_irq (u32 gsi, unsigned int *irq) | |||
730 | */ | 745 | */ |
731 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 746 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
732 | static | 747 | static |
733 | int | 748 | int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) |
734 | acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) | ||
735 | { | 749 | { |
736 | #ifdef CONFIG_ACPI_NUMA | 750 | #ifdef CONFIG_ACPI_NUMA |
737 | int pxm_id; | 751 | int pxm_id; |
738 | 752 | ||
739 | pxm_id = acpi_get_pxm(handle); | 753 | pxm_id = acpi_get_pxm(handle); |
740 | 754 | ||
@@ -742,31 +756,28 @@ acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) | |||
742 | * Assuming that the container driver would have set the proximity | 756 | * Assuming that the container driver would have set the proximity |
743 | * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag | 757 | * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag |
744 | */ | 758 | */ |
745 | node_cpuid[cpu].nid = (pxm_id < 0) ? 0: | 759 | node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_nid_map[pxm_id]; |
746 | pxm_to_nid_map[pxm_id]; | ||
747 | 760 | ||
748 | node_cpuid[cpu].phys_id = physid; | 761 | node_cpuid[cpu].phys_id = physid; |
749 | #endif | 762 | #endif |
750 | return(0); | 763 | return (0); |
751 | } | 764 | } |
752 | 765 | ||
753 | 766 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |
754 | int | ||
755 | acpi_map_lsapic(acpi_handle handle, int *pcpu) | ||
756 | { | 767 | { |
757 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; | 768 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
758 | union acpi_object *obj; | 769 | union acpi_object *obj; |
759 | struct acpi_table_lsapic *lsapic; | 770 | struct acpi_table_lsapic *lsapic; |
760 | cpumask_t tmp_map; | 771 | cpumask_t tmp_map; |
761 | long physid; | 772 | long physid; |
762 | int cpu; | 773 | int cpu; |
763 | 774 | ||
764 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) | 775 | if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) |
765 | return -EINVAL; | 776 | return -EINVAL; |
766 | 777 | ||
767 | if (!buffer.length || !buffer.pointer) | 778 | if (!buffer.length || !buffer.pointer) |
768 | return -EINVAL; | 779 | return -EINVAL; |
769 | 780 | ||
770 | obj = buffer.pointer; | 781 | obj = buffer.pointer; |
771 | if (obj->type != ACPI_TYPE_BUFFER || | 782 | if (obj->type != ACPI_TYPE_BUFFER || |
772 | obj->buffer.length < sizeof(*lsapic)) { | 783 | obj->buffer.length < sizeof(*lsapic)) { |
@@ -782,7 +793,7 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
782 | return -EINVAL; | 793 | return -EINVAL; |
783 | } | 794 | } |
784 | 795 | ||
785 | physid = ((lsapic->id <<8) | (lsapic->eid)); | 796 | physid = ((lsapic->id << 8) | (lsapic->eid)); |
786 | 797 | ||
787 | acpi_os_free(buffer.pointer); | 798 | acpi_os_free(buffer.pointer); |
788 | buffer.length = ACPI_ALLOCATE_BUFFER; | 799 | buffer.length = ACPI_ALLOCATE_BUFFER; |
@@ -790,50 +801,49 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
790 | 801 | ||
791 | cpus_complement(tmp_map, cpu_present_map); | 802 | cpus_complement(tmp_map, cpu_present_map); |
792 | cpu = first_cpu(tmp_map); | 803 | cpu = first_cpu(tmp_map); |
793 | if(cpu >= NR_CPUS) | 804 | if (cpu >= NR_CPUS) |
794 | return -EINVAL; | 805 | return -EINVAL; |
795 | 806 | ||
796 | acpi_map_cpu2node(handle, cpu, physid); | 807 | acpi_map_cpu2node(handle, cpu, physid); |
797 | 808 | ||
798 | cpu_set(cpu, cpu_present_map); | 809 | cpu_set(cpu, cpu_present_map); |
799 | ia64_cpu_to_sapicid[cpu] = physid; | 810 | ia64_cpu_to_sapicid[cpu] = physid; |
800 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu]; | 811 | ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu]; |
801 | 812 | ||
802 | *pcpu = cpu; | 813 | *pcpu = cpu; |
803 | return(0); | 814 | return (0); |
804 | } | 815 | } |
805 | EXPORT_SYMBOL(acpi_map_lsapic); | ||
806 | 816 | ||
817 | EXPORT_SYMBOL(acpi_map_lsapic); | ||
807 | 818 | ||
808 | int | 819 | int acpi_unmap_lsapic(int cpu) |
809 | acpi_unmap_lsapic(int cpu) | ||
810 | { | 820 | { |
811 | int i; | 821 | int i; |
812 | 822 | ||
813 | for (i=0; i<MAX_SAPICS; i++) { | 823 | for (i = 0; i < MAX_SAPICS; i++) { |
814 | if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) { | 824 | if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) { |
815 | ia64_acpiid_to_sapicid[i] = -1; | 825 | ia64_acpiid_to_sapicid[i] = -1; |
816 | break; | 826 | break; |
817 | } | 827 | } |
818 | } | 828 | } |
819 | ia64_cpu_to_sapicid[cpu] = -1; | 829 | ia64_cpu_to_sapicid[cpu] = -1; |
820 | cpu_clear(cpu,cpu_present_map); | 830 | cpu_clear(cpu, cpu_present_map); |
821 | 831 | ||
822 | #ifdef CONFIG_ACPI_NUMA | 832 | #ifdef CONFIG_ACPI_NUMA |
823 | /* NUMA specific cleanup's */ | 833 | /* NUMA specific cleanup's */ |
824 | #endif | 834 | #endif |
825 | 835 | ||
826 | return(0); | 836 | return (0); |
827 | } | 837 | } |
838 | |||
828 | EXPORT_SYMBOL(acpi_unmap_lsapic); | 839 | EXPORT_SYMBOL(acpi_unmap_lsapic); |
829 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 840 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
830 | |||
831 | 841 | ||
832 | #ifdef CONFIG_ACPI_NUMA | 842 | #ifdef CONFIG_ACPI_NUMA |
833 | acpi_status __devinit | 843 | acpi_status __devinit |
834 | acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) | 844 | acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret) |
835 | { | 845 | { |
836 | struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; | 846 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
837 | union acpi_object *obj; | 847 | union acpi_object *obj; |
838 | struct acpi_table_iosapic *iosapic; | 848 | struct acpi_table_iosapic *iosapic; |
839 | unsigned int gsi_base; | 849 | unsigned int gsi_base; |
@@ -882,10 +892,9 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) | |||
882 | map_iosapic_to_node(gsi_base, node); | 892 | map_iosapic_to_node(gsi_base, node); |
883 | return AE_OK; | 893 | return AE_OK; |
884 | } | 894 | } |
885 | #endif /* CONFIG_NUMA */ | 895 | #endif /* CONFIG_NUMA */ |
886 | 896 | ||
887 | int | 897 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) |
888 | acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base) | ||
889 | { | 898 | { |
890 | int err; | 899 | int err; |
891 | 900 | ||
@@ -894,17 +903,18 @@ acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base) | |||
894 | 903 | ||
895 | #if CONFIG_ACPI_NUMA | 904 | #if CONFIG_ACPI_NUMA |
896 | acpi_map_iosapic(handle, 0, NULL, NULL); | 905 | acpi_map_iosapic(handle, 0, NULL, NULL); |
897 | #endif /* CONFIG_ACPI_NUMA */ | 906 | #endif /* CONFIG_ACPI_NUMA */ |
898 | 907 | ||
899 | return 0; | 908 | return 0; |
900 | } | 909 | } |
910 | |||
901 | EXPORT_SYMBOL(acpi_register_ioapic); | 911 | EXPORT_SYMBOL(acpi_register_ioapic); |
902 | 912 | ||
903 | int | 913 | int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base) |
904 | acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base) | ||
905 | { | 914 | { |
906 | return iosapic_remove(gsi_base); | 915 | return iosapic_remove(gsi_base); |
907 | } | 916 | } |
917 | |||
908 | EXPORT_SYMBOL(acpi_unregister_ioapic); | 918 | EXPORT_SYMBOL(acpi_unregister_ioapic); |
909 | 919 | ||
910 | #endif /* CONFIG_ACPI_BOOT */ | 920 | #endif /* CONFIG_ACPI_BOOT */ |
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c index 7a275de6df22..148f6f7ea315 100644 --- a/arch/x86_64/kernel/acpi/sleep.c +++ b/arch/x86_64/kernel/acpi/sleep.c | |||
@@ -47,7 +47,6 @@ | |||
47 | #include <asm/proto.h> | 47 | #include <asm/proto.h> |
48 | #include <asm/tlbflush.h> | 48 | #include <asm/tlbflush.h> |
49 | 49 | ||
50 | |||
51 | /* -------------------------------------------------------------------------- | 50 | /* -------------------------------------------------------------------------- |
52 | Low-Level Sleep Support | 51 | Low-Level Sleep Support |
53 | -------------------------------------------------------------------------- */ | 52 | -------------------------------------------------------------------------- */ |
@@ -77,11 +76,12 @@ static void init_low_mapping(void) | |||
77 | * Create an identity mapped page table and copy the wakeup routine to | 76 | * Create an identity mapped page table and copy the wakeup routine to |
78 | * low memory. | 77 | * low memory. |
79 | */ | 78 | */ |
80 | int acpi_save_state_mem (void) | 79 | int acpi_save_state_mem(void) |
81 | { | 80 | { |
82 | init_low_mapping(); | 81 | init_low_mapping(); |
83 | 82 | ||
84 | memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); | 83 | memcpy((void *)acpi_wakeup_address, &wakeup_start, |
84 | &wakeup_end - &wakeup_start); | ||
85 | acpi_copy_wakeup_routine(acpi_wakeup_address); | 85 | acpi_copy_wakeup_routine(acpi_wakeup_address); |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
@@ -90,7 +90,7 @@ int acpi_save_state_mem (void) | |||
90 | /* | 90 | /* |
91 | * acpi_restore_state | 91 | * acpi_restore_state |
92 | */ | 92 | */ |
93 | void acpi_restore_state_mem (void) | 93 | void acpi_restore_state_mem(void) |
94 | { | 94 | { |
95 | set_pgd(pgd_offset(current->mm, 0UL), low_ptr); | 95 | set_pgd(pgd_offset(current->mm, 0UL), low_ptr); |
96 | flush_tlb_all(); | 96 | flush_tlb_all(); |
@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void) | |||
108 | { | 108 | { |
109 | acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); | 109 | acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); |
110 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) | 110 | if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) |
111 | printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n"); | 111 | printk(KERN_CRIT |
112 | "ACPI: Wakeup code way too big, will crash on attempt to suspend\n"); | ||
112 | } | 113 | } |
113 | 114 | ||
114 | static int __init acpi_sleep_setup(char *str) | 115 | static int __init acpi_sleep_setup(char *str) |
@@ -127,6 +128,8 @@ static int __init acpi_sleep_setup(char *str) | |||
127 | 128 | ||
128 | __setup("acpi_sleep=", acpi_sleep_setup); | 129 | __setup("acpi_sleep=", acpi_sleep_setup); |
129 | 130 | ||
130 | #endif /*CONFIG_ACPI_SLEEP*/ | 131 | #endif /*CONFIG_ACPI_SLEEP */ |
131 | 132 | ||
132 | void acpi_pci_link_exit(void) {} | 133 | void acpi_pci_link_exit(void) |
134 | { | ||
135 | } | ||