2 * arch/ubicom32/include/asm/ptrace.h
3 * Ubicom32 architecture ptrace support.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
28 #ifndef _ASM_UBICOM32_PTRACE_H
29 #define _ASM_UBICOM32_PTRACE_H
34 * We use hard coded constants because this is shared with user
35 * space and the values are NOT allowed to change. Only fields
36 * that are intended to be exposed get values.
65 #define PT_MAC_RC16 104
68 #define PT_SOURCE3 116
69 #define PT_INST_CNT 120
71 #define PT_DUMMY_UNUSED 128
72 #define PT_INT_MASK0 132
73 #define PT_INT_MASK1 136
74 #define PT_TRAP_CAUSE 140
76 #define PT_ORIGINAL_D0 148
77 #define PT_FRAME_TYPE 152
80 * The following 'registers' are not registers at all but are used
81 * locate the relocated sections.
83 #define PT_TEXT_ADDR 200
84 #define PT_TEXT_END_ADDR 204
85 #define PT_DATA_ADDR 208
86 #define PT_EXEC_FDPIC_LOADMAP 212
87 #define PT_INTERP_FDPIC_LOADMAP 216
90 * This struct defines the way the registers are stored on the
91 * stack during a system call.
98 #define UBICOM32_FRAME_TYPE_SYSCALL -1 /* System call frame */
99 #define UBICOM32_FRAME_TYPE_INVALID 0 /* Invalid frame, no longer in use */
100 #define UBICOM32_FRAME_TYPE_INTERRUPT 1 /* Interrupt frame */
101 #define UBICOM32_FRAME_TYPE_TRAP 2 /* Trap frame */
102 #define UBICOM32_FRAME_TYPE_SIGTRAMP 3 /* Signal trampoline frame. */
103 #define UBICOM32_FRAME_TYPE_NEW_THREAD 4 /* New Thread. */
109 unsigned long dn
[16];
117 * Per thread misc registers.
119 unsigned long acc0
[2];
120 unsigned long mac_rc16
;
121 unsigned long acc1
[2];
122 unsigned long source3
;
123 unsigned long inst_cnt
;
125 unsigned long dummy_unused
;
126 unsigned long int_mask0
;
127 unsigned long int_mask1
;
128 unsigned long trap_cause
;
130 unsigned long original_dn_0
;
133 * Frame type. Syscall frames are -1. For other types look above.
135 unsigned long frame_type
;
138 * These fields are not exposed to ptrace.
140 unsigned long previous_pc
;
141 long nesting_level
; /* When the kernel in in user space this
143 unsigned long thread_type
; /* This indicates if this is a kernel
148 * This is the extended stack used by signal handlers and the context
149 * switcher: it's pushed after the normal "struct pt_regs".
151 struct switch_stack
{
157 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
158 #define PTRACE_GETREGS 12
159 #define PTRACE_SETREGS 13
162 #define PS_S (0x2000)
163 #define PS_M (0x1000)
166 extern int __user_mode(unsigned long sp
);
168 #define user_mode(regs) (__user_mode((regs->an[7])))
169 #define user_stack(regs) ((regs)->an[7])
170 #define instruction_pointer(regs) ((regs)->pc)
171 #define profile_pc(regs) instruction_pointer(regs)
172 extern void show_regs(struct pt_regs
*);
173 #endif /* __KERNEL__ */
175 #endif /* __ASSEMBLY__ */
177 #endif /* _ASM_UBICOM32_PTRACE_H */