aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-07-25 04:47:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:39 -0400
commitf22ab814a24e654b1de24db0c5f8b57b5ab2026a (patch)
tree827f3fe1c94ba9cfd180f199ea6d2dc2dfa885df
parentbc64efd220dcd4449aef8dd2564d73127b583b09 (diff)
include/asm/ptrace.h userspace headers cleanup
This patch contains the following cleanups for the asm/ptrace.h userspace headers: - include/asm-generic/Kbuild.asm already lists ptrace.h, remove the superfluous listings in the Kbuild files of the following architectures: - cris - frv - powerpc - x86 - don't expose function prototypes and macros to userspace: - arm - blackfin - cris - mn10300 - parisc - remove #ifdef CONFIG_'s around #define's: - blackfin - m68knommu - sh: AFAIK __SH5__ should work in both kernel and userspace, no need to leak CONFIG_SUPERH64 to userspace - xtensa: cosmetical change to remove empty #ifndef __ASSEMBLY__ #else #endif from the userspace headers Not changed by this patch is the fact that the following architectures have a different struct pt_regs depending on CONFIG_ variables: - h8300 - m68knommu - mips This does not work in userspace. Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: <linux-arch@vger.kernel.org> Cc: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Greg Ungerer <gerg@uclinux.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Grant Grundler <grundler@parisc-linux.org> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Chris Zankel <chris@zankel.net> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Paul Mackerras <paulus@samba.org> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/asm-arm/ptrace.h6
-rw-r--r--include/asm-blackfin/ptrace.h6
-rw-r--r--include/asm-cris/arch-v10/Kbuild1
-rw-r--r--include/asm-cris/arch-v10/ptrace.h4
-rw-r--r--include/asm-cris/arch-v32/Kbuild1
-rw-r--r--include/asm-cris/arch-v32/ptrace.h4
-rw-r--r--include/asm-cris/ptrace.h4
-rw-r--r--include/asm-frv/Kbuild1
-rw-r--r--include/asm-m68knommu/ptrace.h2
-rw-r--r--include/asm-mn10300/ptrace.h8
-rw-r--r--include/asm-parisc/ptrace.h4
-rw-r--r--include/asm-powerpc/Kbuild1
-rw-r--r--include/asm-sh/ptrace.h2
-rw-r--r--include/asm-x86/Kbuild1
-rw-r--r--include/asm-xtensa/ptrace.h10
15 files changed, 32 insertions, 23 deletions
diff --git a/include/asm-arm/ptrace.h b/include/asm-arm/ptrace.h
index 7aaa206cb54e..8382b7510f94 100644
--- a/include/asm-arm/ptrace.h
+++ b/include/asm-arm/ptrace.h
@@ -139,8 +139,6 @@ static inline int valid_user_regs(struct pt_regs *regs)
139 return 0; 139 return 0;
140} 140}
141 141
142#endif /* __KERNEL__ */
143
144#define pc_pointer(v) \ 142#define pc_pointer(v) \
145 ((v) & ~PCMASK) 143 ((v) & ~PCMASK)
146 144
@@ -153,10 +151,10 @@ extern unsigned long profile_pc(struct pt_regs *regs);
153#define profile_pc(regs) instruction_pointer(regs) 151#define profile_pc(regs) instruction_pointer(regs)
154#endif 152#endif
155 153
156#ifdef __KERNEL__
157#define predicate(x) ((x) & 0xf0000000) 154#define predicate(x) ((x) & 0xf0000000)
158#define PREDICATE_ALWAYS 0xe0000000 155#define PREDICATE_ALWAYS 0xe0000000
159#endif 156
157#endif /* __KERNEL__ */
160 158
161#endif /* __ASSEMBLY__ */ 159#endif /* __ASSEMBLY__ */
162 160
diff --git a/include/asm-blackfin/ptrace.h b/include/asm-blackfin/ptrace.h
index b8346cd3a6f6..a45a80e54adc 100644
--- a/include/asm-blackfin/ptrace.h
+++ b/include/asm-blackfin/ptrace.h
@@ -83,14 +83,14 @@ struct pt_regs {
83#define PTRACE_GETREGS 12 83#define PTRACE_GETREGS 12
84#define PTRACE_SETREGS 13 /* ptrace signal */ 84#define PTRACE_SETREGS 13 /* ptrace signal */
85 85
86#ifdef CONFIG_BINFMT_ELF_FDPIC
87#define PTRACE_GETFDPIC 31 86#define PTRACE_GETFDPIC 31
88#define PTRACE_GETFDPIC_EXEC 0 87#define PTRACE_GETFDPIC_EXEC 0
89#define PTRACE_GETFDPIC_INTERP 1 88#define PTRACE_GETFDPIC_INTERP 1
90#endif
91 89
92#define PS_S (0x0002) 90#define PS_S (0x0002)
93 91
92#ifdef __KERNEL__
93
94/* user_mode returns true if only one bit is set in IPEND, other than the 94/* user_mode returns true if only one bit is set in IPEND, other than the
95 master interrupt enable. */ 95 master interrupt enable. */
96#define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1))) 96#define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
@@ -98,6 +98,8 @@ struct pt_regs {
98#define profile_pc(regs) instruction_pointer(regs) 98#define profile_pc(regs) instruction_pointer(regs)
99extern void show_regs(struct pt_regs *); 99extern void show_regs(struct pt_regs *);
100 100
101#endif /* __KERNEL__ */
102
101#endif /* __ASSEMBLY__ */ 103#endif /* __ASSEMBLY__ */
102 104
103/* 105/*
diff --git a/include/asm-cris/arch-v10/Kbuild b/include/asm-cris/arch-v10/Kbuild
index 60e7e1b73cec..7a192e1290b1 100644
--- a/include/asm-cris/arch-v10/Kbuild
+++ b/include/asm-cris/arch-v10/Kbuild
@@ -1,4 +1,3 @@
1header-y += ptrace.h
2header-y += user.h 1header-y += user.h
3header-y += svinto.h 2header-y += svinto.h
4header-y += sv_addr_ag.h 3header-y += sv_addr_ag.h
diff --git a/include/asm-cris/arch-v10/ptrace.h b/include/asm-cris/arch-v10/ptrace.h
index fb14c5ee37f9..2f464eab3a51 100644
--- a/include/asm-cris/arch-v10/ptrace.h
+++ b/include/asm-cris/arch-v10/ptrace.h
@@ -106,10 +106,14 @@ struct switch_stack {
106 unsigned long return_ip; /* ip that _resume will return to */ 106 unsigned long return_ip; /* ip that _resume will return to */
107}; 107};
108 108
109#ifdef __KERNEL__
110
109/* bit 8 is user-mode flag */ 111/* bit 8 is user-mode flag */
110#define user_mode(regs) (((regs)->dccr & 0x100) != 0) 112#define user_mode(regs) (((regs)->dccr & 0x100) != 0)
111#define instruction_pointer(regs) ((regs)->irp) 113#define instruction_pointer(regs) ((regs)->irp)
112#define profile_pc(regs) instruction_pointer(regs) 114#define profile_pc(regs) instruction_pointer(regs)
113extern void show_regs(struct pt_regs *); 115extern void show_regs(struct pt_regs *);
114 116
117#endif /* __KERNEL__ */
118
115#endif 119#endif
diff --git a/include/asm-cris/arch-v32/Kbuild b/include/asm-cris/arch-v32/Kbuild
index a0ec545e242e..35f2fc4f993e 100644
--- a/include/asm-cris/arch-v32/Kbuild
+++ b/include/asm-cris/arch-v32/Kbuild
@@ -1,3 +1,2 @@
1header-y += ptrace.h
2header-y += user.h 1header-y += user.h
3header-y += cryptocop.h 2header-y += cryptocop.h
diff --git a/include/asm-cris/arch-v32/ptrace.h b/include/asm-cris/arch-v32/ptrace.h
index 516cc7062d94..41f4e8662bc2 100644
--- a/include/asm-cris/arch-v32/ptrace.h
+++ b/include/asm-cris/arch-v32/ptrace.h
@@ -106,9 +106,13 @@ struct switch_stack {
106 unsigned long return_ip; /* ip that _resume will return to */ 106 unsigned long return_ip; /* ip that _resume will return to */
107}; 107};
108 108
109#ifdef __KERNEL__
110
109#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0) 111#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
110#define instruction_pointer(regs) ((regs)->erp) 112#define instruction_pointer(regs) ((regs)->erp)
111extern void show_regs(struct pt_regs *); 113extern void show_regs(struct pt_regs *);
112#define profile_pc(regs) instruction_pointer(regs) 114#define profile_pc(regs) instruction_pointer(regs)
113 115
116#endif /* __KERNEL__ */
117
114#endif 118#endif
diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h
index 1ec69a7ea836..d910925e3174 100644
--- a/include/asm-cris/ptrace.h
+++ b/include/asm-cris/ptrace.h
@@ -4,11 +4,13 @@
4#include <asm/arch/ptrace.h> 4#include <asm/arch/ptrace.h>
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7
7/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 8/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
8#define PTRACE_GETREGS 12 9#define PTRACE_GETREGS 12
9#define PTRACE_SETREGS 13 10#define PTRACE_SETREGS 13
10#endif
11 11
12#define profile_pc(regs) instruction_pointer(regs) 12#define profile_pc(regs) instruction_pointer(regs)
13 13
14#endif /* __KERNEL__ */
15
14#endif /* _CRIS_PTRACE_H */ 16#endif /* _CRIS_PTRACE_H */
diff --git a/include/asm-frv/Kbuild b/include/asm-frv/Kbuild
index bc3f12c5b7e0..0f8956def738 100644
--- a/include/asm-frv/Kbuild
+++ b/include/asm-frv/Kbuild
@@ -3,4 +3,3 @@ include include/asm-generic/Kbuild.asm
3header-y += registers.h 3header-y += registers.h
4 4
5unifdef-y += termios.h 5unifdef-y += termios.h
6unifdef-y += ptrace.h
diff --git a/include/asm-m68knommu/ptrace.h b/include/asm-m68knommu/ptrace.h
index 47258e86e8c4..8c9194b98548 100644
--- a/include/asm-m68knommu/ptrace.h
+++ b/include/asm-m68knommu/ptrace.h
@@ -68,10 +68,8 @@ struct switch_stack {
68/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 68/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
69#define PTRACE_GETREGS 12 69#define PTRACE_GETREGS 12
70#define PTRACE_SETREGS 13 70#define PTRACE_SETREGS 13
71#ifdef CONFIG_FPU
72#define PTRACE_GETFPREGS 14 71#define PTRACE_GETFPREGS 14
73#define PTRACE_SETFPREGS 15 72#define PTRACE_SETFPREGS 15
74#endif
75 73
76#ifdef __KERNEL__ 74#ifdef __KERNEL__
77 75
diff --git a/include/asm-mn10300/ptrace.h b/include/asm-mn10300/ptrace.h
index b3684689fcce..7b06cc623d8b 100644
--- a/include/asm-mn10300/ptrace.h
+++ b/include/asm-mn10300/ptrace.h
@@ -88,12 +88,16 @@ extern struct pt_regs *__frame; /* current frame pointer */
88/* options set using PTRACE_SETOPTIONS */ 88/* options set using PTRACE_SETOPTIONS */
89#define PTRACE_O_TRACESYSGOOD 0x00000001 89#define PTRACE_O_TRACESYSGOOD 0x00000001
90 90
91#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 91#if defined(__KERNEL__)
92
93#if !defined(__ASSEMBLY__)
92#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) 94#define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL)
93#define instruction_pointer(regs) ((regs)->pc) 95#define instruction_pointer(regs) ((regs)->pc)
94extern void show_regs(struct pt_regs *); 96extern void show_regs(struct pt_regs *);
95#endif 97#endif /* !__ASSEMBLY */
96 98
97#define profile_pc(regs) ((regs)->pc) 99#define profile_pc(regs) ((regs)->pc)
98 100
101#endif /* __KERNEL__ */
102
99#endif /* _ASM_PTRACE_H */ 103#endif /* _ASM_PTRACE_H */
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h
index 93f990e418f1..3e94c5d85ff5 100644
--- a/include/asm-parisc/ptrace.h
+++ b/include/asm-parisc/ptrace.h
@@ -33,7 +33,6 @@ struct pt_regs {
33 unsigned long ipsw; /* CR22 */ 33 unsigned long ipsw; /* CR22 */
34}; 34};
35 35
36#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
37/* 36/*
38 * The numbers chosen here are somewhat arbitrary but absolutely MUST 37 * The numbers chosen here are somewhat arbitrary but absolutely MUST
39 * not overlap with any of the number assigned in <linux/ptrace.h>. 38 * not overlap with any of the number assigned in <linux/ptrace.h>.
@@ -43,8 +42,11 @@ struct pt_regs {
43 * since we have taken branch traps too) 42 * since we have taken branch traps too)
44 */ 43 */
45#define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ 44#define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */
45
46#ifdef __KERNEL__ 46#ifdef __KERNEL__
47 47
48#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
49
48/* XXX should we use iaoq[1] or iaoq[0] ? */ 50/* XXX should we use iaoq[1] or iaoq[0] ? */
49#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) 51#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
50#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) 52#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
diff --git a/include/asm-powerpc/Kbuild b/include/asm-powerpc/Kbuild
index 04ce8f8a2ee7..5ab7d7fe198c 100644
--- a/include/asm-powerpc/Kbuild
+++ b/include/asm-powerpc/Kbuild
@@ -29,7 +29,6 @@ unifdef-y += elf.h
29unifdef-y += nvram.h 29unifdef-y += nvram.h
30unifdef-y += param.h 30unifdef-y += param.h
31unifdef-y += posix_types.h 31unifdef-y += posix_types.h
32unifdef-y += ptrace.h
33unifdef-y += seccomp.h 32unifdef-y += seccomp.h
34unifdef-y += signal.h 33unifdef-y += signal.h
35unifdef-y += spu_info.h 34unifdef-y += spu_info.h
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index 8d6c92b3e770..7d36dc3bee69 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -5,7 +5,7 @@
5 * Copyright (C) 1999, 2000 Niibe Yutaka 5 * Copyright (C) 1999, 2000 Niibe Yutaka
6 * 6 *
7 */ 7 */
8#if defined(__SH5__) || defined(CONFIG_SUPERH64) 8#if defined(__SH5__)
9struct pt_regs { 9struct pt_regs {
10 unsigned long long pc; 10 unsigned long long pc;
11 unsigned long long sr; 11 unsigned long long sr;
diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild
index 1e3554596f72..00473f7dd819 100644
--- a/include/asm-x86/Kbuild
+++ b/include/asm-x86/Kbuild
@@ -19,7 +19,6 @@ unifdef-y += msr.h
19unifdef-y += mtrr.h 19unifdef-y += mtrr.h
20unifdef-y += posix_types_32.h 20unifdef-y += posix_types_32.h
21unifdef-y += posix_types_64.h 21unifdef-y += posix_types_64.h
22unifdef-y += ptrace.h
23unifdef-y += unistd_32.h 22unifdef-y += unistd_32.h
24unifdef-y += unistd_64.h 23unifdef-y += unistd_64.h
25unifdef-y += vm86.h 24unifdef-y += vm86.h
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
index 422c73e26937..089b0db44816 100644
--- a/include/asm-xtensa/ptrace.h
+++ b/include/asm-xtensa/ptrace.h
@@ -73,10 +73,10 @@
73#define PTRACE_GETXTREGS 18 73#define PTRACE_GETXTREGS 18
74#define PTRACE_SETXTREGS 19 74#define PTRACE_SETXTREGS 19
75 75
76#ifndef __ASSEMBLY__
77
78#ifdef __KERNEL__ 76#ifdef __KERNEL__
79 77
78#ifndef __ASSEMBLY__
79
80/* 80/*
81 * This struct defines the way the registers are stored on the 81 * This struct defines the way the registers are stored on the
82 * kernel stack during a system call or other kernel entry. 82 * kernel stack during a system call or other kernel entry.
@@ -122,14 +122,14 @@ extern void show_regs(struct pt_regs *);
122# ifndef CONFIG_SMP 122# ifndef CONFIG_SMP
123# define profile_pc(regs) instruction_pointer(regs) 123# define profile_pc(regs) instruction_pointer(regs)
124# endif 124# endif
125#endif /* __KERNEL__ */
126 125
127#else /* __ASSEMBLY__ */ 126#else /* __ASSEMBLY__ */
128 127
129#ifdef __KERNEL__
130# include <asm/asm-offsets.h> 128# include <asm/asm-offsets.h>
131#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE) 129#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
132#endif
133 130
134#endif /* !__ASSEMBLY__ */ 131#endif /* !__ASSEMBLY__ */
132
133#endif /* __KERNEL__ */
134
135#endif /* _XTENSA_PTRACE_H */ 135#endif /* _XTENSA_PTRACE_H */