Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42186
b: refs/heads/master
c: a898497
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Oct 25, 2006
1 parent ad7eb4a commit 74b3dcf
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff8a8f25976aa58bbae7883405b00dcbaf4cc823
refs/heads/master: a898497088f46252e6750405504064e2dce53117
67 changes: 66 additions & 1 deletion trunk/arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ Commands:\n\
s single step\n"
#ifdef CONFIG_PPC_CELL
" ss stop execution on all spus\n\
sr restore execution on stopped spus\n"
sr restore execution on stopped spus\n\
sf # dump spu fields for spu # (in hex)\n"
#endif
" S print special registers\n\
t print backtrace\n\
Expand Down Expand Up @@ -2744,8 +2745,66 @@ static void restart_spus(void)
}
}

#define DUMP_WIDTH 23
#define DUMP_FIELD(obj, format, field) \
do { \
if (setjmp(bus_error_jmp) == 0) { \
catch_memory_errors = 1; \
sync(); \
printf(" %-*s = "format"\n", DUMP_WIDTH, \
#field, obj->field); \
sync(); \
__delay(200); \
} else { \
catch_memory_errors = 0; \
printf(" %-*s = *** Error reading field.\n", \
DUMP_WIDTH, #field); \
} \
catch_memory_errors = 0; \
} while (0)

static void dump_spu_fields(struct spu *spu)
{
printf("Dumping spu fields at address %p:\n", 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%x", node);
DUMP_FIELD(spu, "0x%lx", flags);
DUMP_FIELD(spu, "0x%lx", dar);
DUMP_FIELD(spu, "0x%lx", dsisr);
DUMP_FIELD(spu, "%d", class_0_pending);
DUMP_FIELD(spu, "0x%lx", irqs[0]);
DUMP_FIELD(spu, "0x%lx", irqs[1]);
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);
DUMP_FIELD(spu, "0x%p", timestamp);
DUMP_FIELD(spu, "0x%lx", problem_phys);
DUMP_FIELD(spu, "0x%p", problem);
DUMP_FIELD(spu, "0x%x", problem->spu_runcntl_RW);
DUMP_FIELD(spu, "0x%x", problem->spu_status_R);
DUMP_FIELD(spu, "0x%x", problem->spu_npc_RW);
DUMP_FIELD(spu, "0x%p", priv1);

if (spu->priv1)
DUMP_FIELD(spu, "0x%lx", priv1->mfc_sr1_RW);

DUMP_FIELD(spu, "0x%p", priv2);
}

static int do_spu_cmd(void)
{
unsigned long num = 0;
int cmd;

cmd = inchar();
Expand All @@ -2756,6 +2815,12 @@ static int do_spu_cmd(void)
case 'r':
restart_spus();
break;
case 'f':
if (scanhex(&num) && num < XMON_NUM_SPUS && spu_info[num].spu)
dump_spu_fields(spu_info[num].spu);
else
printf("*** Error: invalid spu number\n");
break;
default:
return -1;
}
Expand Down

0 comments on commit 74b3dcf

Please sign in to comment.