blob: 58d44ee1a71f70885aef328fdf6a6af32d6c7b58 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/arch/cris/kernel/ptrace.c
3 *
4 * Parts taken from the m68k port.
Jesper Nilsson1b7e7da2008-01-28 16:30:35 +01005 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * Copyright (c) 2000, 2001, 2002 Axis Communications AB
7 *
8 * Authors: Bjorn Wesen
9 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 */
11
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/mm.h>
15#include <linux/smp.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/errno.h>
17#include <linux/ptrace.h>
18#include <linux/user.h>
David Howells733e5e42009-09-09 08:30:21 +010019#include <linux/tracehook.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
21#include <asm/uaccess.h>
22#include <asm/page.h>
23#include <asm/pgtable.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include <asm/processor.h>
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27/* notification of userspace execution resumption
28 * - triggered by current->work.notify_resume
29 */
Jesper Nilsson7b275522007-11-14 17:00:59 -080030extern int do_signal(int canrestart, struct pt_regs *regs);
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32
Jesper Nilsson7b275522007-11-14 17:00:59 -080033void do_notify_resume(int canrestart, struct pt_regs *regs,
Jesper Nilsson1b7e7da2008-01-28 16:30:35 +010034 __u32 thread_info_flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -070035{
36 /* deal with pending signal delivery */
37 if (thread_info_flags & _TIF_SIGPENDING)
Jesper Nilsson7b275522007-11-14 17:00:59 -080038 do_signal(canrestart,regs);
David Howellsd0420c82009-09-02 09:14:16 +010039
40 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
41 clear_thread_flag(TIF_NOTIFY_RESUME);
42 tracehook_notify_resume(regs);
43 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070044}