diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-10 14:47:26 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-10 14:47:26 -0400 |
commit | f0cd91a68acdc9b49d7f6738b514a426da627649 (patch) | |
tree | 8ad73564015794197583b094217ae0a71e71e753 /arch/x86_64/kernel/setup.c | |
parent | 60eef25701d25e99c991dd0f4a9f3832a0c3ad3e (diff) | |
parent | 128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'arch/x86_64/kernel/setup.c')
-rw-r--r-- | arch/x86_64/kernel/setup.c | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index c50b06765a80..655b9192eeb3 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -571,17 +571,28 @@ static inline void copy_edd(void) | |||
571 | #endif | 571 | #endif |
572 | 572 | ||
573 | #define EBDA_ADDR_POINTER 0x40E | 573 | #define EBDA_ADDR_POINTER 0x40E |
574 | static void __init reserve_ebda_region(void) | 574 | |
575 | unsigned __initdata ebda_addr; | ||
576 | unsigned __initdata ebda_size; | ||
577 | |||
578 | static void discover_ebda(void) | ||
575 | { | 579 | { |
576 | unsigned int addr; | 580 | /* |
577 | /** | ||
578 | * there is a real-mode segmented pointer pointing to the | 581 | * there is a real-mode segmented pointer pointing to the |
579 | * 4K EBDA area at 0x40E | 582 | * 4K EBDA area at 0x40E |
580 | */ | 583 | */ |
581 | addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER); | 584 | ebda_addr = *(unsigned short *)EBDA_ADDR_POINTER; |
582 | addr <<= 4; | 585 | ebda_addr <<= 4; |
583 | if (addr) | 586 | |
584 | reserve_bootmem_generic(addr, PAGE_SIZE); | 587 | ebda_size = *(unsigned short *)(unsigned long)ebda_addr; |
588 | |||
589 | /* Round EBDA up to pages */ | ||
590 | if (ebda_size == 0) | ||
591 | ebda_size = 1; | ||
592 | ebda_size <<= 10; | ||
593 | ebda_size = round_up(ebda_size + (ebda_addr & ~PAGE_MASK), PAGE_SIZE); | ||
594 | if (ebda_size > 64*1024) | ||
595 | ebda_size = 64*1024; | ||
585 | } | 596 | } |
586 | 597 | ||
587 | void __init setup_arch(char **cmdline_p) | 598 | void __init setup_arch(char **cmdline_p) |
@@ -627,6 +638,8 @@ void __init setup_arch(char **cmdline_p) | |||
627 | 638 | ||
628 | check_efer(); | 639 | check_efer(); |
629 | 640 | ||
641 | discover_ebda(); | ||
642 | |||
630 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); | 643 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); |
631 | 644 | ||
632 | dmi_scan_machine(); | 645 | dmi_scan_machine(); |
@@ -669,7 +682,8 @@ void __init setup_arch(char **cmdline_p) | |||
669 | reserve_bootmem_generic(0, PAGE_SIZE); | 682 | reserve_bootmem_generic(0, PAGE_SIZE); |
670 | 683 | ||
671 | /* reserve ebda region */ | 684 | /* reserve ebda region */ |
672 | reserve_ebda_region(); | 685 | if (ebda_addr) |
686 | reserve_bootmem_generic(ebda_addr, ebda_size); | ||
673 | 687 | ||
674 | #ifdef CONFIG_SMP | 688 | #ifdef CONFIG_SMP |
675 | /* | 689 | /* |
@@ -930,6 +944,10 @@ static int __init init_amd(struct cpuinfo_x86 *c) | |||
930 | if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) | 944 | if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) |
931 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); | 945 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); |
932 | 946 | ||
947 | /* Enable workaround for FXSAVE leak */ | ||
948 | if (c->x86 >= 6) | ||
949 | set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability); | ||
950 | |||
933 | r = get_model_name(c); | 951 | r = get_model_name(c); |
934 | if (!r) { | 952 | if (!r) { |
935 | switch (c->x86) { | 953 | switch (c->x86) { |
@@ -1033,7 +1051,7 @@ static void srat_detect_node(void) | |||
1033 | for now. */ | 1051 | for now. */ |
1034 | node = apicid_to_node[hard_smp_processor_id()]; | 1052 | node = apicid_to_node[hard_smp_processor_id()]; |
1035 | if (node == NUMA_NO_NODE) | 1053 | if (node == NUMA_NO_NODE) |
1036 | node = 0; | 1054 | node = first_node(node_online_map); |
1037 | numa_set_node(cpu, node); | 1055 | numa_set_node(cpu, node); |
1038 | 1056 | ||
1039 | if (acpi_numa > 0) | 1057 | if (acpi_numa > 0) |
@@ -1422,3 +1440,22 @@ struct seq_operations cpuinfo_op = { | |||
1422 | .show = show_cpuinfo, | 1440 | .show = show_cpuinfo, |
1423 | }; | 1441 | }; |
1424 | 1442 | ||
1443 | #ifdef CONFIG_INPUT_PCSPKR | ||
1444 | #include <linux/platform_device.h> | ||
1445 | static __init int add_pcspkr(void) | ||
1446 | { | ||
1447 | struct platform_device *pd; | ||
1448 | int ret; | ||
1449 | |||
1450 | pd = platform_device_alloc("pcspkr", -1); | ||
1451 | if (!pd) | ||
1452 | return -ENOMEM; | ||
1453 | |||
1454 | ret = platform_device_add(pd); | ||
1455 | if (ret) | ||
1456 | platform_device_put(pd); | ||
1457 | |||
1458 | return ret; | ||
1459 | } | ||
1460 | device_initcall(add_pcspkr); | ||
1461 | #endif | ||