]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: introduce asm/swab.h
authorIgnacio Encinas <ignacio@iencinas.com>
Wed, 23 Jul 2025 19:47:29 +0000 (20:47 +0100)
committerPaul Walmsley <pjw@kernel.org>
Thu, 18 Sep 2025 14:20:25 +0000 (08:20 -0600)
commitcc2294d3f9c99c216ef563b83b08d2c0604f9b92
treee53a7b573197b966eb28935c6330cb2f287dbb54
parent316b60b984d5be9b86047cdf3bf16d51c7c70cc5
riscv: introduce asm/swab.h

Implement endianness swap macros for RISC-V.

Use the rev8 instruction when Zbb is available. Otherwise, rely on the
default mask-and-shift implementation.

Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Ignacio Encinas <ignacio@iencinas.com>
Link: https://lore.kernel.org/r/20250723-riscv-swab-v6-1-fc11e9a2efc9@iencinas.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/swab.h [new file with mode: 0644]