add OF_boot(), call it if the user says "reboot".

try loading "netbsd.ofppc" first, to allow sharing root fs.
This commit is contained in:
chs 2002-09-18 01:45:04 +00:00
parent 0464f50aa5
commit b7878de767
3 changed files with 29 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: Locore.c,v 1.6 2001/10/23 03:31:25 thorpej Exp $ */
/* $NetBSD: Locore.c,v 1.7 2002/09/18 01:45:04 chs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -109,6 +109,26 @@ OF_exit()
for (;;); /* just in case */
}
__dead void
OF_boot(bootspec)
char *bootspec;
{
static struct {
char *name;
int nargs;
int nreturns;
char *bootspec;
} args = {
"boot",
1,
0,
};
args.bootspec = bootspec;
openfirmware(&args);
for (;;); /* just is case */
}
int
OF_finddevice(name)
char *name;

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.11 2001/10/23 03:31:26 thorpej Exp $ */
/* $NetBSD: boot.c,v 1.12 2002/09/18 01:45:04 chs Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -106,8 +106,7 @@ char bootfile[128];
int boothowto;
int debug;
static int ofw_version = 0;
static char *kernels[] = { "/netbsd", "/netbsd.gz", "/netbsd.ofppc", NULL };
static char *kernels[] = { "/netbsd.ofppc", "/netbsd", "/netbsd.gz", NULL };
static void
prom2boot(dev)
@ -135,6 +134,10 @@ parseargs(str, howtop)
/* Allow user to drop back to the PROM. */
if (strcmp(str, "exit") == 0)
OF_exit();
if (strcmp(str, "halt") == 0)
OF_exit();
if (strcmp(str, "reboot") == 0)
OF_boot("");
*howtop = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: openfirm.h,v 1.2 1998/02/22 07:42:31 mycroft Exp $ */
/* $NetBSD: openfirm.h,v 1.3 2002/09/18 01:45:04 chs Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -38,6 +38,7 @@
#include <sys/types.h>
__dead void OF_exit __P((void)) __attribute__((noreturn));
__dead void OF_boot __P((char *)) __attribute__((noreturn));
int OF_finddevice __P((char *name));
int OF_instance_to_package __P((int ihandle));
int OF_getprop __P((int handle, char *prop, void *buf, int buflen));