123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- #ifndef __ASM_CPU_INFO_H
- #define __ASM_CPU_INFO_H
- #include <linux/types.h>
- #include <asm/cache.h>
- struct cache_desc {
- unsigned int waysize;
- unsigned short sets;
- unsigned char ways;
- unsigned char linesz;
- unsigned char waybit;
- unsigned char flags;
- };
- struct guest_info {
- unsigned long ases;
- unsigned long ases_dyn;
- unsigned long long options;
- unsigned long long options_dyn;
- u8 conf;
- u8 kscratch_mask;
- };
- #define MIPS_CACHE_NOT_PRESENT 0x00000001
- #define MIPS_CACHE_VTAG 0x00000002
- #define MIPS_CACHE_ALIASES 0x00000004
- #define MIPS_CACHE_IC_F_DC 0x00000008
- #define MIPS_IC_SNOOPS_REMOTE 0x00000010
- #define MIPS_CACHE_PINDEX 0x00000020
- struct cpuinfo_mips {
- unsigned long asid_cache;
- #ifdef CONFIG_MIPS_ASID_BITS_VARIABLE
- unsigned long asid_mask;
- #endif
-
- unsigned long ases;
- unsigned long long options;
- unsigned int udelay_val;
- unsigned int processor_id;
- unsigned int fpu_id;
- unsigned int fpu_csr31;
- unsigned int fpu_msk31;
- unsigned int msa_id;
- unsigned int cputype;
- int isa_level;
- int tlbsize;
- int tlbsizevtlb;
- int tlbsizeftlbsets;
- int tlbsizeftlbways;
- struct cache_desc icache;
- struct cache_desc dcache;
- struct cache_desc vcache;
- struct cache_desc scache;
- struct cache_desc tcache;
- int srsets;
- int package;
- int core;
- #ifdef CONFIG_64BIT
- int vmbits;
- #endif
- #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_CPU_MIPSR6)
-
- int vpe_id;
- #endif
- void *data;
- unsigned int watch_reg_count;
- unsigned int watch_reg_use_cnt;
- #define NUM_WATCH_REGS 4
- u16 watch_reg_masks[NUM_WATCH_REGS];
- unsigned int kscratch_mask;
-
- unsigned int writecombine;
-
- unsigned int htw_seq;
-
- struct guest_info guest;
- unsigned int gtoffset_mask;
- unsigned int guestid_mask;
- } __attribute__((aligned(SMP_CACHE_BYTES)));
- extern struct cpuinfo_mips cpu_data[];
- #define current_cpu_data cpu_data[smp_processor_id()]
- #define raw_current_cpu_data cpu_data[raw_smp_processor_id()]
- #define boot_cpu_data cpu_data[0]
- extern void cpu_probe(void);
- extern void cpu_report(void);
- extern const char *__cpu_name[];
- #define cpu_name_string() __cpu_name[raw_smp_processor_id()]
- struct seq_file;
- struct notifier_block;
- extern int register_proc_cpuinfo_notifier(struct notifier_block *nb);
- extern int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v);
- #define proc_cpuinfo_notifier(fn, pri) \
- ({ \
- static struct notifier_block fn##_nb = { \
- .notifier_call = fn, \
- .priority = pri \
- }; \
- \
- register_proc_cpuinfo_notifier(&fn##_nb); \
- })
- struct proc_cpuinfo_notifier_args {
- struct seq_file *m;
- unsigned long n;
- };
- #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_CPU_MIPSR6)
- # define cpu_vpe_id(cpuinfo) ((cpuinfo)->vpe_id)
- #else
- # define cpu_vpe_id(cpuinfo) ({ (void)cpuinfo; 0; })
- #endif
- static inline unsigned long cpu_asid_inc(void)
- {
- return 1 << CONFIG_MIPS_ASID_SHIFT;
- }
- static inline unsigned long cpu_asid_mask(struct cpuinfo_mips *cpuinfo)
- {
- #ifdef CONFIG_MIPS_ASID_BITS_VARIABLE
- return cpuinfo->asid_mask;
- #endif
- return ((1 << CONFIG_MIPS_ASID_BITS) - 1) << CONFIG_MIPS_ASID_SHIFT;
- }
- static inline void set_cpu_asid_mask(struct cpuinfo_mips *cpuinfo,
- unsigned long asid_mask)
- {
- #ifdef CONFIG_MIPS_ASID_BITS_VARIABLE
- cpuinfo->asid_mask = asid_mask;
- #endif
- }
- #endif
|