~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/crypto/crct10dif-ce-glue.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm/crypto/crct10dif-ce-glue.c (Version linux-6.12-rc7) and /arch/m68k/crypto/crct10dif-ce-glue.c (Version linux-5.19.17)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * Accelerated CRC-T10DIF using ARM NEON and C    
  4  *                                                
  5  * Copyright (C) 2016 Linaro Ltd <ard.biesheuv    
  6  */                                               
  7                                                   
  8 #include <linux/crc-t10dif.h>                     
  9 #include <linux/init.h>                           
 10 #include <linux/kernel.h>                         
 11 #include <linux/module.h>                         
 12 #include <linux/string.h>                         
 13                                                   
 14 #include <crypto/internal/hash.h>                 
 15 #include <crypto/internal/simd.h>                 
 16                                                   
 17 #include <asm/neon.h>                             
 18 #include <asm/simd.h>                             
 19                                                   
 20 #define CRC_T10DIF_PMULL_CHUNK_SIZE     16U       
 21                                                   
 22 asmlinkage u16 crc_t10dif_pmull(u16 init_crc,     
 23                                                   
 24 static int crct10dif_init(struct shash_desc *d    
 25 {                                                 
 26         u16 *crc = shash_desc_ctx(desc);          
 27                                                   
 28         *crc = 0;                                 
 29         return 0;                                 
 30 }                                                 
 31                                                   
 32 static int crct10dif_update(struct shash_desc     
 33                             unsigned int lengt    
 34 {                                                 
 35         u16 *crc = shash_desc_ctx(desc);          
 36                                                   
 37         if (length >= CRC_T10DIF_PMULL_CHUNK_S    
 38                 kernel_neon_begin();              
 39                 *crc = crc_t10dif_pmull(*crc,     
 40                 kernel_neon_end();                
 41         } else {                                  
 42                 *crc = crc_t10dif_generic(*crc    
 43         }                                         
 44                                                   
 45         return 0;                                 
 46 }                                                 
 47                                                   
 48 static int crct10dif_final(struct shash_desc *    
 49 {                                                 
 50         u16 *crc = shash_desc_ctx(desc);          
 51                                                   
 52         *(u16 *)out = *crc;                       
 53         return 0;                                 
 54 }                                                 
 55                                                   
 56 static struct shash_alg crc_t10dif_alg = {        
 57         .digestsize             = CRC_T10DIF_D    
 58         .init                   = crct10dif_in    
 59         .update                 = crct10dif_up    
 60         .final                  = crct10dif_fi    
 61         .descsize               = CRC_T10DIF_D    
 62                                                   
 63         .base.cra_name          = "crct10dif",    
 64         .base.cra_driver_name   = "crct10dif-a    
 65         .base.cra_priority      = 200,            
 66         .base.cra_blocksize     = CRC_T10DIF_B    
 67         .base.cra_module        = THIS_MODULE,    
 68 };                                                
 69                                                   
 70 static int __init crc_t10dif_mod_init(void)       
 71 {                                                 
 72         if (!(elf_hwcap2 & HWCAP2_PMULL))         
 73                 return -ENODEV;                   
 74                                                   
 75         return crypto_register_shash(&crc_t10d    
 76 }                                                 
 77                                                   
 78 static void __exit crc_t10dif_mod_exit(void)      
 79 {                                                 
 80         crypto_unregister_shash(&crc_t10dif_al    
 81 }                                                 
 82                                                   
 83 module_init(crc_t10dif_mod_init);                 
 84 module_exit(crc_t10dif_mod_exit);                 
 85                                                   
 86 MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@    
 87 MODULE_DESCRIPTION("Accelerated CRC-T10DIF usi    
 88 MODULE_LICENSE("GPL v2");                         
 89 MODULE_ALIAS_CRYPTO("crct10dif");                 
 90                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php