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

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


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef __ARCH_S390_PERCPU__                      
  3 #define __ARCH_S390_PERCPU__                      
  4                                                   
  5 #include <linux/preempt.h>                        
  6 #include <asm/cmpxchg.h>                          
  7 #include <asm/march.h>                            
  8                                                   
  9 /*                                                
 10  * s390 uses its own implementation for per cp    
 11  * the cpu local data area is cached in the cp    
 12  */                                               
 13 #define __my_cpu_offset get_lowcore()->percpu_    
 14                                                   
 15 /*                                                
 16  * For 64 bit module code, the module may be m    
 17  * per cpu area, use weak definitions to force    
 18  * generate external references.                  
 19  */                                               
 20 #if defined(MODULE)                               
 21 #define ARCH_NEEDS_WEAK_PER_CPU                   
 22 #endif                                            
 23                                                   
 24 /*                                                
 25  * We use a compare-and-swap loop since that u    
 26  * disabling and enabling interrupts like the     
 27  */                                               
 28 #define arch_this_cpu_to_op_simple(pcp, val, o    
 29 ({                                                
 30         typedef typeof(pcp) pcp_op_T__;           
 31         pcp_op_T__ old__, new__, prev__;          
 32         pcp_op_T__ *ptr__;                        
 33         preempt_disable_notrace();                
 34         ptr__ = raw_cpu_ptr(&(pcp));              
 35         prev__ = READ_ONCE(*ptr__);               
 36         do {                                      
 37                 old__ = prev__;                   
 38                 new__ = old__ op (val);           
 39                 prev__ = cmpxchg(ptr__, old__,    
 40         } while (prev__ != old__);                
 41         preempt_enable_notrace();                 
 42         new__;                                    
 43 })                                                
 44                                                   
 45 #define this_cpu_add_1(pcp, val)        arch_t    
 46 #define this_cpu_add_2(pcp, val)        arch_t    
 47 #define this_cpu_add_return_1(pcp, val) arch_t    
 48 #define this_cpu_add_return_2(pcp, val) arch_t    
 49 #define this_cpu_and_1(pcp, val)        arch_t    
 50 #define this_cpu_and_2(pcp, val)        arch_t    
 51 #define this_cpu_or_1(pcp, val)         arch_t    
 52 #define this_cpu_or_2(pcp, val)         arch_t    
 53                                                   
 54 #ifndef MARCH_HAS_Z196_FEATURES                   
 55                                                   
 56 #define this_cpu_add_4(pcp, val)        arch_t    
 57 #define this_cpu_add_8(pcp, val)        arch_t    
 58 #define this_cpu_add_return_4(pcp, val) arch_t    
 59 #define this_cpu_add_return_8(pcp, val) arch_t    
 60 #define this_cpu_and_4(pcp, val)        arch_t    
 61 #define this_cpu_and_8(pcp, val)        arch_t    
 62 #define this_cpu_or_4(pcp, val)         arch_t    
 63 #define this_cpu_or_8(pcp, val)         arch_t    
 64                                                   
 65 #else /* MARCH_HAS_Z196_FEATURES */               
 66                                                   
 67 #define arch_this_cpu_add(pcp, val, op1, op2,     
 68 {                                                 
 69         typedef typeof(pcp) pcp_op_T__;           
 70         pcp_op_T__ val__ = (val);                 
 71         pcp_op_T__ old__, *ptr__;                 
 72         preempt_disable_notrace();                
 73         ptr__ = raw_cpu_ptr(&(pcp));              
 74         if (__builtin_constant_p(val__) &&        
 75             ((szcast)val__ > -129) && ((szcast    
 76                 asm volatile(                     
 77                         op2 "   %[ptr__],%[val    
 78                         : [ptr__] "+Q" (*ptr__    
 79                         : [val__] "i" ((szcast    
 80                         : "cc");                  
 81         } else {                                  
 82                 asm volatile(                     
 83                         op1 "   %[old__],%[val    
 84                         : [old__] "=d" (old__)    
 85                         : [val__] "d" (val__)     
 86                         : "cc");                  
 87         }                                         
 88         preempt_enable_notrace();                 
 89 }                                                 
 90                                                   
 91 #define this_cpu_add_4(pcp, val) arch_this_cpu    
 92 #define this_cpu_add_8(pcp, val) arch_this_cpu    
 93                                                   
 94 #define arch_this_cpu_add_return(pcp, val, op)    
 95 ({                                                
 96         typedef typeof(pcp) pcp_op_T__;           
 97         pcp_op_T__ val__ = (val);                 
 98         pcp_op_T__ old__, *ptr__;                 
 99         preempt_disable_notrace();                
100         ptr__ = raw_cpu_ptr(&(pcp));              
101         asm volatile(                             
102                 op "    %[old__],%[val__],%[pt    
103                 : [old__] "=d" (old__), [ptr__    
104                 : [val__] "d" (val__)             
105                 : "cc");                          
106         preempt_enable_notrace();                 
107         old__ + val__;                            
108 })                                                
109                                                   
110 #define this_cpu_add_return_4(pcp, val) arch_t    
111 #define this_cpu_add_return_8(pcp, val) arch_t    
112                                                   
113 #define arch_this_cpu_to_op(pcp, val, op)         
114 {                                                 
115         typedef typeof(pcp) pcp_op_T__;           
116         pcp_op_T__ val__ = (val);                 
117         pcp_op_T__ old__, *ptr__;                 
118         preempt_disable_notrace();                
119         ptr__ = raw_cpu_ptr(&(pcp));              
120         asm volatile(                             
121                 op "    %[old__],%[val__],%[pt    
122                 : [old__] "=d" (old__), [ptr__    
123                 : [val__] "d" (val__)             
124                 : "cc");                          
125         preempt_enable_notrace();                 
126 }                                                 
127                                                   
128 #define this_cpu_and_4(pcp, val)        arch_t    
129 #define this_cpu_and_8(pcp, val)        arch_t    
130 #define this_cpu_or_4(pcp, val)         arch_t    
131 #define this_cpu_or_8(pcp, val)         arch_t    
132                                                   
133 #endif /* MARCH_HAS_Z196_FEATURES */              
134                                                   
135 #define arch_this_cpu_cmpxchg(pcp, oval, nval)    
136 ({                                                
137         typedef typeof(pcp) pcp_op_T__;           
138         pcp_op_T__ ret__;                         
139         pcp_op_T__ *ptr__;                        
140         preempt_disable_notrace();                
141         ptr__ = raw_cpu_ptr(&(pcp));              
142         ret__ = cmpxchg(ptr__, oval, nval);       
143         preempt_enable_notrace();                 
144         ret__;                                    
145 })                                                
146                                                   
147 #define this_cpu_cmpxchg_1(pcp, oval, nval) ar    
148 #define this_cpu_cmpxchg_2(pcp, oval, nval) ar    
149 #define this_cpu_cmpxchg_4(pcp, oval, nval) ar    
150 #define this_cpu_cmpxchg_8(pcp, oval, nval) ar    
151                                                   
152 #define this_cpu_cmpxchg64(pcp, o, n)   this_c    
153                                                   
154 #define this_cpu_cmpxchg128(pcp, oval, nval)      
155 ({                                                
156         typedef typeof(pcp) pcp_op_T__;           
157         u128 old__, new__, ret__;                 
158         pcp_op_T__ *ptr__;                        
159         old__ = oval;                             
160         new__ = nval;                             
161         preempt_disable_notrace();                
162         ptr__ = raw_cpu_ptr(&(pcp));              
163         ret__ = cmpxchg128((void *)ptr__, old_    
164         preempt_enable_notrace();                 
165         ret__;                                    
166 })                                                
167                                                   
168 #define arch_this_cpu_xchg(pcp, nval)             
169 ({                                                
170         typeof(pcp) *ptr__;                       
171         typeof(pcp) ret__;                        
172         preempt_disable_notrace();                
173         ptr__ = raw_cpu_ptr(&(pcp));              
174         ret__ = xchg(ptr__, nval);                
175         preempt_enable_notrace();                 
176         ret__;                                    
177 })                                                
178                                                   
179 #define this_cpu_xchg_1(pcp, nval) arch_this_c    
180 #define this_cpu_xchg_2(pcp, nval) arch_this_c    
181 #define this_cpu_xchg_4(pcp, nval) arch_this_c    
182 #define this_cpu_xchg_8(pcp, nval) arch_this_c    
183                                                   
184 #include <asm-generic/percpu.h>                   
185                                                   
186 #endif /* __ARCH_S390_PERCPU__ */                 
187                                                   

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