[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [MINI-OS PATCH 01/19] setup: add global pointer for struct hvm_start_info
Similar to start_info_ptr for PV provide hvm_start_info_ptr for PVH. Add a generic function to set the pointer. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- arch/x86/setup.c | 20 +++++++++++++++++--- include/hypervisor.h | 3 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/x86/setup.c b/arch/x86/setup.c index ed28d940..2085ee5c 100644 --- a/arch/x86/setup.c +++ b/arch/x86/setup.c @@ -69,6 +69,11 @@ static inline void sse_init(void) { start_info_t *start_info_ptr; EXPORT_SYMBOL(start_info_ptr); +static void set_info_ptr(start_info_t *ptr) +{ + start_info_ptr = ptr; +} + #define hpc_init() shared_info_t *map_shared_info(void) @@ -123,6 +128,17 @@ static void print_start_of_day(void *p) printk(" stack: %p-%p\n", stack, stack + sizeof(stack)); } #else + +/* + * This pointer holds a reference to the hvm_start_info struct. + */ +struct hvm_start_info *hvm_start_info_ptr; + +static void set_info_ptr(struct hvm_start_info *ptr) +{ + hvm_start_info_ptr = ptr; +} + static void hpc_init(void) { uint32_t eax, ebx, ecx, edx, base; @@ -176,9 +192,7 @@ arch_init(void *par) { static char hello[] = "Bootstrapping...\n"; -#ifdef CONFIG_PARAVIRT - start_info_ptr = par; -#endif + set_info_ptr(par); hpc_init(); (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(hello), hello); diff --git a/include/hypervisor.h b/include/hypervisor.h index d199f039..93f1247f 100644 --- a/include/hypervisor.h +++ b/include/hypervisor.h @@ -33,6 +33,9 @@ extern start_info_t *start_info_ptr; #define start_info (*start_info_ptr) #else +#include <xen/arch-x86/hvm/start_info.h> + +extern struct hvm_start_info *hvm_start_info_ptr; int hvm_get_parameter(int idx, uint64_t *value); int hvm_set_parameter(int idx, uint64_t value); #endif -- 2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |