diff options
-rw-r--r-- | sys/i386/i386/machdep.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 9 | ||||
-rw-r--r-- | sys/i386/include/cpufunc.h | 6 | ||||
-rw-r--r-- | sys/i386/xen/xen_machdep.c | 17 |
4 files changed, 24 insertions, 12 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 2247558..2a7b9ca 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2373,8 +2373,8 @@ init386(first) } if (envmode == 1) kern_envp = static_env; - else if (bootinfo.bi_envp) - kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; + else if ((caddr_t)xen_start_info->cmd_line) + kern_envp = xen_setbootenv((caddr_t)xen_start_info->cmd_line); boothowto |= xen_boothowto(kern_envp); diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index a4b1c5c..a5f8713 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -270,8 +270,11 @@ cpu_fork(td1, p2, td2, flags) /* * XXX XEN need to check on PSL_USER is handled */ +#ifndef XEN + td2->td_md.md_saved_flags = 0; +#else td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; - +#endif /* * Now, cpu_switch() can schedule the new process. * pcb_esp is loaded pointing to the cpu_switch() stack frame @@ -439,7 +442,11 @@ cpu_set_upcall(struct thread *td, struct thread *td0) /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; +#ifdef XEN + td->td_md.md_saved_flags = 0; +#else td->td_md.md_saved_flags = PSL_KERNEL | PSL_I; +#endif } /* diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 948bde1..5f28a86 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -48,7 +48,7 @@ extern void xen_sti(void); extern void xen_load_cr3(u_int data); extern void xen_tlb_flush(void); extern void xen_invlpg(u_int addr); -extern void xen_save_and_cli(u_int *eflags); +extern int xen_save_and_cli(void); extern void xen_restore_flags(u_int eflags); #endif @@ -690,10 +690,10 @@ load_dr7(u_int dr7) static __inline register_t intr_disable(void) { - register_t eflags = 0; + register_t eflags; #ifdef XEN - xen_save_and_cli(&eflags); + eflags = xen_save_and_cli(); #else eflags = read_eflags(); disable_intr(); diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c index 333f95a..b9480f9 100644 --- a/sys/i386/xen/xen_machdep.c +++ b/sys/i386/xen/xen_machdep.c @@ -344,11 +344,13 @@ xen_restore_flags(u_int eflags) __restore_flags(eflags); } -void -xen_save_and_cli(u_int *eflags) +int +xen_save_and_cli(void) { - - __save_and_cli((*eflags)); + int eflags; + + __save_and_cli(eflags); + return (eflags); } void @@ -1141,7 +1143,10 @@ static struct xenbus_watch shutdown_watch = { }; -static void +void setup_shutdown_watcher(void *unused); + + +void setup_shutdown_watcher(void *unused) { if (register_xenbus_watch(&shutdown_watch)) @@ -1149,7 +1154,7 @@ setup_shutdown_watcher(void *unused) } -SYSINIT(shutdown, SI_SUB_PSEUDO, SI_ORDER_ANY, setup_shutdown_watcher, NULL); +SYSINIT(shutdown, SI_SUB_RUN_SCHEDULER, SI_ORDER_ANY, setup_shutdown_watcher, NULL); #ifdef notyet |