patch-2.3.99-pre1 linux/arch/arm/kernel/ptrace.c

Next file: linux/arch/arm/kernel/setup.c
Previous file: linux/arch/arm/kernel/head-armv.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.51/linux/arch/arm/kernel/ptrace.c linux/arch/arm/kernel/ptrace.c
@@ -521,6 +521,48 @@
 			/* give it a chance to run. */
 			ret = 0;
 			goto out;
+			
+		case PTRACE_GETREGS:
+		{	/* Get all gp regs from the child. */
+			unsigned char *stack;
+
+			ret = 0;
+			stack = (unsigned char *)((unsigned long)child + 8192 - sizeof(struct pt_regs));
+			if (copy_to_user((void *)data, stack,
+					 sizeof(struct pt_regs)))
+				ret = -EFAULT;
+
+			goto out;
+		};
+
+		case PTRACE_SETREGS:
+		{
+			/* Set all gp regs in the child. */
+			unsigned char *stack;
+
+			ret = 0;
+			stack = (unsigned char *)((unsigned long)child + 8192 - sizeof(struct pt_regs));
+			if (copy_from_user(stack, (void *)data,
+					   sizeof(struct pt_regs)))
+				ret = -EFAULT;
+			goto out;
+		  };
+
+		case PTRACE_GETFPREGS: 
+			/* Get the child FPU state. */
+			ret = 0;
+			if (copy_to_user((void *)data, &child->thread.fpstate,
+					 sizeof(struct user_fp)))
+				ret = -EFAULT;
+			goto out;
+		
+		case PTRACE_SETFPREGS:
+			/* Set the child FPU state. */
+			ret = 0;
+			if (copy_from_user(&child->thread.fpstate, (void *)data,
+					   sizeof(struct user_fp)))
+				ret = -EFAULT;
+			goto out;
 
 		case PTRACE_DETACH:				/* detach a process that was attached. */
 			ret = -EIO;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)