#include <linux/sysrq.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/bug.h>
#include <asm/ptrace.h>
#include <asm/string.h>
#include <asm/cputable.h>
#include <asm/rtas.h>
#include <asm/sstep.h>
-#include <asm/bug.h>
#include <asm/irq_regs.h>
#include <asm/spu.h>
#include <asm/spu_priv1.h>
#ifdef CONFIG_PPC64
#include <asm/hvcall.h>
#include <asm/paca.h>
+#include <asm/iseries/it_lp_reg_save.h>
#endif
#include "nonstdio.h"
+#include "dis-asm.h"
#define scanhex xmon_scanhex
#define skipbl xmon_skipbl
static void dump(void);
static void prdump(unsigned long, long);
static int ppc_inst_dump(unsigned long, long, int);
-void print_address(unsigned long);
static void backtrace(struct pt_regs *);
static void excprint(struct pt_regs *);
static void prregs(struct pt_regs *);
int xmon_no_auto_backtrace;
-extern int print_insn_powerpc(unsigned long insn, unsigned long memaddr);
-
extern void xmon_enter(void);
extern void xmon_leave(void);
p call a procedure\n\
r print registers\n\
s single step\n"
-#ifdef CONFIG_PPC_CELL
+#ifdef CONFIG_SPU_BASE
" ss stop execution on all spus\n\
sr restore execution on stopped spus\n\
sf # dump spu fields for spu # (in hex)\n\
- sd # dump spu local store for spu # (in hex)\n"
+ sd # dump spu local store for spu # (in hex)\n\
+ sdi # disassemble spu local store for spu # (in hex)\n"
#endif
" S print special registers\n\
t print backtrace\n\
static int xmon_core(struct pt_regs *regs, int fromipi)
{
int cmd = 0;
- unsigned long msr;
struct bpt *bp;
long recurse_jmp[JMP_BUF_LEN];
unsigned long offset;
+ unsigned long flags;
#ifdef CONFIG_SMP
int cpu;
int secondary;
unsigned long timeout;
#endif
- msr = mfmsr();
- mtmsr(msr & ~MSR_EE); /* disable interrupts */
+ local_irq_save(flags);
bp = in_breakpoint_table(regs->nip, &offset);
if (bp != NULL) {
insert_cpu_bpts();
- mtmsr(msr); /* restore interrupt enable */
+ local_irq_restore(flags);
return cmd != 'X' && cmd != EOF;
}
static void print_bug_trap(struct pt_regs *regs)
{
- struct bug_entry *bug;
+ const struct bug_entry *bug;
unsigned long addr;
if (regs->msr & MSR_PR)
bug = find_bug(regs->nip);
if (bug == NULL)
return;
- if (bug->line & BUG_WARNING_TRAP)
+ if (is_warning_bug(bug))
return;
- printf("kernel BUG in %s at %s:%d!\n",
- bug->function, bug->file, (unsigned int)bug->line);
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+ printf("kernel BUG at %s:%u!\n",
+ bug->file, bug->line);
+#else
+ printf("kernel BUG at %p!\n", (void *)bug->bug_addr);
+#endif
}
void excprint(struct pt_regs *fp)
void xmon_init(int enable)
{
+#ifdef CONFIG_PPC_ISERIES
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return;
+#endif
if (enable) {
__debugger = xmon;
__debugger_ipi = xmon_ipi;
static int __init setup_xmon_sysrq(void)
{
+#ifdef CONFIG_PPC_ISERIES
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return 0;
+#endif
register_sysrq_key('x', &sysrq_xmon_op);
return 0;
}
debugger(NULL);
}
-#ifdef CONFIG_PPC_CELL
+#ifdef CONFIG_SPU_BASE
struct spu_info {
struct spu *spu;
DUMP_FIELD(spu, "0x%x", number);
DUMP_FIELD(spu, "%s", name);
- DUMP_FIELD(spu, "%s", devnode->full_name);
- DUMP_FIELD(spu, "0x%x", nid);
DUMP_FIELD(spu, "0x%lx", local_store_phys);
DUMP_FIELD(spu, "0x%p", local_store);
DUMP_FIELD(spu, "0x%lx", ls_size);
DUMP_FIELD(spu, "0x%lx", irqs[2]);
DUMP_FIELD(spu, "0x%x", slb_replace);
DUMP_FIELD(spu, "%d", pid);
- DUMP_FIELD(spu, "%d", prio);
DUMP_FIELD(spu, "0x%p", mm);
DUMP_FIELD(spu, "0x%p", ctx);
DUMP_FIELD(spu, "0x%p", rq);
in_be32(&spu->problem->spu_status_R));
DUMP_VALUE("0x%x", problem->spu_npc_RW,
in_be32(&spu->problem->spu_npc_RW));
- DUMP_FIELD(spu, "0x%p", priv1);
-
- if (spu->priv1) {
- DUMP_VALUE("0x%lx", priv1->mfc_sr1_RW,
- in_be64(&spu->priv1->mfc_sr1_RW));
- }
-
DUMP_FIELD(spu, "0x%p", priv2);
+ DUMP_FIELD(spu, "0x%p", pdata);
}
-static void dump_spu_ls(unsigned long num)
+int
+spu_inst_dump(unsigned long adr, long count, int praddr)
+{
+ return generic_inst_dump(adr, count, praddr, print_insn_spu);
+}
+
+static void dump_spu_ls(unsigned long num, int subcmd)
{
unsigned long offset, addr, ls_addr;
return;
}
- prdump(addr, 64);
- addr += 64;
- last_cmd = "sd\n";
+ switch (subcmd) {
+ case 'i':
+ addr += spu_inst_dump(addr, 16, 1);
+ last_cmd = "sdi\n";
+ break;
+ default:
+ prdump(addr, 64);
+ addr += 64;
+ last_cmd = "sd\n";
+ break;
+ }
spu_info[num].dump_addr = addr;
}
static int do_spu_cmd(void)
{
static unsigned long num = 0;
- int cmd;
+ int cmd, subcmd = 0;
cmd = inchar();
switch (cmd) {
case 'r':
restart_spus();
break;
- case 'f':
case 'd':
+ subcmd = inchar();
+ if (isxdigit(subcmd) || subcmd == '\n')
+ termch = subcmd;
+ case 'f':
scanhex(&num);
if (num >= XMON_NUM_SPUS || !spu_info[num].spu) {
printf("*** Error: invalid spu number\n");
dump_spu_fields(spu_info[num].spu);
break;
default:
- dump_spu_ls(num);
+ dump_spu_ls(num, subcmd);
break;
}
return 0;
}
-#else /* ! CONFIG_PPC_CELL */
+#else /* ! CONFIG_SPU_BASE */
static int do_spu_cmd(void)
{
return -1;