]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Add a prctl to change the endianness of a process.
authorAnton Blanchard <anton@samba.org>
Wed, 7 Jun 2006 06:10:19 +0000 (16:10 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 Jun 2006 11:24:13 +0000 (21:24 +1000)
commit66680d43b8720527b8bb414ad54c21189a11ee6f
tree3a7253dc0b80585a03ddd581e0c00fc0f8bda7a0
parentf12ad1493e71a50535f34238c70a7b90f8789080
[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>
include/linux/prctl.h
kernel/sys.c