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

TOMOYO Linux Cross Reference
Linux/arch/microblaze/include/asm/flat.h

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/microblaze/include/asm/flat.h (Version linux-6.12-rc7) and /arch/i386/include/asm-i386/flat.h (Version linux-5.15.171)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * uClinux flat-format executables                
  4  *                                                
  5  * Copyright (C) 2005 John Williams <jwilliams    
  6  */                                               
  7                                                   
  8 #ifndef _ASM_MICROBLAZE_FLAT_H                    
  9 #define _ASM_MICROBLAZE_FLAT_H                    
 10                                                   
 11 #include <linux/unaligned.h>                      
 12                                                   
 13 /*                                                
 14  * Microblaze works a little differently from     
 15  * of the MICROBLAZE_64 reloc type. Here, a 32    
 16  * over two instructions, an 'imm' instruction    
 17  * 16 bits, then the instruction "proper" whic    
 18  * bits.                                          
 19  */                                               
 20                                                   
 21 /*                                                
 22  * Crack open a symbol reference and extract t    
 23  * relocated. rp is a potentially unaligned po    
 24  * reference                                      
 25  */                                               
 26                                                   
 27 static inline int flat_get_addr_from_rp(u32 __    
 28                                         u32 *a    
 29 {                                                 
 30         u32 *p = (__force u32 *)rp;               
 31                                                   
 32         /* Is it a split 64/32 reference? */      
 33         if (relval & 0x80000000) {                
 34                 /* Grab the two halves of the     
 35                 u32 val_hi, val_lo;               
 36                                                   
 37                 val_hi = get_unaligned(p);        
 38                 val_lo = get_unaligned(p+1);      
 39                                                   
 40                 /* Crack the address out */       
 41                 *addr = ((val_hi & 0xffff) <<     
 42         } else {                                  
 43                 /* Get the address straight ou    
 44                 *addr = get_unaligned(p);         
 45         }                                         
 46                                                   
 47         return 0;                                 
 48 }                                                 
 49                                                   
 50 /*                                                
 51  * Insert an address into the symbol reference    
 52  * unaligned.                                     
 53  */                                               
 54                                                   
 55 static inline int                                 
 56 flat_put_addr_at_rp(u32 __user *rp, u32 addr,     
 57 {                                                 
 58         u32 *p = (__force u32 *)rp;               
 59         /* Is this a split 64/32 reloc? */        
 60         if (relval & 0x80000000) {                
 61                 /* Get the two "halves" */        
 62                 unsigned long val_hi = get_una    
 63                 unsigned long val_lo = get_una    
 64                                                   
 65                 /* insert the address */          
 66                 val_hi = (val_hi & 0xffff0000)    
 67                 val_lo = (val_lo & 0xffff0000)    
 68                                                   
 69                 /* store the two halves back i    
 70                 put_unaligned(val_hi, p);         
 71                 put_unaligned(val_lo, p+1);       
 72         } else {                                  
 73                 /* Put it straight in, no mess    
 74                 put_unaligned(addr, p);           
 75         }                                         
 76         return 0;                                 
 77 }                                                 
 78                                                   
 79 #define flat_get_relocate_addr(rel)     (rel &    
 80                                                   
 81 #endif /* _ASM_MICROBLAZE_FLAT_H */               
 82                                                   

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