Path: blob/master/arch/mips/include/asm/cpu-info.h
17302 views
/*1* This file is subject to the terms and conditions of the GNU General Public2* License. See the file "COPYING" in the main directory of this archive3* for more details.4*5* Copyright (C) 1994 Waldorf GMBH6* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle7* Copyright (C) 1996 Paul M. Antoine8* Copyright (C) 1999, 2000 Silicon Graphics, Inc.9* Copyright (C) 2004 Maciej W. Rozycki10*/11#ifndef __ASM_CPU_INFO_H12#define __ASM_CPU_INFO_H1314#include <linux/types.h>1516#include <asm/cache.h>1718/*19* Descriptor for a cache20*/21struct cache_desc {22unsigned int waysize; /* Bytes per way */23unsigned short sets; /* Number of lines per set */24unsigned char ways; /* Number of ways */25unsigned char linesz; /* Size of line in bytes */26unsigned char waybit; /* Bits to select in a cache set */27unsigned char flags; /* Flags describing cache properties */28};2930/*31* Flag definitions32*/33#define MIPS_CACHE_NOT_PRESENT 0x0000000134#define MIPS_CACHE_VTAG 0x00000002 /* Virtually tagged cache */35#define MIPS_CACHE_ALIASES 0x00000004 /* Cache could have aliases */36#define MIPS_CACHE_IC_F_DC 0x00000008 /* Ic can refill from D-cache */37#define MIPS_IC_SNOOPS_REMOTE 0x00000010 /* Ic snoops remote stores */38#define MIPS_CACHE_PINDEX 0x00000020 /* Physically indexed cache */3940struct cpuinfo_mips {41unsigned int udelay_val;42unsigned int asid_cache;4344/*45* Capability and feature descriptor structure for MIPS CPU46*/47unsigned long options;48unsigned long ases;49unsigned int processor_id;50unsigned int fpu_id;51unsigned int cputype;52int isa_level;53int tlbsize;54struct cache_desc icache; /* Primary I-cache */55struct cache_desc dcache; /* Primary D or combined I/D cache */56struct cache_desc scache; /* Secondary cache */57struct cache_desc tcache; /* Tertiary/split secondary cache */58int srsets; /* Shadow register sets */59int core; /* physical core number */60#ifdef CONFIG_64BIT61int vmbits; /* Virtual memory size in bits */62#endif63#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)64/*65* In the MIPS MT "SMTC" model, each TC is considered66* to be a "CPU" for the purposes of scheduling, but67* exception resources, ASID spaces, etc, are common68* to all TCs within the same VPE.69*/70int vpe_id; /* Virtual Processor number */71#endif72#ifdef CONFIG_MIPS_MT_SMTC73int tc_id; /* Thread Context number */74#endif75void *data; /* Additional data */76unsigned int watch_reg_count; /* Number that exist */77unsigned int watch_reg_use_cnt; /* Usable by ptrace */78#define NUM_WATCH_REGS 479u16 watch_reg_masks[NUM_WATCH_REGS];80unsigned int kscratch_mask; /* Usable KScratch mask. */81} __attribute__((aligned(SMP_CACHE_BYTES)));8283extern struct cpuinfo_mips cpu_data[];84#define current_cpu_data cpu_data[smp_processor_id()]85#define raw_current_cpu_data cpu_data[raw_smp_processor_id()]8687extern void cpu_probe(void);88extern void cpu_report(void);8990extern const char *__cpu_name[];91#define cpu_name_string() __cpu_name[smp_processor_id()]9293#endif /* __ASM_CPU_INFO_H */949596