Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ofppc/stand/ofwboot add OF_boot(), call it if the u...



details:   https://anonhg.NetBSD.org/src/rev/d4fd88b9e142
branches:  trunk
changeset: 536521:d4fd88b9e142
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Sep 18 01:45:04 2002 +0000

description:
add OF_boot(), call it if the user says "reboot".
try loading "netbsd.ofppc" first, to allow sharing root fs.

diffstat:

 sys/arch/ofppc/stand/ofwboot/Locore.c   |  22 +++++++++++++++++++++-
 sys/arch/ofppc/stand/ofwboot/boot.c     |   9 ++++++---
 sys/arch/ofppc/stand/ofwboot/openfirm.h |   3 ++-
 3 files changed, 29 insertions(+), 5 deletions(-)

diffs (83 lines):

diff -r 71a78305fd83 -r d4fd88b9e142 sys/arch/ofppc/stand/ofwboot/Locore.c
--- a/sys/arch/ofppc/stand/ofwboot/Locore.c     Wed Sep 18 01:44:29 2002 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/Locore.c     Wed Sep 18 01:45:04 2002 +0000
@@ -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 @@
        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;
diff -r 71a78305fd83 -r d4fd88b9e142 sys/arch/ofppc/stand/ofwboot/boot.c
--- a/sys/arch/ofppc/stand/ofwboot/boot.c       Wed Sep 18 01:44:29 2002 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/boot.c       Wed Sep 18 01:45:04 2002 +0000
@@ -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 @@
 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 @@
        /* 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;
 
diff -r 71a78305fd83 -r d4fd88b9e142 sys/arch/ofppc/stand/ofwboot/openfirm.h
--- a/sys/arch/ofppc/stand/ofwboot/openfirm.h   Wed Sep 18 01:44:29 2002 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/openfirm.h   Wed Sep 18 01:45:04 2002 +0000
@@ -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));



Home | Main Index | Thread Index | Old Index