mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
x86 asm: move bswap from x86-assembly-cheat
This commit is contained in:
@@ -12397,6 +12397,7 @@ Bibliography:
|
|||||||
* Integer typecasts
|
* Integer typecasts
|
||||||
** link:userland/arch/x86_64/movzx.S[]: MOVZX
|
** link:userland/arch/x86_64/movzx.S[]: MOVZX
|
||||||
** link:userland/arch/x86_64/movsx.S[]: MOVSX
|
** link:userland/arch/x86_64/movsx.S[]: MOVSX
|
||||||
|
* link:userland/arch/x86_64/bswap.S[]: BSWAP: convert between little endian and big endian
|
||||||
|
|
||||||
==== x86 CQTO and CLTQ instructions
|
==== x86 CQTO and CLTQ instructions
|
||||||
|
|
||||||
|
|||||||
13
userland/arch/x86_64/bswap.S
Normal file
13
userland/arch/x86_64/bswap.S
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# # bswap
|
||||||
|
|
||||||
|
# Little endian <=> big endian.
|
||||||
|
|
||||||
|
#include <lkmc.h>
|
||||||
|
|
||||||
|
LKMC_PROLOGUE
|
||||||
|
|
||||||
|
mov $0x12345678, %eax
|
||||||
|
bswapl %eax
|
||||||
|
LKMC_ASSERT_EQ_32(%eax, $0x78563412)
|
||||||
|
|
||||||
|
LKMC_EPILOGUE
|
||||||
Reference in New Issue
Block a user