diff options
author | Rashmica Gupta <rashmica.g@gmail.com> | 2018-09-07 16:40:05 +1000 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2018-09-12 11:08:02 +1000 |
commit | ad9c721057cc1d116ab31383226a7822cada12a4 (patch) | |
tree | 9e06ab72607239811e7b6a3c6713f6f0b52f2079 /libpdbg/p9chip.c | |
parent | 72825ee237f0f357a7852a96d2ced7f20309ab90 (diff) | |
download | pdbg-ad9c721057cc1d116ab31383226a7822cada12a4.tar.gz pdbg-ad9c721057cc1d116ab31383226a7822cada12a4.zip |
libpdbg: Add in getxer and putxer functions
Signed-off-by: Rashmica Gupta <rashmica.g@gmail.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'libpdbg/p9chip.c')
-rw-r--r-- | libpdbg/p9chip.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c index 189d80a..f126968 100644 --- a/libpdbg/p9chip.c +++ b/libpdbg/p9chip.c @@ -292,7 +292,6 @@ static int __p9_ram_instruction(struct thread *thread, uint64_t opcode, uint64_t switch(opcode & OPCODE_MASK) { case MTNIA_OPCODE: predecode = 8; - /* Not currently supported as we can only MTNIA from LR */ PR_ERROR("MTNIA is not currently supported\n"); break; @@ -307,7 +306,18 @@ static int __p9_ram_instruction(struct thread *thread, uint64_t opcode, uint64_t break; case MFSPR_OPCODE: - switch(MFSPR_SPR(opcode)) { + switch(MXSPR_SPR(opcode)) { + case 1: /* XER */ + predecode = 4; + break; + default: + predecode = 0; + break; + } + break; + + case MTSPR_OPCODE: + switch(MXSPR_SPR(opcode)) { case 1: /* XER */ predecode = 4; break; @@ -395,6 +405,21 @@ static int p9_ram_destroy(struct thread *thread) return 0; } +static int p9_ram_getxer(struct pdbg_target *thread, uint64_t *value) +{ + CHECK_ERR(ram_getspr(thread, 1, value)); + + return 0; +} + +static int p9_ram_putxer(struct pdbg_target *thread, uint64_t value) +{ + CHECK_ERR(ram_putspr(thread, 1, value)); + + return 0; + +} + static struct thread p9_thread = { .target = { .name = "POWER9 Thread", @@ -410,6 +435,8 @@ static struct thread p9_thread = { .ram_setup = p9_ram_setup, .ram_instruction = p9_ram_instruction, .ram_destroy = p9_ram_destroy, + .ram_getxer = p9_ram_getxer, + .ram_putxer = p9_ram_putxer, }; DECLARE_HW_UNIT(p9_thread); |