use crime_reboot() and mcclock_poweroff() when appropriate.

With this my O2 resets and powers down again even when using crmfb,
apparently it freaks out the ARCS firmware - with crmfb the machine would
just sit there blinking instead of rebooting.
This commit is contained in:
macallan 2007-09-26 05:52:39 +00:00
parent 4a60b0ecfe
commit 45b87d43e3

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.114 2007/05/17 14:51:28 yamt Exp $ */
/* $NetBSD: machdep.c,v 1.115 2007/09/26 05:52:39 macallan Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.114 2007/05/17 14:51:28 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2007/09/26 05:52:39 macallan Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -83,6 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.114 2007/05/17 14:51:28 yamt Exp $");
#endif
#include <sgimips/dev/int2reg.h>
#include <sgimips/dev/crimevar.h>
#include <sgimips/sgimips/arcemu.h>
#include <dev/arcbios/arcbios.h>
@ -102,6 +103,13 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.114 2007/05/17 14:51:28 yamt Exp $");
#include <sys/exec_elf.h>
#endif
#include "mcclock_mace.h"
#include "crime.h"
#if NMCCLOCK_MACE > 0
void mcclock_poweroff(void);
#endif
struct sgimips_intrhand intrtab[NINTR];
const uint32_t mips_ipl_si_to_sr[SI_NQUEUES] = {
@ -760,7 +768,12 @@ haltsys:
printf("powering off...\n\n");
delay(500000);
ARCBIOS->PowerDown();
#if NMCCLOCK_MACE > 0
if (mach_type == MACH_SGI_IP32) {
mcclock_poweroff();
} else
#endif
ARCBIOS->PowerDown();
printf("WARNING: powerdown failed\n");
/*
* RB_POWERDOWN implies RB_HALT... fall into it...
@ -773,7 +786,12 @@ haltsys:
}
printf("rebooting...\n\n");
ARCBIOS->Reboot();
#if NCRIME > 0
if (mach_type == MACH_SGI_IP32) {
crime_reboot();
} else
#endif
ARCBIOS->Reboot();
for (;;);
}