summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-06-23 01:57:01 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-06-23 01:57:01 +0000
commit9cf59dd5d8ef14dc7a1bd0ab8ade10ad4f39ab84 (patch)
tree6db559edbc329453327dcefb65006fbcc89a1d5f /sys/arch
parenta14ed84c665d191f15c65ce64c08174dff2c3ea5 (diff)
Support ddb initialization on powerpc.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/powerpc/powerpc/locore.S29
-rw-r--r--sys/arch/powerpc/powerpc/machdep.c26
2 files changed, 37 insertions, 18 deletions
diff --git a/sys/arch/powerpc/powerpc/locore.S b/sys/arch/powerpc/powerpc/locore.S
index e34731b35a6..e46c3a21866 100644
--- a/sys/arch/powerpc/powerpc/locore.S
+++ b/sys/arch/powerpc/powerpc/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.16 2001/06/10 18:45:02 drahn Exp $ */
+/* $OpenBSD: locore.S,v 1.17 2001/06/23 01:56:59 drahn Exp $ */
/* $NetBSD: locore.S,v 1.2 1996/10/16 19:33:09 ws Exp $ */
/*
@@ -55,6 +55,9 @@ _C_LABEL(esym): .long 0 /* end of symbol table */
_C_LABEL(proc0paddr): .long 0 /* proc0 p_addr */
idle_u: .long 0 /* fake uarea during idle after exit */
+fwargsave:
+ .long 0
+ .long 0
.globl _C_LABEL(where)
.type _C_LABEL(where),@object
_C_LABEL(where): .long 0
@@ -75,6 +78,9 @@ _ENTRY(_ASM_LABEL(start))
.globl start
.type start,@function
start:
+ lis 3, fwargsave@ha
+ stw 6, fwargsave@l(3)
+ stw 7, fwargsave@l+4(3)
#ifdef SUPPORT_PPC1BUG
mr 0,5
cmpwi 0,0,0
@@ -93,15 +99,20 @@ start:
/* compute end of kernel memory */
lis 8,_end@ha
addi 8,8,_end@l
-#if 0
+ lis 3, fwargsave@ha
+ lwz 6, fwargsave@l(3)
+ lwz 7, fwargsave@l+4(3)
#if defined(DDB) || defined(KERNFS)
- lwz 9,0(8) /* number of symbols */
- add 8,8,9
- lwzu 9,4(8) /* length of string table */
- add 8,8,9
- lis 9,_C_LABEL(esym)@ha
- stw 8,_C_LABEL(esym)@l(9) /* save for symbol handling */
-#endif
+ cmpwi 6, 0
+ beq 1f
+ add 9,6,7
+ lwz 9, -4(9)
+ cmpwi 9,0
+ beq 1f
+ lis 8,_C_LABEL(esym)@ha
+ stw 9,_C_LABEL(esym)@l(8)
+ mr 8, 9
+1:
#endif
li 9,PGOFSET
add 8,8,9
diff --git a/sys/arch/powerpc/powerpc/machdep.c b/sys/arch/powerpc/powerpc/machdep.c
index 3cbcd30faa7..0973059fae1 100644
--- a/sys/arch/powerpc/powerpc/machdep.c
+++ b/sys/arch/powerpc/powerpc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.63 2001/06/10 18:45:02 drahn Exp $ */
+/* $OpenBSD: machdep.c,v 1.64 2001/06/23 01:57:00 drahn Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -124,6 +124,10 @@ char bootpathbuf[512];
struct firmware *fw = NULL;
+#ifdef DDB
+void * startsym, *endsym;
+#endif
+
void ofw_dbg(char *str);
caddr_t allocsys __P((caddr_t));
@@ -329,12 +333,11 @@ where = 3;
/* make a copy of the args! */
strncpy(bootpathbuf, args, 512);
bootpath= &bootpathbuf[0];
- args = bootpath;
- while ( *++args && *args != ' ');
- if (*args) {
- *args++ = 0;
- while (*args) {
- switch (*args++) {
+ while ( *++bootpath && *bootpath != ' ');
+ if (*bootpath) {
+ *bootpath++ = 0;
+ while (*bootpath) {
+ switch (*bootpath++) {
case 'a':
boothowto |= RB_ASKNAME;
break;
@@ -347,11 +350,16 @@ where = 3;
case 'c':
boothowto |= RB_CONFIG;
break;
+ default:
+ break;
}
}
}
-#if 0
- ddb_init((int)(esym - (&_end)), &_end, esym);
+ bootpath= &bootpathbuf[0];
+#if 1
+ bcopy(args +strlen(args) + 1, &startsym, sizeof(startsym));
+ bcopy(args +strlen(args) + 5, &endsym, sizeof(endsym));
+ ddb_init((int)((u_int)endsym - (u_int)startsym), startsym, endsym);
#endif
/*