diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-11 21:41:54 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-12 02:45:12 -0400 |
commit | c535b6a1a685eb23f96e2c221777d6c1e05080d5 (patch) | |
tree | b21eda3f5693f680a2bed64e731013c011459246 /arch | |
parent | af9d13887f9e3699bbc852c39b076d30bb9dff2f (diff) |
x86: let 32bit use apic_ops 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/apic_32.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 2a83c07bd887..7413354c9ffd 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -145,19 +145,13 @@ static int modern_apic(void) | |||
145 | return lapic_get_version() >= 0x14; | 145 | return lapic_get_version() >= 0x14; |
146 | } | 146 | } |
147 | 147 | ||
148 | void apic_icr_write(u32 low, u32 id) | 148 | void xapic_wait_icr_idle(void) |
149 | { | ||
150 | apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(id)); | ||
151 | apic_write_around(APIC_ICR, low); | ||
152 | } | ||
153 | |||
154 | void apic_wait_icr_idle(void) | ||
155 | { | 149 | { |
156 | while (apic_read(APIC_ICR) & APIC_ICR_BUSY) | 150 | while (apic_read(APIC_ICR) & APIC_ICR_BUSY) |
157 | cpu_relax(); | 151 | cpu_relax(); |
158 | } | 152 | } |
159 | 153 | ||
160 | u32 safe_apic_wait_icr_idle(void) | 154 | u32 safe_xapic_wait_icr_idle(void) |
161 | { | 155 | { |
162 | u32 send_status; | 156 | u32 send_status; |
163 | int timeout; | 157 | int timeout; |
@@ -173,6 +167,35 @@ u32 safe_apic_wait_icr_idle(void) | |||
173 | return send_status; | 167 | return send_status; |
174 | } | 168 | } |
175 | 169 | ||
170 | void xapic_icr_write(u32 low, u32 id) | ||
171 | { | ||
172 | apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(id)); | ||
173 | apic_write_around(APIC_ICR, low); | ||
174 | } | ||
175 | |||
176 | u64 xapic_icr_read(void) | ||
177 | { | ||
178 | u32 icr1, icr2; | ||
179 | |||
180 | icr2 = apic_read(APIC_ICR2); | ||
181 | icr1 = apic_read(APIC_ICR); | ||
182 | |||
183 | return icr1 | ((u64)icr2 << 32); | ||
184 | } | ||
185 | |||
186 | static struct apic_ops xapic_ops = { | ||
187 | .read = native_apic_mem_read, | ||
188 | .write = native_apic_mem_write, | ||
189 | .write_atomic = native_apic_mem_write_atomic, | ||
190 | .icr_read = xapic_icr_read, | ||
191 | .icr_write = xapic_icr_write, | ||
192 | .wait_icr_idle = xapic_wait_icr_idle, | ||
193 | .safe_wait_icr_idle = safe_xapic_wait_icr_idle, | ||
194 | }; | ||
195 | |||
196 | struct apic_ops __read_mostly *apic_ops = &xapic_ops; | ||
197 | EXPORT_SYMBOL_GPL(apic_ops); | ||
198 | |||
176 | /** | 199 | /** |
177 | * enable_NMI_through_LVT0 - enable NMI through local vector table 0 | 200 | * enable_NMI_through_LVT0 - enable NMI through local vector table 0 |
178 | */ | 201 | */ |