mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
vtd: ia64 fix of intremap.c
19707:07cf79dfb59c caused compilation error on ia64. This patch fixes it. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
1 parent
e6e2645a53
commit
5f555eacb7
3 files changed
+27
-2
No files matched your search
@@ -1275,4 +1275,22 @@ int iosapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
|
||||
spin_unlock_irqrestore(&irq_descp(vec)->lock, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* for vtd interrupt remapping. xen/drivers/vtd/intremap.c */
|
||||
int iosapic_get_nr_iosapics(void)
|
||||
{
|
||||
int index;
|
||||
|
||||
for (index = NR_IOSAPICS - 1; index >= 0; index--) {
|
||||
if (iosapic_lists[index].addr)
|
||||
break;
|
||||
}
|
||||
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
int iosapic_get_nr_pins(int index)
|
||||
{
|
||||
return iosapic_lists[index].num_rte;
|
||||
}
|
||||
#endif /* XEN */
|
||||
@@ -33,6 +33,10 @@
|
||||
|
||||
#ifdef __ia64__
|
||||
#define dest_SMI -1
|
||||
#define nr_ioapics iosapic_get_nr_iosapics()
|
||||
#define nr_ioapic_registers(i) iosapic_get_nr_pins(i)
|
||||
#else
|
||||
#define nr_ioapic_registers(i) nr_ioapic_registers[i]
|
||||
#endif
|
||||
|
||||
/* apic_pin_2_ir_idx[apicid][pin] = interrupt remapping table index */
|
||||
@@ -45,7 +49,7 @@ static int init_apic_pin_2_ir_idx(void)
|
||||
|
||||
nr_pins = 0;
|
||||
for ( i = 0; i < nr_ioapics; i++ )
|
||||
nr_pins += nr_ioapic_registers[i];
|
||||
nr_pins += nr_ioapic_registers(i);
|
||||
|
||||
_apic_pin_2_ir_idx = xmalloc_array(unsigned int, nr_pins);
|
||||
apic_pin_2_ir_idx = xmalloc_array(unsigned int *, nr_ioapics);
|
||||
@@ -63,7 +67,7 @@ static int init_apic_pin_2_ir_idx(void)
|
||||
for ( i = 0; i < nr_ioapics; i++ )
|
||||
{
|
||||
apic_pin_2_ir_idx[i] = &_apic_pin_2_ir_idx[nr_pins];
|
||||
nr_pins += nr_ioapic_registers[i];
|
||||
nr_pins += nr_ioapic_registers(i);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -186,6 +186,9 @@ struct rte_entry {
|
||||
#define IOSAPIC_RTEINDEX(reg) (((reg) - 0x10) >> 1)
|
||||
extern unsigned long ia64_vector_mask[];
|
||||
extern unsigned long ia64_xen_vector[];
|
||||
|
||||
int iosapic_get_nr_iosapics(void);
|
||||
int iosapic_get_nr_pins(int index);
|
||||
#endif /* XEN */
|
||||
|
||||
#define IO_APIC_BASE(idx) ((unsigned int *)iosapic_lists[idx].addr)
|
||||
|
||||