mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 05:45:20 +00:00
0f60a8ace5
Move the sparc CRC32C assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the arch-specific "shash" code becomes unnecessary and is removed. Note: to see the diff from arch/sparc/crypto/crc32c_glue.c to arch/sparc/lib/crc32_glue.c, view this commit with 'git show -M10'. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20241202010844.144356-11-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com>
22 lines
407 B
ArmAsm
22 lines
407 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include <linux/linkage.h>
|
|
#include <asm/visasm.h>
|
|
#include <asm/asi.h>
|
|
|
|
#include "../crypto/opcodes.h"
|
|
|
|
ENTRY(crc32c_sparc64)
|
|
/* %o0=crc32p, %o1=data_ptr, %o2=len */
|
|
VISEntryHalf
|
|
lda [%o0] ASI_PL, %f1
|
|
1: ldd [%o1], %f2
|
|
CRC32C(0,2,0)
|
|
subcc %o2, 8, %o2
|
|
bne,pt %icc, 1b
|
|
add %o1, 0x8, %o1
|
|
sta %f1, [%o0] ASI_PL
|
|
VISExitHalf
|
|
2: retl
|
|
nop
|
|
ENDPROC(crc32c_sparc64)
|