aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/elf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc/elf.h')
-rw-r--r--include/asm-sparc/elf.h38
1 files changed, 8 insertions, 30 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.