Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.19-rc7 36 lines 1.0 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* 3 * arm32-optimized SHA-512 block function 4 * 5 * Copyright 2025 Google LLC 6 */ 7#include <asm/neon.h> 8#include <asm/simd.h> 9 10static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon); 11 12asmlinkage void sha512_block_data_order(struct sha512_block_state *state, 13 const u8 *data, size_t nblocks); 14asmlinkage void sha512_block_data_order_neon(struct sha512_block_state *state, 15 const u8 *data, size_t nblocks); 16 17static void sha512_blocks(struct sha512_block_state *state, 18 const u8 *data, size_t nblocks) 19{ 20 if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && 21 static_branch_likely(&have_neon) && likely(may_use_simd())) { 22 scoped_ksimd() 23 sha512_block_data_order_neon(state, data, nblocks); 24 } else { 25 sha512_block_data_order(state, data, nblocks); 26 } 27} 28 29#ifdef CONFIG_KERNEL_MODE_NEON 30#define sha512_mod_init_arch sha512_mod_init_arch 31static void sha512_mod_init_arch(void) 32{ 33 if (cpu_has_neon()) 34 static_branch_enable(&have_neon); 35} 36#endif /* CONFIG_KERNEL_MODE_NEON */