]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: partially revert "remove using start_info ..."
authorJuergen Gross <jgross@suse.com>
Mon, 29 Aug 2016 14:18:26 +0000 (16:18 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 30 Aug 2016 08:14:09 +0000 (09:14 +0100)
Commit e33452c4f5547ed14defe6382b3b53664ac5bd8a ("remove using
start_info in architecture independent code") removed the start_info
variable completely. grub stubdom needs the start_info structure.

Readd the start_info structure, but make it dependent on
CONFIG_PARAVIRT.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
arch/x86/setup.c
include/hypervisor.h

index 86955cf6b464aff95de4838ab54099924e27f1e3..52782275ba57c362edfe5829805e9acdf1e12fb4 100644 (file)
 #include <xen/arch-x86/cpuid.h>
 #include <xen/arch-x86/hvm/start_info.h>
 
+#ifdef CONFIG_PARAVIRT
+/*
+ * This structure contains start-of-day info, such as pagetable base pointer,
+ * address of the shared_info structure, and things like that.
+ */
+union start_info_union start_info_union;
+#endif
+
 /*
  * Shared page for communicating with the hypervisor.
  * Events flags go here, for example.
@@ -189,6 +197,10 @@ arch_init(void *par)
        /* print out some useful information  */
        print_start_of_day(par);
 
+#ifdef CONFIG_PARAVIRT
+       memcpy(&start_info, par, sizeof(start_info));
+#endif
+
        start_kernel();
 }
 
index 3073a8ad37a720170f784121a175dc4f9472505c..f3b1f3c186b2a87d183bf131c2b2781c788a94cd 100644 (file)
 #include <mini-os/traps.h>
 
 /* hypervisor.c */
-#ifndef CONFIG_PARAVIRT
+#ifdef CONFIG_PARAVIRT
+/*
+ * a placeholder for the start of day information passed up from the hypervisor
+ */
+union start_info_union
+{
+    start_info_t start_info;
+    char padding[512];
+};
+extern union start_info_union start_info_union;
+#define start_info (start_info_union.start_info)
+#else
 int hvm_get_parameter(int idx, uint64_t *value);
 int hvm_set_parameter(int idx, uint64_t value);
 #endif