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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/barrier.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/powerpc/include/asm/barrier.h (Architecture alpha) and /arch/sparc/include/asm-sparc/barrier.h (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 1999 Cort Dougan <cort@cs.nmt    
  4  */                                               
  5 #ifndef _ASM_POWERPC_BARRIER_H                    
  6 #define _ASM_POWERPC_BARRIER_H                    
  7                                                   
  8 #include <asm/asm-const.h>                        
  9                                                   
 10 #ifndef __ASSEMBLY__                              
 11 #include <asm/ppc-opcode.h>                       
 12 #endif                                            
 13                                                   
 14 /*                                                
 15  * Memory barrier.                                
 16  * The sync instruction guarantees that all me    
 17  * by this processor have been performed (with    
 18  * mechanisms that access memory).  The eieio     
 19  * providing an ordering (separately) for (a)     
 20  * loads and stores to non-cacheable memory (e    
 21  *                                                
 22  * mb() prevents loads and stores being reorde    
 23  * rmb() prevents loads being reordered across    
 24  * wmb() prevents stores being reordered acros    
 25  *                                                
 26  * *mb() variants without smp_ prefix must ord    
 27  * operations with one another. sync is the on    
 28  * to do this.                                    
 29  *                                                
 30  * For the smp_ barriers, ordering is for cach    
 31  * only. We have to use the sync instruction f    
 32  * doesn't order loads with respect to previou    
 33  * used for smp_rmb() and smp_wmb().              
 34  *                                                
 35  * However, on CPUs that don't support lwsync,    
 36  * heavy-weight sync, so smp_wmb() can be a li    
 37  */                                               
 38 #define __mb()   __asm__ __volatile__ ("sync"     
 39 #define __rmb()  __asm__ __volatile__ ("sync"     
 40 #define __wmb()  __asm__ __volatile__ ("sync"     
 41                                                   
 42 /* The sub-arch has lwsync */                     
 43 #if defined(CONFIG_PPC64) || defined(CONFIG_PP    
 44 #    define SMPWMB      LWSYNC                    
 45 #elif defined(CONFIG_BOOKE)                       
 46 #    define SMPWMB      mbar                      
 47 #else                                             
 48 #    define SMPWMB      eieio                     
 49 #endif                                            
 50                                                   
 51 /* clang defines this macro for a builtin, whi    
 52 #undef __lwsync                                   
 53 #define __lwsync()      __asm__ __volatile__ (    
 54 #define __dma_rmb()     __lwsync()                
 55 #define __dma_wmb()     __asm__ __volatile__ (    
 56                                                   
 57 #define __smp_lwsync()  __lwsync()                
 58                                                   
 59 #define __smp_mb()      __mb()                    
 60 #define __smp_rmb()     __lwsync()                
 61 #define __smp_wmb()     __asm__ __volatile__ (    
 62                                                   
 63 /*                                                
 64  * This is a barrier which prevents following     
 65  * started until the value of the argument x i    
 66  * x is a variable loaded from memory, this pr    
 67  * instructions from being executed until the     
 68  */                                               
 69 #define data_barrier(x) \                         
 70         asm volatile("twi 0,%0,0; isync" : : "    
 71                                                   
 72 #define __smp_store_release(p, v)                 
 73 do {                                              
 74         compiletime_assert_atomic_type(*p);       
 75         __smp_lwsync();                           
 76         WRITE_ONCE(*p, v);                        
 77 } while (0)                                       
 78                                                   
 79 #define __smp_load_acquire(p)                     
 80 ({                                                
 81         typeof(*p) ___p1 = READ_ONCE(*p);         
 82         compiletime_assert_atomic_type(*p);       
 83         __smp_lwsync();                           
 84         ___p1;                                    
 85 })                                                
 86                                                   
 87 #ifdef CONFIG_PPC_BOOK3S_64                       
 88 #define NOSPEC_BARRIER_SLOT   nop                 
 89 #elif defined(CONFIG_PPC_E500)                    
 90 #define NOSPEC_BARRIER_SLOT   nop; nop            
 91 #endif                                            
 92                                                   
 93 #ifdef CONFIG_PPC_BARRIER_NOSPEC                  
 94 /*                                                
 95  * Prevent execution of subsequent instruction    
 96  * been fully resolved and are no longer execu    
 97  */                                               
 98 #define barrier_nospec_asm NOSPEC_BARRIER_FIXU    
 99                                                   
100 // This also acts as a compiler barrier due to    
101 #define barrier_nospec() asm (stringify_in_c(b    
102                                                   
103 #else /* !CONFIG_PPC_BARRIER_NOSPEC */            
104 #define barrier_nospec_asm                        
105 #define barrier_nospec()                          
106 #endif /* CONFIG_PPC_BARRIER_NOSPEC */            
107                                                   
108 /*                                                
109  * pmem_wmb() ensures that all stores for whic    
110  * are written to persistent storage by preced    
111  * instructions have updated persistent storag    
112  * access or data transfer caused by subsequen    
113  * initiated.                                     
114  */                                               
115 #define pmem_wmb() __asm__ __volatile__(PPC_PH    
116                                                   
117 #include <asm-generic/barrier.h>                  
118                                                   
119 #endif /* _ASM_POWERPC_BARRIER_H */               
120                                                   

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