diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-10 09:01:54 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-10 12:55:34 -0400 |
commit | 808fc878d373c338f138529c284df5f86ab3cc55 (patch) | |
tree | 15111a25afd6e0bb466d4660d33ac818ae5e5f87 /include/asm-x86 | |
parent | 5548ed1135842d1993a4ba699377a8a3c65dd568 (diff) |
x86, VisWS: turn into generic arch, update asm-x86/mach-visws/mach_apic.h
update asm-x86/mach-visws/mach_apic.h to the generic version.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/mach-visws/mach_apic.h | 104 |
1 files changed, 71 insertions, 33 deletions
diff --git a/include/asm-x86/mach-visws/mach_apic.h b/include/asm-x86/mach-visws/mach_apic.h index a9ef33a8a995..0b2cde5e1b74 100644 --- a/include/asm-x86/mach-visws/mach_apic.h +++ b/include/asm-x86/mach-visws/mach_apic.h | |||
@@ -1,31 +1,40 @@ | |||
1 | #ifndef __ASM_MACH_APIC_H | 1 | #ifndef __ASM_MACH_APIC_H |
2 | #define __ASM_MACH_APIC_H | 2 | #define __ASM_MACH_APIC_H |
3 | 3 | ||
4 | #ifdef CONFIG_X86_LOCAL_APIC | ||
5 | |||
4 | #include <mach_apicdef.h> | 6 | #include <mach_apicdef.h> |
5 | #include <asm/smp.h> | 7 | #include <asm/smp.h> |
6 | 8 | ||
7 | #define APIC_DFR_VALUE (APIC_DFR_FLAT) | 9 | #define APIC_DFR_VALUE (APIC_DFR_FLAT) |
8 | 10 | ||
9 | #define no_balance_irq (0) | 11 | static inline cpumask_t target_cpus(void) |
10 | #define esr_disable (0) | 12 | { |
11 | |||
12 | #define INT_DELIVERY_MODE dest_LowestPrio | ||
13 | #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ | ||
14 | |||
15 | #ifdef CONFIG_SMP | 13 | #ifdef CONFIG_SMP |
16 | #define TARGET_CPUS cpu_online_map | 14 | return cpu_online_map; |
17 | #else | 15 | #else |
18 | #define TARGET_CPUS cpumask_of_cpu(0) | 16 | return cpumask_of_cpu(0); |
19 | #endif | 17 | #endif |
18 | } | ||
20 | 19 | ||
21 | #define check_apicid_used(bitmap, apicid) physid_isset(apicid, bitmap) | 20 | #define NO_BALANCE_IRQ (0) |
22 | #define check_apicid_present(bit) physid_isset(bit, phys_cpu_present_map) | 21 | #define esr_disable (0) |
23 | |||
24 | static inline int apic_id_registered(void) | ||
25 | { | ||
26 | return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); | ||
27 | } | ||
28 | 22 | ||
23 | #ifdef CONFIG_X86_64 | ||
24 | #include <asm/genapic.h> | ||
25 | #define INT_DELIVERY_MODE (genapic->int_delivery_mode) | ||
26 | #define INT_DEST_MODE (genapic->int_dest_mode) | ||
27 | #define TARGET_CPUS (genapic->target_cpus()) | ||
28 | #define apic_id_registered (genapic->apic_id_registered) | ||
29 | #define init_apic_ldr (genapic->init_apic_ldr) | ||
30 | #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) | ||
31 | #define phys_pkg_id (genapic->phys_pkg_id) | ||
32 | #define vector_allocation_domain (genapic->vector_allocation_domain) | ||
33 | extern void setup_apic_routing(void); | ||
34 | #else | ||
35 | #define INT_DELIVERY_MODE dest_LowestPrio | ||
36 | #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ | ||
37 | #define TARGET_CPUS (target_cpus()) | ||
29 | /* | 38 | /* |
30 | * Set up the logical destination ID. | 39 | * Set up the logical destination ID. |
31 | * | 40 | * |
@@ -43,16 +52,56 @@ static inline void init_apic_ldr(void) | |||
43 | apic_write_around(APIC_LDR, val); | 52 | apic_write_around(APIC_LDR, val); |
44 | } | 53 | } |
45 | 54 | ||
46 | static inline void summit_check(char *oem, char *productid) | 55 | static inline int apic_id_registered(void) |
56 | { | ||
57 | return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); | ||
58 | } | ||
59 | |||
60 | static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) | ||
61 | { | ||
62 | return cpus_addr(cpumask)[0]; | ||
63 | } | ||
64 | |||
65 | static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) | ||
47 | { | 66 | { |
67 | return cpuid_apic >> index_msb; | ||
48 | } | 68 | } |
49 | 69 | ||
50 | static inline void setup_apic_routing(void) | 70 | static inline void setup_apic_routing(void) |
51 | { | 71 | { |
72 | #ifdef CONFIG_X86_IO_APIC | ||
73 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", | ||
74 | "Flat", nr_ioapics); | ||
75 | #endif | ||
52 | } | 76 | } |
53 | 77 | ||
54 | static inline int apicid_to_node(int logical_apicid) | 78 | static inline int apicid_to_node(int logical_apicid) |
55 | { | 79 | { |
80 | #ifdef CONFIG_SMP | ||
81 | return apicid_2_node[hard_smp_processor_id()]; | ||
82 | #else | ||
83 | return 0; | ||
84 | #endif | ||
85 | } | ||
86 | #endif | ||
87 | |||
88 | static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) | ||
89 | { | ||
90 | return physid_isset(apicid, bitmap); | ||
91 | } | ||
92 | |||
93 | static inline unsigned long check_apicid_present(int bit) | ||
94 | { | ||
95 | return physid_isset(bit, phys_cpu_present_map); | ||
96 | } | ||
97 | |||
98 | static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map) | ||
99 | { | ||
100 | return phys_map; | ||
101 | } | ||
102 | |||
103 | static inline int multi_timer_check(int apic, int irq) | ||
104 | { | ||
56 | return 0; | 105 | return 0; |
57 | } | 106 | } |
58 | 107 | ||
@@ -64,40 +113,29 @@ static inline int cpu_to_logical_apicid(int cpu) | |||
64 | 113 | ||
65 | static inline int cpu_present_to_apicid(int mps_cpu) | 114 | static inline int cpu_present_to_apicid(int mps_cpu) |
66 | { | 115 | { |
67 | if (mps_cpu < get_physical_broadcast()) | 116 | if (mps_cpu < NR_CPUS && cpu_present(mps_cpu)) |
68 | return mps_cpu; | 117 | return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); |
69 | else | 118 | else |
70 | return BAD_APICID; | 119 | return BAD_APICID; |
71 | } | 120 | } |
72 | 121 | ||
73 | static inline physid_mask_t apicid_to_cpu_present(int apicid) | 122 | static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) |
74 | { | 123 | { |
75 | return physid_mask_of_physid(apicid); | 124 | return physid_mask_of_physid(phys_apicid); |
76 | } | 125 | } |
77 | 126 | ||
78 | #define WAKE_SECONDARY_VIA_INIT | ||
79 | |||
80 | static inline void setup_portio_remap(void) | 127 | static inline void setup_portio_remap(void) |
81 | { | 128 | { |
82 | } | 129 | } |
83 | 130 | ||
84 | static inline void enable_apic_mode(void) | ||
85 | { | ||
86 | } | ||
87 | |||
88 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) | 131 | static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) |
89 | { | 132 | { |
90 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); | 133 | return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map); |
91 | } | 134 | } |
92 | 135 | ||
93 | static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) | 136 | static inline void enable_apic_mode(void) |
94 | { | ||
95 | return cpus_addr(cpumask)[0]; | ||
96 | } | ||
97 | |||
98 | static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) | ||
99 | { | 137 | { |
100 | return cpuid_apic >> index_msb; | ||
101 | } | 138 | } |
102 | 139 | ||
140 | #endif /* CONFIG_X86_LOCAL_APIC */ | ||
103 | #endif /* __ASM_MACH_APIC_H */ | 141 | #endif /* __ASM_MACH_APIC_H */ |