Skip to content

Commit

Permalink
kgdb,sparc: Add in kgdb_arch_set_pc for sparc
Browse files Browse the repository at this point in the history
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 <jason.wessel@windriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jason Wessel committed May 21, 2010
1 parent 4063eb5 commit c75fbb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/sparc/kernel/kgdb_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ void kgdb_arch_exit(void)
{
}

void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
{
regs->pc = ip;
regs->npc = regs->pc + 4;
}

struct kgdb_arch arch_kgdb_ops = {
/* Breakpoint instruction: ta 0x7d */
.gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x7d },
Expand Down
6 changes: 6 additions & 0 deletions arch/sparc/kernel/kgdb_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ void kgdb_arch_exit(void)
{
}

void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
{
regs->tpc = ip;
regs->tnpc = regs->tpc + 4;
}

struct kgdb_arch arch_kgdb_ops = {
/* Breakpoint instruction: ta 0x72 */
.gdb_bpt_instr = { 0x91, 0xd0, 0x20, 0x72 },
Expand Down

0 comments on commit c75fbb0

Please sign in to comment.