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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/idle.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/powerpc/include/asm/idle.h (Architecture i386) and /arch/mips/include/asm-mips/idle.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 
  2 #ifndef _ASM_POWERPC_IDLE_H                       
  3 #define _ASM_POWERPC_IDLE_H                       
  4 #include <asm/runlatch.h>                         
  5 #include <asm/paca.h>                             
  6                                                   
  7 #ifdef CONFIG_PPC_PSERIES                         
  8 DECLARE_PER_CPU(u64, idle_spurr_cycles);          
  9 DECLARE_PER_CPU(u64, idle_entry_purr_snap);       
 10 DECLARE_PER_CPU(u64, idle_entry_spurr_snap);      
 11                                                   
 12 static __always_inline void snapshot_purr_idle    
 13 {                                                 
 14         *this_cpu_ptr(&idle_entry_purr_snap) =    
 15 }                                                 
 16                                                   
 17 static __always_inline void snapshot_spurr_idl    
 18 {                                                 
 19         *this_cpu_ptr(&idle_entry_spurr_snap)     
 20 }                                                 
 21                                                   
 22 static __always_inline void update_idle_purr_a    
 23 {                                                 
 24         u64 wait_cycles;                          
 25         u64 in_purr = *this_cpu_ptr(&idle_entr    
 26                                                   
 27         wait_cycles = be64_to_cpu(get_lppaca()    
 28         wait_cycles += mfspr(SPRN_PURR) - in_p    
 29         get_lppaca()->wait_state_cycles = cpu_    
 30 }                                                 
 31                                                   
 32 static __always_inline void update_idle_spurr_    
 33 {                                                 
 34         u64 *idle_spurr_cycles_ptr = this_cpu_    
 35         u64 in_spurr = *this_cpu_ptr(&idle_ent    
 36                                                   
 37         *idle_spurr_cycles_ptr += mfspr(SPRN_S    
 38 }                                                 
 39                                                   
 40 static __always_inline void pseries_idle_prolo    
 41 {                                                 
 42         ppc64_runlatch_off();                     
 43         snapshot_purr_idle_entry();               
 44         snapshot_spurr_idle_entry();              
 45         /*                                        
 46          * Indicate to the HV that we are idle    
 47          * a good time to find other work to d    
 48          */                                       
 49         get_lppaca()->idle = 1;                   
 50 }                                                 
 51                                                   
 52 static __always_inline void pseries_idle_epilo    
 53 {                                                 
 54         update_idle_purr_accounting();            
 55         update_idle_spurr_accounting();           
 56         get_lppaca()->idle = 0;                   
 57         ppc64_runlatch_on();                      
 58 }                                                 
 59                                                   
 60 static inline u64 read_this_idle_purr(void)       
 61 {                                                 
 62         /*                                        
 63          * If we are reading from an idle cont    
 64          * idle-purr cycles corresponding to t    
 65          * Since the idle context is not yet o    
 66          * snapshot of the idle-purr.             
 67          */                                       
 68         if (unlikely(get_lppaca()->idle == 1))    
 69                 update_idle_purr_accounting();    
 70                 snapshot_purr_idle_entry();       
 71         }                                         
 72                                                   
 73         return be64_to_cpu(get_lppaca()->wait_    
 74 }                                                 
 75                                                   
 76 static inline u64 read_this_idle_spurr(void)      
 77 {                                                 
 78         /*                                        
 79          * If we are reading from an idle cont    
 80          * idle-spurr cycles corresponding to     
 81          * Since the idle context is not yet o    
 82          * snapshot of the idle-spurr.            
 83          */                                       
 84         if (get_lppaca()->idle == 1) {            
 85                 update_idle_spurr_accounting()    
 86                 snapshot_spurr_idle_entry();      
 87         }                                         
 88                                                   
 89         return *this_cpu_ptr(&idle_spurr_cycle    
 90 }                                                 
 91                                                   
 92 #endif /* CONFIG_PPC_PSERIES */                   
 93 #endif                                            
 94                                                   

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