diff options
author | David S. Miller <davem@davemloft.net> | 2008-07-31 23:32:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-31 23:32:35 -0400 |
commit | 6717c282e407650c29e7b058623d89f543015a33 (patch) | |
tree | d23e0e8cea5ec49f5946dfd35bd20ec6e6cd53a9 /arch/sparc | |
parent | 9c636e30a33aa37873c53977c429f0fdad4ec0eb (diff) |
sparc: Add __KERNEL__ ifdef protection to pt_regs helpers.
Some of them use 'bool' and whatnot and therefore are not
kosher for userspace, so don't export them there.
Reported by Roland McGrath.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/ptrace_32.h | 20 | ||||
-rw-r--r-- | arch/sparc/include/asm/ptrace_64.h | 31 |
2 files changed, 25 insertions, 26 deletions
diff --git a/arch/sparc/include/asm/ptrace_32.h b/arch/sparc/include/asm/ptrace_32.h index d43c88b86834..d409c4f21a5c 100644 --- a/arch/sparc/include/asm/ptrace_32.h +++ b/arch/sparc/include/asm/ptrace_32.h | |||
@@ -40,16 +40,6 @@ struct pt_regs { | |||
40 | #define UREG_FP UREG_I6 | 40 | #define UREG_FP UREG_I6 |
41 | #define UREG_RETPC UREG_I7 | 41 | #define UREG_RETPC UREG_I7 |
42 | 42 | ||
43 | static inline bool pt_regs_is_syscall(struct pt_regs *regs) | ||
44 | { | ||
45 | return (regs->psr & PSR_SYSCALL); | ||
46 | } | ||
47 | |||
48 | static inline bool pt_regs_clear_syscall(struct pt_regs *regs) | ||
49 | { | ||
50 | return (regs->psr &= ~PSR_SYSCALL); | ||
51 | } | ||
52 | |||
53 | /* A register window */ | 43 | /* A register window */ |
54 | struct reg_window { | 44 | struct reg_window { |
55 | unsigned long locals[8]; | 45 | unsigned long locals[8]; |
@@ -72,6 +62,16 @@ struct sparc_stackf { | |||
72 | 62 | ||
73 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
74 | 64 | ||
65 | static inline bool pt_regs_is_syscall(struct pt_regs *regs) | ||
66 | { | ||
67 | return (regs->psr & PSR_SYSCALL); | ||
68 | } | ||
69 | |||
70 | static inline bool pt_regs_clear_syscall(struct pt_regs *regs) | ||
71 | { | ||
72 | return (regs->psr &= ~PSR_SYSCALL); | ||
73 | } | ||
74 | |||
75 | #define user_mode(regs) (!((regs)->psr & PSR_PS)) | 75 | #define user_mode(regs) (!((regs)->psr & PSR_PS)) |
76 | #define instruction_pointer(regs) ((regs)->pc) | 76 | #define instruction_pointer(regs) ((regs)->pc) |
77 | #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP]) | 77 | #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP]) |
diff --git a/arch/sparc/include/asm/ptrace_64.h b/arch/sparc/include/asm/ptrace_64.h index 390d92ac67cf..06e4914c13f4 100644 --- a/arch/sparc/include/asm/ptrace_64.h +++ b/arch/sparc/include/asm/ptrace_64.h | |||
@@ -37,21 +37,6 @@ struct pt_regs { | |||
37 | unsigned int magic; | 37 | unsigned int magic; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static inline int pt_regs_trap_type(struct pt_regs *regs) | ||
41 | { | ||
42 | return regs->magic & 0x1ff; | ||
43 | } | ||
44 | |||
45 | static inline bool pt_regs_is_syscall(struct pt_regs *regs) | ||
46 | { | ||
47 | return (regs->tstate & TSTATE_SYSCALL); | ||
48 | } | ||
49 | |||
50 | static inline bool pt_regs_clear_syscall(struct pt_regs *regs) | ||
51 | { | ||
52 | return (regs->tstate &= ~TSTATE_SYSCALL); | ||
53 | } | ||
54 | |||
55 | struct pt_regs32 { | 40 | struct pt_regs32 { |
56 | unsigned int psr; | 41 | unsigned int psr; |
57 | unsigned int pc; | 42 | unsigned int pc; |
@@ -128,6 +113,21 @@ struct sparc_trapf { | |||
128 | 113 | ||
129 | #ifdef __KERNEL__ | 114 | #ifdef __KERNEL__ |
130 | 115 | ||
116 | static inline int pt_regs_trap_type(struct pt_regs *regs) | ||
117 | { | ||
118 | return regs->magic & 0x1ff; | ||
119 | } | ||
120 | |||
121 | static inline bool pt_regs_is_syscall(struct pt_regs *regs) | ||
122 | { | ||
123 | return (regs->tstate & TSTATE_SYSCALL); | ||
124 | } | ||
125 | |||
126 | static inline bool pt_regs_clear_syscall(struct pt_regs *regs) | ||
127 | { | ||
128 | return (regs->tstate &= ~TSTATE_SYSCALL); | ||
129 | } | ||
130 | |||
131 | struct global_reg_snapshot { | 131 | struct global_reg_snapshot { |
132 | unsigned long tstate; | 132 | unsigned long tstate; |
133 | unsigned long tpc; | 133 | unsigned long tpc; |
@@ -154,7 +154,6 @@ extern unsigned long profile_pc(struct pt_regs *); | |||
154 | #define profile_pc(regs) instruction_pointer(regs) | 154 | #define profile_pc(regs) instruction_pointer(regs) |
155 | #endif | 155 | #endif |
156 | extern void show_regs(struct pt_regs *); | 156 | extern void show_regs(struct pt_regs *); |
157 | extern void __show_regs(struct pt_regs *); | ||
158 | #endif | 157 | #endif |
159 | 158 | ||
160 | #else /* __ASSEMBLY__ */ | 159 | #else /* __ASSEMBLY__ */ |