Skip to content

Commit

Permalink
hv: update coding style for tampoline.c
Browse files Browse the repository at this point in the history
  - 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>
  • Loading branch information
yonghuah authored and wenlingz committed Dec 25, 2018
1 parent b89b122 commit ea672c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hypervisor/arch/x86/pm.c
Expand Up @@ -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 */
Expand Down
7 changes: 6 additions & 1 deletion hypervisor/arch/x86/trampoline.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions hypervisor/include/arch/x86/trampoline.h
Expand Up @@ -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;
Expand All @@ -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 */

0 comments on commit ea672c5

Please sign in to comment.