Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ptrace.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Atmark Techno, Inc.
3  *
4  * This file is subject to the terms and conditions of the GNU General Public
5  * License. See the file "COPYING" in the main directory of this archive
6  * for more details.
7  */
8 
9 #ifndef _ASM_MICROBLAZE_PTRACE_H
10 #define _ASM_MICROBLAZE_PTRACE_H
11 
12 #ifndef __ASSEMBLY__
13 
14 typedef unsigned long microblaze_reg_t;
15 
16 struct pt_regs {
54  int pt_mode;
55 };
56 
57 #ifdef __KERNEL__
58 #define kernel_mode(regs) ((regs)->pt_mode)
59 #define user_mode(regs) (!kernel_mode(regs))
60 
61 #define instruction_pointer(regs) ((regs)->pc)
62 #define profile_pc(regs) instruction_pointer(regs)
63 
64 static inline long regs_return_value(struct pt_regs *regs)
65 {
66  return regs->r3;
67 }
68 
69 #else /* __KERNEL__ */
70 
71 /* pt_regs offsets used by gdbserver etc in ptrace syscalls */
72 #define PT_GPR(n) ((n) * sizeof(microblaze_reg_t))
73 #define PT_PC (32 * sizeof(microblaze_reg_t))
74 #define PT_MSR (33 * sizeof(microblaze_reg_t))
75 #define PT_EAR (34 * sizeof(microblaze_reg_t))
76 #define PT_ESR (35 * sizeof(microblaze_reg_t))
77 #define PT_FSR (36 * sizeof(microblaze_reg_t))
78 #define PT_KERNEL_MODE (37 * sizeof(microblaze_reg_t))
79 
80 #endif /* __KERNEL */
81 
82 #endif /* __ASSEMBLY__ */
83 
84 #endif /* _ASM_MICROBLAZE_PTRACE_H */