Skip to content

Commit

Permalink
powerpc: do_break get registers from regs
Browse files Browse the repository at this point in the history
Similar to the previous patch this makes interrupt handler function
types more regular so they can be wrapped with the next patch.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210130130852.2952424-9-npiggin@gmail.com
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Feb 8, 2021
1 parent b4ced80 commit 18722ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions arch/powerpc/include/asm/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ extern void do_send_trap(struct pt_regs *regs, unsigned long address,
unsigned long error_code, int brkpt);
#else

extern void do_break(struct pt_regs *regs, unsigned long address,
unsigned long error_code);
void do_break(struct pt_regs *regs);
#endif

#endif /* _ASM_POWERPC_DEBUG_H */
5 changes: 2 additions & 3 deletions arch/powerpc/kernel/head_8xx.S
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,9 @@ do_databreakpoint:
addi r3,r1,STACK_FRAME_OVERHEAD
mfspr r4,SPRN_BAR
stw r4,_DAR(r11)
#ifdef CONFIG_VMAP_STACK
lwz r5,_DSISR(r11)
#else
#ifndef CONFIG_VMAP_STACK
mfspr r5,SPRN_DSISR
stw r5,_DSISR(r11)
#endif
EXC_XFER_STD(0x1c00, do_break)

Expand Down
7 changes: 3 additions & 4 deletions arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,10 @@ static void do_break_handler(struct pt_regs *regs)
}
}

void do_break (struct pt_regs *regs, unsigned long address,
unsigned long error_code)
void do_break(struct pt_regs *regs)
{
current->thread.trap_nr = TRAP_HWBKPT;
if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, error_code,
if (notify_die(DIE_DABR_MATCH, "dabr_match", regs, regs->dsisr,
11, SIGSEGV) == NOTIFY_STOP)
return;

Expand All @@ -681,7 +680,7 @@ void do_break (struct pt_regs *regs, unsigned long address,
do_break_handler(regs);

/* Deliver the signal to userspace */
force_sig_fault(SIGTRAP, TRAP_HWBKPT, (void __user *)address);
force_sig_fault(SIGTRAP, TRAP_HWBKPT, (void __user *)regs->dar);
}
#endif /* CONFIG_PPC_ADV_DEBUG_REGS */

Expand Down

0 comments on commit 18722ec

Please sign in to comment.