summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2017-06-06 23:11:20 +1000
committerAlistair Popple <alistair@popple.id.au>2017-06-28 16:13:55 +1000
commit15392117158014da555d5a399ac1e4c322ca741b (patch)
treeb5d30efe40628d6ea89640c3584173a37e6e3f06 /src
parent602f056021f67960b1f76f2984aea9d21eeaefbd (diff)
downloadpdbg-15392117158014da555d5a399ac1e4c322ca741b.tar.gz
pdbg-15392117158014da555d5a399ac1e4c322ca741b.zip
libpdbg: Add support for P9 thread operations
This patch adds support for starting and stopping threads on POWER9 as well as instruction ramming which is required to read/write GPRs, etc. Signed-off-by: Alistair Popple <alistair@popple.id.au>
Diffstat (limited to 'src')
-rw-r--r--src/main.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 1f38e94..e0c4424 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,7 +59,7 @@ static char const *device_node;
static int i2c_addr = 0x50;
#define MAX_PROCESSORS 16
-#define MAX_CHIPS 16
+#define MAX_CHIPS 24
#define MAX_THREADS THREADS_PER_CORE
static int **processorsel[MAX_PROCESSORS];
@@ -479,9 +479,9 @@ static void print_proc_reg(struct thread *thread, uint64_t reg, uint64_t value,
else if (reg >= 0 && reg <= 31)
printf("gpr%02" PRIu64 ": ", reg);
- if (rc == 1)
- printf("Chiplet in incorrect state\n");
- else if (rc == 2)
+ if (rc == 1) {
+ printf("Check threadstatus - not all threads on this chiplet are quiesced\n");
+ } else if (rc == 2)
printf("Thread in incorrect state\n");
else
printf("0x%016" PRIx64 "\n", value);
@@ -556,7 +556,7 @@ static int start_thread(struct target *thread_target, uint32_t index, uint64_t *
{
struct thread *thread = target_to_thread(thread_target);
- return ram_start_thread(thread) ? 1 : 0;
+ return ram_start_thread(thread_target) ? 1 : 0;
}
static int step_thread(struct target *thread_target, uint32_t index, uint64_t *count, uint64_t *unused1)
@@ -568,9 +568,7 @@ static int step_thread(struct target *thread_target, uint32_t index, uint64_t *c
static int stop_thread(struct target *thread_target, uint32_t index, uint64_t *unused, uint64_t *unused1)
{
- struct thread *thread = target_to_thread(thread_target);
-
- return ram_stop_thread(thread) ? 1 : 0;
+ return ram_stop_thread(thread_target) ? 1 : 0;
}
static void enable_dn(struct dt_node *dn)
OpenPOWER on IntegriCloud