aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 13:21:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 13:21:26 -0500
commit0afc2edfada50980bec999f94dcea26ebad3dda6 (patch)
tree8963dd8fd78ee5c3481acad5903bc459bd3d055c /include
parenta8e98d6d51a3eb7bb061b1625193a129c8bd094f (diff)
parentd256eb8db60e36fc5dd0a27ce8a64f65df31f7b5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC32]: Use regsets in arch_ptrace(). [SPARC64]: Use regsets in arch_ptrace(). [SPARC32]: Use regsets for ELF core dumping. [SPARC64]: Use regsets for ELF core dumping. [SPARC64]: Remove unintentional ptrace debugging messages. [SPARC]: Move over to arch_ptrace(). [SPARC]: Remove PTRACE_SUN* handling. [SPARC]: Kill DEBUG_PTRACE code. [SPARC32]: Add user regset support. [SPARC64]: Add user regsets. [SPARC64]: Fix booting on non-zero cpu.
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc/elf.h38
-rw-r--r--include/asm-sparc/ptrace.h7
-rw-r--r--include/asm-sparc64/elf.h30
-rw-r--r--include/asm-sparc64/ptrace.h18
4 files changed, 13 insertions, 80 deletions
diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h
index 668814e1e539..d2516eed3a38 100644
--- a/include/asm-sparc/elf.h
+++ b/include/asm-sparc/elf.h
@@ -65,8 +65,14 @@
65#define HWCAP_SPARC_V9 16 65#define HWCAP_SPARC_V9 16
66#define HWCAP_SPARC_ULTRA3 32 66#define HWCAP_SPARC_ULTRA3 32
67 67
68/* For the most part we present code dumps in the format 68#define CORE_DUMP_USE_REGSET
69 * Solaris does. 69
70/* Format is:
71 * G0 --> G7
72 * O0 --> O7
73 * L0 --> L7
74 * I0 --> I7
75 * PSR, PC, nPC, Y, WIM, TBR
70 */ 76 */
71typedef unsigned long elf_greg_t; 77typedef unsigned long elf_greg_t;
72#define ELF_NGREG 38 78#define ELF_NGREG 38
@@ -86,34 +92,6 @@ typedef struct {
86} elf_fpregset_t; 92} elf_fpregset_t;
87 93
88#include <asm/mbus.h> 94#include <asm/mbus.h>
89#include <asm/uaccess.h>
90
91/* Format is:
92 * G0 --> G7
93 * O0 --> O7
94 * L0 --> L7
95 * I0 --> I7
96 * PSR, PC, nPC, Y, WIM, TBR
97 */
98#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \
99do { unsigned long *dest = &(__elf_regs[0]); \
100 struct pt_regs *src = (__pt_regs); \
101 unsigned long __user *sp; \
102 memcpy(&dest[0], &src->u_regs[0], \
103 sizeof(unsigned long) * 16); \
104 /* Don't try this at home kids... */ \
105 sp = (unsigned long __user *) src->u_regs[14]; \
106 copy_from_user(&dest[16], sp, \
107 sizeof(unsigned long) * 16); \
108 dest[32] = src->psr; \
109 dest[33] = src->pc; \
110 dest[34] = src->npc; \
111 dest[35] = src->y; \
112 dest[36] = dest[37] = 0; /* XXX */ \
113} while(0); /* Janitors: Don't touch this semicolon. */
114
115#define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \
116 ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; })
117 95
118/* 96/*
119 * This is used to ensure we don't load something for the wrong architecture. 97 * This is used to ensure we don't load something for the wrong architecture.
diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h
index 714497099a42..8201a7b29d49 100644
--- a/include/asm-sparc/ptrace.h
+++ b/include/asm-sparc/ptrace.h
@@ -61,8 +61,6 @@ struct sparc_stackf {
61 61
62#ifdef __KERNEL__ 62#ifdef __KERNEL__
63 63
64#define __ARCH_SYS_PTRACE 1
65
66#define user_mode(regs) (!((regs)->psr & PSR_PS)) 64#define user_mode(regs) (!((regs)->psr & PSR_PS))
67#define instruction_pointer(regs) ((regs)->pc) 65#define instruction_pointer(regs) ((regs)->pc)
68unsigned long profile_pc(struct pt_regs *); 66unsigned long profile_pc(struct pt_regs *);
@@ -151,8 +149,6 @@ extern void show_regs(struct pt_regs *);
151#define SF_XXARG 0x5c 149#define SF_XXARG 0x5c
152 150
153/* Stuff for the ptrace system call */ 151/* Stuff for the ptrace system call */
154#define PTRACE_SUNATTACH 10
155#define PTRACE_SUNDETACH 11
156#define PTRACE_GETREGS 12 152#define PTRACE_GETREGS 12
157#define PTRACE_SETREGS 13 153#define PTRACE_SETREGS 13
158#define PTRACE_GETFPREGS 14 154#define PTRACE_GETFPREGS 14
@@ -164,7 +160,4 @@ extern void show_regs(struct pt_regs *);
164#define PTRACE_GETFPAREGS 20 160#define PTRACE_GETFPAREGS 20
165#define PTRACE_SETFPAREGS 21 161#define PTRACE_SETFPAREGS 21
166 162
167#define PTRACE_GETUCODE 29 /* stupid bsd-ism */
168
169
170#endif /* !(_SPARC_PTRACE_H) */ 163#endif /* !(_SPARC_PTRACE_H) */
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
index dc7bc63e507e..272a65873f2e 100644
--- a/include/asm-sparc64/elf.h
+++ b/include/asm-sparc64/elf.h
@@ -70,6 +70,8 @@
70#define HWCAP_SPARC_BLKINIT 64 70#define HWCAP_SPARC_BLKINIT 64
71#define HWCAP_SPARC_N2 128 71#define HWCAP_SPARC_N2 128
72 72
73#define CORE_DUMP_USE_REGSET
74
73/* 75/*
74 * These are used to set parameters in the core dumps. 76 * These are used to set parameters in the core dumps.
75 */ 77 */
@@ -78,10 +80,6 @@
78#define ELF_CLASS ELFCLASS64 80#define ELF_CLASS ELFCLASS64
79#define ELF_DATA ELFDATA2MSB 81#define ELF_DATA ELFDATA2MSB
80 82
81typedef unsigned long elf_greg_t;
82
83#define ELF_NGREG 36
84typedef elf_greg_t elf_gregset_t[ELF_NGREG];
85/* Format of 64-bit elf_gregset_t is: 83/* Format of 64-bit elf_gregset_t is:
86 * G0 --> G7 84 * G0 --> G7
87 * O0 --> O7 85 * O0 --> O7
@@ -92,24 +90,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
92 * TNPC 90 * TNPC
93 * Y 91 * Y
94 */ 92 */
95#define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ 93typedef unsigned long elf_greg_t;
96do { unsigned long *dest = &(__elf_regs[0]); \ 94#define ELF_NGREG 36
97 struct pt_regs *src = (__pt_regs); \ 95typedef elf_greg_t elf_gregset_t[ELF_NGREG];
98 unsigned long __user *sp; \
99 int i; \
100 for(i = 0; i < 16; i++) \
101 dest[i] = src->u_regs[i]; \
102 /* Don't try this at home kids... */ \
103 sp = (unsigned long __user *) \
104 ((src->u_regs[14] + STACK_BIAS) \
105 & 0xfffffffffffffff8UL); \
106 for(i = 0; i < 16; i++) \
107 __get_user(dest[i+16], &sp[i]); \
108 dest[32] = src->tstate; \
109 dest[33] = src->tpc; \
110 dest[34] = src->tnpc; \
111 dest[35] = src->y; \
112} while (0);
113 96
114typedef struct { 97typedef struct {
115 unsigned long pr_regs[32]; 98 unsigned long pr_regs[32];
@@ -119,9 +102,6 @@ typedef struct {
119} elf_fpregset_t; 102} elf_fpregset_t;
120#endif 103#endif
121 104
122#define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \
123 ({ ELF_CORE_COPY_REGS((*(__elf_regs)), task_pt_regs(__tsk)); 1; })
124
125/* 105/*
126 * This is used to ensure we don't load something for the wrong architecture. 106 * This is used to ensure we don't load something for the wrong architecture.
127 */ 107 */
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index 7eba90c6c753..734a767f0a4e 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -95,8 +95,6 @@ struct sparc_trapf {
95 95
96#ifdef __KERNEL__ 96#ifdef __KERNEL__
97 97
98#define __ARCH_SYS_PTRACE 1
99
100#define force_successful_syscall_return() \ 98#define force_successful_syscall_return() \
101do { current_thread_info()->syscall_noerror = 1; \ 99do { current_thread_info()->syscall_noerror = 1; \
102} while (0) 100} while (0)
@@ -261,8 +259,6 @@ extern void show_regs(struct pt_regs *);
261#define SF_XXARG 0x5c 259#define SF_XXARG 0x5c
262 260
263/* Stuff for the ptrace system call */ 261/* Stuff for the ptrace system call */
264#define PTRACE_SUNATTACH 10
265#define PTRACE_SUNDETACH 11
266#define PTRACE_GETREGS 12 262#define PTRACE_GETREGS 12
267#define PTRACE_SETREGS 13 263#define PTRACE_SETREGS 13
268#define PTRACE_GETFPREGS 14 264#define PTRACE_GETFPREGS 14
@@ -284,18 +280,4 @@ extern void show_regs(struct pt_regs *);
284#define PTRACE_GETFPREGS64 25 280#define PTRACE_GETFPREGS64 25
285#define PTRACE_SETFPREGS64 26 281#define PTRACE_SETFPREGS64 26
286 282
287#define PTRACE_GETUCODE 29 /* stupid bsd-ism */
288
289/* These are for 32-bit processes debugging 64-bit ones.
290 * Here addr and addr2 are passed in %g2 and %g3 respectively.
291 */
292#define PTRACE_PEEKTEXT64 (30 + PTRACE_PEEKTEXT)
293#define PTRACE_POKETEXT64 (30 + PTRACE_POKETEXT)
294#define PTRACE_PEEKDATA64 (30 + PTRACE_PEEKDATA)
295#define PTRACE_POKEDATA64 (30 + PTRACE_POKEDATA)
296#define PTRACE_READDATA64 (30 + PTRACE_READDATA)
297#define PTRACE_WRITEDATA64 (30 + PTRACE_WRITEDATA)
298#define PTRACE_READTEXT64 (30 + PTRACE_READTEXT)
299#define PTRACE_WRITETEXT64 (30 + PTRACE_WRITETEXT)
300
301#endif /* !(_SPARC64_PTRACE_H) */ 283#endif /* !(_SPARC64_PTRACE_H) */