mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/IO-APIC: consolidate / complete #define-s
Drop redundant ones from apic.h. Add delivery mode mask. Use them in place of open coded hex numbers. Take the opportunity and modify a helper function's parameters to be just unsigned int. Also drop the bogus double underscore from its name, as it and all its callers get touched anyway. No functional change. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
74f299bbd7
commit
839aca83f4
3 files changed
+8
-10
No files matched your search
@@ -410,7 +410,8 @@ void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries)
|
||||
xfree(ioapic_entries);
|
||||
}
|
||||
|
||||
static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsigned long disable)
|
||||
static void modify_IO_APIC_irq(unsigned int irq, unsigned int enable,
|
||||
unsigned int disable)
|
||||
{
|
||||
struct irq_pin_list *entry = irq_2_pin + irq;
|
||||
unsigned int pin, reg;
|
||||
@@ -432,25 +433,25 @@ static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsign
|
||||
/* mask = 1 */
|
||||
static void __mask_IO_APIC_irq (unsigned int irq)
|
||||
{
|
||||
__modify_IO_APIC_irq(irq, 0x00010000, 0);
|
||||
modify_IO_APIC_irq(irq, IO_APIC_REDIR_MASKED, 0);
|
||||
}
|
||||
|
||||
/* mask = 0 */
|
||||
static void __unmask_IO_APIC_irq (unsigned int irq)
|
||||
{
|
||||
__modify_IO_APIC_irq(irq, 0, 0x00010000);
|
||||
modify_IO_APIC_irq(irq, 0, IO_APIC_REDIR_MASKED);
|
||||
}
|
||||
|
||||
/* trigger = 0 */
|
||||
static void __edge_IO_APIC_irq (unsigned int irq)
|
||||
{
|
||||
__modify_IO_APIC_irq(irq, 0, 0x00008000);
|
||||
modify_IO_APIC_irq(irq, 0, IO_APIC_REDIR_LEVEL_TRIGGER);
|
||||
}
|
||||
|
||||
/* trigger = 1 */
|
||||
static void __level_IO_APIC_irq (unsigned int irq)
|
||||
{
|
||||
__modify_IO_APIC_irq(irq, 0x00008000, 0);
|
||||
modify_IO_APIC_irq(irq, IO_APIC_REDIR_LEVEL_TRIGGER, 0);
|
||||
}
|
||||
|
||||
static void mask_IO_APIC_irq(struct irq_desc *desc)
|
||||
@@ -571,7 +572,7 @@ set_ioapic_affinity_irq(struct irq_desc *desc, const cpumask_t *mask)
|
||||
io_apic_write(entry->apic, 0x10 + 1 + pin*2, dest);
|
||||
data = io_apic_read(entry->apic, 0x10 + pin*2);
|
||||
data &= ~IO_APIC_REDIR_VECTOR_MASK;
|
||||
data |= desc->arch.vector & 0xFF;
|
||||
data |= MASK_INSR(desc->arch.vector, IO_APIC_REDIR_VECTOR_MASK);
|
||||
io_apic_modify(entry->apic, 0x10 + pin*2, data);
|
||||
|
||||
if (!entry->next)
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
#define SET_APIC_LOGICAL_ID(x) (((x)<<24))
|
||||
|
||||
#define IO_APIC_REDIR_VECTOR_MASK 0x000FF
|
||||
#define IO_APIC_REDIR_DEST_LOGICAL 0x00800
|
||||
#define IO_APIC_REDIR_DEST_PHYSICAL 0x00000
|
||||
|
||||
/* Possible APIC states */
|
||||
enum apic_mode {
|
||||
APIC_MODE_INVALID, /* Not set yet */
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
/* I/O Unit Redirection Table */
|
||||
#define IO_APIC_REDIR_VECTOR_MASK 0x000FF
|
||||
#define IO_APIC_REDIR_DELIV_MODE_MASK 0x00700
|
||||
#define IO_APIC_REDIR_DEST_LOGICAL 0x00800
|
||||
#define IO_APIC_REDIR_DEST_PHYSICAL 0x00000
|
||||
#define IO_APIC_REDIR_SEND_PENDING (1 << 12)
|
||||
|
||||