]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[POWERPC] Add fast little-endian switch system call
authorPaul Mackerras <paulus@samba.org>
Mon, 28 Apr 2008 03:52:31 +0000 (13:52 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 29 Apr 2008 05:57:34 +0000 (15:57 +1000)
commit745a14cc264b1832c638e41812e0cb04328b2db1
tree427272e0a4a1f3df96f007b1df53b73d572ec63e
parenta01e035ebb552223c03f2d9138ffc73f2d4d3965
[POWERPC] Add fast little-endian switch system call

This adds a system call on 64-bit platforms for switching between
little-endian and big-endian modes that is much faster than doing a
prctl call.  This system call is handled as a special case right at
the start of the system call entry code, and because it is a special
case, it uses a system call number which is out of the range of
normal system calls, namely 0x1ebe.

Measurements with lmbench on a 4.2GHz POWER6 showed no measurable
change in the speed of normal system calls with this patch.

Switching endianness with this new system call takes around 60ns on a
4.2GHz POWER6, compared with around 300ns to switch endian mode with a
prctl.  This can provide a significant performance advantage for
emulators for little-endian architectures that want to switch between
big-endian and little-endian mode frequently, e.g. because they are
generating instructions sequences on the fly and they want to run
those sequences in little-endian mode.

The other thing about this system call is that it doesn't clobber as
many registers as a normal system call.  It only clobbers r12.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/head_64.S