| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  *  linux/arch/cris/kernel/ptrace.c | 
 | 3 |  * | 
 | 4 |  * Parts taken from the m68k port. | 
| Jesper Nilsson | 1b7e7da | 2008-01-28 16:30:35 +0100 | [diff] [blame] | 5 |  * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 |  * Copyright (c) 2000, 2001, 2002 Axis Communications AB | 
 | 7 |  * | 
 | 8 |  * Authors:   Bjorn Wesen | 
 | 9 |  * | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 |  */ | 
 | 11 |  | 
 | 12 | #include <linux/kernel.h> | 
 | 13 | #include <linux/sched.h> | 
 | 14 | #include <linux/mm.h> | 
 | 15 | #include <linux/smp.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/errno.h> | 
 | 17 | #include <linux/ptrace.h> | 
 | 18 | #include <linux/user.h> | 
| David Howells | 733e5e4 | 2009-09-09 08:30:21 +0100 | [diff] [blame] | 19 | #include <linux/tracehook.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 |  | 
 | 21 | #include <asm/uaccess.h> | 
 | 22 | #include <asm/page.h> | 
 | 23 | #include <asm/pgtable.h> | 
 | 24 | #include <asm/system.h> | 
 | 25 | #include <asm/processor.h> | 
 | 26 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 |  | 
 | 28 | /* notification of userspace execution resumption | 
 | 29 |  * - triggered by current->work.notify_resume | 
 | 30 |  */ | 
| Jesper Nilsson | 7b27552 | 2007-11-14 17:00:59 -0800 | [diff] [blame] | 31 | extern int do_signal(int canrestart, struct pt_regs *regs); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 |  | 
 | 33 |  | 
| Jesper Nilsson | 7b27552 | 2007-11-14 17:00:59 -0800 | [diff] [blame] | 34 | void do_notify_resume(int canrestart, struct pt_regs *regs, | 
| Jesper Nilsson | 1b7e7da | 2008-01-28 16:30:35 +0100 | [diff] [blame] | 35 | 		      __u32 thread_info_flags) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | { | 
 | 37 | 	/* deal with pending signal delivery */ | 
 | 38 | 	if (thread_info_flags & _TIF_SIGPENDING) | 
| Jesper Nilsson | 7b27552 | 2007-11-14 17:00:59 -0800 | [diff] [blame] | 39 | 		do_signal(canrestart,regs); | 
| David Howells | d0420c8 | 2009-09-02 09:14:16 +0100 | [diff] [blame] | 40 |  | 
 | 41 | 	if (thread_info_flags & _TIF_NOTIFY_RESUME) { | 
 | 42 | 		clear_thread_flag(TIF_NOTIFY_RESUME); | 
 | 43 | 		tracehook_notify_resume(regs); | 
| David Howells | ee18d64 | 2009-09-02 09:14:21 +0100 | [diff] [blame] | 44 | 		if (current->replacement_session_keyring) | 
 | 45 | 			key_replace_session_keyring(); | 
| David Howells | d0420c8 | 2009-09-02 09:14:16 +0100 | [diff] [blame] | 46 | 	} | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | } |