Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcsh Sync kloader(4) behavior with hpcmips:



details:   https://anonhg.NetBSD.org/src/rev/b9b07dd69577
branches:  trunk
changeset: 754538:b9b07dd69577
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon May 03 12:16:04 2010 +0000

description:
Sync kloader(4) behavior with hpcmips:
- use bootstr passed via reboot(2) with RB_STRING for the next kernel path
- prepare independent opt_kloader_kernel_path.h for KLOADER_KERNEL_PATH
- some cosmetics to reduce diffs from hpcmips

Tested on HPW-50PA (Hitachi PERSONA).

diffstat:

 sys/arch/hpcsh/conf/files.hpcsh |   8 ++++----
 sys/arch/hpcsh/hpcsh/machdep.c  |  32 +++++++++++++++++++-------------
 2 files changed, 23 insertions(+), 17 deletions(-)

diffs (102 lines):

diff -r 0d1978b9a517 -r b9b07dd69577 sys/arch/hpcsh/conf/files.hpcsh
--- a/sys/arch/hpcsh/conf/files.hpcsh   Mon May 03 09:51:36 2010 +0000
+++ b/sys/arch/hpcsh/conf/files.hpcsh   Mon May 03 12:16:04 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcsh,v 1.51 2008/02/20 21:43:34 drochner Exp $
+#      $NetBSD: files.hpcsh,v 1.52 2010/05/03 12:16:04 tsutsui Exp $
 #
 maxpartitions 8
 
@@ -16,11 +16,11 @@
 #file  arch/hpcsh/hpcsh/bus_dma.c
 file   arch/hpcsh/hpcsh/clock_machdep.c
 
-defflag opt_kloader.h                          KLOADER
-defparam opt_kloader.h                         KLOADER_KERNEL_PATH
-defflag debug_kloader.h                                KLOADER_DEBUG
 file   dev/kloader.c                           kloader
 file   arch/hpcsh/hpcsh/kloader_machdep.c      kloader
+defflag opt_kloader.h                          KLOADER
+defflag debug_kloader.h                                KLOADER_DEBUG
+defparam opt_kloader_kernel_path.h             KLOADER_KERNEL_PATH
 
 # power management
 include "dev/hpc/files.hpcapm"
diff -r 0d1978b9a517 -r b9b07dd69577 sys/arch/hpcsh/hpcsh/machdep.c
--- a/sys/arch/hpcsh/hpcsh/machdep.c    Mon May 03 09:51:36 2010 +0000
+++ b/sys/arch/hpcsh/hpcsh/machdep.c    Mon May 03 12:16:04 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.72 2010/03/02 21:17:31 pooka Exp $       */
+/*     $NetBSD: machdep.c,v 1.73 2010/05/03 12:16:04 tsutsui Exp $     */
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.72 2010/03/02 21:17:31 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2010/05/03 12:16:04 tsutsui Exp $");
 
 #include "opt_md.h"
 #include "opt_ddb.h"
@@ -38,11 +38,7 @@
 #include "hd64465if.h"
 
 #include "opt_kloader.h"
-#ifdef KLOADER
-#if !defined(KLOADER_KERNEL_PATH)
-#define KLOADER_KERNEL_PATH    "/netbsd"
-#endif
-#endif
+#include "opt_kloader_kernel_path.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -169,6 +165,12 @@
 void machine_startup(int, char *[], struct bootinfo *)
        __attribute__((__noreturn__));
 
+#ifdef KLOADER
+#if !defined(KLOADER_KERNEL_PATH)
+#define KLOADER_KERNEL_PATH    "/netbsd"
+#endif /* !KLOADER_KERNEL_PATH */
+static const char kernel_path[] = KLOADER_KERNEL_PATH;
+#endif /* KLOADER */
 
 void
 machine_startup(int argc, char *argv[], struct bootinfo *bi)
@@ -377,8 +379,12 @@
        }
 
 #ifdef KLOADER
-       if ((howto & RB_HALT) == 0)
-               kloader_reboot_setup(KLOADER_KERNEL_PATH);
+       if ((howto & RB_HALT) == 0) {
+               if ((howto & RB_STRING) != 0)
+                       kloader_reboot_setup(bootstr);
+               else
+                       kloader_reboot_setup(kernel_path);
+       }
 #endif
 
        boothowto = howto;
@@ -411,14 +417,14 @@
        pmf_system_shutdown(boothowto);
 
        /* Finally, halt/reboot the system. */
+       if ((howto & RB_HALT) != 0) {
+               printf("halted.\n");
+       } else {
 #ifdef KLOADER
-       if ((howto & RB_HALT) == 0) {
                kloader_reboot();
                /* NOTREACHED */
+#endif
        }
-#endif
-
-       printf("halted.\n");
 
 #if NHD64465IF > 0
        hd64465_shutdown();



Home | Main Index | Thread Index | Old Index