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

TOMOYO Linux Cross Reference
Linux/arch/loongarch/lib/unaligned.S

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/loongarch/lib/unaligned.S (Version linux-6.12-rc7) and /arch/mips/lib/unaligned.S (Version linux-5.18.19)


  1 /* SPDX-License-Identifier: GPL-2.0 */            
  2 /*                                                
  3  * Copyright (C) 2020-2022 Loongson Technology    
  4  */                                               
  5                                                   
  6 #include <linux/linkage.h>                        
  7                                                   
  8 #include <asm/asm.h>                              
  9 #include <asm/asmmacro.h>                         
 10 #include <asm/asm-extable.h>                      
 11 #include <asm/errno.h>                            
 12 #include <asm/regdef.h>                           
 13                                                   
 14 .L_fixup_handle_unaligned:                        
 15         li.w    a0, -EFAULT                       
 16         jr      ra                                
 17                                                   
 18 /*                                                
 19  * unsigned long unaligned_read(void *addr, vo    
 20  *                                                
 21  * a0: addr                                       
 22  * a1: value                                      
 23  * a2: n                                          
 24  * a3: sign                                       
 25  */                                               
 26 SYM_FUNC_START(unaligned_read)                    
 27         beqz    a2, 5f                            
 28                                                   
 29         li.w    t2, 0                             
 30         addi.d  t0, a2, -1                        
 31         slli.d  t1, t0, 3                         
 32         add.d   a0, a0, t0                        
 33                                                   
 34         beqz    a3, 2f                            
 35 1:      ld.b    t3, a0, 0                         
 36         b       3f                                
 37                                                   
 38 2:      ld.bu   t3, a0, 0                         
 39 3:      sll.d   t3, t3, t1                        
 40         or      t2, t2, t3                        
 41         addi.d  t1, t1, -8                        
 42         addi.d  a0, a0, -1                        
 43         addi.d  a2, a2, -1                        
 44         bgtz    a2, 2b                            
 45 4:      st.d    t2, a1, 0                         
 46                                                   
 47         move    a0, a2                            
 48         jr      ra                                
 49                                                   
 50 5:      li.w    a0, -EFAULT                       
 51         jr      ra                                
 52                                                   
 53         _asm_extable 1b, .L_fixup_handle_unali    
 54         _asm_extable 2b, .L_fixup_handle_unali    
 55         _asm_extable 4b, .L_fixup_handle_unali    
 56 SYM_FUNC_END(unaligned_read)                      
 57                                                   
 58 /*                                                
 59  * unsigned long unaligned_write(void *addr, u    
 60  *                                                
 61  * a0: addr                                       
 62  * a1: value                                      
 63  * a2: n                                          
 64  */                                               
 65 SYM_FUNC_START(unaligned_write)                   
 66         beqz    a2, 3f                            
 67                                                   
 68         li.w    t0, 0                             
 69 1:      srl.d   t1, a1, t0                        
 70 2:      st.b    t1, a0, 0                         
 71         addi.d  t0, t0, 8                         
 72         addi.d  a2, a2, -1                        
 73         addi.d  a0, a0, 1                         
 74         bgtz    a2, 1b                            
 75                                                   
 76         move    a0, a2                            
 77         jr      ra                                
 78                                                   
 79 3:      li.w    a0, -EFAULT                       
 80         jr      ra                                
 81                                                   
 82         _asm_extable 2b, .L_fixup_handle_unali    
 83 SYM_FUNC_END(unaligned_write)                     
                                                      

~ [ 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