2018-06-22 23:15:12 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) <2018> Intel Corporation
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RELOCATE_H
|
|
|
|
#define RELOCATE_H
|
|
|
|
|
|
|
|
extern void _relocate(void);
|
|
|
|
extern uint64_t get_hv_image_delta(void);
|
|
|
|
extern uint64_t get_hv_image_base(void);
|
2018-06-23 01:16:17 +08:00
|
|
|
extern uint64_t read_trampoline_sym(void *sym);
|
|
|
|
extern void write_trampoline_sym(void *sym, uint64_t val);
|
2018-06-29 05:32:43 +08:00
|
|
|
extern uint64_t prepare_trampoline(void);
|
2018-06-22 23:15:12 +08:00
|
|
|
|
|
|
|
/* external symbols that are helpful for relocation */
|
|
|
|
extern uint8_t _DYNAMIC[];
|
2018-06-29 05:32:43 +08:00
|
|
|
extern const uint8_t _ld_trampoline_load[];
|
|
|
|
extern uint8_t _ld_trampoline_start[];
|
|
|
|
extern uint8_t _ld_trampoline_end[];
|
|
|
|
extern const uint64_t _ld_trampoline_size;
|
2018-06-22 23:15:12 +08:00
|
|
|
|
|
|
|
extern uint8_t cpu_primary_start_32[];
|
|
|
|
extern uint8_t cpu_primary_start_64[];
|
|
|
|
|
2018-06-29 05:32:43 +08:00
|
|
|
extern uint8_t trampoline_fixup_cs[];
|
|
|
|
extern uint8_t trampoline_fixup_ip[];
|
|
|
|
extern uint8_t trampoline_fixup_target[];
|
|
|
|
extern uint8_t CPU_Boot_Page_Tables_Start[];
|
|
|
|
extern uint8_t CPU_Boot_Page_Tables_ptr[];
|
|
|
|
extern uint8_t trampoline_pdpt_addr[];
|
|
|
|
extern uint8_t trampoline_gdt_ptr[];
|
|
|
|
extern uint8_t trampoline_start64_fixup[];
|
2018-06-22 23:15:12 +08:00
|
|
|
extern uint8_t trampoline_spinlock_ptr[];
|
|
|
|
|
2018-06-29 05:32:43 +08:00
|
|
|
extern uint64_t trampoline_start16_paddr;
|
|
|
|
|
2018-06-22 23:15:12 +08:00
|
|
|
#endif /* RELOCATE_H */
|