summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-09-03 06:35:04 +0000
committerpeter <peter@FreeBSD.org>2000-09-03 06:35:04 +0000
commite10bd0ffe1c110a40ac05640941f4f3674c31fef (patch)
tree8bf6e37151837cc8d9efcf7bf54b7109353febbf
parent17525e969e5709f9d8d5c11c8e93ffab85273e98 (diff)
downloadFreeBSD-src-e10bd0ffe1c110a40ac05640941f4f3674c31fef.zip
FreeBSD-src-e10bd0ffe1c110a40ac05640941f4f3674c31fef.tar.gz
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.
-rw-r--r--sys/kern/kern_shutdown.c11
1 files 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;
OpenPOWER on IntegriCloud