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

TOMOYO Linux Cross Reference
Linux/arch/s390/include/asm/futex.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/s390/include/asm/futex.h (Architecture ppc) and /arch/i386/include/asm-i386/futex.h (Architecture i386)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef _ASM_S390_FUTEX_H                         
  3 #define _ASM_S390_FUTEX_H                         
  4                                                   
  5 #include <linux/uaccess.h>                        
  6 #include <linux/futex.h>                          
  7 #include <asm/asm-extable.h>                      
  8 #include <asm/mmu_context.h>                      
  9 #include <asm/errno.h>                            
 10                                                   
 11 #define __futex_atomic_op(insn, ret, oldval, n    
 12         asm volatile(                             
 13                 "   sacf  256\n"                  
 14                 "0: l     %1,0(%6)\n"             
 15                 "1:"insn                          
 16                 "2: cs    %1,%2,0(%6)\n"          
 17                 "3: jl    1b\n"                   
 18                 "   lhi   %0,0\n"                 
 19                 "4: sacf  768\n"                  
 20                 EX_TABLE(0b,4b) EX_TABLE(1b,4b    
 21                 EX_TABLE(2b,4b) EX_TABLE(3b,4b    
 22                 : "=d" (ret), "=&d" (oldval),     
 23                   "=m" (*uaddr)                   
 24                 : "" (-EFAULT), "d" (oparg), "    
 25                   "m" (*uaddr) : "cc");           
 26                                                   
 27 static inline int arch_futex_atomic_op_inuser(    
 28                 u32 __user *uaddr)                
 29 {                                                 
 30         int oldval = 0, newval, ret;              
 31                                                   
 32         switch (op) {                             
 33         case FUTEX_OP_SET:                        
 34                 __futex_atomic_op("lr %2,%5\n"    
 35                                   ret, oldval,    
 36                 break;                            
 37         case FUTEX_OP_ADD:                        
 38                 __futex_atomic_op("lr %2,%1\na    
 39                                   ret, oldval,    
 40                 break;                            
 41         case FUTEX_OP_OR:                         
 42                 __futex_atomic_op("lr %2,%1\no    
 43                                   ret, oldval,    
 44                 break;                            
 45         case FUTEX_OP_ANDN:                       
 46                 __futex_atomic_op("lr %2,%1\nn    
 47                                   ret, oldval,    
 48                 break;                            
 49         case FUTEX_OP_XOR:                        
 50                 __futex_atomic_op("lr %2,%1\nx    
 51                                   ret, oldval,    
 52                 break;                            
 53         default:                                  
 54                 ret = -ENOSYS;                    
 55         }                                         
 56                                                   
 57         if (!ret)                                 
 58                 *oval = oldval;                   
 59                                                   
 60         return ret;                               
 61 }                                                 
 62                                                   
 63 static inline int futex_atomic_cmpxchg_inatomi    
 64                                                   
 65 {                                                 
 66         int ret;                                  
 67                                                   
 68         asm volatile(                             
 69                 "   sacf 256\n"                   
 70                 "0: cs   %1,%4,0(%5)\n"           
 71                 "1: la   %0,0\n"                  
 72                 "2: sacf 768\n"                   
 73                 EX_TABLE(0b,2b) EX_TABLE(1b,2b    
 74                 : "=d" (ret), "+d" (oldval), "    
 75                 : "" (-EFAULT), "d" (newval),     
 76                 : "cc", "memory");                
 77         *uval = oldval;                           
 78         return ret;                               
 79 }                                                 
 80                                                   
 81 #endif /* _ASM_S390_FUTEX_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