hv: lapic: export write_lapic_reg32

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1
2018-03-27 21:51:14 +08:00
committed by Jack Ren
parent 471082cc6c
commit 57152d0f27
3 changed files with 19 additions and 12 deletions

View File

@@ -166,15 +166,19 @@ struct lapic_info {
static struct lapic_info lapic_info;
static uint32_t read_lapic_reg32(uint32_t offset)
static inline uint32_t read_lapic_reg32(uint32_t offset)
{
ASSERT((offset >= 0x020) && (offset <= 0x3FF), "");
if (offset < 0x20 || offset > 0x3ff)
return 0;
return mmio_read_long(lapic_info.xapic.vaddr + offset);
}
static void write_lapic_reg32(uint32_t offset, uint32_t value)
inline void write_lapic_reg32(uint32_t offset, uint32_t value)
{
ASSERT((offset >= 0x020) && (offset <= 0x3FF), "");
if (offset < 0x20 || offset > 0x3ff)
return;
mmio_write_long(value, lapic_info.xapic.vaddr + offset);
}