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

TOMOYO Linux Cross Reference
Linux/arch/s390/include/asm/cpu_mcf.h

Version: ~ [ linux-5.17-rc1 ] ~ [ linux-5.16.2 ] ~ [ linux-5.15.16 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.93 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.173 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.225 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.262 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.297 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.299 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/s390/include/asm/cpu_mcf.h (Version linux-5.17-rc1) and /arch/alpha/include/asm-alpha/cpu_mcf.h (Version linux-4.0.9)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Counter facility support definitions for th    
  4  *                                                
  5  * Copyright IBM Corp. 2019                       
  6  * Author(s): Hendrik Brueckner <brueckner@lin    
  7  */                                               
  8 #ifndef _ASM_S390_CPU_MCF_H                       
  9 #define _ASM_S390_CPU_MCF_H                       
 10                                                   
 11 #include <linux/perf_event.h>                     
 12 #include <asm/cpu_mf.h>                           
 13                                                   
 14 enum cpumf_ctr_set {                              
 15         CPUMF_CTR_SET_BASIC   = 0,    /* Basic    
 16         CPUMF_CTR_SET_USER    = 1,    /* Probl    
 17         CPUMF_CTR_SET_CRYPTO  = 2,    /* Crypt    
 18         CPUMF_CTR_SET_EXT     = 3,    /* Exten    
 19         CPUMF_CTR_SET_MT_DIAG = 4,    /* MT-di    
 20                                                   
 21         /* Maximum number of counter sets */      
 22         CPUMF_CTR_SET_MAX,                        
 23 };                                                
 24                                                   
 25 #define CPUMF_LCCTL_ENABLE_SHIFT    16            
 26 #define CPUMF_LCCTL_ACTCTL_SHIFT     0            
 27                                                   
 28 static inline void ctr_set_enable(u64 *state,     
 29 {                                                 
 30         *state |= ctrsets << CPUMF_LCCTL_ENABL    
 31 }                                                 
 32                                                   
 33 static inline void ctr_set_disable(u64 *state,    
 34 {                                                 
 35         *state &= ~(ctrsets << CPUMF_LCCTL_ENA    
 36 }                                                 
 37                                                   
 38 static inline void ctr_set_start(u64 *state, u    
 39 {                                                 
 40         *state |= ctrsets << CPUMF_LCCTL_ACTCT    
 41 }                                                 
 42                                                   
 43 static inline void ctr_set_stop(u64 *state, u6    
 44 {                                                 
 45         *state &= ~(ctrsets << CPUMF_LCCTL_ACT    
 46 }                                                 
 47                                                   
 48 static inline int ctr_stcctm(enum cpumf_ctr_se    
 49 {                                                 
 50         switch (set) {                            
 51         case CPUMF_CTR_SET_BASIC:                 
 52                 return stcctm(BASIC, range, de    
 53         case CPUMF_CTR_SET_USER:                  
 54                 return stcctm(PROBLEM_STATE, r    
 55         case CPUMF_CTR_SET_CRYPTO:                
 56                 return stcctm(CRYPTO_ACTIVITY,    
 57         case CPUMF_CTR_SET_EXT:                   
 58                 return stcctm(EXTENDED, range,    
 59         case CPUMF_CTR_SET_MT_DIAG:               
 60                 return stcctm(MT_DIAG_CLEARING    
 61         case CPUMF_CTR_SET_MAX:                   
 62                 return 3;                         
 63         }                                         
 64         return 3;                                 
 65 }                                                 
 66                                                   
 67 struct cpu_cf_events {                            
 68         struct cpumf_ctr_info   info;             
 69         atomic_t                ctr_set[CPUMF_    
 70         atomic64_t              alert;            
 71         u64                     state;            
 72         u64                     dev_state;        
 73         unsigned int            flags;            
 74         size_t used;                    /* Byt    
 75         size_t usedss;                  /* Byt    
 76         unsigned char start[PAGE_SIZE]; /* Cou    
 77         unsigned char stop[PAGE_SIZE];  /* Cou    
 78         unsigned char data[PAGE_SIZE];  /* Cou    
 79         unsigned int sets;              /* # C    
 80 };                                                
 81 DECLARE_PER_CPU(struct cpu_cf_events, cpu_cf_e    
 82                                                   
 83 bool kernel_cpumcf_avail(void);                   
 84 int __kernel_cpumcf_begin(void);                  
 85 unsigned long kernel_cpumcf_alert(int clear);     
 86 void __kernel_cpumcf_end(void);                   
 87                                                   
 88 static inline int kernel_cpumcf_begin(void)       
 89 {                                                 
 90         if (!cpum_cf_avail())                     
 91                 return -ENODEV;                   
 92                                                   
 93         preempt_disable();                        
 94         return __kernel_cpumcf_begin();           
 95 }                                                 
 96 static inline void kernel_cpumcf_end(void)        
 97 {                                                 
 98         __kernel_cpumcf_end();                    
 99         preempt_enable();                         
100 }                                                 
101                                                   
102 /* Return true if store counter set multiple i    
103 static inline int stccm_avail(void)               
104 {                                                 
105         return test_facility(142);                
106 }                                                 
107                                                   
108 size_t cpum_cf_ctrset_size(enum cpumf_ctr_set     
109                            struct cpumf_ctr_in    
110 int cfset_online_cpu(unsigned int cpu);           
111 int cfset_offline_cpu(unsigned int cpu);          
112 #endif /* _ASM_S390_CPU_MCF_H */                  
113                                                   

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp