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

TOMOYO Linux Cross Reference
Linux/arch/xtensa/include/uapi/asm/swab.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/xtensa/include/uapi/asm/swab.h (Version linux-6.12-rc7) and /arch/i386/include/uapi/asm/swab.h (Version linux-5.4.284)


** Warning: Cannot open xref database.

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux      1 
  2 /*                                                
  3  * include/asm-xtensa/swab.h                      
  4  *                                                
  5  * This file is subject to the terms and condi    
  6  * License.  See the file "COPYING" in the mai    
  7  * for more details.                              
  8  *                                                
  9  * Copyright (C) 2001 - 2005 Tensilica Inc.       
 10  */                                               
 11                                                   
 12 #ifndef _XTENSA_SWAB_H                            
 13 #define _XTENSA_SWAB_H                            
 14                                                   
 15 #include <linux/types.h>                          
 16 #include <linux/compiler.h>                       
 17                                                   
 18 #define __SWAB_64_THRU_32__                       
 19                                                   
 20 static inline __attribute_const__ __u32 __arch    
 21 {                                                 
 22     __u32 res;                                    
 23     /* instruction sequence from Xtensa ISA re    
 24     __asm__("ssai     8           \n\t"           
 25             "srli     %0, %1, 16  \n\t"           
 26             "src      %0, %0, %1  \n\t"           
 27             "src      %0, %0, %0  \n\t"           
 28             "src      %0, %1, %0  \n"             
 29             : "=&a" (res)                         
 30             : "a" (x)                             
 31             );                                    
 32     return res;                                   
 33 }                                                 
 34 #define __arch_swab32 __arch_swab32               
 35                                                   
 36 static inline __attribute_const__ __u16 __arch    
 37 {                                                 
 38     /* Given that 'short' values are signed (i    
 39      * we cannot assume that the upper 16-bits    
 40      * zero.  We are careful to mask values af    
 41      */                                           
 42                                                   
 43     /* There exists an anomaly between xt-gcc     
 44      * inserts an extui instruction after putt    
 45      * to ensure that it uses only the least-s    
 46      * the result.  xt-xcc doesn't use an extu    
 47      * __asm__ macro follows convention that t    
 48      * 'unsigned short' result are still zero.    
 49      * follow convention; indeed, it leaves ga    
 50      * bits of the register.                      
 51                                                   
 52      * Declaring the temporary variables 'res'    
 53      * types while the return type of the func    
 54      * forces both compilers to insert exactly    
 55      * (or equivalent) to mask off the upper 1    
 56                                                   
 57     __u32 res;                                    
 58     __u32 tmp;                                    
 59                                                   
 60     __asm__("extui    %1, %2, 8, 8\n\t"           
 61             "slli     %0, %2, 8   \n\t"           
 62             "or       %0, %0, %1  \n"             
 63             : "=&a" (res), "=&a" (tmp)            
 64             : "a" (x)                             
 65             );                                    
 66                                                   
 67     return res;                                   
 68 }                                                 
 69 #define __arch_swab16 __arch_swab16               
 70                                                   
 71 #endif /* _XTENSA_SWAB_H */                       
 72                                                   

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