mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
hv: pgtable: fix 'Use of function like macro'
Convert HPA2HVA, HVA2HPA, GPA2HVA and HVA2GPA to inline functions.
v1 -> v2:
* Modify the following statement.
rsdp = biosacpi_search_rsdp((char *)hpa2hva((uint64_t)(*addr << 4)),
0x400);
Instead of "(uint64_t)(*addr << 4)", "(uint64_t)(*addr) << 4U" would
be clearer.
Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
@@ -37,7 +37,8 @@ static inline uint32_t uart16550_read_reg(uint64_t base, uint16_t reg_idx)
|
||||
if (serial_port_mapped) {
|
||||
return pio_read8((uint16_t)base + reg_idx);
|
||||
} else {
|
||||
return mmio_read32((void*)((uint32_t*)HPA2HVA(base) + reg_idx));
|
||||
return mmio_read32((void *)((uint32_t *)hpa2hva(base) +
|
||||
reg_idx));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +51,8 @@ static inline void uart16550_write_reg(uint64_t base,
|
||||
if (serial_port_mapped) {
|
||||
pio_write8((uint8_t)val, (uint16_t)base + reg_idx);
|
||||
} else {
|
||||
mmio_write32(val, (void*)((uint32_t*)HPA2HVA(base) + reg_idx));
|
||||
mmio_write32(val, (void *)((uint32_t *)hpa2hva(base) +
|
||||
reg_idx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user