diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-12 23:15:27 +0000 |
commit | ae38fd1e4c98588314a42097c5a5e77dcef23561 (patch) | |
tree | f9f10c203bb9e5fbad4810d1f8774c08dfad20ff /arch/ppc/xmon | |
parent | 466a823d79f41d0713b272e48fd73e494b0588e0 (diff) |
Merge with Linux 2.3.50.
Diffstat (limited to 'arch/ppc/xmon')
-rw-r--r-- | arch/ppc/xmon/start.c | 26 | ||||
-rw-r--r-- | arch/ppc/xmon/xmon.c | 32 |
2 files changed, 44 insertions, 14 deletions
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c index 8e924699f..95b19ba47 100644 --- a/arch/ppc/xmon/start.c +++ b/arch/ppc/xmon/start.c @@ -17,12 +17,12 @@ static volatile unsigned char *sccc, *sccd; unsigned long TXRDY, RXRDY; extern void xmon_printf(const char *fmt, ...); -extern void drawchar(char); -extern void drawstring(const char *str); +extern void prom_drawchar(char); +extern void prom_drawstring(const char *str); static int xmon_expect(const char *str, unsigned int timeout); static int console = 0; -static int use_screen = 0; +static int use_screen = 1; /* default */ static int via_modem = 0; static int xmon_use_sccb = 0; static struct device_node *macio_node; @@ -48,6 +48,8 @@ xmon_map_scc(void) { volatile unsigned char *base; + use_screen = 0; + if ( _machine == _MACH_Pmac ) { struct device_node *np; @@ -58,7 +60,7 @@ xmon_map_scc(void) /* needs to be hacked if xmon_printk is to be used from within find_via_pmu() */ if (!via_modem && disp_bi && find_via_pmu()) { - drawstring("xmon uses screen and keyboard\n"); + prom_drawstring("xmon uses screen and keyboard\n"); use_screen = 1; return; } @@ -122,7 +124,7 @@ xmon_write(void *handle, void *ptr, int nb) if (use_screen) { /* write it on the screen */ for (i = 0; i < nb; ++i) - drawchar(*p++); + prom_drawchar(*p++); return nb; } #endif @@ -142,6 +144,7 @@ xmon_write(void *handle, void *ptr, int nb) ct = 1; --i; } else { + prom_drawchar(c); if (console) printk("%c", c); ct = 0; @@ -187,15 +190,15 @@ xmon_get_pmu_key(void) do { if (--t < 0) { on = 1 - on; - drawchar(on? 0xdb: 0x20); - drawchar('\b'); + prom_drawchar(on? 0xdb: 0x20); + prom_drawchar('\b'); t = 200000; } pmu_poll(); } while (xmon_pmu_keycode == -1); k = xmon_pmu_keycode; if (on) - drawstring(" \b"); + prom_drawstring(" \b"); /* test for shift keys */ if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) { @@ -284,6 +287,8 @@ xmon_init_scc() { int i, x; + if (macio_node != 0) + feature_set(macio_node, FEATURE_Serial_enable); if (via_modem && macio_node != 0) { unsigned int t0; @@ -399,15 +404,12 @@ int xmon_expect(const char *str, unsigned int timeout) for (;;) { c = xmon_read_poll(); if (c == -1) { - if (readtb() - t0 > timeout) { - printk("timeout\n"); + if (readtb() - t0 > timeout) return 0; - } continue; } if (c == '\n') break; - printk("%c", c); if (c != '\r' && lineptr < &line[sizeof(line) - 1]) *lineptr++ = c; } diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c index d18d74dfd..620df9aea 100644 --- a/arch/ppc/xmon/xmon.c +++ b/arch/ppc/xmon/xmon.c @@ -119,7 +119,8 @@ void xmon(struct pt_regs *excp) { struct pt_regs regs; - int msr, cmd; + int msr, cmd, i; + unsigned *sp; if (excp == NULL) { asm volatile ("stw 0,0(%0)\n\ @@ -135,6 +136,29 @@ xmon(struct pt_regs *excp) excp = ®s; } + prom_drawstring("xmon pc="); prom_drawhex(excp->nip); + prom_drawstring(" lr="); prom_drawhex(excp->link); + prom_drawstring(" msr="); prom_drawhex(excp->msr); + prom_drawstring(" trap="); prom_drawhex(excp->trap); + prom_drawstring(" sp="); prom_drawhex(excp->gpr[1]); + sp = &excp->gpr[0]; + for (i = 0; i < 32; ++i) { + if ((i & 7) == 0) + prom_drawstring("\n"); + prom_drawstring(" "); + prom_drawhex(sp[i]); + } + sp = (unsigned *) excp->gpr[1]; + for (i = 0; i < 64; ++i) { + if ((i & 7) == 0) { + prom_drawstring("\n"); + prom_drawhex(sp); + prom_drawstring(" "); + } + prom_drawstring(" "); + prom_drawhex(sp[i]); + } + prom_drawstring("\n"); msr = get_msr(); set_msr(msr & ~0x8000); /* disable interrupts */ remove_bpts(); @@ -521,7 +545,7 @@ void excprint(struct pt_regs *fp) { printf("vector: %x at pc = %x %s", - fp->trap, fp->nip,/* pretty_lookup_name(fp->nip)*/""); + fp->trap, fp->nip, pretty_lookup_name(fp->nip)); printf(", msr = %x, sp = %x [%x]\n", fp->msr, fp->gpr[1], fp); if (fp->trap == 0x300 || fp->trap == 0x600) @@ -1390,6 +1414,10 @@ static char *lookup_name(unsigned long addr) if ( !sysmap || !sysmap_size ) return NULL; + /* adjust if addr is relative to kernelbase */ + if ( addr < PAGE_OFFSET ) + addr += PAGE_OFFSET; + cmp = simple_strtoul(c, &c, 8); strcpy( last, strsep( &c, "\n")); while ( c < (sysmap+sysmap_size) ) |