cpu-info.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. 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. void *data; /* Additional data */
  70. } __attribute__((aligned(SMP_CACHE_BYTES)));
  71. extern struct cpuinfo_mips cpu_data[];
  72. #define current_cpu_data cpu_data[smp_processor_id()]
  73. extern void cpu_probe(void);
  74. extern void cpu_report(void);
  75. #endif /* __ASM_CPU_INFO_H */