2 * Copyright (c) 2007 Benjamin Herrenschmidt, IBM Coproration
3 * Extracted from ptrace.c and ptrace32.c
5 * This file is subject to the terms and conditions of the GNU General
6 * Public License. See the file README.legal in the main directory of
7 * this archive for more details.
10 #ifndef _POWERPC_PTRACE_PPC32_H
11 #define _POWERPC_PTRACE_PPC32_H
14 * Set of msr bits that gdb can change on behalf of a process.
16 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
17 #define MSR_DEBUGCHANGE 0
19 #define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
23 * Max register writeable via put_reg
25 #define PT_MAX_PUT_REG PT_MQ
28 * Munging of MSR on return from get_regs
30 * Nothing to do on ppc32
32 #define PT_MUNGE_MSR(msr, task) (msr)
38 * For get_evrregs/set_evrregs functions 'data' has the following layout:
48 * Get contents of SPE register state in task TASK.
50 static inline int get_evrregs(unsigned long *data, struct task_struct *task)
54 if (!access_ok(VERIFY_WRITE, data, 35 * sizeof(unsigned long)))
58 if (__put_user(task->thread.spefscr, &data[34]))
61 /* copy SPE registers EVR[0] .. EVR[31] */
62 for (i = 0; i < 32; i++, data++)
63 if (__put_user(task->thread.evr[i], data))
67 if (__put_user64(task->thread.acc, (unsigned long long *)data))
74 * Write contents of SPE register state into task TASK.
76 static inline int set_evrregs(struct task_struct *task, unsigned long *data)
80 if (!access_ok(VERIFY_READ, data, 35 * sizeof(unsigned long)))
84 if (__get_user(task->thread.spefscr, &data[34]))
87 /* copy SPE registers EVR[0] .. EVR[31] */
88 for (i = 0; i < 32; i++, data++)
89 if (__get_user(task->thread.evr[i], data))
92 if (__get_user64(task->thread.acc, (unsigned long long*)data))
97 #endif /* CONFIG_SPE */
100 #endif /* _POWERPC_PTRACE_PPC32_H */