diff options
author | David S. Miller <davem@davemloft.net> | 2008-02-07 07:36:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-07 07:36:02 -0500 |
commit | 5a4924d7be5df430132e109d3d2f26be610b4707 (patch) | |
tree | aecba49d6f6d3f633ab14ecf8e08aa23b9393e35 /include/asm-sparc/elf.h | |
parent | 3389742f3c346d9ef5fb46e7baa04972bdd6d151 (diff) |
[SPARC32]: Use regsets for ELF core dumping.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc/elf.h')
-rw-r--r-- | include/asm-sparc/elf.h | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h index aaf6ef40ee2f..2f8ff3fa0957 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 | */ |
71 | typedef unsigned long elf_greg_t; | 77 | typedef unsigned long elf_greg_t; |
72 | #define ELF_NGREG 38 | 78 | #define ELF_NGREG 38 |
@@ -87,34 +93,6 @@ typedef struct { | |||
87 | 93 | ||
88 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
89 | #include <asm/mbus.h> | 95 | #include <asm/mbus.h> |
90 | #include <asm/uaccess.h> | ||
91 | |||
92 | /* Format is: | ||
93 | * G0 --> G7 | ||
94 | * O0 --> O7 | ||
95 | * L0 --> L7 | ||
96 | * I0 --> I7 | ||
97 | * PSR, PC, nPC, Y, WIM, TBR | ||
98 | */ | ||
99 | #define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ | ||
100 | do { unsigned long *dest = &(__elf_regs[0]); \ | ||
101 | struct pt_regs *src = (__pt_regs); \ | ||
102 | unsigned long __user *sp; \ | ||
103 | memcpy(&dest[0], &src->u_regs[0], \ | ||
104 | sizeof(unsigned long) * 16); \ | ||
105 | /* Don't try this at home kids... */ \ | ||
106 | sp = (unsigned long __user *) src->u_regs[14]; \ | ||
107 | copy_from_user(&dest[16], sp, \ | ||
108 | sizeof(unsigned long) * 16); \ | ||
109 | dest[32] = src->psr; \ | ||
110 | dest[33] = src->pc; \ | ||
111 | dest[34] = src->npc; \ | ||
112 | dest[35] = src->y; \ | ||
113 | dest[36] = dest[37] = 0; /* XXX */ \ | ||
114 | } while(0); /* Janitors: Don't touch this semicolon. */ | ||
115 | |||
116 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ | ||
117 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; }) | ||
118 | 96 | ||
119 | /* | 97 | /* |
120 | * This is used to ensure we don't load something for the wrong architecture. | 98 | * This is used to ensure we don't load something for the wrong architecture. |