MFC: Cache the value of the lower half of each I/O APIC redirection table
entry and thus cut the execution time for masking and unmasking I/O APIC pins in half.
This commit is contained in:
parent
fd3b56a33d
commit
42f7829611
@ -85,6 +85,7 @@ struct ioapic_intsrc {
|
||||
u_int io_edgetrigger:1;
|
||||
u_int io_masked:1;
|
||||
int io_bus:4;
|
||||
uint32_t io_lowreg;
|
||||
};
|
||||
|
||||
struct ioapic {
|
||||
@ -203,9 +204,7 @@ ioapic_enable_source(struct intsrc *isrc)
|
||||
|
||||
mtx_lock_spin(&icu_lock);
|
||||
if (intpin->io_masked) {
|
||||
flags = ioapic_read(io->io_addr,
|
||||
IOAPIC_REDTBL_LO(intpin->io_intpin));
|
||||
flags &= ~(IOART_INTMASK);
|
||||
flags = intpin->io_lowreg & ~IOART_INTMASK;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
|
||||
flags);
|
||||
intpin->io_masked = 0;
|
||||
@ -222,9 +221,7 @@ ioapic_disable_source(struct intsrc *isrc, int eoi)
|
||||
|
||||
mtx_lock_spin(&icu_lock);
|
||||
if (!intpin->io_masked && !intpin->io_edgetrigger) {
|
||||
flags = ioapic_read(io->io_addr,
|
||||
IOAPIC_REDTBL_LO(intpin->io_intpin));
|
||||
flags |= IOART_INTMSET;
|
||||
flags = intpin->io_lowreg | IOART_INTMSET;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
|
||||
flags);
|
||||
intpin->io_masked = 1;
|
||||
@ -309,6 +306,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
||||
|
||||
/* Write the values to the APIC. */
|
||||
mtx_lock_spin(&icu_lock);
|
||||
intpin->io_lowreg = low;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
|
||||
value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
|
||||
value &= ~IOART_DEST;
|
||||
|
@ -84,6 +84,7 @@ struct ioapic_intsrc {
|
||||
u_int io_edgetrigger:1;
|
||||
u_int io_masked:1;
|
||||
int io_bus:4;
|
||||
uint32_t io_lowreg;
|
||||
};
|
||||
|
||||
struct ioapic {
|
||||
@ -202,9 +203,7 @@ ioapic_enable_source(struct intsrc *isrc)
|
||||
|
||||
mtx_lock_spin(&icu_lock);
|
||||
if (intpin->io_masked) {
|
||||
flags = ioapic_read(io->io_addr,
|
||||
IOAPIC_REDTBL_LO(intpin->io_intpin));
|
||||
flags &= ~(IOART_INTMASK);
|
||||
flags = intpin->io_lowreg & ~IOART_INTMASK;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
|
||||
flags);
|
||||
intpin->io_masked = 0;
|
||||
@ -221,9 +220,7 @@ ioapic_disable_source(struct intsrc *isrc, int eoi)
|
||||
|
||||
mtx_lock_spin(&icu_lock);
|
||||
if (!intpin->io_masked && !intpin->io_edgetrigger) {
|
||||
flags = ioapic_read(io->io_addr,
|
||||
IOAPIC_REDTBL_LO(intpin->io_intpin));
|
||||
flags |= IOART_INTMSET;
|
||||
flags = intpin->io_lowreg | IOART_INTMSET;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
|
||||
flags);
|
||||
intpin->io_masked = 1;
|
||||
@ -308,6 +305,7 @@ ioapic_program_intpin(struct ioapic_intsrc *intpin)
|
||||
|
||||
/* Write the values to the APIC. */
|
||||
mtx_lock_spin(&icu_lock);
|
||||
intpin->io_lowreg = low;
|
||||
ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
|
||||
value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
|
||||
value &= ~IOART_DEST;
|
||||
|
Loading…
x
Reference in New Issue
Block a user