Module Name:    src
Committed By:   kiyohara
Date:           Thu Jun 20 13:40:09 UTC 2013

Modified Files:
        src/sys/arch/epoc32/epoc32: autoconf.c machdep.c

Log Message:
Support boothowto.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/epoc32/epoc32/autoconf.c \
    src/sys/arch/epoc32/epoc32/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/epoc32/epoc32/autoconf.c
diff -u src/sys/arch/epoc32/epoc32/autoconf.c:1.1 src/sys/arch/epoc32/epoc32/autoconf.c:1.2
--- src/sys/arch/epoc32/epoc32/autoconf.c:1.1	Sun Apr 28 12:11:26 2013
+++ src/sys/arch/epoc32/epoc32/autoconf.c	Thu Jun 20 13:40:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1 2013/04/28 12:11:26 kiyohara Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.2 2013/06/20 13:40:09 kiyohara Exp $	*/
 /*
  * Copyright (c) 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1 2013/04/28 12:11:26 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2013/06/20 13:40:09 kiyohara Exp $");
 
 #include <sys/systm.h>
 #include <sys/types.h>
@@ -71,4 +71,8 @@ device_register(device_t dev, void *aux)
 		prop_dictionary_set_uint32(dict, "height", epoc32_fb_height);
 		prop_dictionary_set_uint32(dict, "addr", epoc32_fb_addr);
 	}
+
+	if (booted_device == NULL)
+		if (device_is_a(dev, "wd"))
+			booted_device = dev;
 }
Index: src/sys/arch/epoc32/epoc32/machdep.c
diff -u src/sys/arch/epoc32/epoc32/machdep.c:1.1 src/sys/arch/epoc32/epoc32/machdep.c:1.2
--- src/sys/arch/epoc32/epoc32/machdep.c:1.1	Sun Apr 28 12:11:26 2013
+++ src/sys/arch/epoc32/epoc32/machdep.c	Thu Jun 20 13:40:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.1 2013/04/28 12:11:26 kiyohara Exp $	*/
+/*	$NetBSD: machdep.c,v 1.2 2013/06/20 13:40:09 kiyohara Exp $	*/
 /*
  * Copyright (c) 2012, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.1 2013/04/28 12:11:26 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2013/06/20 13:40:09 kiyohara Exp $");
 
 #include "clpscom.h"
 #include "clpslcd.h"
@@ -84,6 +84,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 
 
 BootConfig bootconfig;		/* Boot config storage */
+static char bootargs[256];
 char *boot_args = NULL;
 
 vm_offset_t physical_start;
@@ -170,6 +171,7 @@ initarm(void *arg)
 	struct btinfo_model *model = NULL;
 	struct btinfo_memory *memory = NULL;
 	struct btinfo_video *video = NULL;
+	struct btinfo_bootargs *args = NULL;
 	u_int l1pagetable, _end_physical;
 	int loop, loop1, n, i;
 
@@ -211,6 +213,20 @@ initarm(void *arg)
 			epoc32_fb_width = video->width;
 			epoc32_fb_height = video->height;
 			break;
+
+		case BTINFO_BOOTARGS:
+			args = (struct btinfo_bootargs *)btinfo;
+			btinfo = &(args + 1)->common;
+			memcpy(bootargs, args->bootargs,
+			    min(sizeof(bootargs), sizeof(args->bootargs)));
+			bootargs[sizeof(bootargs) - 1] = '\0';
+			boot_args = bootargs;
+			break;
+
+		default:
+#define NEXT_BOOTINFO(bi) (struct btinfo_common *)((char *)bi + (bi)->len)
+
+			btinfo = NEXT_BOOTINFO(btinfo);
 		}
 	}
 	if (bootconfig.dramblocks == 0)
@@ -218,6 +234,9 @@ initarm(void *arg)
 
 	consinit();
 
+	if (boot_args != NULL)
+		parse_mi_bootargs(boot_args);
+
 	physical_start = bootconfig.dram[0].address;
 	physical_freestart = bootconfig.dram[0].address;
 	physical_freeend = KERNEL_TEXT_BASE;

Reply via email to