mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 14:33:38 +00:00
HV: Use mmio_read/write_long for IOAPIC mmio-access
This is to do the clean-up of IOAPIC mmio-access. Use the same API to access the IOAPIC register. At the same time it also helps to avoid the optimization in direct access mode.(The volatile is already added in mmio_read_long/mmio_write_long) V1->V2: Follow Fengwei's suggestion to use the mmio_read/write_long Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
parent
ec13f4e1f2
commit
b37c049ef4
@ -95,9 +95,9 @@ ioapic_read_reg32(const void *ioapic_base, const uint8_t offset)
|
||||
spinlock_irqsave_obtain(&ioapic_lock);
|
||||
|
||||
/* Write IOREGSEL */
|
||||
*(uint32_t *)(ioapic_base) = offset;
|
||||
mmio_write_long(offset, (void *)ioapic_base);
|
||||
/* Read IOWIN */
|
||||
v = *(uint32_t *)(ioapic_base + IOAPIC_WINSWL_OFFSET);
|
||||
v = mmio_read_long((void *)ioapic_base + IOAPIC_WINSWL_OFFSET);
|
||||
|
||||
spinlock_irqrestore_release(&ioapic_lock);
|
||||
return v;
|
||||
@ -112,9 +112,9 @@ ioapic_write_reg32(const void *ioapic_base,
|
||||
spinlock_irqsave_obtain(&ioapic_lock);
|
||||
|
||||
/* Write IOREGSEL */
|
||||
*(uint32_t *)(ioapic_base) = offset;
|
||||
mmio_write_long(offset, (void *)ioapic_base);
|
||||
/* Write IOWIN */
|
||||
*(uint32_t *)(ioapic_base + IOAPIC_WINSWL_OFFSET) = value;
|
||||
mmio_write_long(value, (void *)ioapic_base + IOAPIC_WINSWL_OFFSET);
|
||||
|
||||
spinlock_irqrestore_release(&ioapic_lock);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user