cpu-info.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. * Copyright (C) 2004 Maciej W. Rozycki
  11. */
  12. #ifndef __ASM_CPU_INFO_H
  13. #define __ASM_CPU_INFO_H
  14. #include <linux/config.h>
  15. #include <asm/cache.h>
  16. #ifdef CONFIG_SGI_IP27
  17. #include <asm/sn/types.h>
  18. #endif
  19. /*
  20. * Descriptor for a cache
  21. */
  22. struct cache_desc {
  23. unsigned short linesz; /* Size of line in bytes */
  24. unsigned short ways; /* Number of ways */
  25. unsigned short sets; /* Number of lines per set */
  26. unsigned int waysize; /* Bytes per way */
  27. unsigned int waybit; /* Bits to select in a cache set */
  28. unsigned int flags; /* Flags describing cache properties */
  29. };
  30. /*
  31. * Flag definitions
  32. */
  33. #define MIPS_CACHE_NOT_PRESENT 0x00000001
  34. #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 */
  39. struct cpuinfo_mips {
  40. unsigned long udelay_val;
  41. unsigned long asid_cache;
  42. #if defined(CONFIG_SGI_IP27)
  43. // cpuid_t p_cpuid; /* PROM assigned cpuid */
  44. cnodeid_t p_nodeid; /* my node ID in compact-id-space */
  45. nasid_t p_nasid; /* my node ID in numa-as-id-space */
  46. unsigned char p_slice; /* Physical position on node board */
  47. #endif
  48. #if 0
  49. unsigned long loops_per_sec;
  50. unsigned long ipi_count;
  51. unsigned long irq_attempt[NR_IRQS];
  52. unsigned long smp_local_irq_count;
  53. unsigned long prof_multiplier;
  54. unsigned long prof_counter;
  55. #endif
  56. /*
  57. * Capability and feature descriptor structure for MIPS CPU
  58. */
  59. unsigned long options;
  60. unsigned long ases;
  61. unsigned int processor_id;
  62. unsigned int fpu_id;
  63. unsigned int cputype;
  64. int isa_level;
  65. int tlbsize;
  66. struct cache_desc icache; /* Primary I-cache */
  67. struct cache_desc dcache; /* Primary D or combined I/D cache */
  68. struct cache_desc scache; /* Secondary cache */
  69. struct cache_desc tcache; /* Tertiary/split secondary cache */
  70. #if defined(CONFIG_MIPS_MT_SMTC)
  71. /*
  72. * In the MIPS MT "SMTC" model, each TC is considered
  73. * to be a "CPU" for the purposes of scheduling, but
  74. * exception resources, ASID spaces, etc, are common
  75. * to all TCs within the same VPE.
  76. */
  77. int vpe_id; /* Virtual Processor number */
  78. int tc_id; /* Thread Context number */
  79. #endif /* CONFIG_MIPS_MT */
  80. void *data; /* Additional data */
  81. } __attribute__((aligned(SMP_CACHE_BYTES)));
  82. extern struct cpuinfo_mips cpu_data[];
  83. #define current_cpu_data cpu_data[smp_processor_id()]
  84. extern void cpu_probe(void);
  85. extern void cpu_report(void);
  86. #endif /* __ASM_CPU_INFO_H */