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