1 // SPDX-License-Identifier: GPL-2.0
3 * linux/arch/cris/kernel/ptrace.c
5 * Parts taken from the m68k port.
7 * Copyright (c) 2000, 2001, 2002 Axis Communications AB
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
16 #include <linux/smp.h>
17 #include <linux/errno.h>
18 #include <linux/ptrace.h>
19 #include <linux/user.h>
20 #include <linux/tracehook.h>
22 #include <linux/uaccess.h>
24 #include <asm/pgtable.h>
25 #include <asm/processor.h>
28 /* notification of userspace execution resumption
29 * - triggered by current->work.notify_resume
31 extern int do_signal(int canrestart
, struct pt_regs
*regs
);
34 void do_notify_resume(int canrestart
, struct pt_regs
*regs
,
35 __u32 thread_info_flags
)
37 /* deal with pending signal delivery */
38 if (thread_info_flags
& _TIF_SIGPENDING
)
39 do_signal(canrestart
,regs
);
41 if (thread_info_flags
& _TIF_NOTIFY_RESUME
) {
42 clear_thread_flag(TIF_NOTIFY_RESUME
);
43 tracehook_notify_resume(regs
);
47 void do_work_pending(int syscall
, struct pt_regs
*regs
,
48 unsigned int thread_flags
)
51 if (likely(thread_flags
& _TIF_NEED_RESCHED
)) {
54 if (unlikely(!user_mode(regs
)))
57 if (thread_flags
& _TIF_SIGPENDING
) {
58 do_signal(syscall
, regs
);
61 clear_thread_flag(TIF_NOTIFY_RESUME
);
62 tracehook_notify_resume(regs
);
66 thread_flags
= current_thread_info()->flags
;
67 } while (thread_flags
& _TIF_WORK_MASK
);