diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-14 01:19:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-14 03:02:54 -0400 |
commit | 94a8c3c2437c8946f1b6c8e0b2c560a7db8ed3c6 (patch) | |
tree | 7bad615005b6047306336e8f688edcf1c6bb74dd /arch | |
parent | f910a9dc7c865896815e2a95fe33363e9522f277 (diff) |
x86: let 32bit use apic_ops too - fix
fix for pv - clean up the namespace there too.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/paravirt.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/vmi_32.c | 51 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 19 |
3 files changed, 57 insertions, 18 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 4f29ff847ebe..e0f139106c7e 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -360,11 +360,6 @@ struct pv_cpu_ops pv_cpu_ops = { | |||
360 | 360 | ||
361 | struct pv_apic_ops pv_apic_ops = { | 361 | struct pv_apic_ops pv_apic_ops = { |
362 | #ifdef CONFIG_X86_LOCAL_APIC | 362 | #ifdef CONFIG_X86_LOCAL_APIC |
363 | #ifndef CONFIG_X86_64 | ||
364 | .apic_write = native_apic_mem_write, | ||
365 | .apic_write_atomic = native_apic_mem_write_atomic, | ||
366 | .apic_read = native_apic_mem_read, | ||
367 | #endif | ||
368 | .setup_boot_clock = setup_boot_APIC_clock, | 363 | .setup_boot_clock = setup_boot_APIC_clock, |
369 | .setup_secondary_clock = setup_secondary_APIC_clock, | 364 | .setup_secondary_clock = setup_secondary_APIC_clock, |
370 | .startup_ipi_hook = paravirt_nop, | 365 | .startup_ipi_hook = paravirt_nop, |
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index b15346092b7b..cf3074354553 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c | |||
@@ -676,6 +676,50 @@ static inline int __init probe_vmi_rom(void) | |||
676 | return 0; | 676 | return 0; |
677 | } | 677 | } |
678 | 678 | ||
679 | #ifdef CONFIG_X86_LOCAL_APIC | ||
680 | static u32 vmi_apic_read(u32 reg) | ||
681 | { | ||
682 | return 0; | ||
683 | } | ||
684 | |||
685 | static void vmi_apic_write(u32 reg, u32 val) | ||
686 | { | ||
687 | /* Warn to see if there's any stray references */ | ||
688 | WARN_ON(1); | ||
689 | } | ||
690 | |||
691 | static u64 vmi_apic_icr_read(void) | ||
692 | { | ||
693 | return 0; | ||
694 | } | ||
695 | |||
696 | static void vmi_apic_icr_write(u32 low, u32 id) | ||
697 | { | ||
698 | /* Warn to see if there's any stray references */ | ||
699 | WARN_ON(1); | ||
700 | } | ||
701 | |||
702 | static void vmi_apic_wait_icr_idle(void) | ||
703 | { | ||
704 | return; | ||
705 | } | ||
706 | |||
707 | static u32 vmi_safe_apic_wait_icr_idle(void) | ||
708 | { | ||
709 | return 0; | ||
710 | } | ||
711 | |||
712 | static struct apic_ops vmi_basic_apic_ops = { | ||
713 | .read = vmi_apic_read, | ||
714 | .write = vmi_apic_write, | ||
715 | .write_atomic = vmi_apic_write, | ||
716 | .icr_read = vmi_apic_icr_read, | ||
717 | .icr_write = vmi_apic_icr_write, | ||
718 | .wait_icr_idle = vmi_apic_wait_icr_idle, | ||
719 | .safe_wait_icr_idle = vmi_safe_apic_wait_icr_idle, | ||
720 | }; | ||
721 | #endif | ||
722 | |||
679 | /* | 723 | /* |
680 | * VMI setup common to all processors | 724 | * VMI setup common to all processors |
681 | */ | 725 | */ |
@@ -904,9 +948,10 @@ static inline int __init activate_vmi(void) | |||
904 | #endif | 948 | #endif |
905 | 949 | ||
906 | #ifdef CONFIG_X86_LOCAL_APIC | 950 | #ifdef CONFIG_X86_LOCAL_APIC |
907 | para_fill(pv_apic_ops.apic_read, APICRead); | 951 | para_fill(vmi_basic_apic_ops.read, APICRead); |
908 | para_fill(pv_apic_ops.apic_write, APICWrite); | 952 | para_fill(vmi_basic_apic_ops.write, APICWrite); |
909 | para_fill(pv_apic_ops.apic_write_atomic, APICWrite); | 953 | para_fill(vmi_basic_apic_ops.write_atomic, APICWrite); |
954 | apic_ops = &vmi_basic_apic_ops; | ||
910 | #endif | 955 | #endif |
911 | 956 | ||
912 | /* | 957 | /* |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 54e255667530..d11dda7ebd7a 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -559,7 +559,6 @@ static void xen_apic_write(u32 reg, u32 val) | |||
559 | WARN_ON(1); | 559 | WARN_ON(1); |
560 | } | 560 | } |
561 | 561 | ||
562 | #ifdef CONFIG_X86_64 | ||
563 | static u64 xen_apic_icr_read(void) | 562 | static u64 xen_apic_icr_read(void) |
564 | { | 563 | { |
565 | return 0; | 564 | return 0; |
@@ -576,6 +575,11 @@ static void xen_apic_wait_icr_idle(void) | |||
576 | return; | 575 | return; |
577 | } | 576 | } |
578 | 577 | ||
578 | static u32 xen_safe_apic_wait_icr_idle(void) | ||
579 | { | ||
580 | return 0; | ||
581 | } | ||
582 | |||
579 | static struct apic_ops xen_basic_apic_ops = { | 583 | static struct apic_ops xen_basic_apic_ops = { |
580 | .read = xen_apic_read, | 584 | .read = xen_apic_read, |
581 | .write = xen_apic_write, | 585 | .write = xen_apic_write, |
@@ -583,9 +587,8 @@ static struct apic_ops xen_basic_apic_ops = { | |||
583 | .icr_read = xen_apic_icr_read, | 587 | .icr_read = xen_apic_icr_read, |
584 | .icr_write = xen_apic_icr_write, | 588 | .icr_write = xen_apic_icr_write, |
585 | .wait_icr_idle = xen_apic_wait_icr_idle, | 589 | .wait_icr_idle = xen_apic_wait_icr_idle, |
586 | .safe_wait_icr_idle = xen_apic_wait_icr_idle, | 590 | .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle, |
587 | }; | 591 | }; |
588 | #endif | ||
589 | 592 | ||
590 | #endif | 593 | #endif |
591 | 594 | ||
@@ -1159,11 +1162,6 @@ static const struct pv_irq_ops xen_irq_ops __initdata = { | |||
1159 | 1162 | ||
1160 | static const struct pv_apic_ops xen_apic_ops __initdata = { | 1163 | static const struct pv_apic_ops xen_apic_ops __initdata = { |
1161 | #ifdef CONFIG_X86_LOCAL_APIC | 1164 | #ifdef CONFIG_X86_LOCAL_APIC |
1162 | #ifndef CONFIG_X86_64 | ||
1163 | .apic_write = xen_apic_write, | ||
1164 | .apic_write_atomic = xen_apic_write, | ||
1165 | .apic_read = xen_apic_read, | ||
1166 | #endif | ||
1167 | .setup_boot_clock = paravirt_nop, | 1165 | .setup_boot_clock = paravirt_nop, |
1168 | .setup_secondary_clock = paravirt_nop, | 1166 | .setup_secondary_clock = paravirt_nop, |
1169 | .startup_ipi_hook = paravirt_nop, | 1167 | .startup_ipi_hook = paravirt_nop, |
@@ -1322,9 +1320,10 @@ asmlinkage void __init xen_start_kernel(void) | |||
1322 | pv_irq_ops = xen_irq_ops; | 1320 | pv_irq_ops = xen_irq_ops; |
1323 | pv_apic_ops = xen_apic_ops; | 1321 | pv_apic_ops = xen_apic_ops; |
1324 | pv_mmu_ops = xen_mmu_ops; | 1322 | pv_mmu_ops = xen_mmu_ops; |
1325 | #ifdef CONFIG_X86_64 | 1323 | |
1324 | #ifdef CONFIG_X86_LOCAL_APIC | ||
1326 | /* | 1325 | /* |
1327 | * for 64bit, set up the basic apic ops aswell. | 1326 | * set up the basic apic ops. |
1328 | */ | 1327 | */ |
1329 | apic_ops = &xen_basic_apic_ops; | 1328 | apic_ops = &xen_basic_apic_ops; |
1330 | #endif | 1329 | #endif |