Index: arch/amd64/amd64/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/amd64/amd64/machdep.c,v retrieving revision 1.179 diff -p -r1.179 machdep.c *** arch/amd64/amd64/machdep.c 2 Mar 2012 16:43:30 -0000 1.179 --- arch/amd64/amd64/machdep.c 3 Mar 2012 23:21:03 -0000 *************** u_long cpu_dump_mempagecnt(void); *** 309,314 **** --- 309,316 ---- void dodumpsys(void); void dumpsys(void); + extern int time_adjusted; /* XXX no common header */ + void dump_misc_init(void); void dump_seg_prep(void); int dump_seg_iter(int (*)(paddr_t, paddr_t)); *************** sendsig_siginfo(const ksiginfo_t *ksi, c *** 711,722 **** l->l_sigstk.ss_flags |= SS_ONSTACK; } - int waittime = -1; struct pcb dumppcb; void cpu_reboot(int howto, char *bootstr) { int s = IPL_NONE; if (cold) { --- 713,724 ---- l->l_sigstk.ss_flags |= SS_ONSTACK; } struct pcb dumppcb; void cpu_reboot(int howto, char *bootstr) { + static bool syncdone = false; int s = IPL_NONE; if (cold) { *************** cpu_reboot(int howto, char *bootstr) *** 725,739 **** } boothowto = howto; ! if ((howto & RB_NOSYNC) == 0 && waittime < 0) { ! waittime = 0; ! vfs_shutdown(); ! /* ! * If we've been adjusting the clock, the todr ! * will be out of synch; adjust it now. ! */ ! resettodr(); ! } /* Disable interrupts. */ s = splhigh(); --- 727,763 ---- } boothowto = howto; ! ! /* i386 maybe_dump() */ ! ! /* ! * If we've panic'd, don't make the situation potentially ! * worse by syncing or unmounting the file systems. ! */ ! if ((howto & RB_NOSYNC) == 0 && panicstr == NULL) { ! if (!syncdone) { ! syncdone = true; ! /* XXX used to force unmount as well, here */ ! vfs_sync_all(curlwp); ! /* ! * If we've been adjusting the clock, the todr ! * will be out of synch; adjust it now. ! * ! * XXX used to do this after unmounting all ! * filesystems with vfs_shutdown(). ! */ ! if (time_adjusted != 0) ! resettodr(); ! } ! ! while (vfs_unmountall1(curlwp, false, false) || ! config_detach_all(boothowto) || ! vfs_unmount_forceone(curlwp)) ! ; /* do nothing */ ! } else ! suspendsched(); ! ! pmf_system_shutdown(boothowto); /* Disable interrupts. */ s = splhigh(); *************** cpu_reboot(int howto, char *bootstr) *** 745,752 **** haltsys: doshutdownhooks(); - pmf_system_shutdown(boothowto); - if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { #ifndef XEN #if NACPICA > 0 --- 769,774 ---- Index: arch/i386/i386/machdep.c =================================================================== RCS file: /cvsroot/src/sys/arch/i386/i386/machdep.c,v retrieving revision 1.723 diff -p -r1.723 machdep.c *** arch/i386/i386/machdep.c 2 Mar 2012 16:43:31 -0000 1.723 --- arch/i386/i386/machdep.c 3 Mar 2012 23:21:03 -0000 *************** void *** 835,845 **** cpu_reboot(int howto, char *bootstr) { static bool syncdone = false; ! struct lwp *l; ! int s; ! ! s = IPL_NONE; ! l = (curlwp == NULL) ? &lwp0 : curlwp; if (cold) { howto |= RB_HALT; --- 835,841 ---- cpu_reboot(int howto, char *bootstr) { static bool syncdone = false; ! int s = IPL_NONE; if (cold) { howto |= RB_HALT; *************** cpu_reboot(int howto, char *bootstr) *** 861,867 **** if (!syncdone) { syncdone = true; /* XXX used to force unmount as well, here */ ! vfs_sync_all(l); /* * If we've been adjusting the clock, the todr * will be out of synch; adjust it now. --- 857,863 ---- if (!syncdone) { syncdone = true; /* XXX used to force unmount as well, here */ ! vfs_sync_all(curlwp); /* * If we've been adjusting the clock, the todr * will be out of synch; adjust it now. *************** cpu_reboot(int howto, char *bootstr) *** 873,881 **** resettodr(); } ! while (vfs_unmountall1(l, false, false) || config_detach_all(boothowto) || ! vfs_unmount_forceone(l)) ; /* do nothing */ } else suspendsched(); --- 869,877 ---- resettodr(); } ! while (vfs_unmountall1(curlwp, false, false) || config_detach_all(boothowto) || ! vfs_unmount_forceone(curlwp)) ; /* do nothing */ } else suspendsched(); *************** cpu_reboot(int howto, char *bootstr) *** 883,889 **** --- 879,889 ---- pmf_system_shutdown(boothowto); s = splhigh(); + + /* amd64 maybe_dump() */ + haltsys: + doshutdownhooks(); if ((howto & RB_POWERDOWN) == RB_POWERDOWN) { #ifdef XEN