hv: update coding style for tampoline.c

- add API get trampoline_start16_paddr() instead
    of exporting this global variable.
  - other minor update.

Tracked-On: #2095
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yonghua Huang 2018-12-18 18:55:46 +08:00 committed by wenlingz
parent b89b12280c
commit ea672c5b07
3 changed files with 8 additions and 5 deletions

View File

@ -131,7 +131,7 @@ void host_enter_s3(struct pm_s_state_data *sstate_data, uint32_t pm1a_cnt_val, u
stac();
/* set ACRN wakeup vec instead */
*(sstate_data->wake_vector_32) = (uint32_t)trampoline_start16_paddr;
*(sstate_data->wake_vector_32) = (uint32_t)get_trampoline_start16_paddr();
clac();
/* offline all APs */

View File

@ -9,7 +9,7 @@
#include <vm0_boot.h>
#include <e820.h>
uint64_t trampoline_start16_paddr;
static uint64_t trampoline_start16_paddr;
/*
* Because trampoline code is relocated in different way, if HV code
@ -50,6 +50,11 @@ void write_trampoline_stack_sym(uint16_t pcpu_id)
clflush(hva);
}
uint64_t get_trampoline_start16_paddr(void)
{
return trampoline_start16_paddr;
}
static void update_trampoline_code_refs(uint64_t dest_pa)
{
void *ptr;

View File

@ -10,6 +10,7 @@ extern uint64_t read_trampoline_sym(const void *sym);
extern void write_trampoline_sym(const void *sym, uint64_t val);
extern void write_trampoline_stack_sym(uint16_t pcpu_id);
extern uint64_t prepare_trampoline(void);
extern uint64_t get_trampoline_start16_paddr(void);
/* external symbols that are helpful for relocation */
extern const uint8_t ld_trampoline_load;
@ -23,7 +24,4 @@ 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;
extern uint64_t trampoline_start16_paddr;
#endif /* TRAMPOLINE_H */