summaryrefslogtreecommitdiffstats
path: root/libpdbg/p8chip.c
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2018-06-19 15:25:19 +1000
committerAlistair Popple <alistair@popple.id.au>2018-06-25 14:45:34 +1000
commit0879ddb117916cabdc13d51db20ea202ebfab096 (patch)
treeaa81f2c9f43912683815a3c686f1bb2971c17453 /libpdbg/p8chip.c
parent06be084330e5e418a17611e853a471ce3262fd62 (diff)
downloadpdbg-0879ddb117916cabdc13d51db20ea202ebfab096.tar.gz
pdbg-0879ddb117916cabdc13d51db20ea202ebfab096.zip
p8chip: Restore RAS_MODE_REG to original value
This correctly restores the MR_THREAD_IN_DEBUG bit rather than always clearing it after. Signed-off-by: Michael Neuling <mikey@neuling.org>
Diffstat (limited to 'libpdbg/p8chip.c')
-rw-r--r--libpdbg/p8chip.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 6640bb4..3e90c8d 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -127,8 +127,7 @@ static struct thread_state get_thread_status(struct thread *thread)
/* Need to activete debug mode to get complete status */
pib_read(&thread->target, RAS_MODE_REG, &mode_reg);
- mode_reg |= MR_THREAD_IN_DEBUG;
- pib_write(&thread->target, RAS_MODE_REG, mode_reg);
+ pib_write(&thread->target, RAS_MODE_REG, mode_reg | MR_THREAD_IN_DEBUG);
/* Read status */
pib_read(&thread->target, RAS_STATUS_REG, &val);
@@ -194,7 +193,6 @@ static struct thread_state get_thread_status(struct thread *thread)
}
/* Clear debug mode */
- mode_reg &= ~MR_THREAD_IN_DEBUG;
pib_write(&thread->target, RAS_MODE_REG, mode_reg);
return thread_status;
OpenPOWER on IntegriCloud