mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +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:
@@ -30,8 +30,16 @@
|
||||
|
||||
#ifndef ASSEMBLER
|
||||
/* gpa --> hpa -->hva */
|
||||
#define GPA2HVA(vm, x) HPA2HVA(gpa2hpa(vm, x))
|
||||
#define HVA2GPA(vm, x) hpa2gpa(vm, HVA2HPA(x))
|
||||
static inline void *gpa2hva(const struct vm *vm, uint64_t x)
|
||||
{
|
||||
return hpa2hva(gpa2hpa(vm, x));
|
||||
}
|
||||
|
||||
static inline uint64_t hva2gpa(const struct vm *vm, void *x)
|
||||
{
|
||||
return hpa2gpa(vm, hva2hpa(x));
|
||||
}
|
||||
|
||||
#endif /* !ASSEMBLER */
|
||||
|
||||
#endif /* HYPERVISOR_H */
|
||||
|
||||
Reference in New Issue
Block a user