cpu-info.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1994 Waldorf GMBH
  7. * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle
  8. * Copyright (C) 1996 Paul M. Antoine
  9. * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  10. */
  11. #ifndef __ASM_CPU_INFO_H
  12. #define __ASM_CPU_INFO_H
  13. #include <linux/config.h>
  14. #include <asm/cache.h>
  15. #ifdef CONFIG_SGI_IP27
  16. #include <asm/sn/types.h>
  17. #endif
  18. /*
  19. * Descriptor for a cache
  20. */
  21. struct cache_desc {
  22. unsigned short linesz; /* Size of line in bytes */
  23. unsigned short ways; /* Number of ways */
  24. unsigned short sets; /* Number of lines per set */
  25. unsigned int waysize; /* Bytes per way */
  26. unsigned int waybit; /* Bits to select in a cache set */
  27. unsigned int flags; /* Flags describing cache properties */
  28. };
  29. /*
  30. * Flag definitions
  31. */
  32. #define MIPS_CACHE_NOT_PRESENT 0x00000001
  33. #define MIPS_CACHE_VTAG 0x00000002 /* Virtually tagged cache */
  34. #define MIPS_CACHE_ALIASES 0x00000004 /* Cache could have aliases */
  35. #define MIPS_CACHE_IC_F_DC 0x00000008 /* Ic can refill from D-cache */
  36. #define MIPS_IC_SNOOPS_REMOTE 0x00000010 /* Ic snoops remote stores */
  37. struct cpuinfo_mips {
  38. unsigned long udelay_val;
  39. unsigned long asid_cache;
  40. #if defined(CONFIG_SGI_IP27)
  41. // cpuid_t p_cpuid; /* PROM assigned cpuid */
  42. cnodeid_t p_nodeid; /* my node ID in compact-id-space */
  43. nasid_t p_nasid; /* my node ID in numa-as-id-space */
  44. unsigned char p_slice; /* Physical position on node board */
  45. #endif
  46. #if 0
  47. unsigned long loops_per_sec;
  48. unsigned long ipi_count;
  49. unsigned long irq_attempt[NR_IRQS];
  50. unsigned long smp_local_irq_count;
  51. unsigned long prof_multiplier;
  52. unsigned long prof_counter;
  53. #endif
  54. /*
  55. * Capability and feature descriptor structure for MIPS CPU
  56. */
  57. unsigned long options;
  58. unsigned int processor_id;
  59. unsigned int fpu_id;
  60. unsigned int cputype;
  61. int isa_level;
  62. int tlbsize;
  63. struct cache_desc icache; /* Primary I-cache */
  64. struct cache_desc dcache; /* Primary D or combined I/D cache */
  65. struct cache_desc scache; /* Secondary cache */
  66. struct cache_desc tcache; /* Tertiary/split secondary cache */
  67. void *data; /* Additional data */
  68. } __attribute__((aligned(SMP_CACHE_BYTES)));
  69. extern struct cpuinfo_mips cpu_data[];
  70. #define current_cpu_data cpu_data[smp_processor_id()]
  71. extern void cpu_probe(void);
  72. extern void cpu_report(void);
  73. #endif /* __ASM_CPU_INFO_H */