aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2006-06-07 02:10:19 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-09 07:24:13 -0400
commit651d765d0b2c72d33430487c8b6ef64c60cd2134 (patch)
tree3a7253dc0b80585a03ddd581e0c00fc0f8bda7a0 /include
parent3b5e905ee3bd23e9311951890aba57a0dbc81ca4 (diff)
[PATCH] Add a prctl to change the endianness of a process.
This new prctl is intended for changing the execution mode of the processor, on processors that support both a little-endian mode and a big-endian mode. It is intended for use by programs such as instruction set emulators (for example an x86 emulator on PowerPC), which may find it convenient to use the processor in an alternate endianness mode when executing translated instructions. Note that this does not imply the existence of a fully-fledged ABI for both endiannesses, or of compatibility code for converting system calls done in the non-native endianness mode. The program is expected to arrange for all of its system call arguments to be presented in the native endianness. Switching between big and little-endian mode will require some care in constructing the instruction sequence for the switch. Generally the instructions up to the instruction that invokes the prctl system call will have to be in the old endianness, and subsequent instructions will have to be in the new endianness. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/prctl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index bf022c43a18e..52a9be41250d 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -52,4 +52,11 @@
52#define PR_SET_NAME 15 /* Set process name */ 52#define PR_SET_NAME 15 /* Set process name */
53#define PR_GET_NAME 16 /* Get process name */ 53#define PR_GET_NAME 16 /* Get process name */
54 54
55/* Get/set process endian */
56#define PR_GET_ENDIAN 19
57#define PR_SET_ENDIAN 20
58# define PR_ENDIAN_BIG 0
59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
61
55#endif /* _LINUX_PRCTL_H */ 62#endif /* _LINUX_PRCTL_H */