summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/bootstrap.c20
-rw-r--r--kern/debug.c6
2 files changed, 25 insertions, 1 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index b7db2df..cf10d67 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -63,7 +63,12 @@
#else
#include <mach/machine/multiboot.h>
#include <mach/exec/exec.h>
+#ifdef MACH_XEN
+#include <mach/xen.h>
+extern struct start_info boot_info; /* XXX put this in a header! */
+#else /* MACH_XEN */
extern struct multiboot_info boot_info; /* XXX put this in a header! */
+#endif /* MACH_XEN */
#endif
#include "boot_script.h"
@@ -101,10 +106,23 @@ task_insert_send_right(
void bootstrap_create()
{
+ int compat;
+#ifdef MACH_XEN
+ struct multiboot_module *bmods = ((struct multiboot_module *)
+ boot_info.mod_start);
+ int n;
+ for (n = 0; bmods[n].mod_start; n++) {
+ bmods[n].mod_start = kvtophys(bmods[n].mod_start + (vm_offset_t) bmods);
+ bmods[n].mod_end = kvtophys(bmods[n].mod_end + (vm_offset_t) bmods);
+ bmods[n].string = kvtophys(bmods[n].string + (vm_offset_t) bmods);
+ }
+ boot_info.mods_count = n;
+ boot_info.flags |= MULTIBOOT_MODS;
+#else /* MACH_XEN */
struct multiboot_module *bmods = ((struct multiboot_module *)
phystokv(boot_info.mods_addr));
- int compat;
+#endif /* MACH_XEN */
if (!(boot_info.flags & MULTIBOOT_MODS)
|| (boot_info.mods_count == 0))
panic ("No bootstrap code loaded with the kernel!");
diff --git a/kern/debug.c b/kern/debug.c
index 67b04ad..57a8126 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -24,6 +24,8 @@
* the rights to redistribute these changes.
*/
+#include <mach/xen.h>
+
#include <kern/printf.h>
#include <stdarg.h>
@@ -164,6 +166,9 @@ panic(const char *s, ...)
#if MACH_KDB
Debugger("panic");
#else
+# ifdef MACH_HYP
+ hyp_crash();
+# else
/* Give the user time to see the message */
{
int i = 1000; /* seconds */
@@ -172,6 +177,7 @@ panic(const char *s, ...)
}
halt_all_cpus (reboot_on_panic);
+# endif /* MACH_HYP */
#endif
}