rtuDataAnalysis.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. #ifndef _ASM_IA64_PAL_H
  2. #define _ASM_IA64_PAL_H
  3. /*
  4. * Processor Abstraction Layer definitions.
  5. *
  6. * This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0
  7. * chapter 11 IA-64 Processor Abstraction Layer
  8. *
  9. * Copyright (C) 1998-2001 Hewlett-Packard Co
  10. * David Mosberger-Tang <davidm@hpl.hp.com>
  11. * Stephane Eranian <eranian@hpl.hp.com>
  12. * Copyright (C) 1999 VA Linux Systems
  13. * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  14. * Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
  15. * Copyright (C) 2008 Silicon Graphics, Inc. (SGI)
  16. *
  17. * 99/10/01 davidm Make sure we pass zero for reserved parameters.
  18. * 00/03/07 davidm Updated pal_cache_flush() to be in sync with PAL v2.6.
  19. * 00/03/23 cfleck Modified processor min-state save area to match updated PAL & SAL info
  20. * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added
  21. * 00/05/25 eranian Support for stack calls, and static physical calls
  22. * 00/06/18 eranian Support for stacked physical calls
  23. * 06/10/26 rja Support for Intel Itanium Architecture Software Developer's
  24. * Manual Rev 2.2 (Jan 2006)
  25. */
  26. /*
  27. * Note that some of these calls use a static-register only calling
  28. * convention which has nothing to do with the regular calling
  29. * convention.
  30. */
  31. #define PAL_CACHE_FLUSH 1 /* flush i/d cache */
  32. #define PAL_CACHE_INFO 2 /* get detailed i/d cache info */
  33. #define PAL_CACHE_INIT 3 /* initialize i/d cache */
  34. #define PAL_CACHE_SUMMARY 4 /* get summary of cache hierarchy */
  35. #define PAL_MEM_ATTRIB 5 /* list supported memory attributes */
  36. #define PAL_PTCE_INFO 6 /* purge TLB info */
  37. #define PAL_VM_INFO 7 /* return supported virtual memory features */
  38. #define PAL_VM_SUMMARY 8 /* return summary on supported vm features */
  39. #define PAL_BUS_GET_FEATURES 9 /* return processor bus interface features settings */
  40. #define PAL_BUS_SET_FEATURES 10 /* set processor bus features */
  41. #define PAL_DEBUG_INFO 11 /* get number of debug registers */
  42. #define PAL_FIXED_ADDR 12 /* get fixed component of processors's directed address */
  43. #define PAL_FREQ_BASE 13 /* base frequency of the platform */
  44. #define PAL_FREQ_RATIOS 14 /* ratio of processor, bus and ITC frequency */
  45. #define PAL_PERF_MON_INFO 15 /* return performance monitor info */
  46. #define PAL_PLATFORM_ADDR 16 /* set processor interrupt block and IO port space addr */
  47. #define PAL_PROC_GET_FEATURES 17 /* get configurable processor features & settings */
  48. #define PAL_PROC_SET_FEATURES 18 /* enable/disable configurable processor features */
  49. #define PAL_RSE_INFO 19 /* return rse information */
  50. #define PAL_VERSION 20 /* return version of PAL code */
  51. #define PAL_MC_CLEAR_LOG 21 /* clear all processor log info */
  52. #define PAL_MC_DRAIN 22 /* drain operations which could result in an MCA */
  53. #define PAL_MC_EXPECTED 23 /* set/reset expected MCA indicator */
  54. #define PAL_MC_DYNAMIC_STATE 24 /* get processor dynamic state */
  55. #define PAL_MC_ERROR_INFO 25 /* get processor MCA info and static state */
  56. #define PAL_MC_RESUME 26 /* Return to interrupted process */
  57. #define PAL_MC_REGISTER_MEM 27 /* Register memory for PAL to use during MCAs and inits */
  58. #define PAL_HALT 28 /* enter the low power HALT state */
  59. #define PAL_HALT_LIGHT 29 /* enter the low power light halt state*/
  60. #define PAL_COPY_INFO 30 /* returns info needed to relocate PAL */
  61. #define PAL_CACHE_LINE_INIT 31 /* init tags & data of cache line */
  62. #define PAL_PMI_ENTRYPOINT 32 /* register PMI memory entry points with the processor */
  63. #define PAL_ENTER_IA_32_ENV 33 /* enter IA-32 system environment */
  64. #define PAL_VM_PAGE_SIZE 34 /* return vm TC and page walker page sizes */
  65. #define PAL_MEM_FOR_TEST 37 /* get amount of memory needed for late processor test */
  66. #define PAL_CACHE_PROT_INFO 38 /* get i/d cache protection info */
  67. #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/
  68. #define PAL_SHUTDOWN 40 /* enter processor shutdown state */
  69. #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
  70. #define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
  71. #define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */
  72. #define PAL_GET_HW_POLICY 48 /* Get current hardware resource sharing policy */
  73. #define PAL_SET_HW_POLICY 49 /* Set current hardware resource sharing policy */
  74. #define PAL_VP_INFO 50 /* Information about virtual processor features */
  75. #define PAL_MC_HW_TRACKING 51 /* Hardware tracking status */
  76. #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
  77. #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
  78. #define PAL_TEST_PROC 258 /* perform late processor self-test */
  79. #define PAL_CACHE_READ 259 /* read tag & data of cacheline for diagnostic testing */
  80. #define PAL_CACHE_WRITE 260 /* write tag & data of cacheline for diagnostic testing */
  81. #define PAL_VM_TR_READ 261 /* read contents of translation register */
  82. #define PAL_GET_PSTATE 262 /* get the current P-state */
  83. #define PAL_SET_PSTATE 263 /* set the P-state */
  84. #define PAL_BRAND_INFO 274 /* Processor branding information */
  85. #define PAL_GET_PSTATE_TYPE_LASTSET 0
  86. #define PAL_GET_PSTATE_TYPE_AVGANDRESET 1
  87. #define PAL_GET_PSTATE_TYPE_AVGNORESET 2
  88. #define PAL_GET_PSTATE_TYPE_INSTANT 3
  89. #define PAL_MC_ERROR_INJECT 276 /* Injects processor error or returns injection capabilities */
  90. #ifndef __ASSEMBLY__
  91. #include <linux/types.h>
  92. #include <asm/fpu.h>
  93. /*
  94. * Data types needed to pass information into PAL procedures and
  95. * interpret information returned by them.
  96. */
  97. /* Return status from the PAL procedure */
  98. typedef s64 pal_status_t;
  99. #define PAL_STATUS_SUCCESS 0 /* No error */
  100. #define PAL_STATUS_UNIMPLEMENTED (-1) /* Unimplemented procedure */
  101. #define PAL_STATUS_EINVAL (-2) /* Invalid argument */
  102. #define PAL_STATUS_ERROR (-3) /* Error */
  103. #define PAL_STATUS_CACHE_INIT_FAIL (-4) /* Could not initialize the
  104. * specified level and type of
  105. * cache without sideeffects
  106. * and "restrict" was 1
  107. */
  108. #define PAL_STATUS_REQUIRES_MEMORY (-9) /* Call requires PAL memory buffer */
  109. /* Processor cache level in the hierarchy */
  110. typedef u64 pal_cache_level_t;
  111. #define PAL_CACHE_LEVEL_L0 0 /* L0 */
  112. #define PAL_CACHE_LEVEL_L1 1 /* L1 */
  113. #define PAL_CACHE_LEVEL_L2 2 /* L2 */
  114. /* Processor cache type at a particular level in the hierarchy */
  115. typedef u64 pal_cache_type_t;
  116. #define PAL_CACHE_TYPE_INSTRUCTION 1 /* Instruction cache */
  117. #define PAL_CACHE_TYPE_DATA 2 /* Data or unified cache */
  118. #define PAL_CACHE_TYPE_INSTRUCTION_DATA 3 /* Both Data & Instruction */
  119. #define PAL_CACHE_FLUSH_INVALIDATE 1 /* Invalidate clean lines */
  120. #define PAL_CACHE_FLUSH_CHK_INTRS 2 /* check for interrupts/mc while flushing */
  121. /* Processor cache line size in bytes */
  122. typedef int pal_cache_line_size_t;
  123. /* Processor cache line state */
  124. typedef u64 pal_cache_line_state_t;
  125. #define PAL_CACHE_LINE_STATE_INVALID 0 /* Invalid */
  126. #define PAL_CACHE_LINE_STATE_SHARED 1 /* Shared */
  127. #define PAL_CACHE_LINE_STATE_EXCLUSIVE 2 /* Exclusive */
  128. #define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */
  129. typedef struct pal_freq_ratio {
  130. u32 den, num; /* numerator & denominator */
  131. } itc_ratio, proc_ratio;
  132. typedef union pal_cache_config_info_1_s {
  133. struct {
  134. u64 u : 1, /* 0 Unified cache ? */
  135. at : 2, /* 2-1 Cache mem attr*/
  136. reserved : 5, /* 7-3 Reserved */
  137. associativity : 8, /* 16-8 Associativity*/
  138. line_size : 8, /* 23-17 Line size */
  139. stride : 8, /* 31-24 Stride */
  140. store_latency : 8, /*39-32 Store latency*/
  141. load_latency : 8, /* 47-40 Load latency*/
  142. store_hints : 8, /* 55-48 Store hints*/
  143. load_hints : 8; /* 63-56 Load hints */
  144. } pcci1_bits;
  145. u64 pcci1_data;
  146. } pal_cache_config_info_1_t;
  147. typedef union pal_cache_config_info_2_s {
  148. struct {
  149. u32 cache_size; /*cache size in bytes*/
  150. u32 alias_boundary : 8, /* 39-32 aliased addr
  151. * separation for max
  152. * performance.
  153. */
  154. tag_ls_bit : 8, /* 47-40 LSb of addr*/
  155. tag_ms_bit : 8, /* 55-48 MSb of addr*/
  156. reserved : 8; /* 63-56 Reserved */
  157. } pcci2_bits;
  158. u64 pcci2_data;
  159. } pal_cache_config_info_2_t;
  160. typedef struct pal_cache_config_info_s {
  161. pal_status_t pcci_status;
  162. pal_cache_config_info_1_t pcci_info_1;
  163. pal_cache_config_info_2_t pcci_info_2;
  164. u64 pcci_reserved;
  165. } pal_cache_config_info_t;
  166. #define pcci_ld_hints pcci_info_1.pcci1_bits.load_hints
  167. #define pcci_st_hints pcci_info_1.pcci1_bits.store_hints
  168. #define pcci_ld_latency pcci_info_1.pcci1_bits.load_latency
  169. #define pcci_st_latency pcci_info_1.pcci1_bits.store_latency
  170. #define pcci_stride pcci_info_1.pcci1_bits.stride
  171. #define pcci_line_size pcci_info_1.pcci1_bits.line_size
  172. #define pcci_assoc pcci_info_1.pcci1_bits.associativity
  173. #define pcci_cache_attr pcci_info_1.pcci1_bits.at
  174. #define pcci_unified pcci_info_1.pcci1_bits.u
  175. #define pcci_tag_msb pcci_info_2.pcci2_bits.tag_ms_bit
  176. #define pcci_tag_lsb pcci_info_2.pcci2_bits.tag_ls_bit
  177. #define pcci_alias_boundary pcci_info_2.pcci2_bits.alias_boundary
  178. #define pcci_cache_size pcci_info_2.pcci2_bits.cache_size
  179. /* Possible values for cache attributes */
  180. #define PAL_CACHE_ATTR_WT 0 /* Write through cache */
  181. #define PAL_CACHE_ATTR_WB 1 /* Write back cache */
  182. #define PAL_CACHE_ATTR_WT_OR_WB 2 /* Either write thru or write
  183. * back depending on TLB
  184. * memory attributes