diff options
author | Paul Mackerras <paulus@samba.org> | 2006-06-07 02:14:40 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-09 07:24:15 -0400 |
commit | fab5db97e44f76461f76b24adfa8ccb14d4df498 (patch) | |
tree | 123026a1a6f1702468220189b7410077479ae8a2 /include/asm-powerpc/processor.h | |
parent | 651d765d0b2c72d33430487c8b6ef64c60cd2134 (diff) |
[PATCH] powerpc: Implement support for setting little-endian mode via prctl
This adds the PowerPC part of the code to allow processes to change
their endian mode via prctl.
This also extends the alignment exception handler to be able to fix up
alignment exceptions that occur in little-endian mode, both for
"PowerPC" little-endian and true little-endian.
We always enter signal handlers in big-endian mode -- the support for
little-endian mode does not amount to the creation of a little-endian
user/kernel ABI. If the signal handler returns, the endian mode is
restored to what it was when the signal was delivered.
We have two new kernel CPU feature bits, one for PPC little-endian and
one for true little-endian. Most of the classic 32-bit processors
support PPC little-endian, and this is reflected in the CPU feature
table. There are two corresponding feature bits reported to userland
in the AT_HWCAP aux vector entry.
This is based on an earlier patch by Anton Blanchard.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/processor.h')
-rw-r--r-- | include/asm-powerpc/processor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h index d5c7ef1cca26..fa6163268153 100644 --- a/include/asm-powerpc/processor.h +++ b/include/asm-powerpc/processor.h | |||
@@ -211,6 +211,12 @@ unsigned long get_wchan(struct task_struct *p); | |||
211 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); | 211 | extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr); |
212 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); | 212 | extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val); |
213 | 213 | ||
214 | #define GET_ENDIAN(tsk, adr) get_endian((tsk), (adr)) | ||
215 | #define SET_ENDIAN(tsk, val) set_endian((tsk), (val)) | ||
216 | |||
217 | extern int get_endian(struct task_struct *tsk, unsigned long adr); | ||
218 | extern int set_endian(struct task_struct *tsk, unsigned int val); | ||
219 | |||
214 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) | 220 | static inline unsigned int __unpack_fe01(unsigned long msr_bits) |
215 | { | 221 | { |
216 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); | 222 | return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8); |