Yoshinori Sato | fe54616 | 2015-05-11 02:34:48 +0900 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/h8300/kernel/ptrace_h8s.c |
| 3 | * ptrace cpu depend helper functions |
| 4 | * |
| 5 | * Yoshinori Sato <ysato@users.sourceforge.jp> |
| 6 | * |
| 7 | * This file is subject to the terms and conditions of the GNU General |
| 8 | * Public License. See the file COPYING in the main directory of |
| 9 | * this archive for more details. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/linkage.h> |
Ingo Molnar | 3f07c01 | 2017-02-08 18:51:30 +0100 | [diff] [blame] | 13 | #include <linux/sched/signal.h> |
Yoshinori Sato | fe54616 | 2015-05-11 02:34:48 +0900 | [diff] [blame] | 14 | #include <linux/errno.h> |
| 15 | #include <asm/ptrace.h> |
| 16 | |
| 17 | #define CCR_MASK 0x6f |
| 18 | #define EXR_TRACE 0x80 |
| 19 | |
| 20 | /* disable singlestep */ |
| 21 | void user_disable_single_step(struct task_struct *child) |
| 22 | { |
| 23 | unsigned char exr; |
| 24 | |
| 25 | exr = h8300_get_reg(child, PT_EXR); |
| 26 | exr &= ~EXR_TRACE; |
| 27 | h8300_put_reg(child, PT_EXR, exr); |
| 28 | } |
| 29 | |
| 30 | /* enable singlestep */ |
| 31 | void user_enable_single_step(struct task_struct *child) |
| 32 | { |
| 33 | unsigned char exr; |
| 34 | |
| 35 | exr = h8300_get_reg(child, PT_EXR); |
| 36 | exr |= EXR_TRACE; |
| 37 | h8300_put_reg(child, PT_EXR, exr); |
| 38 | } |
| 39 | |
| 40 | asmlinkage void trace_trap(unsigned long bp) |
| 41 | { |
| 42 | (void)bp; |
Eric W. Biederman | 3cf5d07 | 2019-05-23 10:17:27 -0500 | [diff] [blame] | 43 | force_sig(SIGTRAP); |
Yoshinori Sato | fe54616 | 2015-05-11 02:34:48 +0900 | [diff] [blame] | 44 | } |