Skip to content

Commit

Permalink
x86/APIC: Rewrite apic_isr_read() to match apic_{tmr,irr}_read()
Browse files Browse the repository at this point in the history
This allows for marginally better code generation including the use of BT
rather than SHR/TEST.

Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
  • Loading branch information
andyhhp committed Jul 24, 2024
1 parent c29f6ee commit 5795a0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xen/arch/x86/include/asm/apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ static inline void apic_icr_write(u32 low, u32 dest)
}
}

static inline bool apic_isr_read(uint8_t vector)
static inline bool apic_isr_read(unsigned int vector)
{
return (apic_read(APIC_ISR + ((vector & ~0x1f) >> 1)) >>
(vector & 0x1f)) & 1;
return apic_read(APIC_ISR + (vector / 32 * 0x10)) & (1U << (vector % 32));
}

static inline bool apic_tmr_read(unsigned int vector)
Expand Down

0 comments on commit 5795a0b

Please sign in to comment.