kern_shutdown.c (26812) | kern_shutdown.c (27997) |
---|---|
1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 | 1/*- 2 * Copyright (c) 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 |
39 * $Id: kern_shutdown.c,v 1.16 1997/06/15 02:03:03 wollman Exp $ | 39 * $Id: kern_shutdown.c,v 1.17 1997/06/22 16:04:16 peter Exp $ |
40 */ 41 42#include "opt_ddb.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/reboot.h> 47#include <sys/msgbuf.h> --- 38 unchanged lines hidden (view full) --- 86#endif 87 88SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW, 89 &debugger_on_panic, 0, ""); 90#endif 91 92 93/* | 40 */ 41 42#include "opt_ddb.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/reboot.h> 47#include <sys/msgbuf.h> --- 38 unchanged lines hidden (view full) --- 86#endif 87 88SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW, 89 &debugger_on_panic, 0, ""); 90#endif 91 92 93/* |
94 * If there is a hardware watchdog, point this at the function needed to 95 * hold it off. 96 * It's needed when the kernel needs to do some lengthy operations. 97 * e.g. in wd.c when dumping core.. It's most annoying to have 98 * your precious core-dump only half written because the wdog kicked in. 99 */ 100watchdog_tickle_fn wdog_tickler = NULL; 101 102/* |
|
94 * Variable panicstr contains argument to first call to panic; used as flag 95 * to indicate that the kernel has already called panic. 96 */ 97const char *panicstr; 98 99/* 100 * callout list for things to do a shutdown 101 */ --- 83 unchanged lines hidden (view full) --- 185 break; 186 } 187 printf("oops, I'm on cpu#%d, I need to be on cpu#0!\n", 188 c); 189 tsleep((caddr_t)&smp_active, PZERO, "cpu0wt", 10); 190 } 191 } 192#endif | 103 * Variable panicstr contains argument to first call to panic; used as flag 104 * to indicate that the kernel has already called panic. 105 */ 106const char *panicstr; 107 108/* 109 * callout list for things to do a shutdown 110 */ --- 83 unchanged lines hidden (view full) --- 194 break; 195 } 196 printf("oops, I'm on cpu#%d, I need to be on cpu#0!\n", 197 c); 198 tsleep((caddr_t)&smp_active, PZERO, "cpu0wt", 10); 199 } 200 } 201#endif |
202 /* 203 * Do any callouts that should be done BEFORE syncing the filesystems. 204 */ |
|
193 ep = shutdown_list1; 194 while (ep) { 195 shutdown_list1 = ep->next; 196 (*ep->function)(howto, ep->arg); 197 ep = ep->next; 198 } | 205 ep = shutdown_list1; 206 while (ep) { 207 shutdown_list1 = ep->next; 208 (*ep->function)(howto, ep->arg); 209 ep = ep->next; 210 } |
211 212 /* 213 * Now sync filesystems 214 */ |
|
199 if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) { 200 register struct buf *bp; 201 int iter, nbusy; 202 203 waittime = 0; 204 printf("\nsyncing disks... "); 205 206 sync(&proc0, NULL, NULL); --- 31 unchanged lines hidden (view full) --- 238 /* 239 * Unmount filesystems 240 */ 241 if (panicstr == 0) 242 vfs_unmountall(); 243 } 244 DELAY(100000); /* wait for console output to finish */ 245 } | 215 if (!cold && (howto & RB_NOSYNC) == 0 && waittime < 0) { 216 register struct buf *bp; 217 int iter, nbusy; 218 219 waittime = 0; 220 printf("\nsyncing disks... "); 221 222 sync(&proc0, NULL, NULL); --- 31 unchanged lines hidden (view full) --- 254 /* 255 * Unmount filesystems 256 */ 257 if (panicstr == 0) 258 vfs_unmountall(); 259 } 260 DELAY(100000); /* wait for console output to finish */ 261 } |
262 263 /* 264 * Ok, now do things that assume all filesystem activity has 265 * been completed. 266 */ |
|
246 ep = shutdown_list2; 247 while (ep) { 248 shutdown_list2 = ep->next; 249 (*ep->function)(howto, ep->arg); 250 ep = ep->next; 251 } 252 splhigh(); 253 if (howto & RB_HALT) { --- 220 unchanged lines hidden --- | 267 ep = shutdown_list2; 268 while (ep) { 269 shutdown_list2 = ep->next; 270 (*ep->function)(howto, ep->arg); 271 ep = ep->next; 272 } 273 splhigh(); 274 if (howto & RB_HALT) { --- 220 unchanged lines hidden --- |