|
@@ -179,6 +179,30 @@ static int set_user_msr(struct task_struct *task, unsigned long msr)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_PPC64
|
|
|
+static unsigned long get_user_dscr(struct task_struct *task)
|
|
|
+{
|
|
|
+ return task->thread.dscr;
|
|
|
+}
|
|
|
+
|
|
|
+static int set_user_dscr(struct task_struct *task, unsigned long dscr)
|
|
|
+{
|
|
|
+ task->thread.dscr = dscr;
|
|
|
+ task->thread.dscr_inherit = 1;
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#else
|
|
|
+static unsigned long get_user_dscr(struct task_struct *task)
|
|
|
+{
|
|
|
+ return -EIO;
|
|
|
+}
|
|
|
+
|
|
|
+static int set_user_dscr(struct task_struct *task, unsigned long dscr)
|
|
|
+{
|
|
|
+ return -EIO;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* We prevent mucking around with the reserved area of trap
|
|
|
* which are used internally by the kernel.
|
|
@@ -200,6 +224,9 @@ unsigned long ptrace_get_reg(struct task_struct *task, int regno)
|
|
|
if (regno == PT_MSR)
|
|
|
return get_user_msr(task);
|
|
|
|
|
|
+ if (regno == PT_DSCR)
|
|
|
+ return get_user_dscr(task);
|
|
|
+
|
|
|
if (regno < (sizeof(struct pt_regs) / sizeof(unsigned long)))
|
|
|
return ((unsigned long *)task->thread.regs)[regno];
|
|
|
|
|
@@ -218,6 +245,8 @@ int ptrace_put_reg(struct task_struct *task, int regno, unsigned long data)
|
|
|
return set_user_msr(task, data);
|
|
|
if (regno == PT_TRAP)
|
|
|
return set_user_trap(task, data);
|
|
|
+ if (regno == PT_DSCR)
|
|
|
+ return set_user_dscr(task, data);
|
|
|
|
|
|
if (regno <= PT_MAX_PUT_REG) {
|
|
|
((unsigned long *)task->thread.regs)[regno] = data;
|