提交 d83e94ac 编写于 作者: Y Yinghai Lu 提交者: Ingo Molnar

x86, io-apic: remove union about dest for log/phy

let user decide the meaning of the bits.

This unifies the 32-bit and 64-bit io-apic code a bit.
Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 7a959cff
...@@ -1224,7 +1224,7 @@ static int setup_ioapic_entry(int apic, int irq, ...@@ -1224,7 +1224,7 @@ static int setup_ioapic_entry(int apic, int irq,
entry->delivery_mode = INT_DELIVERY_MODE; entry->delivery_mode = INT_DELIVERY_MODE;
entry->dest_mode = INT_DEST_MODE; entry->dest_mode = INT_DEST_MODE;
entry->dest.logical.logical_dest = destination; entry->dest = destination;
entry->mask = 0; /* enable IRQ */ entry->mask = 0; /* enable IRQ */
entry->trigger = trigger; entry->trigger = trigger;
...@@ -1336,7 +1336,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, ...@@ -1336,7 +1336,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin,
*/ */
entry.dest_mode = INT_DEST_MODE; entry.dest_mode = INT_DEST_MODE;
entry.mask = 1; /* mask IRQ now */ entry.mask = 1; /* mask IRQ now */
entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS); entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
entry.delivery_mode = INT_DELIVERY_MODE; entry.delivery_mode = INT_DELIVERY_MODE;
entry.polarity = 0; entry.polarity = 0;
entry.trigger = 0; entry.trigger = 0;
...@@ -1425,19 +1425,15 @@ __apicdebuginit(void) print_IO_APIC(void) ...@@ -1425,19 +1425,15 @@ __apicdebuginit(void) print_IO_APIC(void)
printk(KERN_DEBUG ".... IRQ redirection table:\n"); printk(KERN_DEBUG ".... IRQ redirection table:\n");
printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol" printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol"
" Stat Dest Deli Vect: \n"); " Stat Dmod Deli Vect: \n");
for (i = 0; i <= reg_01.bits.entries; i++) { for (i = 0; i <= reg_01.bits.entries; i++) {
struct IO_APIC_route_entry entry; struct IO_APIC_route_entry entry;
entry = ioapic_read_entry(apic, i); entry = ioapic_read_entry(apic, i);
printk(KERN_DEBUG " %02x %03X %02X ", printk(KERN_DEBUG " %02x %02X ", i, entry.dest);
i,
entry.dest.logical.logical_dest,
entry.dest.physical.physical_dest
);
printk("%1d %1d %1d %1d %1d %1d %1d %02X\n", printk("%1d %1d %1d %1d %1d %1d %1d %02X\n",
entry.mask, entry.mask,
...@@ -1717,7 +1713,7 @@ void disable_IO_APIC(void) ...@@ -1717,7 +1713,7 @@ void disable_IO_APIC(void)
entry.dest_mode = 0; /* Physical */ entry.dest_mode = 0; /* Physical */
entry.delivery_mode = dest_ExtINT; /* ExtInt */ entry.delivery_mode = dest_ExtINT; /* ExtInt */
entry.vector = 0; entry.vector = 0;
entry.dest.physical.physical_dest = read_apic_id(); entry.dest = read_apic_id();
/* /*
* Add it to the IO-APIC irq-routing table: * Add it to the IO-APIC irq-routing table:
...@@ -2185,7 +2181,7 @@ static inline void __init unlock_ExtINT_logic(void) ...@@ -2185,7 +2181,7 @@ static inline void __init unlock_ExtINT_logic(void)
entry1.dest_mode = 0; /* physical delivery */ entry1.dest_mode = 0; /* physical delivery */
entry1.mask = 0; /* unmask IRQ now */ entry1.mask = 0; /* unmask IRQ now */
entry1.dest.physical.physical_dest = hard_smp_processor_id(); entry1.dest = hard_smp_processor_id();
entry1.delivery_mode = dest_ExtINT; entry1.delivery_mode = dest_ExtINT;
entry1.polarity = entry0.polarity; entry1.polarity = entry0.polarity;
entry1.trigger = 0; entry1.trigger = 0;
......
...@@ -87,24 +87,8 @@ struct IO_APIC_route_entry { ...@@ -87,24 +87,8 @@ struct IO_APIC_route_entry {
mask : 1, /* 0: enabled, 1: disabled */ mask : 1, /* 0: enabled, 1: disabled */
__reserved_2 : 15; __reserved_2 : 15;
#ifdef CONFIG_X86_32
union {
struct {
__u32 __reserved_1 : 24,
physical_dest : 4,
__reserved_2 : 4;
} physical;
struct {
__u32 __reserved_1 : 24,
logical_dest : 8;
} logical;
} dest;
#else
__u32 __reserved_3 : 24, __u32 __reserved_3 : 24,
dest : 8; dest : 8;
#endif
} __attribute__ ((packed)); } __attribute__ ((packed));
struct IR_IO_APIC_route_entry { struct IR_IO_APIC_route_entry {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册