From e10bd0ffe1c110a40ac05640941f4f3674c31fef Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 3 Sep 2000 06:35:04 +0000 Subject: gcc knows that savectx() is potentially a setjmp style dual-return function which may lead to stack lossage and clobbered variables. This isn't the case here, but there is no way to tell gcc that. Work around this in a kinda bizzare way, but it shuts gcc up. --- sys/kern/kern_shutdown.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 258699e..0630069 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -304,13 +304,8 @@ boot(howto) */ EVENTHANDLER_INVOKE(shutdown_post_sync, howto); splhigh(); - if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold) { - savectx(&dumppcb); -#ifdef __i386__ - dumppcb.pcb_cr3 = rcr3(); -#endif + if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold) dumpsys(); - } /* Now that we're going to really halt the system... */ EVENTHANDLER_INVOKE(shutdown_final, howto); @@ -470,6 +465,10 @@ dumpsys(void) int error; static int dumping; + savectx(&dumppcb); +#ifdef __i386__ + dumppcb.pcb_cr3 = rcr3(); +#endif if (dumping++) { printf("Dump already in progress, bailing...\n"); return; -- cgit v1.1