Use the "shut-down" and "reset-all" Forth procedures to halt and

reboot, as calling OF_exit() just hangs a mac.

FreeBSD on my G4 800Mhz mac behaves identically to OSX for halt
and reboot now.

Reviewed by: grehan  (who also supplied the concept and sample code)
This commit is contained in:
gallatin 2003-12-09 14:45:39 +00:00
parent d10b5c1ba5
commit f7822af269
5 changed files with 42 additions and 2 deletions

View File

@ -162,8 +162,9 @@ static void
powerpc_ofw_shutdown(void *junk, int howto)
{
if (howto & RB_HALT) {
OF_exit();
OF_halt();
}
OF_reboot();
}
static void

View File

@ -173,6 +173,24 @@ ppc_boot(str)
OF_boot(str);
}
void
OF_halt()
{
int retval; /* dummy, this may not be needed */
OF_interpret("shut-down", 1, &retval);
for (;;); /* just in case */
}
void
OF_reboot()
{
int retval; /* dummy, this may not be needed */
OF_interpret("reset-all", 1, &retval);
for (;;); /* just in case */
}
void
OF_getetheraddr(device_t dev, u_char *addr)
{

View File

@ -48,6 +48,8 @@ void mem_regions(struct mem_region **, int *, struct mem_region **, int *);
* Not sure whether boot itself should be implementation dependent instead. XXX
*/
void ppc_exit(void);
void OF_halt(void);
void OF_reboot(void);
void ppc_boot(char *bootspec);
int dk_match(char *name);

View File

@ -162,8 +162,9 @@ static void
powerpc_ofw_shutdown(void *junk, int howto)
{
if (howto & RB_HALT) {
OF_exit();
OF_halt();
}
OF_reboot();
}
static void

View File

@ -173,6 +173,24 @@ ppc_boot(str)
OF_boot(str);
}
void
OF_halt()
{
int retval; /* dummy, this may not be needed */
OF_interpret("shut-down", 1, &retval);
for (;;); /* just in case */
}
void
OF_reboot()
{
int retval; /* dummy, this may not be needed */
OF_interpret("reset-all", 1, &retval);
for (;;); /* just in case */
}
void
OF_getetheraddr(device_t dev, u_char *addr)
{