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.18-rc5 37 lines 1.1 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 kernel_neon_begin(); 23 sha512_block_data_order_neon(state, data, nblocks); 24 kernel_neon_end(); 25 } else { 26 sha512_block_data_order(state, data, nblocks); 27 } 28} 29 30#ifdef CONFIG_KERNEL_MODE_NEON 31#define sha512_mod_init_arch sha512_mod_init_arch 32static void sha512_mod_init_arch(void) 33{ 34 if (cpu_has_neon()) 35 static_branch_enable(&have_neon); 36} 37#endif /* CONFIG_KERNEL_MODE_NEON */