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

TOMOYO Linux Cross Reference
Linux/arch/loongarch/include/asm/cpu-info.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/loongarch/include/asm/cpu-info.h (Architecture ppc) and /arch/alpha/include/asm-alpha/cpu-info.h (Architecture alpha)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 2020-2022 Loongson Technology    
  4  */                                               
  5 #ifndef __ASM_CPU_INFO_H                          
  6 #define __ASM_CPU_INFO_H                          
  7                                                   
  8 #include <linux/cache.h>                          
  9 #include <linux/types.h>                          
 10                                                   
 11 #include <asm/loongarch.h>                        
 12                                                   
 13 /* cache_desc->flags */                           
 14 enum {                                            
 15         CACHE_PRESENT   = (1 << 0),               
 16         CACHE_PRIVATE   = (1 << 1),     /* cor    
 17         CACHE_INCLUSIVE = (1 << 2),     /* inc    
 18 };                                                
 19                                                   
 20 /*                                                
 21  * Descriptor for a cache                         
 22  */                                               
 23 struct cache_desc {                               
 24         unsigned char type;                       
 25         unsigned char level;                      
 26         unsigned short sets;    /* Number of l    
 27         unsigned char ways;     /* Number of w    
 28         unsigned char linesz;   /* Size of lin    
 29         unsigned char flags;    /* Flags descr    
 30 };                                                
 31                                                   
 32 #define CACHE_LEVEL_MAX         3                 
 33 #define CACHE_LEAVES_MAX        6                 
 34                                                   
 35 struct cpuinfo_loongarch {                        
 36         u64                     asid_cache;       
 37         unsigned long           asid_mask;        
 38                                                   
 39         /*                                        
 40          * Capability and feature descriptor s    
 41          */                                       
 42         unsigned long long      options;          
 43         unsigned int            processor_id;     
 44         unsigned int            fpu_vers;         
 45         unsigned int            fpu_csr0;         
 46         unsigned int            fpu_mask;         
 47         unsigned int            cputype;          
 48         int                     isa_level;        
 49         int                     tlbsize;          
 50         int                     tlbsizemtlb;      
 51         int                     tlbsizestlbset    
 52         int                     tlbsizestlbway    
 53         int                     cache_leaves_p    
 54         struct cache_desc       cache_leaves[C    
 55         int                     core;   /* phy    
 56         int                     package;/* phy    
 57         int                     global_id; /*     
 58         int                     vabits; /* Vir    
 59         int                     pabits; /* Phy    
 60         unsigned int            ksave_mask; /*    
 61         unsigned int            watch_dreg_cou    
 62         unsigned int            watch_ireg_cou    
 63         unsigned int            watch_reg_use_    
 64 } __aligned(SMP_CACHE_BYTES);                     
 65                                                   
 66 extern struct cpuinfo_loongarch cpu_data[];       
 67 #define boot_cpu_data cpu_data[0]                 
 68 #define current_cpu_data cpu_data[smp_processo    
 69 #define raw_current_cpu_data cpu_data[raw_smp_    
 70                                                   
 71 extern void cpu_probe(void);                      
 72                                                   
 73 extern const char *__cpu_family[];                
 74 extern const char *__cpu_full_name[];             
 75 #define cpu_family_string()     __cpu_family[r    
 76 #define cpu_full_name_string()  __cpu_full_nam    
 77                                                   
 78 struct seq_file;                                  
 79 struct notifier_block;                            
 80                                                   
 81 extern int register_proc_cpuinfo_notifier(stru    
 82 extern int proc_cpuinfo_notifier_call_chain(un    
 83                                                   
 84 #define proc_cpuinfo_notifier(fn, pri)            
 85 ({                                                
 86         static struct notifier_block fn##_nb =    
 87                 .notifier_call = fn,              
 88                 .priority = pri                   
 89         };                                        
 90                                                   
 91         register_proc_cpuinfo_notifier(&fn##_n    
 92 })                                                
 93                                                   
 94 struct proc_cpuinfo_notifier_args {               
 95         struct seq_file *m;                       
 96         unsigned long n;                          
 97 };                                                
 98                                                   
 99 static inline bool cpus_are_siblings(int cpua,    
100 {                                                 
101         struct cpuinfo_loongarch *infoa = &cpu    
102         struct cpuinfo_loongarch *infob = &cpu    
103                                                   
104         if (infoa->package != infob->package)     
105                 return false;                     
106                                                   
107         if (infoa->core != infob->core)           
108                 return false;                     
109                                                   
110         return true;                              
111 }                                                 
112                                                   
113 static inline unsigned long cpu_asid_mask(stru    
114 {                                                 
115         return cpuinfo->asid_mask;                
116 }                                                 
117                                                   
118 static inline void set_cpu_asid_mask(struct cp    
119                                      unsigned     
120 {                                                 
121         cpuinfo->asid_mask = asid_mask;           
122 }                                                 
123                                                   
124 #endif /* __ASM_CPU_INFO_H */                     
125                                                   

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