entry->delivery_mode = apic->irq_delivery_mode;
entry->dest_mode = apic->irq_dest_mode;
- entry->dest = destination;
+ entry->dest = destination & 0xff;
+ entry->virt_ext_dest = destination >> 8;
entry->vector = vector;
entry->mask = 0; /* enable IRQ */
entry->trigger = attr->trigger;
entry = ioapic_read_entry(apic, i);
- pr_debug(" %02x %02X ", i, entry.dest);
+ pr_debug(" %02x %02X%02X ", i, entry.virt_ext_dest, entry.dest);
pr_cont("%1d %1d %1d %1d %1d "
"%1d %1d %02X\n",
entry.mask,
*/
if (ioapic_i8259.pin != -1) {
struct IO_APIC_route_entry entry;
+ u32 apic_id = read_apic_id();
memset(&entry, 0, sizeof(entry));
entry.mask = 0; /* Enabled */
entry.dest_mode = 0; /* Physical */
entry.delivery_mode = dest_ExtINT; /* ExtInt */
entry.vector = 0;
- entry.dest = read_apic_id();
+ entry.dest = apic_id & 0xff;
+ entry.virt_ext_dest = apic_id >> 8;
/*
* Add it to the IO-APIC irq-routing table:
raw_spin_lock_irqsave(&ioapic_lock, flags);
ret = apic_set_affinity(data, mask, &dest);
if (!ret) {
- /* Only the high 8 bits are valid. */
- dest = SET_APIC_LOGICAL_ID(dest);
- __target_IO_APIC_irq(irq, dest, irqd_cfg(data));
+ u32 destreg = (dest & 0xff) << 24;
+ if (x2apic_enabled())
+ destreg |= (dest & 0x7f00) << 9;
+
+ __target_IO_APIC_irq(irq, destreg, irqd_cfg(data));
ret = IRQ_SET_MASK_OK_NOCOPY;
}
raw_spin_unlock_irqrestore(&ioapic_lock, flags);
int apic, pin, i;
struct IO_APIC_route_entry entry0, entry1;
unsigned char save_control, save_freq_select;
+ u32 apic_id;
pin = find_isa_irq_pin(8, mp_INT);
if (pin == -1) {
entry0 = ioapic_read_entry(apic, pin);
clear_IO_APIC_pin(apic, pin);
+ apic_id = hard_smp_processor_id();
memset(&entry1, 0, sizeof(entry1));
entry1.dest_mode = 0; /* physical delivery */
entry1.mask = 0; /* unmask IRQ now */
- entry1.dest = hard_smp_processor_id();
+ entry1.dest = apic_id & 0xff;
+ entry1.virt_ext_dest = apic_id >> 8;
entry1.delivery_mode = dest_ExtINT;
entry1.polarity = entry0.polarity;
entry1.trigger = 0;