diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 235 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/earlyquirk.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 18 | ||||
-rw-r--r-- | arch/i386/kernel/efi.c | 89 | ||||
-rw-r--r-- | arch/i386/kernel/hpet.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/io_apic.c | 19 | ||||
-rw-r--r-- | arch/i386/kernel/mpparse.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/srat.c | 84 | ||||
-rw-r--r-- | arch/i386/kernel/sysenter.c | 53 |
9 files changed, 251 insertions, 260 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index cbcb2c27f48b..e94aff6888ca 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -66,7 +66,7 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return | |||
66 | 66 | ||
67 | #define BAD_MADT_ENTRY(entry, end) ( \ | 67 | #define BAD_MADT_ENTRY(entry, end) ( \ |
68 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ | 68 | (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ |
69 | ((acpi_table_entry_header *)entry)->length < sizeof(*entry)) | 69 | ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) |
70 | 70 | ||
71 | #define PREFIX "ACPI: " | 71 | #define PREFIX "ACPI: " |
72 | 72 | ||
@@ -79,7 +79,7 @@ int acpi_ioapic; | |||
79 | int acpi_strict; | 79 | int acpi_strict; |
80 | EXPORT_SYMBOL(acpi_strict); | 80 | EXPORT_SYMBOL(acpi_strict); |
81 | 81 | ||
82 | acpi_interrupt_flags acpi_sci_flags __initdata; | 82 | u8 acpi_sci_flags __initdata; |
83 | int acpi_sci_override_gsi __initdata; | 83 | int acpi_sci_override_gsi __initdata; |
84 | int acpi_skip_timer_override __initdata; | 84 | int acpi_skip_timer_override __initdata; |
85 | int acpi_use_timer_override __initdata; | 85 | int acpi_use_timer_override __initdata; |
@@ -92,11 +92,6 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; | |||
92 | #warning ACPI uses CMPXCHG, i486 and later hardware | 92 | #warning ACPI uses CMPXCHG, i486 and later hardware |
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | #define MAX_MADT_ENTRIES 256 | ||
96 | u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] = | ||
97 | {[0 ... MAX_MADT_ENTRIES - 1] = 0xff }; | ||
98 | EXPORT_SYMBOL(x86_acpiid_to_apicid); | ||
99 | |||
100 | /* -------------------------------------------------------------------------- | 95 | /* -------------------------------------------------------------------------- |
101 | Boot-time Configuration | 96 | Boot-time Configuration |
102 | -------------------------------------------------------------------------- */ | 97 | -------------------------------------------------------------------------- */ |
@@ -166,30 +161,26 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) | |||
166 | 161 | ||
167 | #ifdef CONFIG_PCI_MMCONFIG | 162 | #ifdef CONFIG_PCI_MMCONFIG |
168 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ | 163 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ |
169 | struct acpi_table_mcfg_config *pci_mmcfg_config; | 164 | struct acpi_mcfg_allocation *pci_mmcfg_config; |
170 | int pci_mmcfg_config_num; | 165 | int pci_mmcfg_config_num; |
171 | 166 | ||
172 | int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) | 167 | int __init acpi_parse_mcfg(struct acpi_table_header *header) |
173 | { | 168 | { |
174 | struct acpi_table_mcfg *mcfg; | 169 | struct acpi_table_mcfg *mcfg; |
175 | unsigned long i; | 170 | unsigned long i; |
176 | int config_size; | 171 | int config_size; |
177 | 172 | ||
178 | if (!phys_addr || !size) | 173 | if (!header) |
179 | return -EINVAL; | 174 | return -EINVAL; |
180 | 175 | ||
181 | mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size); | 176 | mcfg = (struct acpi_table_mcfg *)header; |
182 | if (!mcfg) { | ||
183 | printk(KERN_WARNING PREFIX "Unable to map MCFG\n"); | ||
184 | return -ENODEV; | ||
185 | } | ||
186 | 177 | ||
187 | /* how many config structures do we have */ | 178 | /* how many config structures do we have */ |
188 | pci_mmcfg_config_num = 0; | 179 | pci_mmcfg_config_num = 0; |
189 | i = size - sizeof(struct acpi_table_mcfg); | 180 | i = header->length - sizeof(struct acpi_table_mcfg); |
190 | while (i >= sizeof(struct acpi_table_mcfg_config)) { | 181 | while (i >= sizeof(struct acpi_mcfg_allocation)) { |
191 | ++pci_mmcfg_config_num; | 182 | ++pci_mmcfg_config_num; |
192 | i -= sizeof(struct acpi_table_mcfg_config); | 183 | i -= sizeof(struct acpi_mcfg_allocation); |
193 | }; | 184 | }; |
194 | if (pci_mmcfg_config_num == 0) { | 185 | if (pci_mmcfg_config_num == 0) { |
195 | printk(KERN_ERR PREFIX "MMCONFIG has no entries\n"); | 186 | printk(KERN_ERR PREFIX "MMCONFIG has no entries\n"); |
@@ -204,9 +195,9 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) | |||
204 | return -ENOMEM; | 195 | return -ENOMEM; |
205 | } | 196 | } |
206 | 197 | ||
207 | memcpy(pci_mmcfg_config, &mcfg->config, config_size); | 198 | memcpy(pci_mmcfg_config, &mcfg[1], config_size); |
208 | for (i = 0; i < pci_mmcfg_config_num; ++i) { | 199 | for (i = 0; i < pci_mmcfg_config_num; ++i) { |
209 | if (mcfg->config[i].base_reserved) { | 200 | if (pci_mmcfg_config[i].address > 0xFFFFFFFF) { |
210 | printk(KERN_ERR PREFIX | 201 | printk(KERN_ERR PREFIX |
211 | "MMCONFIG not in low 4GB of memory\n"); | 202 | "MMCONFIG not in low 4GB of memory\n"); |
212 | kfree(pci_mmcfg_config); | 203 | kfree(pci_mmcfg_config); |
@@ -220,24 +211,24 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) | |||
220 | #endif /* CONFIG_PCI_MMCONFIG */ | 211 | #endif /* CONFIG_PCI_MMCONFIG */ |
221 | 212 | ||
222 | #ifdef CONFIG_X86_LOCAL_APIC | 213 | #ifdef CONFIG_X86_LOCAL_APIC |
223 | static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) | 214 | static int __init acpi_parse_madt(struct acpi_table_header *table) |
224 | { | 215 | { |
225 | struct acpi_table_madt *madt = NULL; | 216 | struct acpi_table_madt *madt = NULL; |
226 | 217 | ||
227 | if (!phys_addr || !size || !cpu_has_apic) | 218 | if (!cpu_has_apic) |
228 | return -EINVAL; | 219 | return -EINVAL; |
229 | 220 | ||
230 | madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size); | 221 | madt = (struct acpi_table_madt *)table; |
231 | if (!madt) { | 222 | if (!madt) { |
232 | printk(KERN_WARNING PREFIX "Unable to map MADT\n"); | 223 | printk(KERN_WARNING PREFIX "Unable to map MADT\n"); |
233 | return -ENODEV; | 224 | return -ENODEV; |
234 | } | 225 | } |
235 | 226 | ||
236 | if (madt->lapic_address) { | 227 | if (madt->address) { |
237 | acpi_lapic_addr = (u64) madt->lapic_address; | 228 | acpi_lapic_addr = (u64) madt->address; |
238 | 229 | ||
239 | printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", | 230 | printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n", |
240 | madt->lapic_address); | 231 | madt->address); |
241 | } | 232 | } |
242 | 233 | ||
243 | acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); | 234 | acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id); |
@@ -246,21 +237,17 @@ static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size) | |||
246 | } | 237 | } |
247 | 238 | ||
248 | static int __init | 239 | static int __init |
249 | acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end) | 240 | acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) |
250 | { | 241 | { |
251 | struct acpi_table_lapic *processor = NULL; | 242 | struct acpi_madt_local_apic *processor = NULL; |
252 | 243 | ||
253 | processor = (struct acpi_table_lapic *)header; | 244 | processor = (struct acpi_madt_local_apic *)header; |
254 | 245 | ||
255 | if (BAD_MADT_ENTRY(processor, end)) | 246 | if (BAD_MADT_ENTRY(processor, end)) |
256 | return -EINVAL; | 247 | return -EINVAL; |
257 | 248 | ||
258 | acpi_table_print_madt_entry(header); | 249 | acpi_table_print_madt_entry(header); |
259 | 250 | ||
260 | /* Record local apic id only when enabled */ | ||
261 | if (processor->flags.enabled) | ||
262 | x86_acpiid_to_apicid[processor->acpi_id] = processor->id; | ||
263 | |||
264 | /* | 251 | /* |
265 | * We need to register disabled CPU as well to permit | 252 | * We need to register disabled CPU as well to permit |
266 | * counting disabled CPUs. This allows us to size | 253 | * counting disabled CPUs. This allows us to size |
@@ -269,18 +256,18 @@ acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end) | |||
269 | * when we use CPU hotplug. | 256 | * when we use CPU hotplug. |
270 | */ | 257 | */ |
271 | mp_register_lapic(processor->id, /* APIC ID */ | 258 | mp_register_lapic(processor->id, /* APIC ID */ |
272 | processor->flags.enabled); /* Enabled? */ | 259 | processor->lapic_flags & ACPI_MADT_ENABLED); /* Enabled? */ |
273 | 260 | ||
274 | return 0; | 261 | return 0; |
275 | } | 262 | } |
276 | 263 | ||
277 | static int __init | 264 | static int __init |
278 | acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, | 265 | acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, |
279 | const unsigned long end) | 266 | const unsigned long end) |
280 | { | 267 | { |
281 | struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL; | 268 | struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL; |
282 | 269 | ||
283 | lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header; | 270 | lapic_addr_ovr = (struct acpi_madt_local_apic_override *)header; |
284 | 271 | ||
285 | if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) | 272 | if (BAD_MADT_ENTRY(lapic_addr_ovr, end)) |
286 | return -EINVAL; | 273 | return -EINVAL; |
@@ -291,11 +278,11 @@ acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header, | |||
291 | } | 278 | } |
292 | 279 | ||
293 | static int __init | 280 | static int __init |
294 | acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) | 281 | acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end) |
295 | { | 282 | { |
296 | struct acpi_table_lapic_nmi *lapic_nmi = NULL; | 283 | struct acpi_madt_local_apic_nmi *lapic_nmi = NULL; |
297 | 284 | ||
298 | lapic_nmi = (struct acpi_table_lapic_nmi *)header; | 285 | lapic_nmi = (struct acpi_madt_local_apic_nmi *)header; |
299 | 286 | ||
300 | if (BAD_MADT_ENTRY(lapic_nmi, end)) | 287 | if (BAD_MADT_ENTRY(lapic_nmi, end)) |
301 | return -EINVAL; | 288 | return -EINVAL; |
@@ -313,11 +300,11 @@ acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end) | |||
313 | #ifdef CONFIG_X86_IO_APIC | 300 | #ifdef CONFIG_X86_IO_APIC |
314 | 301 | ||
315 | static int __init | 302 | static int __init |
316 | acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end) | 303 | acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end) |
317 | { | 304 | { |
318 | struct acpi_table_ioapic *ioapic = NULL; | 305 | struct acpi_madt_io_apic *ioapic = NULL; |
319 | 306 | ||
320 | ioapic = (struct acpi_table_ioapic *)header; | 307 | ioapic = (struct acpi_madt_io_apic *)header; |
321 | 308 | ||
322 | if (BAD_MADT_ENTRY(ioapic, end)) | 309 | if (BAD_MADT_ENTRY(ioapic, end)) |
323 | return -EINVAL; | 310 | return -EINVAL; |
@@ -342,11 +329,11 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | |||
342 | polarity = 3; | 329 | polarity = 3; |
343 | 330 | ||
344 | /* Command-line over-ride via acpi_sci= */ | 331 | /* Command-line over-ride via acpi_sci= */ |
345 | if (acpi_sci_flags.trigger) | 332 | if (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) |
346 | trigger = acpi_sci_flags.trigger; | 333 | trigger = (acpi_sci_flags & ACPI_MADT_TRIGGER_MASK) >> 2; |
347 | 334 | ||
348 | if (acpi_sci_flags.polarity) | 335 | if (acpi_sci_flags & ACPI_MADT_POLARITY_MASK) |
349 | polarity = acpi_sci_flags.polarity; | 336 | polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK; |
350 | 337 | ||
351 | /* | 338 | /* |
352 | * mp_config_acpi_legacy_irqs() already setup IRQs < 16 | 339 | * mp_config_acpi_legacy_irqs() already setup IRQs < 16 |
@@ -357,51 +344,52 @@ static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) | |||
357 | 344 | ||
358 | /* | 345 | /* |
359 | * stash over-ride to indicate we've been here | 346 | * stash over-ride to indicate we've been here |
360 | * and for later update of acpi_fadt | 347 | * and for later update of acpi_gbl_FADT |
361 | */ | 348 | */ |
362 | acpi_sci_override_gsi = gsi; | 349 | acpi_sci_override_gsi = gsi; |
363 | return; | 350 | return; |
364 | } | 351 | } |
365 | 352 | ||
366 | static int __init | 353 | static int __init |
367 | acpi_parse_int_src_ovr(acpi_table_entry_header * header, | 354 | acpi_parse_int_src_ovr(struct acpi_subtable_header * header, |
368 | const unsigned long end) | 355 | const unsigned long end) |
369 | { | 356 | { |
370 | struct acpi_table_int_src_ovr *intsrc = NULL; | 357 | struct acpi_madt_interrupt_override *intsrc = NULL; |
371 | 358 | ||
372 | intsrc = (struct acpi_table_int_src_ovr *)header; | 359 | intsrc = (struct acpi_madt_interrupt_override *)header; |
373 | 360 | ||
374 | if (BAD_MADT_ENTRY(intsrc, end)) | 361 | if (BAD_MADT_ENTRY(intsrc, end)) |
375 | return -EINVAL; | 362 | return -EINVAL; |
376 | 363 | ||
377 | acpi_table_print_madt_entry(header); | 364 | acpi_table_print_madt_entry(header); |
378 | 365 | ||
379 | if (intsrc->bus_irq == acpi_fadt.sci_int) { | 366 | if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) { |
380 | acpi_sci_ioapic_setup(intsrc->global_irq, | 367 | acpi_sci_ioapic_setup(intsrc->global_irq, |
381 | intsrc->flags.polarity, | 368 | intsrc->inti_flags & ACPI_MADT_POLARITY_MASK, |
382 | intsrc->flags.trigger); | 369 | (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2); |
383 | return 0; | 370 | return 0; |
384 | } | 371 | } |
385 | 372 | ||
386 | if (acpi_skip_timer_override && | 373 | if (acpi_skip_timer_override && |
387 | intsrc->bus_irq == 0 && intsrc->global_irq == 2) { | 374 | intsrc->source_irq == 0 && intsrc->global_irq == 2) { |
388 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); | 375 | printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); |
389 | return 0; | 376 | return 0; |
390 | } | 377 | } |
391 | 378 | ||
392 | mp_override_legacy_irq(intsrc->bus_irq, | 379 | mp_override_legacy_irq(intsrc->source_irq, |
393 | intsrc->flags.polarity, | 380 | intsrc->inti_flags & ACPI_MADT_POLARITY_MASK, |
394 | intsrc->flags.trigger, intsrc->global_irq); | 381 | (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2, |
382 | intsrc->global_irq); | ||
395 | 383 | ||
396 | return 0; | 384 | return 0; |
397 | } | 385 | } |
398 | 386 | ||
399 | static int __init | 387 | static int __init |
400 | acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) | 388 | acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end) |
401 | { | 389 | { |
402 | struct acpi_table_nmi_src *nmi_src = NULL; | 390 | struct acpi_madt_nmi_source *nmi_src = NULL; |
403 | 391 | ||
404 | nmi_src = (struct acpi_table_nmi_src *)header; | 392 | nmi_src = (struct acpi_madt_nmi_source *)header; |
405 | 393 | ||
406 | if (BAD_MADT_ENTRY(nmi_src, end)) | 394 | if (BAD_MADT_ENTRY(nmi_src, end)) |
407 | return -EINVAL; | 395 | return -EINVAL; |
@@ -417,7 +405,7 @@ acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end) | |||
417 | 405 | ||
418 | /* | 406 | /* |
419 | * acpi_pic_sci_set_trigger() | 407 | * acpi_pic_sci_set_trigger() |
420 | * | 408 | * |
421 | * use ELCR to set PIC-mode trigger type for SCI | 409 | * use ELCR to set PIC-mode trigger type for SCI |
422 | * | 410 | * |
423 | * If a PIC-mode SCI is not recognized or gives spurious IRQ7's | 411 | * If a PIC-mode SCI is not recognized or gives spurious IRQ7's |
@@ -511,7 +499,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
511 | { | 499 | { |
512 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 500 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
513 | union acpi_object *obj; | 501 | union acpi_object *obj; |
514 | struct acpi_table_lapic *lapic; | 502 | struct acpi_madt_local_apic *lapic; |
515 | cpumask_t tmp_map, new_map; | 503 | cpumask_t tmp_map, new_map; |
516 | u8 physid; | 504 | u8 physid; |
517 | int cpu; | 505 | int cpu; |
@@ -529,10 +517,10 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
529 | return -EINVAL; | 517 | return -EINVAL; |
530 | } | 518 | } |
531 | 519 | ||
532 | lapic = (struct acpi_table_lapic *)obj->buffer.pointer; | 520 | lapic = (struct acpi_madt_local_apic *)obj->buffer.pointer; |
533 | 521 | ||
534 | if ((lapic->header.type != ACPI_MADT_LAPIC) || | 522 | if (lapic->header.type != ACPI_MADT_TYPE_LOCAL_APIC || |
535 | (!lapic->flags.enabled)) { | 523 | !(lapic->lapic_flags & ACPI_MADT_ENABLED)) { |
536 | kfree(buffer.pointer); | 524 | kfree(buffer.pointer); |
537 | return -EINVAL; | 525 | return -EINVAL; |
538 | } | 526 | } |
@@ -544,7 +532,7 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu) | |||
544 | buffer.pointer = NULL; | 532 | buffer.pointer = NULL; |
545 | 533 | ||
546 | tmp_map = cpu_present_map; | 534 | tmp_map = cpu_present_map; |
547 | mp_register_lapic(physid, lapic->flags.enabled); | 535 | mp_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED); |
548 | 536 | ||
549 | /* | 537 | /* |
550 | * If mp_register_lapic successfully generates a new logical cpu | 538 | * If mp_register_lapic successfully generates a new logical cpu |
@@ -566,14 +554,6 @@ EXPORT_SYMBOL(acpi_map_lsapic); | |||
566 | 554 | ||
567 | int acpi_unmap_lsapic(int cpu) | 555 | int acpi_unmap_lsapic(int cpu) |
568 | { | 556 | { |
569 | int i; | ||
570 | |||
571 | for_each_possible_cpu(i) { | ||
572 | if (x86_acpiid_to_apicid[i] == x86_cpu_to_apicid[cpu]) { | ||
573 | x86_acpiid_to_apicid[i] = -1; | ||
574 | break; | ||
575 | } | ||
576 | } | ||
577 | x86_cpu_to_apicid[cpu] = -1; | 557 | x86_cpu_to_apicid[cpu] = -1; |
578 | cpu_clear(cpu, cpu_present_map); | 558 | cpu_clear(cpu, cpu_present_map); |
579 | num_processors--; | 559 | num_processors--; |
@@ -619,42 +599,36 @@ acpi_scan_rsdp(unsigned long start, unsigned long length) | |||
619 | return 0; | 599 | return 0; |
620 | } | 600 | } |
621 | 601 | ||
622 | static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size) | 602 | static int __init acpi_parse_sbf(struct acpi_table_header *table) |
623 | { | 603 | { |
624 | struct acpi_table_sbf *sb; | 604 | struct acpi_table_boot *sb; |
625 | |||
626 | if (!phys_addr || !size) | ||
627 | return -EINVAL; | ||
628 | 605 | ||
629 | sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size); | 606 | sb = (struct acpi_table_boot *)table; |
630 | if (!sb) { | 607 | if (!sb) { |
631 | printk(KERN_WARNING PREFIX "Unable to map SBF\n"); | 608 | printk(KERN_WARNING PREFIX "Unable to map SBF\n"); |
632 | return -ENODEV; | 609 | return -ENODEV; |
633 | } | 610 | } |
634 | 611 | ||
635 | sbf_port = sb->sbf_cmos; /* Save CMOS port */ | 612 | sbf_port = sb->cmos_index; /* Save CMOS port */ |
636 | 613 | ||
637 | return 0; | 614 | return 0; |
638 | } | 615 | } |
639 | 616 | ||
640 | #ifdef CONFIG_HPET_TIMER | 617 | #ifdef CONFIG_HPET_TIMER |
641 | 618 | ||
642 | static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | 619 | static int __init acpi_parse_hpet(struct acpi_table_header *table) |
643 | { | 620 | { |
644 | struct acpi_table_hpet *hpet_tbl; | 621 | struct acpi_table_hpet *hpet_tbl; |
645 | struct resource *hpet_res; | 622 | struct resource *hpet_res; |
646 | resource_size_t res_start; | 623 | resource_size_t res_start; |
647 | 624 | ||
648 | if (!phys || !size) | 625 | hpet_tbl = (struct acpi_table_hpet *)table; |
649 | return -EINVAL; | ||
650 | |||
651 | hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size); | ||
652 | if (!hpet_tbl) { | 626 | if (!hpet_tbl) { |
653 | printk(KERN_WARNING PREFIX "Unable to map HPET\n"); | 627 | printk(KERN_WARNING PREFIX "Unable to map HPET\n"); |
654 | return -ENODEV; | 628 | return -ENODEV; |
655 | } | 629 | } |
656 | 630 | ||
657 | if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) { | 631 | if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) { |
658 | printk(KERN_WARNING PREFIX "HPET timers must be located in " | 632 | printk(KERN_WARNING PREFIX "HPET timers must be located in " |
659 | "memory.\n"); | 633 | "memory.\n"); |
660 | return -1; | 634 | return -1; |
@@ -667,29 +641,28 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | |||
667 | hpet_res->name = (void *)&hpet_res[1]; | 641 | hpet_res->name = (void *)&hpet_res[1]; |
668 | hpet_res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 642 | hpet_res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
669 | snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, | 643 | snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, |
670 | "HPET %u", hpet_tbl->number); | 644 | "HPET %u", hpet_tbl->sequence); |
671 | hpet_res->end = (1 * 1024) - 1; | 645 | hpet_res->end = (1 * 1024) - 1; |
672 | } | 646 | } |
673 | 647 | ||
674 | #ifdef CONFIG_X86_64 | 648 | #ifdef CONFIG_X86_64 |
675 | vxtime.hpet_address = hpet_tbl->addr.addrl | | 649 | vxtime.hpet_address = hpet_tbl->address.address; |
676 | ((long)hpet_tbl->addr.addrh << 32); | ||
677 | 650 | ||
678 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", | 651 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", |
679 | hpet_tbl->id, vxtime.hpet_address); | 652 | hpet_tbl->id, vxtime.hpet_address); |
680 | 653 | ||
681 | res_start = vxtime.hpet_address; | 654 | res_start = vxtime.hpet_address; |
682 | #else /* X86 */ | 655 | #else /* X86 */ |
683 | { | 656 | { |
684 | extern unsigned long hpet_address; | 657 | extern unsigned long hpet_address; |
685 | 658 | ||
686 | hpet_address = hpet_tbl->addr.addrl; | 659 | hpet_address = hpet_tbl->address.address; |
687 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", | 660 | printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", |
688 | hpet_tbl->id, hpet_address); | 661 | hpet_tbl->id, hpet_address); |
689 | 662 | ||
690 | res_start = hpet_address; | 663 | res_start = hpet_address; |
691 | } | 664 | } |
692 | #endif /* X86 */ | 665 | #endif /* X86 */ |
693 | 666 | ||
694 | if (hpet_res) { | 667 | if (hpet_res) { |
695 | hpet_res->start = res_start; | 668 | hpet_res->start = res_start; |
@@ -707,42 +680,28 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) | |||
707 | extern u32 pmtmr_ioport; | 680 | extern u32 pmtmr_ioport; |
708 | #endif | 681 | #endif |
709 | 682 | ||
710 | static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) | 683 | static int __init acpi_parse_fadt(struct acpi_table_header *table) |
711 | { | 684 | { |
712 | struct fadt_descriptor *fadt = NULL; | ||
713 | |||
714 | fadt = (struct fadt_descriptor *)__acpi_map_table(phys, size); | ||
715 | if (!fadt) { | ||
716 | printk(KERN_WARNING PREFIX "Unable to map FADT\n"); | ||
717 | return 0; | ||
718 | } | ||
719 | /* initialize sci_int early for INT_SRC_OVR MADT parsing */ | ||
720 | acpi_fadt.sci_int = fadt->sci_int; | ||
721 | |||
722 | /* initialize rev and apic_phys_dest_mode for x86_64 genapic */ | ||
723 | acpi_fadt.revision = fadt->revision; | ||
724 | acpi_fadt.force_apic_physical_destination_mode = | ||
725 | fadt->force_apic_physical_destination_mode; | ||
726 | 685 | ||
727 | #ifdef CONFIG_X86_PM_TIMER | 686 | #ifdef CONFIG_X86_PM_TIMER |
728 | /* detect the location of the ACPI PM Timer */ | 687 | /* detect the location of the ACPI PM Timer */ |
729 | if (fadt->revision >= FADT2_REVISION_ID) { | 688 | if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) { |
730 | /* FADT rev. 2 */ | 689 | /* FADT rev. 2 */ |
731 | if (fadt->xpm_tmr_blk.address_space_id != | 690 | if (acpi_gbl_FADT.xpm_timer_block.space_id != |
732 | ACPI_ADR_SPACE_SYSTEM_IO) | 691 | ACPI_ADR_SPACE_SYSTEM_IO) |
733 | return 0; | 692 | return 0; |
734 | 693 | ||
735 | pmtmr_ioport = fadt->xpm_tmr_blk.address; | 694 | pmtmr_ioport = acpi_gbl_FADT.xpm_timer_block.address; |
736 | /* | 695 | /* |
737 | * "X" fields are optional extensions to the original V1.0 | 696 | * "X" fields are optional extensions to the original V1.0 |
738 | * fields, so we must selectively expand V1.0 fields if the | 697 | * fields, so we must selectively expand V1.0 fields if the |
739 | * corresponding X field is zero. | 698 | * corresponding X field is zero. |
740 | */ | 699 | */ |
741 | if (!pmtmr_ioport) | 700 | if (!pmtmr_ioport) |
742 | pmtmr_ioport = fadt->V1_pm_tmr_blk; | 701 | pmtmr_ioport = acpi_gbl_FADT.pm_timer_block; |
743 | } else { | 702 | } else { |
744 | /* FADT rev. 1 */ | 703 | /* FADT rev. 1 */ |
745 | pmtmr_ioport = fadt->V1_pm_tmr_blk; | 704 | pmtmr_ioport = acpi_gbl_FADT.pm_timer_block; |
746 | } | 705 | } |
747 | if (pmtmr_ioport) | 706 | if (pmtmr_ioport) |
748 | printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", | 707 | printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", |
@@ -784,13 +743,13 @@ static int __init acpi_parse_madt_lapic_entries(void) | |||
784 | if (!cpu_has_apic) | 743 | if (!cpu_has_apic) |
785 | return -ENODEV; | 744 | return -ENODEV; |
786 | 745 | ||
787 | /* | 746 | /* |
788 | * Note that the LAPIC address is obtained from the MADT (32-bit value) | 747 | * Note that the LAPIC address is obtained from the MADT (32-bit value) |
789 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). | 748 | * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). |
790 | */ | 749 | */ |
791 | 750 | ||
792 | count = | 751 | count = |
793 | acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, | 752 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, |
794 | acpi_parse_lapic_addr_ovr, 0); | 753 | acpi_parse_lapic_addr_ovr, 0); |
795 | if (count < 0) { | 754 | if (count < 0) { |
796 | printk(KERN_ERR PREFIX | 755 | printk(KERN_ERR PREFIX |
@@ -800,7 +759,7 @@ static int __init acpi_parse_madt_lapic_entries(void) | |||
800 | 759 | ||
801 | mp_register_lapic_address(acpi_lapic_addr); | 760 | mp_register_lapic_address(acpi_lapic_addr); |
802 | 761 | ||
803 | count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic, | 762 | count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC, acpi_parse_lapic, |
804 | MAX_APICS); | 763 | MAX_APICS); |
805 | if (!count) { | 764 | if (!count) { |
806 | printk(KERN_ERR PREFIX "No LAPIC entries present\n"); | 765 | printk(KERN_ERR PREFIX "No LAPIC entries present\n"); |
@@ -813,7 +772,7 @@ static int __init acpi_parse_madt_lapic_entries(void) | |||
813 | } | 772 | } |
814 | 773 | ||
815 | count = | 774 | count = |
816 | acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0); | 775 | acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0); |
817 | if (count < 0) { | 776 | if (count < 0) { |
818 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 777 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
819 | /* TBD: Cleanup to allow fallback to MPS */ | 778 | /* TBD: Cleanup to allow fallback to MPS */ |
@@ -842,7 +801,7 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
842 | return -ENODEV; | 801 | return -ENODEV; |
843 | } | 802 | } |
844 | 803 | ||
845 | if (!cpu_has_apic) | 804 | if (!cpu_has_apic) |
846 | return -ENODEV; | 805 | return -ENODEV; |
847 | 806 | ||
848 | /* | 807 | /* |
@@ -855,7 +814,7 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
855 | } | 814 | } |
856 | 815 | ||
857 | count = | 816 | count = |
858 | acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, | 817 | acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic, |
859 | MAX_IO_APICS); | 818 | MAX_IO_APICS); |
860 | if (!count) { | 819 | if (!count) { |
861 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); | 820 | printk(KERN_ERR PREFIX "No IOAPIC entries present\n"); |
@@ -866,7 +825,7 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
866 | } | 825 | } |
867 | 826 | ||
868 | count = | 827 | count = |
869 | acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, | 828 | acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr, |
870 | NR_IRQ_VECTORS); | 829 | NR_IRQ_VECTORS); |
871 | if (count < 0) { | 830 | if (count < 0) { |
872 | printk(KERN_ERR PREFIX | 831 | printk(KERN_ERR PREFIX |
@@ -880,13 +839,13 @@ static int __init acpi_parse_madt_ioapic_entries(void) | |||
880 | * pretend we got one so we can set the SCI flags. | 839 | * pretend we got one so we can set the SCI flags. |
881 | */ | 840 | */ |
882 | if (!acpi_sci_override_gsi) | 841 | if (!acpi_sci_override_gsi) |
883 | acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0); | 842 | acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0); |
884 | 843 | ||
885 | /* Fill in identity legacy mapings where no override */ | 844 | /* Fill in identity legacy mapings where no override */ |
886 | mp_config_acpi_legacy_irqs(); | 845 | mp_config_acpi_legacy_irqs(); |
887 | 846 | ||
888 | count = | 847 | count = |
889 | acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, | 848 | acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_parse_nmi_src, |
890 | NR_IRQ_VECTORS); | 849 | NR_IRQ_VECTORS); |
891 | if (count < 0) { | 850 | if (count < 0) { |
892 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); | 851 | printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); |
@@ -908,7 +867,7 @@ static void __init acpi_process_madt(void) | |||
908 | #ifdef CONFIG_X86_LOCAL_APIC | 867 | #ifdef CONFIG_X86_LOCAL_APIC |
909 | int count, error; | 868 | int count, error; |
910 | 869 | ||
911 | count = acpi_table_parse(ACPI_APIC, acpi_parse_madt); | 870 | count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt); |
912 | if (count >= 1) { | 871 | if (count >= 1) { |
913 | 872 | ||
914 | /* | 873 | /* |
@@ -1195,7 +1154,7 @@ int __init acpi_boot_table_init(void) | |||
1195 | if (acpi_disabled && !acpi_ht) | 1154 | if (acpi_disabled && !acpi_ht) |
1196 | return 1; | 1155 | return 1; |
1197 | 1156 | ||
1198 | /* | 1157 | /* |
1199 | * Initialize the ACPI boot-time table parser. | 1158 | * Initialize the ACPI boot-time table parser. |
1200 | */ | 1159 | */ |
1201 | error = acpi_table_init(); | 1160 | error = acpi_table_init(); |
@@ -1204,7 +1163,7 @@ int __init acpi_boot_table_init(void) | |||
1204 | return error; | 1163 | return error; |
1205 | } | 1164 | } |
1206 | 1165 | ||
1207 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); | 1166 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); |
1208 | 1167 | ||
1209 | /* | 1168 | /* |
1210 | * blacklist may disable ACPI entirely | 1169 | * blacklist may disable ACPI entirely |
@@ -1232,19 +1191,19 @@ int __init acpi_boot_init(void) | |||
1232 | if (acpi_disabled && !acpi_ht) | 1191 | if (acpi_disabled && !acpi_ht) |
1233 | return 1; | 1192 | return 1; |
1234 | 1193 | ||
1235 | acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); | 1194 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); |
1236 | 1195 | ||
1237 | /* | 1196 | /* |
1238 | * set sci_int and PM timer address | 1197 | * set sci_int and PM timer address |
1239 | */ | 1198 | */ |
1240 | acpi_table_parse(ACPI_FADT, acpi_parse_fadt); | 1199 | acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt); |
1241 | 1200 | ||
1242 | /* | 1201 | /* |
1243 | * Process the Multiple APIC Description Table (MADT), if present | 1202 | * Process the Multiple APIC Description Table (MADT), if present |
1244 | */ | 1203 | */ |
1245 | acpi_process_madt(); | 1204 | acpi_process_madt(); |
1246 | 1205 | ||
1247 | acpi_table_parse(ACPI_HPET, acpi_parse_hpet); | 1206 | acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet); |
1248 | 1207 | ||
1249 | return 0; | 1208 | return 0; |
1250 | } | 1209 | } |
@@ -1315,13 +1274,17 @@ static int __init setup_acpi_sci(char *s) | |||
1315 | if (!s) | 1274 | if (!s) |
1316 | return -EINVAL; | 1275 | return -EINVAL; |
1317 | if (!strcmp(s, "edge")) | 1276 | if (!strcmp(s, "edge")) |
1318 | acpi_sci_flags.trigger = 1; | 1277 | acpi_sci_flags = ACPI_MADT_TRIGGER_EDGE | |
1278 | (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK); | ||
1319 | else if (!strcmp(s, "level")) | 1279 | else if (!strcmp(s, "level")) |
1320 | acpi_sci_flags.trigger = 3; | 1280 | acpi_sci_flags = ACPI_MADT_TRIGGER_LEVEL | |
1281 | (acpi_sci_flags & ~ACPI_MADT_TRIGGER_MASK); | ||
1321 | else if (!strcmp(s, "high")) | 1282 | else if (!strcmp(s, "high")) |
1322 | acpi_sci_flags.polarity = 1; | 1283 | acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_HIGH | |
1284 | (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK); | ||
1323 | else if (!strcmp(s, "low")) | 1285 | else if (!strcmp(s, "low")) |
1324 | acpi_sci_flags.polarity = 3; | 1286 | acpi_sci_flags = ACPI_MADT_POLARITY_ACTIVE_LOW | |
1287 | (acpi_sci_flags & ~ACPI_MADT_POLARITY_MASK); | ||
1325 | else | 1288 | else |
1326 | return -EINVAL; | 1289 | return -EINVAL; |
1327 | return 0; | 1290 | return 0; |
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index 4b60af7f91dd..bf86f7662d8b 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | static int nvidia_hpet_detected __initdata; | 17 | static int nvidia_hpet_detected __initdata; |
18 | 18 | ||
19 | static int __init nvidia_hpet_check(unsigned long phys, unsigned long size) | 19 | static int __init nvidia_hpet_check(struct acpi_table_header *header) |
20 | { | 20 | { |
21 | nvidia_hpet_detected = 1; | 21 | nvidia_hpet_detected = 1; |
22 | return 0; | 22 | return 0; |
@@ -30,7 +30,7 @@ static int __init check_bridge(int vendor, int device) | |||
30 | is enabled. */ | 30 | is enabled. */ |
31 | if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { | 31 | if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { |
32 | nvidia_hpet_detected = 0; | 32 | nvidia_hpet_detected = 0; |
33 | acpi_table_parse(ACPI_HPET, nvidia_hpet_check); | 33 | acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check); |
34 | if (nvidia_hpet_detected == 0) { | 34 | if (nvidia_hpet_detected == 0) { |
35 | acpi_skip_timer_override = 1; | 35 | acpi_skip_timer_override = 1; |
36 | printk(KERN_INFO "Nvidia board " | 36 | printk(KERN_INFO "Nvidia board " |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index 8f40cb47720e..fa5cac255c16 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c | |||
@@ -196,7 +196,7 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index) | |||
196 | inb(cx_address); | 196 | inb(cx_address); |
197 | /* Dummy op - must do something useless after P_LVL3 | 197 | /* Dummy op - must do something useless after P_LVL3 |
198 | * read */ | 198 | * read */ |
199 | t = inl(acpi_fadt.xpm_tmr_blk.address); | 199 | t = inl(acpi_gbl_FADT.xpm_timer_block.address); |
200 | } | 200 | } |
201 | longhaul.bits.EnableSoftVID = 0; | 201 | longhaul.bits.EnableSoftVID = 0; |
202 | wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); | 202 | wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); |
@@ -214,7 +214,7 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index) | |||
214 | /* Invoke C3 */ | 214 | /* Invoke C3 */ |
215 | inb(cx_address); | 215 | inb(cx_address); |
216 | /* Dummy op - must do something useless after P_LVL3 read */ | 216 | /* Dummy op - must do something useless after P_LVL3 read */ |
217 | t = inl(acpi_fadt.xpm_tmr_blk.address); | 217 | t = inl(acpi_gbl_FADT.xpm_timer_block.address); |
218 | } | 218 | } |
219 | /* Disable bus ratio bit */ | 219 | /* Disable bus ratio bit */ |
220 | longhaul.bits.EnableSoftBusRatio = 0; | 220 | longhaul.bits.EnableSoftBusRatio = 0; |
@@ -234,7 +234,7 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index) | |||
234 | inb(cx_address); | 234 | inb(cx_address); |
235 | /* Dummy op - must do something useless after P_LVL3 | 235 | /* Dummy op - must do something useless after P_LVL3 |
236 | * read */ | 236 | * read */ |
237 | t = inl(acpi_fadt.xpm_tmr_blk.address); | 237 | t = inl(acpi_gbl_FADT.xpm_timer_block.address); |
238 | } | 238 | } |
239 | longhaul.bits.EnableSoftVID = 0; | 239 | longhaul.bits.EnableSoftVID = 0; |
240 | wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); | 240 | wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); |
@@ -291,8 +291,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index) | |||
291 | outb(3, 0x22); | 291 | outb(3, 0x22); |
292 | } else if ((pr != NULL) && pr->flags.bm_control) { | 292 | } else if ((pr != NULL) && pr->flags.bm_control) { |
293 | /* Disable bus master arbitration */ | 293 | /* Disable bus master arbitration */ |
294 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1, | 294 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1); |
295 | ACPI_MTX_DO_NOT_LOCK); | ||
296 | } | 295 | } |
297 | switch (longhaul_version) { | 296 | switch (longhaul_version) { |
298 | 297 | ||
@@ -322,8 +321,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index) | |||
322 | case TYPE_POWERSAVER: | 321 | case TYPE_POWERSAVER: |
323 | if (longhaul_flags & USE_ACPI_C3) { | 322 | if (longhaul_flags & USE_ACPI_C3) { |
324 | /* Don't allow wakeup */ | 323 | /* Don't allow wakeup */ |
325 | acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0, | 324 | acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0); |
326 | ACPI_MTX_DO_NOT_LOCK); | ||
327 | do_powersaver(cx->address, clock_ratio_index); | 325 | do_powersaver(cx->address, clock_ratio_index); |
328 | } else { | 326 | } else { |
329 | do_powersaver(0, clock_ratio_index); | 327 | do_powersaver(0, clock_ratio_index); |
@@ -336,8 +334,7 @@ static void longhaul_setstate(unsigned int clock_ratio_index) | |||
336 | outb(0, 0x22); | 334 | outb(0, 0x22); |
337 | } else if ((pr != NULL) && pr->flags.bm_control) { | 335 | } else if ((pr != NULL) && pr->flags.bm_control) { |
338 | /* Enable bus master arbitration */ | 336 | /* Enable bus master arbitration */ |
339 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0, | 337 | acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); |
340 | ACPI_MTX_DO_NOT_LOCK); | ||
341 | } | 338 | } |
342 | outb(pic2_mask,0xA1); /* restore mask */ | 339 | outb(pic2_mask,0xA1); /* restore mask */ |
343 | outb(pic1_mask,0x21); | 340 | outb(pic1_mask,0x21); |
@@ -416,7 +413,7 @@ static int __init longhaul_get_ranges(void) | |||
416 | highest_speed = calc_speed(maxmult); | 413 | highest_speed = calc_speed(maxmult); |
417 | lowest_speed = calc_speed(minmult); | 414 | lowest_speed = calc_speed(minmult); |
418 | dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, | 415 | dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, |
419 | print_speed(lowest_speed/1000), | 416 | print_speed(lowest_speed/1000), |
420 | print_speed(highest_speed/1000)); | 417 | print_speed(highest_speed/1000)); |
421 | 418 | ||
422 | if (lowest_speed == highest_speed) { | 419 | if (lowest_speed == highest_speed) { |
@@ -531,6 +528,7 @@ static void __init longhaul_setup_voltagescaling(void) | |||
531 | /* Calculate kHz for one voltage step */ | 528 | /* Calculate kHz for one voltage step */ |
532 | kHz_step = (highest_speed - min_vid_speed) / numvscales; | 529 | kHz_step = (highest_speed - min_vid_speed) / numvscales; |
533 | 530 | ||
531 | |||
534 | j = 0; | 532 | j = 0; |
535 | while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) { | 533 | while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) { |
536 | speed = longhaul_table[j].frequency; | 534 | speed = longhaul_table[j].frequency; |
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c index b92c7f0a358a..8f9c624ace6f 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/i386/kernel/efi.c | |||
@@ -473,6 +473,70 @@ static inline void __init check_range_for_systab(efi_memory_desc_t *md) | |||
473 | } | 473 | } |
474 | 474 | ||
475 | /* | 475 | /* |
476 | * Wrap all the virtual calls in a way that forces the parameters on the stack. | ||
477 | */ | ||
478 | |||
479 | #define efi_call_virt(f, args...) \ | ||
480 | ((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args) | ||
481 | |||
482 | static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) | ||
483 | { | ||
484 | return efi_call_virt(get_time, tm, tc); | ||
485 | } | ||
486 | |||
487 | static efi_status_t virt_efi_set_time (efi_time_t *tm) | ||
488 | { | ||
489 | return efi_call_virt(set_time, tm); | ||
490 | } | ||
491 | |||
492 | static efi_status_t virt_efi_get_wakeup_time (efi_bool_t *enabled, | ||
493 | efi_bool_t *pending, | ||
494 | efi_time_t *tm) | ||
495 | { | ||
496 | return efi_call_virt(get_wakeup_time, enabled, pending, tm); | ||
497 | } | ||
498 | |||
499 | static efi_status_t virt_efi_set_wakeup_time (efi_bool_t enabled, | ||
500 | efi_time_t *tm) | ||
501 | { | ||
502 | return efi_call_virt(set_wakeup_time, enabled, tm); | ||
503 | } | ||
504 | |||
505 | static efi_status_t virt_efi_get_variable (efi_char16_t *name, | ||
506 | efi_guid_t *vendor, u32 *attr, | ||
507 | unsigned long *data_size, void *data) | ||
508 | { | ||
509 | return efi_call_virt(get_variable, name, vendor, attr, data_size, data); | ||
510 | } | ||
511 | |||
512 | static efi_status_t virt_efi_get_next_variable (unsigned long *name_size, | ||
513 | efi_char16_t *name, | ||
514 | efi_guid_t *vendor) | ||
515 | { | ||
516 | return efi_call_virt(get_next_variable, name_size, name, vendor); | ||
517 | } | ||
518 | |||
519 | static efi_status_t virt_efi_set_variable (efi_char16_t *name, | ||
520 | efi_guid_t *vendor, | ||
521 | unsigned long attr, | ||
522 | unsigned long data_size, void *data) | ||
523 | { | ||
524 | return efi_call_virt(set_variable, name, vendor, attr, data_size, data); | ||
525 | } | ||
526 | |||
527 | static efi_status_t virt_efi_get_next_high_mono_count (u32 *count) | ||
528 | { | ||
529 | return efi_call_virt(get_next_high_mono_count, count); | ||
530 | } | ||
531 | |||
532 | static void virt_efi_reset_system (int reset_type, efi_status_t status, | ||
533 | unsigned long data_size, | ||
534 | efi_char16_t *data) | ||
535 | { | ||
536 | efi_call_virt(reset_system, reset_type, status, data_size, data); | ||
537 | } | ||
538 | |||
539 | /* | ||
476 | * This function will switch the EFI runtime services to virtual mode. | 540 | * This function will switch the EFI runtime services to virtual mode. |
477 | * Essentially, look through the EFI memmap and map every region that | 541 | * Essentially, look through the EFI memmap and map every region that |
478 | * has the runtime attribute bit set in its memory descriptor and update | 542 | * has the runtime attribute bit set in its memory descriptor and update |
@@ -525,22 +589,15 @@ void __init efi_enter_virtual_mode(void) | |||
525 | * pointers in the runtime service table to the new virtual addresses. | 589 | * pointers in the runtime service table to the new virtual addresses. |
526 | */ | 590 | */ |
527 | 591 | ||
528 | efi.get_time = (efi_get_time_t *) efi.systab->runtime->get_time; | 592 | efi.get_time = virt_efi_get_time; |
529 | efi.set_time = (efi_set_time_t *) efi.systab->runtime->set_time; | 593 | efi.set_time = virt_efi_set_time; |
530 | efi.get_wakeup_time = (efi_get_wakeup_time_t *) | 594 | efi.get_wakeup_time = virt_efi_get_wakeup_time; |
531 | efi.systab->runtime->get_wakeup_time; | 595 | efi.set_wakeup_time = virt_efi_set_wakeup_time; |
532 | efi.set_wakeup_time = (efi_set_wakeup_time_t *) | 596 | efi.get_variable = virt_efi_get_variable; |
533 | efi.systab->runtime->set_wakeup_time; | 597 | efi.get_next_variable = virt_efi_get_next_variable; |
534 | efi.get_variable = (efi_get_variable_t *) | 598 | efi.set_variable = virt_efi_set_variable; |
535 | efi.systab->runtime->get_variable; | 599 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; |
536 | efi.get_next_variable = (efi_get_next_variable_t *) | 600 | efi.reset_system = virt_efi_reset_system; |
537 | efi.systab->runtime->get_next_variable; | ||
538 | efi.set_variable = (efi_set_variable_t *) | ||
539 | efi.systab->runtime->set_variable; | ||
540 | efi.get_next_high_mono_count = (efi_get_next_high_mono_count_t *) | ||
541 | efi.systab->runtime->get_next_high_mono_count; | ||
542 | efi.reset_system = (efi_reset_system_t *) | ||
543 | efi.systab->runtime->reset_system; | ||
544 | } | 601 | } |
545 | 602 | ||
546 | void __init | 603 | void __init |
diff --git a/arch/i386/kernel/hpet.c b/arch/i386/kernel/hpet.c index 45a8685bb60b..0b29d41322a2 100644 --- a/arch/i386/kernel/hpet.c +++ b/arch/i386/kernel/hpet.c | |||
@@ -12,7 +12,7 @@ | |||
12 | /* FSEC = 10^-15 NSEC = 10^-9 */ | 12 | /* FSEC = 10^-15 NSEC = 10^-9 */ |
13 | #define FSEC_PER_NSEC 1000000 | 13 | #define FSEC_PER_NSEC 1000000 |
14 | 14 | ||
15 | static void *hpet_ptr; | 15 | static void __iomem *hpet_ptr; |
16 | 16 | ||
17 | static cycle_t read_hpet(void) | 17 | static cycle_t read_hpet(void) |
18 | { | 18 | { |
@@ -40,8 +40,7 @@ static int __init init_hpet_clocksource(void) | |||
40 | return -ENODEV; | 40 | return -ENODEV; |
41 | 41 | ||
42 | /* calculate the hpet address: */ | 42 | /* calculate the hpet address: */ |
43 | hpet_base = | 43 | hpet_base = ioremap_nocache(hpet_address, HPET_MMAP_SIZE); |
44 | (void __iomem*)ioremap_nocache(hpet_address, HPET_MMAP_SIZE); | ||
45 | hpet_ptr = hpet_base + HPET_COUNTER; | 44 | hpet_ptr = hpet_base + HPET_COUNTER; |
46 | 45 | ||
47 | /* calculate the frequency: */ | 46 | /* calculate the frequency: */ |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 6a3875f81a0a..ba8d302a0b72 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
@@ -126,7 +126,7 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i | |||
126 | */ | 126 | */ |
127 | static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) | 127 | static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) |
128 | { | 128 | { |
129 | volatile struct io_apic *io_apic = io_apic_base(apic); | 129 | volatile struct io_apic __iomem *io_apic = io_apic_base(apic); |
130 | if (sis_apic_bug) | 130 | if (sis_apic_bug) |
131 | writel(reg, &io_apic->index); | 131 | writel(reg, &io_apic->index); |
132 | writel(value, &io_apic->data); | 132 | writel(value, &io_apic->data); |
@@ -2606,25 +2606,32 @@ static struct irq_chip msi_chip = { | |||
2606 | .retrigger = ioapic_retrigger_irq, | 2606 | .retrigger = ioapic_retrigger_irq, |
2607 | }; | 2607 | }; |
2608 | 2608 | ||
2609 | int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev) | 2609 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) |
2610 | { | 2610 | { |
2611 | struct msi_msg msg; | 2611 | struct msi_msg msg; |
2612 | int ret; | 2612 | int irq, ret; |
2613 | irq = create_irq(); | ||
2614 | if (irq < 0) | ||
2615 | return irq; | ||
2616 | |||
2617 | set_irq_msi(irq, desc); | ||
2613 | ret = msi_compose_msg(dev, irq, &msg); | 2618 | ret = msi_compose_msg(dev, irq, &msg); |
2614 | if (ret < 0) | 2619 | if (ret < 0) { |
2620 | destroy_irq(irq); | ||
2615 | return ret; | 2621 | return ret; |
2622 | } | ||
2616 | 2623 | ||
2617 | write_msi_msg(irq, &msg); | 2624 | write_msi_msg(irq, &msg); |
2618 | 2625 | ||
2619 | set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, | 2626 | set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, |
2620 | "edge"); | 2627 | "edge"); |
2621 | 2628 | ||
2622 | return 0; | 2629 | return irq; |
2623 | } | 2630 | } |
2624 | 2631 | ||
2625 | void arch_teardown_msi_irq(unsigned int irq) | 2632 | void arch_teardown_msi_irq(unsigned int irq) |
2626 | { | 2633 | { |
2627 | return; | 2634 | destroy_irq(irq); |
2628 | } | 2635 | } |
2629 | 2636 | ||
2630 | #endif /* CONFIG_PCI_MSI */ | 2637 | #endif /* CONFIG_PCI_MSI */ |
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 49bff3596bff..4f5983c98669 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c | |||
@@ -1057,7 +1057,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
1057 | static int gsi_to_irq[MAX_GSI_NUM]; | 1057 | static int gsi_to_irq[MAX_GSI_NUM]; |
1058 | 1058 | ||
1059 | /* Don't set up the ACPI SCI because it's already set up */ | 1059 | /* Don't set up the ACPI SCI because it's already set up */ |
1060 | if (acpi_fadt.sci_int == gsi) | 1060 | if (acpi_gbl_FADT.sci_interrupt == gsi) |
1061 | return gsi; | 1061 | return gsi; |
1062 | 1062 | ||
1063 | ioapic = mp_find_ioapic(gsi); | 1063 | ioapic = mp_find_ioapic(gsi); |
@@ -1114,7 +1114,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
1114 | /* | 1114 | /* |
1115 | * Don't assign IRQ used by ACPI SCI | 1115 | * Don't assign IRQ used by ACPI SCI |
1116 | */ | 1116 | */ |
1117 | if (gsi == acpi_fadt.sci_int) | 1117 | if (gsi == acpi_gbl_FADT.sci_interrupt) |
1118 | gsi = pci_irq++; | 1118 | gsi = pci_irq++; |
1119 | gsi_to_irq[irq] = gsi; | 1119 | gsi_to_irq[irq] = gsi; |
1120 | } else { | 1120 | } else { |
diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c index f7e735c077c3..2a8713ec0f9a 100644 --- a/arch/i386/kernel/srat.c +++ b/arch/i386/kernel/srat.c | |||
@@ -62,19 +62,19 @@ extern void * boot_ioremap(unsigned long, unsigned long); | |||
62 | /* Identify CPU proximity domains */ | 62 | /* Identify CPU proximity domains */ |
63 | static void __init parse_cpu_affinity_structure(char *p) | 63 | static void __init parse_cpu_affinity_structure(char *p) |
64 | { | 64 | { |
65 | struct acpi_table_processor_affinity *cpu_affinity = | 65 | struct acpi_srat_cpu_affinity *cpu_affinity = |
66 | (struct acpi_table_processor_affinity *) p; | 66 | (struct acpi_srat_cpu_affinity *) p; |
67 | 67 | ||
68 | if (!cpu_affinity->flags.enabled) | 68 | if ((cpu_affinity->flags & ACPI_SRAT_CPU_ENABLED) == 0) |
69 | return; /* empty entry */ | 69 | return; /* empty entry */ |
70 | 70 | ||
71 | /* mark this node as "seen" in node bitmap */ | 71 | /* mark this node as "seen" in node bitmap */ |
72 | BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain); | 72 | BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain_lo); |
73 | 73 | ||
74 | apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain; | 74 | apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain_lo; |
75 | 75 | ||
76 | printk("CPU 0x%02X in proximity domain 0x%02X\n", | 76 | printk("CPU 0x%02X in proximity domain 0x%02X\n", |
77 | cpu_affinity->apic_id, cpu_affinity->proximity_domain); | 77 | cpu_affinity->apic_id, cpu_affinity->proximity_domain_lo); |
78 | } | 78 | } |
79 | 79 | ||
80 | /* | 80 | /* |
@@ -84,28 +84,27 @@ static void __init parse_cpu_affinity_structure(char *p) | |||
84 | static void __init parse_memory_affinity_structure (char *sratp) | 84 | static void __init parse_memory_affinity_structure (char *sratp) |
85 | { | 85 | { |
86 | unsigned long long paddr, size; | 86 | unsigned long long paddr, size; |
87 | unsigned long start_pfn, end_pfn; | 87 | unsigned long start_pfn, end_pfn; |
88 | u8 pxm; | 88 | u8 pxm; |
89 | struct node_memory_chunk_s *p, *q, *pend; | 89 | struct node_memory_chunk_s *p, *q, *pend; |
90 | struct acpi_table_memory_affinity *memory_affinity = | 90 | struct acpi_srat_mem_affinity *memory_affinity = |
91 | (struct acpi_table_memory_affinity *) sratp; | 91 | (struct acpi_srat_mem_affinity *) sratp; |
92 | 92 | ||
93 | if (!memory_affinity->flags.enabled) | 93 | if ((memory_affinity->flags & ACPI_SRAT_MEM_ENABLED) == 0) |
94 | return; /* empty entry */ | 94 | return; /* empty entry */ |
95 | 95 | ||
96 | pxm = memory_affinity->proximity_domain & 0xff; | ||
97 | |||
96 | /* mark this node as "seen" in node bitmap */ | 98 | /* mark this node as "seen" in node bitmap */ |
97 | BMAP_SET(pxm_bitmap, memory_affinity->proximity_domain); | 99 | BMAP_SET(pxm_bitmap, pxm); |
98 | 100 | ||
99 | /* calculate info for memory chunk structure */ | 101 | /* calculate info for memory chunk structure */ |
100 | paddr = memory_affinity->base_addr_hi; | 102 | paddr = memory_affinity->base_address; |
101 | paddr = (paddr << 32) | memory_affinity->base_addr_lo; | 103 | size = memory_affinity->length; |
102 | size = memory_affinity->length_hi; | 104 | |
103 | size = (size << 32) | memory_affinity->length_lo; | ||
104 | |||
105 | start_pfn = paddr >> PAGE_SHIFT; | 105 | start_pfn = paddr >> PAGE_SHIFT; |
106 | end_pfn = (paddr + size) >> PAGE_SHIFT; | 106 | end_pfn = (paddr + size) >> PAGE_SHIFT; |
107 | 107 | ||
108 | pxm = memory_affinity->proximity_domain; | ||
109 | 108 | ||
110 | if (num_memory_chunks >= MAXCHUNKS) { | 109 | if (num_memory_chunks >= MAXCHUNKS) { |
111 | printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n", | 110 | printk("Too many mem chunks in SRAT. Ignoring %lld MBytes at %llx\n", |
@@ -132,8 +131,8 @@ static void __init parse_memory_affinity_structure (char *sratp) | |||
132 | printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n", | 131 | printk("Memory range 0x%lX to 0x%lX (type 0x%X) in proximity domain 0x%02X %s\n", |
133 | start_pfn, end_pfn, | 132 | start_pfn, end_pfn, |
134 | memory_affinity->memory_type, | 133 | memory_affinity->memory_type, |
135 | memory_affinity->proximity_domain, | 134 | pxm, |
136 | (memory_affinity->flags.hot_pluggable ? | 135 | ((memory_affinity->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) ? |
137 | "enabled and removable" : "enabled" ) ); | 136 | "enabled and removable" : "enabled" ) ); |
138 | } | 137 | } |
139 | 138 | ||
@@ -185,10 +184,10 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp) | |||
185 | num_memory_chunks = 0; | 184 | num_memory_chunks = 0; |
186 | while (p < end) { | 185 | while (p < end) { |
187 | switch (*p) { | 186 | switch (*p) { |
188 | case ACPI_SRAT_PROCESSOR_AFFINITY: | 187 | case ACPI_SRAT_TYPE_CPU_AFFINITY: |
189 | parse_cpu_affinity_structure(p); | 188 | parse_cpu_affinity_structure(p); |
190 | break; | 189 | break; |
191 | case ACPI_SRAT_MEMORY_AFFINITY: | 190 | case ACPI_SRAT_TYPE_MEMORY_AFFINITY: |
192 | parse_memory_affinity_structure(p); | 191 | parse_memory_affinity_structure(p); |
193 | break; | 192 | break; |
194 | default: | 193 | default: |
@@ -262,31 +261,30 @@ out_fail: | |||
262 | return 0; | 261 | return 0; |
263 | } | 262 | } |
264 | 263 | ||
264 | struct acpi_static_rsdt { | ||
265 | struct acpi_table_rsdt table; | ||
266 | u32 padding[7]; /* Allow for 7 more table entries */ | ||
267 | }; | ||
268 | |||
265 | int __init get_memcfg_from_srat(void) | 269 | int __init get_memcfg_from_srat(void) |
266 | { | 270 | { |
267 | struct acpi_table_header *header = NULL; | 271 | struct acpi_table_header *header = NULL; |
268 | struct acpi_table_rsdp *rsdp = NULL; | 272 | struct acpi_table_rsdp *rsdp = NULL; |
269 | struct acpi_table_rsdt *rsdt = NULL; | 273 | struct acpi_table_rsdt *rsdt = NULL; |
270 | struct acpi_pointer *rsdp_address = NULL; | 274 | acpi_native_uint rsdp_address = 0; |
271 | struct acpi_table_rsdt saved_rsdt; | 275 | struct acpi_static_rsdt saved_rsdt; |
272 | int tables = 0; | 276 | int tables = 0; |
273 | int i = 0; | 277 | int i = 0; |
274 | 278 | ||
275 | if (ACPI_FAILURE(acpi_find_root_pointer(ACPI_PHYSICAL_ADDRESSING, | 279 | rsdp_address = acpi_find_rsdp(); |
276 | rsdp_address))) { | 280 | if (!rsdp_address) { |
277 | printk("%s: System description tables not found\n", | 281 | printk("%s: System description tables not found\n", |
278 | __FUNCTION__); | 282 | __FUNCTION__); |
279 | goto out_err; | 283 | goto out_err; |
280 | } | 284 | } |
281 | 285 | ||
282 | if (rsdp_address->pointer_type == ACPI_PHYSICAL_POINTER) { | 286 | printk("%s: assigning address to rsdp\n", __FUNCTION__); |
283 | printk("%s: assigning address to rsdp\n", __FUNCTION__); | 287 | rsdp = (struct acpi_table_rsdp *)(u32)rsdp_address; |
284 | rsdp = (struct acpi_table_rsdp *) | ||
285 | (u32)rsdp_address->pointer.physical; | ||
286 | } else { | ||
287 | printk("%s: rsdp_address is not a physical pointer\n", __FUNCTION__); | ||
288 | goto out_err; | ||
289 | } | ||
290 | if (!rsdp) { | 288 | if (!rsdp) { |
291 | printk("%s: Didn't find ACPI root!\n", __FUNCTION__); | 289 | printk("%s: Didn't find ACPI root!\n", __FUNCTION__); |
292 | goto out_err; | 290 | goto out_err; |
@@ -295,13 +293,13 @@ int __init get_memcfg_from_srat(void) | |||
295 | printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, | 293 | printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision, |
296 | rsdp->oem_id); | 294 | rsdp->oem_id); |
297 | 295 | ||
298 | if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) { | 296 | if (strncmp(rsdp->signature, ACPI_SIG_RSDP,strlen(ACPI_SIG_RSDP))) { |
299 | printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__); | 297 | printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__); |
300 | goto out_err; | 298 | goto out_err; |
301 | } | 299 | } |
302 | 300 | ||
303 | rsdt = (struct acpi_table_rsdt *) | 301 | rsdt = (struct acpi_table_rsdt *) |
304 | boot_ioremap(rsdp->rsdt_address, sizeof(struct acpi_table_rsdt)); | 302 | boot_ioremap(rsdp->rsdt_physical_address, sizeof(struct acpi_table_rsdt)); |
305 | 303 | ||
306 | if (!rsdt) { | 304 | if (!rsdt) { |
307 | printk(KERN_WARNING | 305 | printk(KERN_WARNING |
@@ -310,9 +308,9 @@ int __init get_memcfg_from_srat(void) | |||
310 | goto out_err; | 308 | goto out_err; |
311 | } | 309 | } |
312 | 310 | ||
313 | header = & rsdt->header; | 311 | header = &rsdt->header; |
314 | 312 | ||
315 | if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) { | 313 | if (strncmp(header->signature, ACPI_SIG_RSDT, strlen(ACPI_SIG_RSDT))) { |
316 | printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); | 314 | printk(KERN_WARNING "ACPI: RSDT signature incorrect\n"); |
317 | goto out_err; | 315 | goto out_err; |
318 | } | 316 | } |
@@ -330,9 +328,9 @@ int __init get_memcfg_from_srat(void) | |||
330 | 328 | ||
331 | memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); | 329 | memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt)); |
332 | 330 | ||
333 | if (saved_rsdt.header.length > sizeof(saved_rsdt)) { | 331 | if (saved_rsdt.table.header.length > sizeof(saved_rsdt)) { |
334 | printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", | 332 | printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n", |
335 | saved_rsdt.header.length); | 333 | saved_rsdt.table.header.length); |
336 | goto out_err; | 334 | goto out_err; |
337 | } | 335 | } |
338 | 336 | ||
@@ -341,15 +339,15 @@ int __init get_memcfg_from_srat(void) | |||
341 | for (i = 0; i < tables; i++) { | 339 | for (i = 0; i < tables; i++) { |
342 | /* Map in header, then map in full table length. */ | 340 | /* Map in header, then map in full table length. */ |
343 | header = (struct acpi_table_header *) | 341 | header = (struct acpi_table_header *) |
344 | boot_ioremap(saved_rsdt.entry[i], sizeof(struct acpi_table_header)); | 342 | boot_ioremap(saved_rsdt.table.table_offset_entry[i], sizeof(struct acpi_table_header)); |
345 | if (!header) | 343 | if (!header) |
346 | break; | 344 | break; |
347 | header = (struct acpi_table_header *) | 345 | header = (struct acpi_table_header *) |
348 | boot_ioremap(saved_rsdt.entry[i], header->length); | 346 | boot_ioremap(saved_rsdt.table.table_offset_entry[i], header->length); |
349 | if (!header) | 347 | if (!header) |
350 | break; | 348 | break; |
351 | 349 | ||
352 | if (strncmp((char *) &header->signature, "SRAT", 4)) | 350 | if (strncmp((char *) &header->signature, ACPI_SIG_SRAT, 4)) |
353 | continue; | 351 | continue; |
354 | 352 | ||
355 | /* we've found the srat table. don't need to look at any more tables */ | 353 | /* we've found the srat table. don't need to look at any more tables */ |
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index 5da744204d10..bc882a2b1db6 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c | |||
@@ -70,11 +70,12 @@ void enable_sep_cpu(void) | |||
70 | */ | 70 | */ |
71 | extern const char vsyscall_int80_start, vsyscall_int80_end; | 71 | extern const char vsyscall_int80_start, vsyscall_int80_end; |
72 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; | 72 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; |
73 | static void *syscall_page; | 73 | static struct page *syscall_pages[1]; |
74 | 74 | ||
75 | int __init sysenter_setup(void) | 75 | int __init sysenter_setup(void) |
76 | { | 76 | { |
77 | syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); | 77 | void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); |
78 | syscall_pages[0] = virt_to_page(syscall_page); | ||
78 | 79 | ||
79 | #ifdef CONFIG_COMPAT_VDSO | 80 | #ifdef CONFIG_COMPAT_VDSO |
80 | __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY); | 81 | __set_fixmap(FIX_VDSO, __pa(syscall_page), PAGE_READONLY); |
@@ -96,31 +97,12 @@ int __init sysenter_setup(void) | |||
96 | } | 97 | } |
97 | 98 | ||
98 | #ifndef CONFIG_COMPAT_VDSO | 99 | #ifndef CONFIG_COMPAT_VDSO |
99 | static struct page *syscall_nopage(struct vm_area_struct *vma, | ||
100 | unsigned long adr, int *type) | ||
101 | { | ||
102 | struct page *p = virt_to_page(adr - vma->vm_start + syscall_page); | ||
103 | get_page(p); | ||
104 | return p; | ||
105 | } | ||
106 | |||
107 | /* Prevent VMA merging */ | ||
108 | static void syscall_vma_close(struct vm_area_struct *vma) | ||
109 | { | ||
110 | } | ||
111 | |||
112 | static struct vm_operations_struct syscall_vm_ops = { | ||
113 | .close = syscall_vma_close, | ||
114 | .nopage = syscall_nopage, | ||
115 | }; | ||
116 | |||
117 | /* Defined in vsyscall-sysenter.S */ | 100 | /* Defined in vsyscall-sysenter.S */ |
118 | extern void SYSENTER_RETURN; | 101 | extern void SYSENTER_RETURN; |
119 | 102 | ||
120 | /* Setup a VMA at program startup for the vsyscall page */ | 103 | /* Setup a VMA at program startup for the vsyscall page */ |
121 | int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) | 104 | int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) |
122 | { | 105 | { |
123 | struct vm_area_struct *vma; | ||
124 | struct mm_struct *mm = current->mm; | 106 | struct mm_struct *mm = current->mm; |
125 | unsigned long addr; | 107 | unsigned long addr; |
126 | int ret; | 108 | int ret; |
@@ -132,38 +114,25 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int exstack) | |||
132 | goto up_fail; | 114 | goto up_fail; |
133 | } | 115 | } |
134 | 116 | ||
135 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); | ||
136 | if (!vma) { | ||
137 | ret = -ENOMEM; | ||
138 | goto up_fail; | ||
139 | } | ||
140 | |||
141 | vma->vm_start = addr; | ||
142 | vma->vm_end = addr + PAGE_SIZE; | ||
143 | /* MAYWRITE to allow gdb to COW and set breakpoints */ | ||
144 | vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE; | ||
145 | /* | 117 | /* |
118 | * MAYWRITE to allow gdb to COW and set breakpoints | ||
119 | * | ||
146 | * Make sure the vDSO gets into every core dump. | 120 | * Make sure the vDSO gets into every core dump. |
147 | * Dumping its contents makes post-mortem fully interpretable later | 121 | * Dumping its contents makes post-mortem fully interpretable later |
148 | * without matching up the same kernel and hardware config to see | 122 | * without matching up the same kernel and hardware config to see |
149 | * what PC values meant. | 123 | * what PC values meant. |
150 | */ | 124 | */ |
151 | vma->vm_flags |= VM_ALWAYSDUMP; | 125 | ret = install_special_mapping(mm, addr, PAGE_SIZE, |
152 | vma->vm_flags |= mm->def_flags; | 126 | VM_READ|VM_EXEC| |
153 | vma->vm_page_prot = protection_map[vma->vm_flags & 7]; | 127 | VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC| |
154 | vma->vm_ops = &syscall_vm_ops; | 128 | VM_ALWAYSDUMP, |
155 | vma->vm_mm = mm; | 129 | syscall_pages); |
156 | 130 | if (ret) | |
157 | ret = insert_vm_struct(mm, vma); | ||
158 | if (unlikely(ret)) { | ||
159 | kmem_cache_free(vm_area_cachep, vma); | ||
160 | goto up_fail; | 131 | goto up_fail; |
161 | } | ||
162 | 132 | ||
163 | current->mm->context.vdso = (void *)addr; | 133 | current->mm->context.vdso = (void *)addr; |
164 | current_thread_info()->sysenter_return = | 134 | current_thread_info()->sysenter_return = |
165 | (void *)VDSO_SYM(&SYSENTER_RETURN); | 135 | (void *)VDSO_SYM(&SYSENTER_RETURN); |
166 | mm->total_vm++; | ||
167 | up_fail: | 136 | up_fail: |
168 | up_write(&mm->mmap_sem); | 137 | up_write(&mm->mmap_sem); |
169 | return ret; | 138 | return ret; |