mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 08:04:55 +00:00
hv: fixup addresses in the c code for relocation
- Trampoline code doesn't have the same relocation delta with HV, Need to manually patch them when referenced from HV - replace all references to CONFIG_RAM_START with the actual HV load address Signed-off-by: Zheng Gen <gen.zheng@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
@@ -131,3 +131,19 @@ void _relocate(void)
|
||||
start = (struct Elf64_Rel *)((char *)start + size);
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t read_trampoline_sym(void *sym)
|
||||
{
|
||||
uint64_t *hva;
|
||||
|
||||
hva = HPA2HVA(trampoline_start16_paddr) + trampoline_relo_addr(sym);
|
||||
return *hva;
|
||||
}
|
||||
|
||||
void write_trampoline_sym(void *sym, uint64_t val)
|
||||
{
|
||||
uint64_t *hva;
|
||||
|
||||
hva = HPA2HVA(trampoline_start16_paddr) + trampoline_relo_addr(sym);
|
||||
*hva = val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user