Skip to content

Commit c75fbb0

Browse files
committed
kgdb,sparc: Add in kgdb_arch_set_pc for sparc
The new debug core api requires all architectures that use to debug core to implement a function to set the program counter. Signed-off-by: Jason Wessel <[email protected]> Acked-by: David S. Miller <[email protected]>
1 parent 4063eb5 commit c75fbb0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

arch/sparc/kernel/kgdb_32.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ void kgdb_arch_exit(void)
158158
{
159159
}
160160

161+
void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
162+
{
163+
regs->pc = ip;
164+
regs->npc = regs->pc + 4;
165+
}
166+
161167
struct kgdb_arch arch_kgdb_ops = {
162168
/* Breakpoint instruction: ta 0x7d */
163169
.gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x7d },

arch/sparc/kernel/kgdb_64.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ void kgdb_arch_exit(void)
181181
{
182182
}
183183

184+
void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
185+
{
186+
regs->tpc = ip;
187+
regs->tnpc = regs->tpc + 4;
188+
}
189+
184190
struct kgdb_arch arch_kgdb_ops = {
185191
/* Breakpoint instruction: ta 0x72 */
186192
.gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x72 },

0 commit comments

Comments
 (0)