From bad6707cdd6af8bec183b0412e7566066c73f9b7 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Wed, 29 Nov 2006 16:31:19 +0000 Subject: [PATCH] Get info of kernel symbol table from bootloader before calling consinit(). consinit() was moved before oea_init() in rev 1.136, but startsym and endsym are not initialized at that point. Now kernel symbols are usable (on ddb(4), ksyms(4) etc.) again on macppc. --- sys/arch/macppc/macppc/machdep.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c index df982d84eae0..afb75cbc20fc 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.141 2006/10/24 02:47:40 mrg Exp $ */ +/* $NetBSD: machdep.c,v 1.142 2006/11/29 16:31:19 tsutsui Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141 2006/10/24 02:47:40 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.142 2006/11/29 16:31:19 tsutsui Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -183,6 +183,14 @@ initppc(startkernel, endkernel, args) * but I really think the console should be initialized * as early as possible. */ +#if NKSYMS || defined(DDB) || defined(LKM) + /* get info of kernel symbol table from bootloader */ + memcpy(&startsym, args + strlen(args) + 1, sizeof(startsym)); + memcpy(&endsym, args + strlen(args) + 1 + sizeof(startsym), + sizeof(endsym)); + if (startsym == NULL || endsym == NULL) + startsym = endsym = NULL; +#endif consinit(); oea_init(ext_intr); @@ -203,13 +211,6 @@ initppc(startkernel, endkernel, args) /* * Parse arg string. */ -#if NKSYMS || defined(DDB) || defined(LKM) - memcpy(&startsym, args + strlen(args) + 1, sizeof(startsym)); - memcpy(&endsym, args + strlen(args) + 5, sizeof(endsym)); - if (startsym == NULL || endsym == NULL) - startsym = endsym = NULL; -#endif - if (args) { strcpy(bootpath, args); args = bootpath;