diff options
author | Chris Zankel <chris@zankel.net> | 2008-02-12 14:55:32 -0500 |
---|---|---|
committer | Chris Zankel <chris@zankel.net> | 2008-02-13 20:09:08 -0500 |
commit | 8d7e8240e66cecc84a375aceb26942d02b291198 (patch) | |
tree | 97074169ed7a281ccf5207a653781f57ddb2bffc /include | |
parent | 0b2c3afdaaaa3e577300b2235df43eb8af00020b (diff) |
[XTENSA] Clean up elf-gregset.
Remove additional registers from the ELF gregset structure that
are only used by the kernel or are not required or invalid in
user-space. The ar registers are always aligned to a windowbase
value of 0, and the WB register is always assumed to be 0.
Increase the size of the structure to 128 entries. This will
provide enough space in future.
Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-xtensa/elf.h | 92 |
1 files changed, 4 insertions, 88 deletions
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h index 467384542502..0444507b438d 100644 --- a/include/asm-xtensa/elf.h +++ b/include/asm-xtensa/elf.h | |||
@@ -72,109 +72,25 @@ | |||
72 | 72 | ||
73 | /* ELF register definitions. This is needed for core dump support. */ | 73 | /* ELF register definitions. This is needed for core dump support. */ |
74 | 74 | ||
75 | /* | ||
76 | * elf_gregset_t contains the application-level state in the following order: | ||
77 | * Processor info: config_version, cpuxy | ||
78 | * Processor state: pc, ps, exccause, excvaddr, wb, ws, | ||
79 | * lbeg, lend, lcount, sar | ||
80 | * GP regs: ar0 - arXX | ||
81 | */ | ||
82 | |||
83 | typedef unsigned long elf_greg_t; | 75 | typedef unsigned long elf_greg_t; |
84 | 76 | ||
85 | typedef struct { | 77 | typedef struct { |
86 | elf_greg_t xchal_config_id0; | ||
87 | elf_greg_t xchal_config_id1; | ||
88 | elf_greg_t cpux; | ||
89 | elf_greg_t cpuy; | ||
90 | elf_greg_t pc; | 78 | elf_greg_t pc; |
91 | elf_greg_t ps; | 79 | elf_greg_t ps; |
92 | elf_greg_t exccause; | ||
93 | elf_greg_t excvaddr; | ||
94 | elf_greg_t windowbase; | ||
95 | elf_greg_t windowstart; | ||
96 | elf_greg_t lbeg; | 80 | elf_greg_t lbeg; |
97 | elf_greg_t lend; | 81 | elf_greg_t lend; |
98 | elf_greg_t lcount; | 82 | elf_greg_t lcount; |
99 | elf_greg_t sar; | 83 | elf_greg_t sar; |
100 | elf_greg_t syscall; | 84 | elf_greg_t windowstart; |
101 | elf_greg_t ar[64]; | 85 | elf_greg_t reserved[9+48]; |
86 | elf_greg_t a[64]; | ||
102 | } xtensa_gregset_t; | 87 | } xtensa_gregset_t; |
103 | 88 | ||
104 | #define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t)) | 89 | #define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t)) |
105 | 90 | ||
106 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 91 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
107 | 92 | ||
108 | /* | 93 | #define ELF_NFPREG 18 |
109 | * Compute the size of the coprocessor and extra state layout (register info) | ||
110 | * table (in bytes). | ||
111 | * This is actually the maximum size of the table, as opposed to the size, | ||
112 | * which is available from the _xtensa_reginfo_table_size global variable. | ||
113 | * | ||
114 | * (See also arch/xtensa/kernel/coprocessor.S) | ||
115 | * | ||
116 | */ | ||
117 | |||
118 | #ifndef XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM | ||
119 | # define XTENSA_CPE_LTABLE_SIZE 0 | ||
120 | #else | ||
121 | # define XTENSA_CPE_SEGMENT(num) (num ? (1+num) : 0) | ||
122 | # define XTENSA_CPE_LTABLE_ENTRIES \ | ||
123 | ( XTENSA_CPE_SEGMENT(XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM) \ | ||
124 | + XTENSA_CPE_SEGMENT(XCHAL_CP0_SA_CONTENTS_LIBDB_NUM) \ | ||
125 | + XTENSA_CPE_SEGMENT(XCHAL_CP1_SA_CONTENTS_LIBDB_NUM) \ | ||
126 | + XTENSA_CPE_SEGMENT(XCHAL_CP2_SA_CONTENTS_LIBDB_NUM) \ | ||
127 | + XTENSA_CPE_SEGMENT(XCHAL_CP3_SA_CONTENTS_LIBDB_NUM) \ | ||
128 | + XTENSA_CPE_SEGMENT(XCHAL_CP4_SA_CONTENTS_LIBDB_NUM) \ | ||
129 | + XTENSA_CPE_SEGMENT(XCHAL_CP5_SA_CONTENTS_LIBDB_NUM) \ | ||
130 | + XTENSA_CPE_SEGMENT(XCHAL_CP6_SA_CONTENTS_LIBDB_NUM) \ | ||
131 | + XTENSA_CPE_SEGMENT(XCHAL_CP7_SA_CONTENTS_LIBDB_NUM) \ | ||
132 | + 1 /* final entry */ \ | ||
133 | ) | ||
134 | # define XTENSA_CPE_LTABLE_SIZE (XTENSA_CPE_LTABLE_ENTRIES * 8) | ||
135 | #endif | ||
136 | |||
137 | |||
138 | /* | ||
139 | * Instantiations of the elf_fpregset_t type contain, in most | ||
140 | * architectures, the floating point (FPU) register set. | ||
141 | * For Xtensa, this type is extended to contain all custom state, | ||
142 | * ie. coprocessor and "extra" (non-coprocessor) state (including, | ||
143 | * for example, TIE-defined states and register files; as well | ||
144 | * as other optional processor state). | ||
145 | * This includes FPU state if a floating-point coprocessor happens | ||
146 | * to have been configured within the Xtensa processor. | ||
147 | * | ||
148 | * TOTAL_FPREGS_SIZE is the required size (without rounding) | ||
149 | * of elf_fpregset_t. It provides space for the following: | ||
150 | * | ||
151 | * a) 32-bit mask of active coprocessors for this task (similar | ||
152 | * to CPENABLE in single-threaded Xtensa processor systems) | ||
153 | * | ||
154 | * b) table describing the layout of custom states (ie. of | ||
155 | * individual registers, etc) within the save areas | ||
156 | * | ||
157 | * c) save areas for each coprocessor and for non-coprocessor | ||
158 | * ("extra") state | ||
159 | * | ||
160 | * Note that save areas may require up to 16-byte alignment when | ||
161 | * accessed by save/restore sequences. We do not need to ensure | ||
162 | * such alignment in an elf_fpregset_t structure because custom | ||
163 | * state is not directly loaded/stored into it; rather, save area | ||
164 | * contents are copied to elf_fpregset_t from the active save areas | ||
165 | * (see 'struct task_struct' definition in processor.h for that) | ||
166 | * using memcpy(). But we do allow space for such alignment, | ||
167 | * to allow optimizations of layout and copying. | ||
168 | */ | ||
169 | #if 0 | ||
170 | #define TOTAL_FPREGS_SIZE \ | ||
171 | (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE) | ||
172 | #define ELF_NFPREG \ | ||
173 | ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t)) | ||
174 | #else | ||
175 | #define TOTAL_FPREGS_SIZE 0 | ||
176 | #define ELF_NFPREG 0 | ||
177 | #endif | ||
178 | 94 | ||
179 | typedef unsigned int elf_fpreg_t; | 95 | typedef unsigned int elf_fpreg_t; |
180 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | 96 | typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; |