diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-12 04:01:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-13 02:27:46 -0400 |
commit | f910a9dc7c865896815e2a95fe33363e9522f277 (patch) | |
tree | a4d1361f7d38dd358da62a1c14191cdbf6011d98 /arch/x86/kernel/genx2apic_uv_x.c | |
parent | 4c9961d56ec20c27ec5d02e49fd7427748312741 (diff) |
x86: make 64bit have get_apic_id
generalize the x2apic code some more.
let read_apic_id become a macro (later on a function/inline)
GET_APIC_ID(apic_read(APIC_ID))
+#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
instead of this weird construct:
-#define read_apic_id (genapic->read_apic_id)
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/x86/kernel/genx2apic_uv_x.c')
-rw-r--r-- | arch/x86/kernel/genx2apic_uv_x.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index c915f750241e..3ca29cd8c23c 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
@@ -139,16 +139,31 @@ static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask) | |||
139 | return BAD_APICID; | 139 | return BAD_APICID; |
140 | } | 140 | } |
141 | 141 | ||
142 | static unsigned int uv_read_apic_id(void) | 142 | static unsigned int get_apic_id(unsigned long x) |
143 | { | 143 | { |
144 | unsigned int id; | 144 | unsigned int id; |
145 | 145 | ||
146 | WARN_ON(preemptible() && num_online_cpus() > 1); | 146 | WARN_ON(preemptible() && num_online_cpus() > 1); |
147 | id = apic_read(APIC_ID) | __get_cpu_var(x2apic_extra_bits); | 147 | id = x | __get_cpu_var(x2apic_extra_bits); |
148 | 148 | ||
149 | return id; | 149 | return id; |
150 | } | 150 | } |
151 | 151 | ||
152 | static long set_apic_id(unsigned int id) | ||
153 | { | ||
154 | unsigned long x; | ||
155 | |||
156 | /* maskout x2apic_extra_bits ? */ | ||
157 | x = id; | ||
158 | return x; | ||
159 | } | ||
160 | |||
161 | static unsigned int uv_read_apic_id(void) | ||
162 | { | ||
163 | |||
164 | return get_apic_id(apic_read(APIC_ID)); | ||
165 | } | ||
166 | |||
152 | static unsigned int phys_pkg_id(int index_msb) | 167 | static unsigned int phys_pkg_id(int index_msb) |
153 | { | 168 | { |
154 | return uv_read_apic_id() >> index_msb; | 169 | return uv_read_apic_id() >> index_msb; |
@@ -175,7 +190,9 @@ struct genapic apic_x2apic_uv_x = { | |||
175 | /* ZZZ.send_IPI_self = uv_send_IPI_self, */ | 190 | /* ZZZ.send_IPI_self = uv_send_IPI_self, */ |
176 | .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, | 191 | .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, |
177 | .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */ | 192 | .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */ |
178 | .read_apic_id = uv_read_apic_id, | 193 | .get_apic_id = get_apic_id, |
194 | .set_apic_id = set_apic_id, | ||
195 | .apic_id_mask = (0xFFFFFFFFu), | ||
179 | }; | 196 | }; |
180 | 197 | ||
181 | static __cpuinit void set_x2apic_extra_bits(int pnode) | 198 | static __cpuinit void set_x2apic_extra_bits(int pnode) |