diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-10-16 22:18:05 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-10-17 13:06:21 -0400 |
commit | bcdd48739d1336332e4086c9e1c9f225290b8194 (patch) | |
tree | 6305de8af340d352b740406268d245be5cfaf329 /arch | |
parent | 16583bc0b4871299a60cbcdd1c6e102e3f9b8e4b (diff) |
ia64/pv_ops/xen: implement xen pv_iosapic_ops.
implement xen pv_iosapic_ops for xen paravirtualized
iosapic.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/xen/xen_pv_ops.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c index 5b23cd5e9153..41a6cbfab150 100644 --- a/arch/ia64/xen/xen_pv_ops.c +++ b/arch/ia64/xen/xen_pv_ops.c | |||
@@ -292,6 +292,57 @@ const struct pv_cpu_asm_switch xen_cpu_asm_switch = { | |||
292 | }; | 292 | }; |
293 | 293 | ||
294 | /*************************************************************************** | 294 | /*************************************************************************** |
295 | * pv_iosapic_ops | ||
296 | * iosapic read/write hooks. | ||
297 | */ | ||
298 | static void | ||
299 | xen_pcat_compat_init(void) | ||
300 | { | ||
301 | /* nothing */ | ||
302 | } | ||
303 | |||
304 | static struct irq_chip* | ||
305 | xen_iosapic_get_irq_chip(unsigned long trigger) | ||
306 | { | ||
307 | return NULL; | ||
308 | } | ||
309 | |||
310 | static unsigned int | ||
311 | xen_iosapic_read(char __iomem *iosapic, unsigned int reg) | ||
312 | { | ||
313 | struct physdev_apic apic_op; | ||
314 | int ret; | ||
315 | |||
316 | apic_op.apic_physbase = (unsigned long)iosapic - | ||
317 | __IA64_UNCACHED_OFFSET; | ||
318 | apic_op.reg = reg; | ||
319 | ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); | ||
320 | if (ret) | ||
321 | return ret; | ||
322 | return apic_op.value; | ||
323 | } | ||
324 | |||
325 | static void | ||
326 | xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | ||
327 | { | ||
328 | struct physdev_apic apic_op; | ||
329 | |||
330 | apic_op.apic_physbase = (unsigned long)iosapic - | ||
331 | __IA64_UNCACHED_OFFSET; | ||
332 | apic_op.reg = reg; | ||
333 | apic_op.value = val; | ||
334 | HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); | ||
335 | } | ||
336 | |||
337 | static const struct pv_iosapic_ops xen_iosapic_ops __initdata = { | ||
338 | .pcat_compat_init = xen_pcat_compat_init, | ||
339 | .__get_irq_chip = xen_iosapic_get_irq_chip, | ||
340 | |||
341 | .__read = xen_iosapic_read, | ||
342 | .__write = xen_iosapic_write, | ||
343 | }; | ||
344 | |||
345 | /*************************************************************************** | ||
295 | * pv_ops initialization | 346 | * pv_ops initialization |
296 | */ | 347 | */ |
297 | 348 | ||
@@ -302,6 +353,7 @@ xen_setup_pv_ops(void) | |||
302 | pv_info = xen_info; | 353 | pv_info = xen_info; |
303 | pv_init_ops = xen_init_ops; | 354 | pv_init_ops = xen_init_ops; |
304 | pv_cpu_ops = xen_cpu_ops; | 355 | pv_cpu_ops = xen_cpu_ops; |
356 | pv_iosapic_ops = xen_iosapic_ops; | ||
305 | 357 | ||
306 | paravirt_cpu_asm_init(&xen_cpu_asm_switch); | 358 | paravirt_cpu_asm_init(&xen_cpu_asm_switch); |
307 | } | 359 | } |