diff options
author | Jordan Niethe <jniethe5@gmail.com> | 2020-05-06 06:40:29 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-05-18 17:10:37 +0300 |
commit | aabd2233b6aefeee6d7a2f667076d8346be1d30a (patch) | |
tree | 16af29fb1e8ce389f1fb220c3ff6845a15f65122 /arch/powerpc/include | |
parent | 8094892d1aff14269d3b7bfcd8b941217eecd81f (diff) | |
download | linux-aabd2233b6aefeee6d7a2f667076d8346be1d30a.tar.xz |
powerpc: Use a function for byte swapping instructions
Use a function for byte swapping instructions in preparation of a more
complicated instruction type.
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Balamuruhan S <bala24@linux.ibm.com>
Link: https://lore.kernel.org/r/20200506034050.24806-10-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/inst.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/inst.h b/arch/powerpc/include/asm/inst.h index 09b4ec7debc1..ff2c8fe3e262 100644 --- a/arch/powerpc/include/asm/inst.h +++ b/arch/powerpc/include/asm/inst.h @@ -18,4 +18,9 @@ static inline int ppc_inst_primary_opcode(u32 x) return ppc_inst_val(x) >> 26; } +static inline u32 ppc_inst_swab(u32 x) +{ + return ppc_inst(swab32(ppc_inst_val(x))); +} + #endif /* _ASM_POWERPC_INST_H */ |