pal.h 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692
  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. *
  16. * 99/10/01 davidm Make sure we pass zero for reserved parameters.
  17. * 00/03/07 davidm Updated pal_cache_flush() to be in sync with PAL v2.6.
  18. * 00/03/23 cfleck Modified processor min-state save area to match updated PAL & SAL info
  19. * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added
  20. * 00/05/25 eranian Support for stack calls, and static physical calls
  21. * 00/06/18 eranian Support for stacked physical calls
  22. */
  23. /*
  24. * Note that some of these calls use a static-register only calling
  25. * convention which has nothing to do with the regular calling
  26. * convention.
  27. */
  28. #define PAL_CACHE_FLUSH 1 /* flush i/d cache */
  29. #define PAL_CACHE_INFO 2 /* get detailed i/d cache info */
  30. #define PAL_CACHE_INIT 3 /* initialize i/d cache */
  31. #define PAL_CACHE_SUMMARY 4 /* get summary of cache heirarchy */
  32. #define PAL_MEM_ATTRIB 5 /* list supported memory attributes */
  33. #define PAL_PTCE_INFO 6 /* purge TLB info */
  34. #define PAL_VM_INFO 7 /* return supported virtual memory features */
  35. #define PAL_VM_SUMMARY 8 /* return summary on supported vm features */
  36. #define PAL_BUS_GET_FEATURES 9 /* return processor bus interface features settings */
  37. #define PAL_BUS_SET_FEATURES 10 /* set processor bus features */
  38. #define PAL_DEBUG_INFO 11 /* get number of debug registers */
  39. #define PAL_FIXED_ADDR 12 /* get fixed component of processors's directed address */
  40. #define PAL_FREQ_BASE 13 /* base frequency of the platform */
  41. #define PAL_FREQ_RATIOS 14 /* ratio of processor, bus and ITC frequency */
  42. #define PAL_PERF_MON_INFO 15 /* return performance monitor info */
  43. #define PAL_PLATFORM_ADDR 16 /* set processor interrupt block and IO port space addr */
  44. #define PAL_PROC_GET_FEATURES 17 /* get configurable processor features & settings */
  45. #define PAL_PROC_SET_FEATURES 18 /* enable/disable configurable processor features */
  46. #define PAL_RSE_INFO 19 /* return rse information */
  47. #define PAL_VERSION 20 /* return version of PAL code */
  48. #define PAL_MC_CLEAR_LOG 21 /* clear all processor log info */
  49. #define PAL_MC_DRAIN 22 /* drain operations which could result in an MCA */
  50. #define PAL_MC_EXPECTED 23 /* set/reset expected MCA indicator */
  51. #define PAL_MC_DYNAMIC_STATE 24 /* get processor dynamic state */
  52. #define PAL_MC_ERROR_INFO 25 /* get processor MCA info and static state */
  53. #define PAL_MC_RESUME 26 /* Return to interrupted process */
  54. #define PAL_MC_REGISTER_MEM 27 /* Register memory for PAL to use during MCAs and inits */
  55. #define PAL_HALT 28 /* enter the low power HALT state */
  56. #define PAL_HALT_LIGHT 29 /* enter the low power light halt state*/
  57. #define PAL_COPY_INFO 30 /* returns info needed to relocate PAL */
  58. #define PAL_CACHE_LINE_INIT 31 /* init tags & data of cache line */
  59. #define PAL_PMI_ENTRYPOINT 32 /* register PMI memory entry points with the processor */
  60. #define PAL_ENTER_IA_32_ENV 33 /* enter IA-32 system environment */
  61. #define PAL_VM_PAGE_SIZE 34 /* return vm TC and page walker page sizes */
  62. #define PAL_MEM_FOR_TEST 37 /* get amount of memory needed for late processor test */
  63. #define PAL_CACHE_PROT_INFO 38 /* get i/d cache protection info */
  64. #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/
  65. #define PAL_SHUTDOWN 40 /* enter processor shutdown state */
  66. #define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */
  67. #define PAL_LOGICAL_TO_PHYSICAL 42 /* returns information on logical to physical processor mapping */
  68. #define PAL_CACHE_SHARED_INFO 43 /* returns information on caches shared by logical processor */
  69. #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */
  70. #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */
  71. #define PAL_TEST_PROC 258 /* perform late processor self-test */
  72. #define PAL_CACHE_READ 259 /* read tag & data of cacheline for diagnostic testing */
  73. #define PAL_CACHE_WRITE 260 /* write tag & data of cacheline for diagnostic testing */
  74. #define PAL_VM_TR_READ 261 /* read contents of translation register */
  75. #define PAL_GET_PSTATE 262 /* get the current P-state */
  76. #define PAL_SET_PSTATE 263 /* set the P-state */
  77. #define PAL_BRAND_INFO 274 /* Processor branding information */
  78. #ifndef __ASSEMBLY__
  79. #include <linux/types.h>
  80. #include <asm/fpu.h>
  81. /*
  82. * Data types needed to pass information into PAL procedures and
  83. * interpret information returned by them.
  84. */
  85. /* Return status from the PAL procedure */
  86. typedef s64 pal_status_t;
  87. #define PAL_STATUS_SUCCESS 0 /* No error */
  88. #define PAL_STATUS_UNIMPLEMENTED (-1) /* Unimplemented procedure */
  89. #define PAL_STATUS_EINVAL (-2) /* Invalid argument */
  90. #define PAL_STATUS_ERROR (-3) /* Error */
  91. #define PAL_STATUS_CACHE_INIT_FAIL (-4) /* Could not initialize the
  92. * specified level and type of
  93. * cache without sideeffects
  94. * and "restrict" was 1
  95. */
  96. /* Processor cache level in the heirarchy */
  97. typedef u64 pal_cache_level_t;
  98. #define PAL_CACHE_LEVEL_L0 0 /* L0 */
  99. #define PAL_CACHE_LEVEL_L1 1 /* L1 */
  100. #define PAL_CACHE_LEVEL_L2 2 /* L2 */
  101. /* Processor cache type at a particular level in the heirarchy */
  102. typedef u64 pal_cache_type_t;
  103. #define PAL_CACHE_TYPE_INSTRUCTION 1 /* Instruction cache */
  104. #define PAL_CACHE_TYPE_DATA 2 /* Data or unified cache */
  105. #define PAL_CACHE_TYPE_INSTRUCTION_DATA 3 /* Both Data & Instruction */
  106. #define PAL_CACHE_FLUSH_INVALIDATE 1 /* Invalidate clean lines */
  107. #define PAL_CACHE_FLUSH_CHK_INTRS 2 /* check for interrupts/mc while flushing */
  108. /* Processor cache line size in bytes */
  109. typedef int pal_cache_line_size_t;
  110. /* Processor cache line state */
  111. typedef u64 pal_cache_line_state_t;
  112. #define PAL_CACHE_LINE_STATE_INVALID 0 /* Invalid */
  113. #define PAL_CACHE_LINE_STATE_SHARED 1 /* Shared */
  114. #define PAL_CACHE_LINE_STATE_EXCLUSIVE 2 /* Exclusive */
  115. #define PAL_CACHE_LINE_STATE_MODIFIED 3 /* Modified */
  116. typedef struct pal_freq_ratio {
  117. u32 den, num; /* numerator & denominator */
  118. } itc_ratio, proc_ratio;
  119. typedef union pal_cache_config_info_1_s {
  120. struct {
  121. u64 u : 1, /* 0 Unified cache ? */
  122. at : 2, /* 2-1 Cache mem attr*/
  123. reserved : 5, /* 7-3 Reserved */
  124. associativity : 8, /* 16-8 Associativity*/
  125. line_size : 8, /* 23-17 Line size */
  126. stride : 8, /* 31-24 Stride */
  127. store_latency : 8, /*39-32 Store latency*/
  128. load_latency : 8, /* 47-40 Load latency*/
  129. store_hints : 8, /* 55-48 Store hints*/
  130. load_hints : 8; /* 63-56 Load hints */
  131. } pcci1_bits;
  132. u64 pcci1_data;
  133. } pal_cache_config_info_1_t;
  134. typedef union pal_cache_config_info_2_s {
  135. struct {
  136. u32 cache_size; /*cache size in bytes*/
  137. u32 alias_boundary : 8, /* 39-32 aliased addr
  138. * separation for max
  139. * performance.
  140. */
  141. tag_ls_bit : 8, /* 47-40 LSb of addr*/
  142. tag_ms_bit : 8, /* 55-48 MSb of addr*/
  143. reserved : 8; /* 63-56 Reserved */
  144. } pcci2_bits;
  145. u64 pcci2_data;
  146. } pal_cache_config_info_2_t;
  147. typedef struct pal_cache_config_info_s {
  148. pal_status_t pcci_status;
  149. pal_cache_config_info_1_t pcci_info_1;
  150. pal_cache_config_info_2_t pcci_info_2;
  151. u64 pcci_reserved;
  152. } pal_cache_config_info_t;
  153. #define pcci_ld_hints pcci_info_1.pcci1_bits.load_hints
  154. #define pcci_st_hints pcci_info_1.pcci1_bits.store_hints
  155. #define pcci_ld_latency pcci_info_1.pcci1_bits.load_latency
  156. #define pcci_st_latency pcci_info_1.pcci1_bits.store_latency
  157. #define pcci_stride pcci_info_1.pcci1_bits.stride
  158. #define pcci_line_size pcci_info_1.pcci1_bits.line_size
  159. #define pcci_assoc pcci_info_1.pcci1_bits.associativity
  160. #define pcci_cache_attr pcci_info_1.pcci1_bits.at
  161. #define pcci_unified pcci_info_1.pcci1_bits.u
  162. #define pcci_tag_msb pcci_info_2.pcci2_bits.tag_ms_bit
  163. #define pcci_tag_lsb pcci_info_2.pcci2_bits.tag_ls_bit
  164. #define pcci_alias_boundary pcci_info_2.pcci2_bits.alias_boundary
  165. #define pcci_cache_size pcci_info_2.pcci2_bits.cache_size
  166. /* Possible values for cache attributes */
  167. #define PAL_CACHE_ATTR_WT 0 /* Write through cache */
  168. #define PAL_CACHE_ATTR_WB 1 /* Write back cache */
  169. #define PAL_CACHE_ATTR_WT_OR_WB 2 /* Either write thru or write
  170. * back depending on TLB
  171. * memory attributes
  172. */
  173. /* Possible values for cache hints */
  174. #define PAL_CACHE_HINT_TEMP_1 0 /* Temporal level 1 */
  175. #define PAL_CACHE_HINT_NTEMP_1 1 /* Non-temporal level 1 */
  176. #define PAL_CACHE_HINT_NTEMP_ALL 3 /* Non-temporal all levels */
  177. /* Processor cache protection information */
  178. typedef union pal_cache_protection_element_u {
  179. u32 pcpi_data;
  180. struct {
  181. u32 data_bits : 8, /* # data bits covered by
  182. * each unit of protection
  183. */
  184. tagprot_lsb : 6, /* Least -do- */
  185. tagprot_msb : 6, /* Most Sig. tag address
  186. * bit that this
  187. * protection covers.
  188. */
  189. prot_bits : 6, /* # of protection bits */
  190. method : 4, /* Protection method */
  191. t_d : 2; /* Indicates which part
  192. * of the cache this
  193. * protection encoding
  194. * applies.
  195. */
  196. } pcp_info;
  197. } pal_cache_protection_element_t;
  198. #define pcpi_cache_prot_part pcp_info.t_d
  199. #define pcpi_prot_method pcp_info.method
  200. #define pcpi_prot_bits pcp_info.prot_bits
  201. #define pcpi_tagprot_msb pcp_info.tagprot_msb
  202. #define pcpi_tagprot_lsb pcp_info.tagprot_lsb
  203. #define pcpi_data_bits pcp_info.data_bits
  204. /* Processor cache part encodings */
  205. #define PAL_CACHE_PROT_PART_DATA 0 /* Data protection */
  206. #define PAL_CACHE_PROT_PART_TAG 1 /* Tag protection */
  207. #define PAL_CACHE_PROT_PART_TAG_DATA 2 /* Tag+data protection (tag is
  208. * more significant )
  209. */
  210. #define PAL_CACHE_PROT_PART_DATA_TAG 3 /* Data+tag protection (data is
  211. * more significant )
  212. */
  213. #define PAL_CACHE_PROT_PART_MAX 6
  214. typedef struct pal_cache_protection_info_s {
  215. pal_status_t pcpi_status;
  216. pal_cache_protection_element_t pcp_info[PAL_CACHE_PROT_PART_MAX];
  217. } pal_cache_protection_info_t;
  218. /* Processor cache protection method encodings */
  219. #define PAL_CACHE_PROT_METHOD_NONE 0 /* No protection */
  220. #define PAL_CACHE_PROT_METHOD_ODD_PARITY 1 /* Odd parity */
  221. #define PAL_CACHE_PROT_METHOD_EVEN_PARITY 2 /* Even parity */
  222. #define PAL_CACHE_PROT_METHOD_ECC 3 /* ECC protection */
  223. /* Processor cache line identification in the heirarchy */
  224. typedef union pal_cache_line_id_u {
  225. u64 pclid_data;
  226. struct {
  227. u64 cache_type : 8, /* 7-0 cache type */
  228. level : 8, /* 15-8 level of the
  229. * cache in the
  230. * heirarchy.
  231. */
  232. way : 8, /* 23-16 way in the set
  233. */
  234. part : 8, /* 31-24 part of the
  235. * cache
  236. */
  237. reserved : 32; /* 63-32 is reserved*/
  238. } pclid_info_read;
  239. struct {
  240. u64 cache_type : 8, /* 7-0 cache type */
  241. level : 8, /* 15-8 level of the
  242. * cache in the
  243. * heirarchy.
  244. */
  245. way : 8, /* 23-16 way in the set
  246. */
  247. part : 8, /* 31-24 part of the
  248. * cache
  249. */
  250. mesi : 8, /* 39-32 cache line
  251. * state
  252. */
  253. start : 8, /* 47-40 lsb of data to
  254. * invert
  255. */
  256. length : 8, /* 55-48 #bits to
  257. * invert
  258. */
  259. trigger : 8; /* 63-56 Trigger error
  260. * by doing a load
  261. * after the write
  262. */
  263. } pclid_info_write;
  264. } pal_cache_line_id_u_t;
  265. #define pclid_read_part pclid_info_read.part
  266. #define pclid_read_way pclid_info_read.way
  267. #define pclid_read_level pclid_info_read.level
  268. #define pclid_read_cache_type pclid_info_read.cache_type
  269. #define pclid_write_trigger pclid_info_write.trigger
  270. #define pclid_write_length pclid_info_write.length
  271. #define pclid_write_start pclid_info_write.start
  272. #define pclid_write_mesi pclid_info_write.mesi
  273. #define pclid_write_part pclid_info_write.part
  274. #define pclid_write_way pclid_info_write.way
  275. #define pclid_write_level pclid_info_write.level
  276. #define pclid_write_cache_type pclid_info_write.cache_type
  277. /* Processor cache line part encodings */
  278. #define PAL_CACHE_LINE_ID_PART_DATA 0 /* Data */
  279. #define PAL_CACHE_LINE_ID_PART_TAG 1 /* Tag */
  280. #define PAL_CACHE_LINE_ID_PART_DATA_PROT 2 /* Data protection */
  281. #define PAL_CACHE_LINE_ID_PART_TAG_PROT 3 /* Tag protection */
  282. #define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT 4 /* Data+tag
  283. * protection
  284. */
  285. typedef struct pal_cache_line_info_s {
  286. pal_status_t pcli_status; /* Return status of the read cache line
  287. * info call.
  288. */
  289. u64 pcli_data; /* 64-bit data, tag, protection bits .. */
  290. u64 pcli_data_len; /* data length in bits */
  291. pal_cache_line_state_t pcli_cache_line_state; /* mesi state */
  292. } pal_cache_line_info_t;
  293. /* Machine Check related crap */
  294. /* Pending event status bits */
  295. typedef u64 pal_mc_pending_events_t;
  296. #define PAL_MC_PENDING_MCA (1 << 0)
  297. #define PAL_MC_PENDING_INIT (1 << 1)
  298. /* Error information type */
  299. typedef u64 pal_mc_info_index_t;
  300. #define PAL_MC_INFO_PROCESSOR 0 /* Processor */
  301. #define PAL_MC_INFO_CACHE_CHECK 1 /* Cache check */
  302. #define PAL_MC_INFO_TLB_CHECK 2 /* Tlb check */
  303. #define PAL_MC_INFO_BUS_CHECK 3 /* Bus check */
  304. #define PAL_MC_INFO_REQ_ADDR 4 /* Requestor address */
  305. #define PAL_MC_INFO_RESP_ADDR 5 /* Responder address */
  306. #define PAL_MC_INFO_TARGET_ADDR 6 /* Target address */
  307. #define PAL_MC_INFO_IMPL_DEP 7 /* Implementation
  308. * dependent
  309. */
  310. typedef struct pal_process_state_info_s {
  311. u64 reserved1 : 2,
  312. rz : 1, /* PAL_CHECK processor
  313. * rendezvous
  314. * successful.
  315. */
  316. ra : 1, /* PAL_CHECK attempted
  317. * a rendezvous.
  318. */
  319. me : 1, /* Distinct multiple
  320. * errors occurred
  321. */
  322. mn : 1, /* Min. state save
  323. * area has been
  324. * registered with PAL
  325. */
  326. sy : 1, /* Storage integrity
  327. * synched
  328. */
  329. co : 1, /* Continuable */
  330. ci : 1, /* MC isolated */
  331. us : 1, /* Uncontained storage
  332. * damage.
  333. */
  334. hd : 1, /* Non-essential hw
  335. * lost (no loss of
  336. * functionality)
  337. * causing the
  338. * processor to run in
  339. * degraded mode.
  340. */
  341. tl : 1, /* 1 => MC occurred
  342. * after an instr was
  343. * executed but before
  344. * the trap that
  345. * resulted from instr
  346. * execution was
  347. * generated.
  348. * (Trap Lost )
  349. */
  350. mi : 1, /* More information available
  351. * call PAL_MC_ERROR_INFO
  352. */
  353. pi : 1, /* Precise instruction pointer */
  354. pm : 1, /* Precise min-state save area */
  355. dy : 1, /* Processor dynamic
  356. * state valid
  357. */
  358. in : 1, /* 0 = MC, 1 = INIT */
  359. rs : 1, /* RSE valid */
  360. cm : 1, /* MC corrected */
  361. ex : 1, /* MC is expected */
  362. cr : 1, /* Control regs valid*/
  363. pc : 1, /* Perf cntrs valid */
  364. dr : 1, /* Debug regs valid */
  365. tr : 1, /* Translation regs
  366. * valid
  367. */
  368. rr : 1, /* Region regs valid */
  369. ar : 1, /* App regs valid */
  370. br : 1, /* Branch regs valid */
  371. pr : 1, /* Predicate registers
  372. * valid
  373. */
  374. fp : 1, /* fp registers valid*/
  375. b1 : 1, /* Preserved bank one
  376. * general registers
  377. * are valid
  378. */
  379. b0 : 1, /* Preserved bank zero
  380. * general registers
  381. * are valid
  382. */
  383. gr : 1, /* General registers
  384. * are valid
  385. * (excl. banked regs)
  386. */
  387. dsize : 16, /* size of dynamic
  388. * state returned
  389. * by the processor
  390. */
  391. reserved2 : 11,
  392. cc : 1, /* Cache check */
  393. tc : 1, /* TLB check */
  394. bc : 1, /* Bus check */
  395. rc : 1, /* Register file check */
  396. uc : 1; /* Uarch check */
  397. } pal_processor_state_info_t;
  398. typedef struct pal_cache_check_info_s {
  399. u64 op : 4, /* Type of cache
  400. * operation that
  401. * caused the machine
  402. * check.
  403. */
  404. level : 2, /* Cache level */
  405. reserved1 : 2,
  406. dl : 1, /* Failure in data part
  407. * of cache line
  408. */
  409. tl : 1, /* Failure in tag part
  410. * of cache line
  411. */
  412. dc : 1, /* Failure in dcache */
  413. ic : 1, /* Failure in icache */
  414. mesi : 3, /* Cache line state */
  415. mv : 1, /* mesi valid */
  416. way : 5, /* Way in which the
  417. * error occurred
  418. */
  419. wiv : 1, /* Way field valid */
  420. reserved2 : 1,
  421. dp : 1, /* Data poisoned on MBE */
  422. reserved3 : 8,
  423. index : 20, /* Cache line index */
  424. reserved4 : 2,
  425. is : 1, /* instruction set (1 == ia32) */
  426. iv : 1, /* instruction set field valid */
  427. pl : 2, /* privilege level */
  428. pv : 1, /* privilege level field valid */
  429. mcc : 1, /* Machine check corrected */
  430. tv : 1, /* Target address
  431. * structure is valid
  432. */
  433. rq : 1, /* Requester identifier
  434. * structure is valid
  435. */
  436. rp : 1, /* Responder identifier
  437. * structure is valid
  438. */
  439. pi : 1; /* Precise instruction pointer
  440. * structure is valid
  441. */
  442. } pal_cache_check_info_t;
  443. typedef struct pal_tlb_check_info_s {
  444. u64 tr_slot : 8, /* Slot# of TR where
  445. * error occurred
  446. */
  447. trv : 1, /* tr_slot field is valid */
  448. reserved1 : 1,
  449. level : 2, /* TLB level where failure occurred */
  450. reserved2 : 4,
  451. dtr : 1, /* Fail in data TR */
  452. itr : 1, /* Fail in inst TR */
  453. dtc : 1, /* Fail in data TC */
  454. itc : 1, /* Fail in inst. TC */
  455. op : 4, /* Cache operation */
  456. reserved3 : 30,
  457. is : 1, /* instruction set (1 == ia32) */
  458. iv : 1, /* instruction set field valid */
  459. pl : 2, /* privilege level */
  460. pv : 1, /* privilege level field valid */
  461. mcc : 1, /* Machine check corrected */
  462. tv : 1, /* Target address
  463. * structure is valid
  464. */
  465. rq : 1, /* Requester identifier
  466. * structure is valid
  467. */
  468. rp : 1, /* Responder identifier
  469. * structure is valid
  470. */
  471. pi : 1; /* Precise instruction pointer
  472. * structure is valid
  473. */
  474. } pal_tlb_check_info_t;
  475. typedef struct pal_bus_check_info_s {
  476. u64 size : 5, /* Xaction size */
  477. ib : 1, /* Internal bus error */
  478. eb : 1, /* External bus error */
  479. cc : 1, /* Error occurred
  480. * during cache-cache
  481. * transfer.
  482. */
  483. type : 8, /* Bus xaction type*/
  484. sev : 5, /* Bus error severity*/
  485. hier : 2, /* Bus hierarchy level */
  486. dp : 1, /* Data poisoned on MBE */
  487. bsi : 8, /* Bus error status
  488. * info
  489. */
  490. reserved2 : 22,
  491. is : 1, /* instruction set (1 == ia32) */
  492. iv : 1, /* instruction set field valid */
  493. pl : 2, /* privilege level */
  494. pv : 1, /* privilege level field valid */
  495. mcc : 1, /* Machine check corrected */
  496. tv : 1, /* Target address
  497. * structure is valid
  498. */
  499. rq : 1, /* Requester identifier
  500. * structure is valid
  501. */
  502. rp : 1, /* Responder identifier
  503. * structure is valid
  504. */
  505. pi : 1; /* Precise instruction pointer
  506. * structure is valid
  507. */
  508. } pal_bus_check_info_t;
  509. typedef struct pal_reg_file_check_info_s {
  510. u64 id : 4, /* Register file identifier */
  511. op : 4, /* Type of register
  512. * operation that
  513. * caused the machine
  514. * check.
  515. */
  516. reg_num : 7, /* Register number */
  517. rnv : 1, /* reg_num valid */
  518. reserved2 : 38,
  519. is : 1, /* instruction set (1 == ia32) */
  520. iv : 1, /* instruction set field valid */
  521. pl : 2, /* privilege level */
  522. pv : 1, /* privilege level field valid */
  523. mcc : 1, /* Machine check corrected */
  524. reserved3 : 3,
  525. pi : 1; /* Precise instruction pointer
  526. * structure is valid
  527. */
  528. } pal_reg_file_check_info_t;
  529. typedef struct pal_uarch_check_info_s {
  530. u64 sid : 5, /* Structure identification */
  531. level : 3, /* Level of failure */
  532. array_id : 4, /* Array identification */
  533. op : 4, /* Type of
  534. * operation that
  535. * caused the machine
  536. * check.
  537. */
  538. way : 6, /* Way of structure */
  539. wv : 1, /* way valid */
  540. xv : 1, /* index valid */
  541. reserved1 : 8,
  542. index : 8, /* Index or set of the uarch
  543. * structure that failed.
  544. */
  545. reserved2 : 24,
  546. is : 1, /* instruction set (1 == ia32) */
  547. iv : 1, /* instruction set field valid */
  548. pl : 2, /* privilege level */
  549. pv : 1, /* privilege level field valid */
  550. mcc : 1, /* Machine check corrected */
  551. tv : 1, /* Target address
  552. * structure is valid
  553. */
  554. rq : 1, /* Requester identifier
  555. * structure is valid
  556. */
  557. rp : 1, /* Responder identifier
  558. * structure is valid
  559. */
  560. pi : 1; /* Precise instruction pointer
  561. * structure is valid
  562. */
  563. } pal_uarch_check_info_t;
  564. typedef union pal_mc_error_info_u {
  565. u64 pmei_data;
  566. pal_processor_state_info_t pme_processor;
  567. pal_cache_check_info_t pme_cache;
  568. pal_tlb_check_info_t pme_tlb;
  569. pal_bus_check_info_t pme_bus;
  570. pal_reg_file_check_info_t pme_reg_file;
  571. pal_uarch_check_info_t pme_uarch;
  572. } pal_mc_error_info_t;
  573. #define pmci_proc_unknown_check pme_processor.uc
  574. #define pmci_proc_bus_check pme_processor.bc
  575. #define pmci_proc_tlb_check pme_processor.tc
  576. #define pmci_proc_cache_check pme_processor.cc
  577. #define pmci_proc_dynamic_state_size pme_processor.dsize
  578. #define pmci_proc_gpr_valid pme_processor.gr
  579. #define pmci_proc_preserved_bank0_gpr_valid pme_processor.b0
  580. #define pmci_proc_preserved_bank1_gpr_valid pme_processor.b1
  581. #define pmci_proc_fp_valid pme_processor.fp
  582. #define pmci_proc_predicate_regs_valid pme_processor.pr
  583. #define pmci_proc_branch_regs_valid pme_processor.br
  584. #define pmci_proc_app_regs_valid pme_processor.ar
  585. #define pmci_proc_region_regs_valid pme_processor.rr
  586. #define pmci_proc_translation_regs_valid pme_processor.tr
  587. #define pmci_proc_debug_regs_valid pme_processor.dr
  588. #define pmci_proc_perf_counters_valid pme_processor.pc
  589. #define pmci_proc_control_regs_valid pme_processor.cr
  590. #define pmci_proc_machine_check_expected pme_processor.ex
  591. #define pmci_proc_machine_check_corrected pme_processor.cm
  592. #define pmci_proc_rse_valid pme_processor.rs
  593. #define pmci_proc_machine_check_or_init pme_processor.in
  594. #define pmci_proc_dynamic_state_valid pme_processor.dy
  595. #define pmci_proc_operation pme_processor.op
  596. #define pmci_proc_trap_lost pme_processor.tl
  597. #define pmci_proc_hardware_damage pme_processor.hd
  598. #define pmci_proc_uncontained_storage_damage pme_processor.us
  599. #define pmci_proc_machine_check_isolated pme_processor.ci
  600. #define pmci_proc_continuable pme_processor.co
  601. #define pmci_proc_storage_intergrity_synced pme_processor.sy
  602. #define pmci_proc_min_state_save_area_regd pme_processor.mn
  603. #define pmci_proc_distinct_multiple_errors pme_processor.me
  604. #define pmci_proc_pal_attempted_rendezvous pme_processor.ra
  605. #define pmci_proc_pal_rendezvous_complete pme_processor.rz
  606. #define pmci_cache_level pme_cache.level
  607. #define pmci_cache_line_state pme_cache.mesi
  608. #define pmci_cache_line_state_valid pme_cache.mv
  609. #define pmci_cache_line_index pme_cache.index
  610. #define pmci_cache_instr_cache_fail pme_cache.ic
  611. #define pmci_cache_data_cache_fail pme_cache.dc
  612. #define pmci_cache_line_tag_fail pme_cache.tl
  613. #define pmci_cache_line_data_fail pme_cache.dl
  614. #define pmci_cache_operation pme_cache.op
  615. #define pmci_cache_way_valid pme_cache.wv
  616. #define pmci_cache_target_address_valid pme_cache.tv
  617. #define pmci_cache_way pme_cache.way
  618. #define pmci_cache_mc pme_cache.mc
  619. #define pmci_tlb_instr_translation_cache_fail pme_tlb.itc
  620. #define pmci_tlb_data_translation_cache_fail pme_tlb.dtc
  621. #define pmci_tlb_instr_translation_reg_fail pme_tlb.itr
  622. #define pmci_tlb_data_translation_reg_fail pme_tlb.dtr
  623. #define pmci_tlb_translation_reg_slot pme_tlb.tr_slot
  624. #define pmci_tlb_mc pme_tlb.mc
  625. #define pmci_bus_status_info pme_bus.bsi
  626. #define pmci_bus_req_address_valid pme_bus.rq
  627. #define pmci_bus_resp_address_valid pme_bus.rp
  628. #define pmci_bus_target_address_valid pme_bus.tv
  629. #define pmci_bus_error_severity pme_bus.sev
  630. #define pmci_bus_transaction_type pme_bus.type
  631. #define pmci_bus_cache_cache_transfer pme_bus.cc
  632. #define pmci_bus_transaction_size pme_bus.size
  633. #define pmci_bus_internal_error pme_bus.ib
  634. #define pmci_bus_external_error pme_bus.eb
  635. #define pmci_bus_mc pme_bus.mc
  636. /*
  637. * NOTE: this min_state_save area struct only includes the 1KB
  638. * architectural state save area. The other 3 KB is scratch space
  639. * for PAL.
  640. */
  641. typedef struct pal_min_state_area_s {
  642. u64 pmsa_nat_bits; /* nat bits for saved GRs */
  643. u64 pmsa_gr[15]; /* GR1 - GR15 */
  644. u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */
  645. u64 pmsa_bank1_gr[16]; /* GR16 - GR31 */
  646. u64 pmsa_pr; /* predicate registers */
  647. u64 pmsa_br0; /* branch register 0 */
  648. u64 pmsa_rsc; /* ar.rsc */
  649. u64 pmsa_iip; /* cr.iip */
  650. u64 pmsa_ipsr; /* cr.ipsr */
  651. u64 pmsa_ifs; /* cr.ifs */
  652. u64 pmsa_xip; /* previous iip */
  653. u64 pmsa_xpsr; /* previous psr */
  654. u64 pmsa_xfs; /* previous ifs */
  655. u64 pmsa_br1; /* branch register 1 */
  656. u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */
  657. } pal_min_state_area_t;
  658. struct ia64_pal_retval {
  659. /*
  660. * A zero status value indicates call completed without error.
  661. * A negative status value indicates reason of call failure.
  662. * A positive status value indicates success but an
  663. * informational value should be printed (e.g., "reboot for
  664. * change to take effect").
  665. */
  666. s64 status;
  667. u64 v0;
  668. u64 v1;
  669. u64 v2;
  670. };
  671. /*
  672. * Note: Currently unused PAL arguments are generally labeled
  673. * "reserved" so the value specified in the PAL documentation
  674. * (generally 0) MUST be passed. Reserved parameters are not optional
  675. * parameters.
  676. */
  677. extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
  678. extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
  679. extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
  680. extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
  681. extern void ia64_save_scratch_fpregs (struct ia64_fpreg *);
  682. extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
  683. #define PAL_CALL(iprv,a0,a1,a2,a3) do { \
  684. struct ia64_fpreg fr[6]; \
  685. ia64_save_scratch_fpregs(fr); \
  686. iprv = ia64_pal_call_static(a0, a1, a2, a3); \
  687. ia64_load_scratch_fpregs(fr); \
  688. } while (0)
  689. #define PAL_CALL_STK(iprv,a0,a1,a2,a3) do { \
  690. struct ia64_fpreg fr[6]; \
  691. ia64_save_scratch_fpregs(fr); \
  692. iprv = ia64_pal_call_stacked(a0, a1, a2, a3); \
  693. ia64_load_scratch_fpregs(fr); \
  694. } while (0)
  695. #define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do { \
  696. struct ia64_fpreg fr[6]; \
  697. ia64_save_scratch_fpregs(fr); \
  698. iprv = ia64_pal_call_phys_static(a0, a1, a2, a3); \
  699. ia64_load_scratch_fpregs(fr); \
  700. } while (0)
  701. #define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do { \
  702. struct ia64_fpreg fr[6]; \
  703. ia64_save_scratch_fpregs(fr); \
  704. iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3); \
  705. ia64_load_scratch_fpregs(fr); \
  706. } while (0)
  707. typedef int (*ia64_pal_handler) (u64, ...);
  708. extern ia64_pal_handler ia64_pal;
  709. extern void ia64_pal_handler_init (void *);
  710. extern ia64_pal_handler ia64_pal;
  711. extern pal_cache_config_info_t l0d_cache_config_info;
  712. extern pal_cache_config_info_t l0i_cache_config_info;
  713. extern pal_cache_config_info_t l1_cache_config_info;
  714. extern pal_cache_config_info_t l2_cache_config_info;
  715. extern pal_cache_protection_info_t l0d_cache_protection_info;
  716. extern pal_cache_protection_info_t l0i_cache_protection_info;
  717. extern pal_cache_protection_info_t l1_cache_protection_info;
  718. extern pal_cache_protection_info_t l2_cache_protection_info;
  719. extern pal_cache_config_info_t pal_cache_config_info_get(pal_cache_level_t,
  720. pal_cache_type_t);
  721. extern pal_cache_protection_info_t pal_cache_protection_info_get(pal_cache_level_t,
  722. pal_cache_type_t);
  723. extern void pal_error(int);
  724. /* Useful wrappers for the current list of pal procedures */
  725. typedef union pal_bus_features_u {
  726. u64 pal_bus_features_val;
  727. struct {
  728. u64 pbf_reserved1 : 29;
  729. u64 pbf_req_bus_parking : 1;
  730. u64 pbf_bus_lock_mask : 1;
  731. u64 pbf_enable_half_xfer_rate : 1;
  732. u64 pbf_reserved2 : 22;
  733. u64 pbf_disable_xaction_queueing : 1;
  734. u64 pbf_disable_resp_err_check : 1;
  735. u64 pbf_disable_berr_check : 1;
  736. u64 pbf_disable_bus_req_internal_err_signal : 1;
  737. u64 pbf_disable_bus_req_berr_signal : 1;
  738. u64 pbf_disable_bus_init_event_check : 1;
  739. u64 pbf_disable_bus_init_event_signal : 1;
  740. u64 pbf_disable_bus_addr_err_check : 1;
  741. u64 pbf_disable_bus_addr_err_signal : 1;
  742. u64 pbf_disable_bus_data_err_check : 1;
  743. } pal_bus_features_s;
  744. } pal_bus_features_u_t;
  745. extern void pal_bus_features_print (u64);
  746. /* Provide information about configurable processor bus features */
  747. static inline s64
  748. ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
  749. pal_bus_features_u_t *features_status,
  750. pal_bus_features_u_t *features_control)
  751. {
  752. struct ia64_pal_retval iprv;
  753. PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0);
  754. if (features_avail)
  755. features_avail->pal_bus_features_val = iprv.v0;
  756. if (features_status)
  757. features_status->pal_bus_features_val = iprv.v1;
  758. if (features_control)
  759. features_control->pal_bus_features_val = iprv.v2;
  760. return iprv.status;
  761. }
  762. /* Enables/disables specific processor bus features */
  763. static inline s64
  764. ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
  765. {
  766. struct ia64_pal_retval iprv;
  767. PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
  768. return iprv.status;
  769. }
  770. /* Get detailed cache information */
  771. static inline s64
  772. ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf)
  773. {
  774. struct ia64_pal_retval iprv;
  775. PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
  776. if (iprv.status == 0) {
  777. conf->pcci_status = iprv.status;
  778. conf->pcci_info_1.pcci1_data = iprv.v0;
  779. conf->pcci_info_2.pcci2_data = iprv.v1;
  780. conf->pcci_reserved = iprv.v2;
  781. }
  782. return iprv.status;
  783. }
  784. /* Get detailed cche protection information */
  785. static inline s64
  786. ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot)
  787. {
  788. struct ia64_pal_retval iprv;
  789. PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
  790. if (iprv.status == 0) {
  791. prot->pcpi_status = iprv.status;
  792. prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff;
  793. prot->pcp_info[1].pcpi_data = iprv.v0 >> 32;
  794. prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff;
  795. prot->pcp_info[3].pcpi_data = iprv.v1 >> 32;
  796. prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
  797. prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
  798. }
  799. return iprv.status;
  800. }
  801. /*
  802. * Flush the processor instruction or data caches. *PROGRESS must be
  803. * initialized to zero before calling this for the first time..
  804. */
  805. static inline s64
  806. ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
  807. {
  808. struct ia64_pal_retval iprv;
  809. PAL_CALL(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
  810. if (vector)
  811. *vector = iprv.v0;
  812. *progress = iprv.v1;
  813. return iprv.status;
  814. }
  815. /* Initialize the processor controlled caches */
  816. static inline s64
  817. ia64_pal_cache_init (u64 level, u64 cache_type, u64 rest)
  818. {
  819. struct ia64_pal_retval iprv;
  820. PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, rest);
  821. return iprv.status;
  822. }
  823. /* Initialize the tags and data of a data or unified cache line of
  824. * processor controlled cache to known values without the availability
  825. * of backing memory.
  826. */
  827. static inline s64
  828. ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
  829. {
  830. struct ia64_pal_retval iprv;
  831. PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
  832. return iprv.status;
  833. }
  834. /* Read the data and tag of a processor controlled cache line for diags */
  835. static inline s64
  836. ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
  837. {
  838. struct ia64_pal_retval iprv;
  839. PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data,
  840. physical_addr, 0);
  841. return iprv.status;
  842. }
  843. /* Return summary information about the heirarchy of caches controlled by the processor */
  844. static inline s64
  845. ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
  846. {
  847. struct ia64_pal_retval iprv;
  848. PAL_CALL(iprv, PAL_CACHE_SUMMARY, 0, 0, 0);
  849. if (cache_levels)
  850. *cache_levels = iprv.v0;
  851. if (unique_caches)
  852. *unique_caches = iprv.v1;
  853. return iprv.status;
  854. }
  855. /* Write the data and tag of a processor-controlled cache line for diags */
  856. static inline s64
  857. ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
  858. {
  859. struct ia64_pal_retval iprv;
  860. PAL_CALL_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data,
  861. physical_addr, data);
  862. return iprv.status;
  863. }
  864. /* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
  865. static inline s64
  866. ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
  867. u64 *buffer_size, u64 *buffer_align)
  868. {
  869. struct ia64_pal_retval iprv;
  870. PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
  871. if (buffer_size)
  872. *buffer_size = iprv.v0;
  873. if (buffer_align)
  874. *buffer_align = iprv.v1;
  875. return iprv.status;
  876. }
  877. /* Copy relocatable PAL procedures from ROM to memory */
  878. static inline s64
  879. ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
  880. {
  881. struct ia64_pal_retval iprv;
  882. PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
  883. if (pal_proc_offset)
  884. *pal_proc_offset = iprv.v0;
  885. return iprv.status;
  886. }
  887. /* Return the number of instruction and data debug register pairs */
  888. static inline s64
  889. ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
  890. {
  891. struct ia64_pal_retval iprv;
  892. PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
  893. if (inst_regs)
  894. *inst_regs = iprv.v0;
  895. if (data_regs)
  896. *data_regs = iprv.v1;
  897. return iprv.status;
  898. }
  899. #ifdef TBD
  900. /* Switch from IA64-system environment to IA-32 system environment */
  901. static inline s64
  902. ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
  903. {
  904. struct ia64_pal_retval iprv;
  905. PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
  906. return iprv.status;
  907. }
  908. #endif
  909. /* Get unique geographical address of this processor on its bus */
  910. static inline s64
  911. ia64_pal_fixed_addr (u64 *global_unique_addr)
  912. {
  913. struct ia64_pal_retval iprv;
  914. PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
  915. if (global_unique_addr)
  916. *global_unique_addr = iprv.v0;
  917. return iprv.status;
  918. }
  919. /* Get base frequency of the platform if generated by the processor */
  920. static inline s64
  921. ia64_pal_freq_base (u64 *platform_base_freq)
  922. {
  923. struct ia64_pal_retval iprv;
  924. PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
  925. if (platform_base_freq)
  926. *platform_base_freq = iprv.v0;
  927. return iprv.status;
  928. }
  929. /*
  930. * Get the ratios for processor frequency, bus frequency and interval timer to
  931. * to base frequency of the platform
  932. */
  933. static inline s64
  934. ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
  935. struct pal_freq_ratio *itc_ratio)
  936. {
  937. struct ia64_pal_retval iprv;
  938. PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
  939. if (proc_ratio)
  940. *(u64 *)proc_ratio = iprv.v0;
  941. if (bus_ratio)
  942. *(u64 *)bus_ratio = iprv.v1;
  943. if (itc_ratio)
  944. *(u64 *)itc_ratio = iprv.v2;
  945. return iprv.status;
  946. }
  947. /* Make the processor enter HALT or one of the implementation dependent low
  948. * power states where prefetching and execution are suspended and cache and
  949. * TLB coherency is not maintained.
  950. */
  951. static inline s64
  952. ia64_pal_halt (u64 halt_state)
  953. {
  954. struct ia64_pal_retval iprv;
  955. PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
  956. return iprv.status;
  957. }
  958. typedef union pal_power_mgmt_info_u {
  959. u64 ppmi_data;
  960. struct {
  961. u64 exit_latency : 16,
  962. entry_latency : 16,
  963. power_consumption : 28,
  964. im : 1,
  965. co : 1,
  966. reserved : 2;
  967. } pal_power_mgmt_info_s;
  968. } pal_power_mgmt_info_u_t;
  969. /* Return information about processor's optional power management capabilities. */
  970. static inline s64
  971. ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
  972. {
  973. struct ia64_pal_retval iprv;
  974. PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
  975. return iprv.status;
  976. }
  977. /* Get the current P-state information */
  978. static inline s64
  979. ia64_pal_get_pstate (u64 *pstate_index)
  980. {
  981. struct ia64_pal_retval iprv;
  982. PAL_CALL_STK(iprv, PAL_GET_PSTATE, 0, 0, 0);
  983. *pstate_index = iprv.v0;
  984. return iprv.status;
  985. }
  986. /* Set the P-state */
  987. static inline s64
  988. ia64_pal_set_pstate (u64 pstate_index)
  989. {
  990. struct ia64_pal_retval iprv;
  991. PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0);
  992. return iprv.status;
  993. }
  994. /* Processor branding information*/
  995. static inline s64
  996. ia64_pal_get_brand_info (char *brand_info)
  997. {
  998. struct ia64_pal_retval iprv;
  999. PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
  1000. return iprv.status;
  1001. }
  1002. /* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
  1003. * suspended, but cache and TLB coherency is maintained.
  1004. */
  1005. static inline s64
  1006. ia64_pal_halt_light (void)
  1007. {
  1008. struct ia64_pal_retval iprv;
  1009. PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
  1010. return iprv.status;
  1011. }
  1012. /* Clear all the processor error logging registers and reset the indicator that allows
  1013. * the error logging registers to be written. This procedure also checks the pending
  1014. * machine check bit and pending INIT bit and reports their states.
  1015. */
  1016. static inline s64
  1017. ia64_pal_mc_clear_log (u64 *pending_vector)
  1018. {
  1019. struct ia64_pal_retval iprv;
  1020. PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
  1021. if (pending_vector)
  1022. *pending_vector = iprv.v0;
  1023. return iprv.status;
  1024. }
  1025. /* Ensure that all outstanding transactions in a processor are completed or that any
  1026. * MCA due to thes outstanding transaction is taken.
  1027. */
  1028. static inline s64
  1029. ia64_pal_mc_drain (void)
  1030. {
  1031. struct ia64_pal_retval iprv;
  1032. PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
  1033. return iprv.status;
  1034. }
  1035. /* Return the machine check dynamic processor state */
  1036. static inline s64
  1037. ia64_pal_mc_dynamic_state (u64 offset, u64 *size, u64 *pds)
  1038. {
  1039. struct ia64_pal_retval iprv;
  1040. PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, offset, 0, 0);
  1041. if (size)
  1042. *size = iprv.v0;
  1043. if (pds)
  1044. *pds = iprv.v1;
  1045. return iprv.status;
  1046. }
  1047. /* Return processor machine check information */
  1048. static inline s64
  1049. ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
  1050. {
  1051. struct ia64_pal_retval iprv;
  1052. PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
  1053. if (size)
  1054. *size = iprv.v0;
  1055. if (error_info)
  1056. *error_info = iprv.v1;
  1057. return iprv.status;
  1058. }
  1059. /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
  1060. * attempt to correct any expected machine checks.
  1061. */
  1062. static inline s64
  1063. ia64_pal_mc_expected (u64 expected, u64 *previous)
  1064. {
  1065. struct ia64_pal_retval iprv;
  1066. PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
  1067. if (previous)
  1068. *previous = iprv.v0;
  1069. return iprv.status;
  1070. }
  1071. /* Register a platform dependent location with PAL to which it can save
  1072. * minimal processor state in the event of a machine check or initialization
  1073. * event.
  1074. */
  1075. static inline s64
  1076. ia64_pal_mc_register_mem (u64 physical_addr)
  1077. {
  1078. struct ia64_pal_retval iprv;
  1079. PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, 0, 0);
  1080. return iprv.status;
  1081. }
  1082. /* Restore minimal architectural processor state, set CMC interrupt if necessary
  1083. * and resume execution
  1084. */
  1085. static inline s64
  1086. ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
  1087. {
  1088. struct ia64_pal_retval iprv;
  1089. PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
  1090. return iprv.status;
  1091. }
  1092. /* Return the memory attributes implemented by the processor */
  1093. static inline s64
  1094. ia64_pal_mem_attrib (u64 *mem_attrib)
  1095. {
  1096. struct ia64_pal_retval iprv;
  1097. PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
  1098. if (mem_attrib)
  1099. *mem_attrib = iprv.v0 & 0xff;
  1100. return iprv.status;
  1101. }
  1102. /* Return the amount of memory needed for second phase of processor
  1103. * self-test and the required alignment of memory.
  1104. */
  1105. static inline s64
  1106. ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
  1107. {
  1108. struct ia64_pal_retval iprv;
  1109. PAL_CALL(iprv, PAL_MEM_FOR_TEST, 0, 0, 0);
  1110. if (bytes_needed)
  1111. *bytes_needed = iprv.v0;
  1112. if (alignment)
  1113. *alignment = iprv.v1;
  1114. return iprv.status;
  1115. }
  1116. typedef union pal_perf_mon_info_u {
  1117. u64 ppmi_data;
  1118. struct {
  1119. u64 generic : 8,
  1120. width : 8,
  1121. cycles : 8,
  1122. retired : 8,
  1123. reserved : 32;
  1124. } pal_perf_mon_info_s;
  1125. } pal_perf_mon_info_u_t;
  1126. /* Return the performance monitor information about what can be counted
  1127. * and how to configure the monitors to count the desired events.
  1128. */
  1129. static inline s64
  1130. ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
  1131. {
  1132. struct ia64_pal_retval iprv;
  1133. PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
  1134. if (pm_info)
  1135. pm_info->ppmi_data = iprv.v0;
  1136. return iprv.status;
  1137. }
  1138. /* Specifies the physical address of the processor interrupt block
  1139. * and I/O port space.
  1140. */
  1141. static inline s64
  1142. ia64_pal_platform_addr (u64 type, u64 physical_addr)
  1143. {
  1144. struct ia64_pal_retval iprv;
  1145. PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
  1146. return iprv.status;
  1147. }
  1148. /* Set the SAL PMI entrypoint in memory */
  1149. static inline s64
  1150. ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
  1151. {
  1152. struct ia64_pal_retval iprv;
  1153. PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
  1154. return iprv.status;
  1155. }
  1156. struct pal_features_s;
  1157. /* Provide information about configurable processor features */
  1158. static inline s64
  1159. ia64_pal_proc_get_features (u64 *features_avail,
  1160. u64 *features_status,
  1161. u64 *features_control)
  1162. {
  1163. struct ia64_pal_retval iprv;
  1164. PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0);
  1165. if (iprv.status == 0) {
  1166. *features_avail = iprv.v0;
  1167. *features_status = iprv.v1;
  1168. *features_control = iprv.v2;
  1169. }
  1170. return iprv.status;
  1171. }
  1172. /* Enable/disable processor dependent features */
  1173. static inline s64
  1174. ia64_pal_proc_set_features (u64 feature_select)
  1175. {
  1176. struct ia64_pal_retval iprv;
  1177. PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
  1178. return iprv.status;
  1179. }
  1180. /*
  1181. * Put everything in a struct so we avoid the global offset table whenever
  1182. * possible.
  1183. */
  1184. typedef struct ia64_ptce_info_s {
  1185. u64 base;
  1186. u32 count[2];
  1187. u32 stride[2];
  1188. } ia64_ptce_info_t;
  1189. /* Return the information required for the architected loop used to purge
  1190. * (initialize) the entire TC
  1191. */
  1192. static inline s64
  1193. ia64_get_ptce (ia64_ptce_info_t *ptce)
  1194. {
  1195. struct ia64_pal_retval iprv;
  1196. if (!ptce)
  1197. return -1;
  1198. PAL_CALL(iprv, PAL_PTCE_INFO, 0, 0, 0);
  1199. if (iprv.status == 0) {
  1200. ptce->base = iprv.v0;
  1201. ptce->count[0] = iprv.v1 >> 32;
  1202. ptce->count[1] = iprv.v1 & 0xffffffff;
  1203. ptce->stride[0] = iprv.v2 >> 32;
  1204. ptce->stride[1] = iprv.v2 & 0xffffffff;
  1205. }
  1206. return iprv.status;
  1207. }
  1208. /* Return info about implemented application and control registers. */
  1209. static inline s64
  1210. ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
  1211. {
  1212. struct ia64_pal_retval iprv;
  1213. PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
  1214. if (reg_info_1)
  1215. *reg_info_1 = iprv.v0;
  1216. if (reg_info_2)
  1217. *reg_info_2 = iprv.v1;
  1218. return iprv.status;
  1219. }
  1220. typedef union pal_hints_u {
  1221. u64 ph_data;
  1222. struct {
  1223. u64 si : 1,
  1224. li : 1,
  1225. reserved : 62;
  1226. } pal_hints_s;
  1227. } pal_hints_u_t;
  1228. /* Return information about the register stack and RSE for this processor
  1229. * implementation.
  1230. */
  1231. static inline s64
  1232. ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
  1233. {
  1234. struct ia64_pal_retval iprv;
  1235. PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
  1236. if (num_phys_stacked)
  1237. *num_phys_stacked = iprv.v0;
  1238. if (hints)
  1239. hints->ph_data = iprv.v1;
  1240. return iprv.status;
  1241. }
  1242. /* Cause the processor to enter SHUTDOWN state, where prefetching and execution are
  1243. * suspended, but cause cache and TLB coherency to be maintained.
  1244. * This is usually called in IA-32 mode.
  1245. */
  1246. static inline s64
  1247. ia64_pal_shutdown (void)
  1248. {
  1249. struct ia64_pal_retval iprv;
  1250. PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
  1251. return iprv.status;
  1252. }
  1253. /* Perform the second phase of processor self-test. */
  1254. static inline s64
  1255. ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
  1256. {
  1257. struct ia64_pal_retval iprv;
  1258. PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
  1259. if (self_test_state)
  1260. *self_test_state = iprv.v0;
  1261. return iprv.status;
  1262. }
  1263. typedef union pal_version_u {
  1264. u64 pal_version_val;
  1265. struct {
  1266. u64 pv_pal_b_rev : 8;
  1267. u64 pv_pal_b_model : 8;
  1268. u64 pv_reserved1 : 8;
  1269. u64 pv_pal_vendor : 8;
  1270. u64 pv_pal_a_rev : 8;
  1271. u64 pv_pal_a_model : 8;
  1272. u64 pv_reserved2 : 16;
  1273. } pal_version_s;
  1274. } pal_version_u_t;
  1275. /*
  1276. * Return PAL version information. While the documentation states that
  1277. * PAL_VERSION can be called in either physical or virtual mode, some
  1278. * implementations only allow physical calls. We don't call it very often,
  1279. * so the overhead isn't worth eliminating.
  1280. */
  1281. static inline s64
  1282. ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
  1283. {
  1284. struct ia64_pal_retval iprv;
  1285. PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
  1286. if (pal_min_version)
  1287. pal_min_version->pal_version_val = iprv.v0;
  1288. if (pal_cur_version)
  1289. pal_cur_version->pal_version_val = iprv.v1;
  1290. return iprv.status;
  1291. }
  1292. typedef union pal_tc_info_u {
  1293. u64 pti_val;
  1294. struct {
  1295. u64 num_sets : 8,
  1296. associativity : 8,
  1297. num_entries : 16,
  1298. pf : 1,
  1299. unified : 1,
  1300. reduce_tr : 1,
  1301. reserved : 29;
  1302. } pal_tc_info_s;
  1303. } pal_tc_info_u_t;
  1304. #define tc_reduce_tr pal_tc_info_s.reduce_tr
  1305. #define tc_unified pal_tc_info_s.unified
  1306. #define tc_pf pal_tc_info_s.pf
  1307. #define tc_num_entries pal_tc_info_s.num_entries
  1308. #define tc_associativity pal_tc_info_s.associativity
  1309. #define tc_num_sets pal_tc_info_s.num_sets
  1310. /* Return information about the virtual memory characteristics of the processor
  1311. * implementation.
  1312. */
  1313. static inline s64
  1314. ia64_pal_vm_info (u64 tc_level, u64 tc_type, pal_tc_info_u_t *tc_info, u64 *tc_pages)
  1315. {
  1316. struct ia64_pal_retval iprv;
  1317. PAL_CALL(iprv, PAL_VM_INFO, tc_level, tc_type, 0);
  1318. if (tc_info)
  1319. tc_info->pti_val = iprv.v0;
  1320. if (tc_pages)
  1321. *tc_pages = iprv.v1;
  1322. return iprv.status;
  1323. }
  1324. /* Get page size information about the virtual memory characteristics of the processor
  1325. * implementation.
  1326. */
  1327. static inline s64
  1328. ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
  1329. {
  1330. struct ia64_pal_retval iprv;
  1331. PAL_CALL(iprv, PAL_VM_PAGE_SIZE, 0, 0, 0);
  1332. if (tr_pages)
  1333. *tr_pages = iprv.v0;
  1334. if (vw_pages)
  1335. *vw_pages = iprv.v1;
  1336. return iprv.status;
  1337. }
  1338. typedef union pal_vm_info_1_u {
  1339. u64 pvi1_val;
  1340. struct {
  1341. u64 vw : 1,
  1342. phys_add_size : 7,
  1343. key_size : 8,
  1344. max_pkr : 8,
  1345. hash_tag_id : 8,
  1346. max_dtr_entry : 8,
  1347. max_itr_entry : 8,
  1348. max_unique_tcs : 8,
  1349. num_tc_levels : 8;
  1350. } pal_vm_info_1_s;
  1351. } pal_vm_info_1_u_t;
  1352. typedef union pal_vm_info_2_u {
  1353. u64 pvi2_val;
  1354. struct {
  1355. u64 impl_va_msb : 8,
  1356. rid_size : 8,
  1357. reserved : 48;
  1358. } pal_vm_info_2_s;
  1359. } pal_vm_info_2_u_t;
  1360. /* Get summary information about the virtual memory characteristics of the processor
  1361. * implementation.
  1362. */
  1363. static inline s64
  1364. ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
  1365. {
  1366. struct ia64_pal_retval iprv;
  1367. PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
  1368. if (vm_info_1)
  1369. vm_info_1->pvi1_val = iprv.v0;
  1370. if (vm_info_2)
  1371. vm_info_2->pvi2_val = iprv.v1;
  1372. return iprv.status;
  1373. }
  1374. typedef union pal_itr_valid_u {
  1375. u64 piv_val;
  1376. struct {
  1377. u64 access_rights_valid : 1,
  1378. priv_level_valid : 1,
  1379. dirty_bit_valid : 1,
  1380. mem_attr_valid : 1,
  1381. reserved : 60;
  1382. } pal_tr_valid_s;
  1383. } pal_tr_valid_u_t;
  1384. /* Read a translation register */
  1385. static inline s64
  1386. ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
  1387. {
  1388. struct ia64_pal_retval iprv;
  1389. PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)ia64_tpa(tr_buffer));
  1390. if (tr_valid)
  1391. tr_valid->piv_val = iprv.v0;
  1392. return iprv.status;
  1393. }
  1394. /*
  1395. * PAL_PREFETCH_VISIBILITY transaction types
  1396. */
  1397. #define PAL_VISIBILITY_VIRTUAL 0
  1398. #define PAL_VISIBILITY_PHYSICAL 1
  1399. /*
  1400. * PAL_PREFETCH_VISIBILITY return codes
  1401. */
  1402. #define PAL_VISIBILITY_OK 1
  1403. #define PAL_VISIBILITY_OK_REMOTE_NEEDED 0
  1404. #define PAL_VISIBILITY_INVAL_ARG -2
  1405. #define PAL_VISIBILITY_ERROR -3
  1406. static inline s64
  1407. ia64_pal_prefetch_visibility (s64 trans_type)
  1408. {
  1409. struct ia64_pal_retval iprv;
  1410. PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0);
  1411. return iprv.status;
  1412. }
  1413. /* data structure for getting information on logical to physical mappings */
  1414. typedef union pal_log_overview_u {
  1415. struct {
  1416. u64 num_log :16, /* Total number of logical
  1417. * processors on this die
  1418. */
  1419. tpc :8, /* Threads per core */
  1420. reserved3 :8, /* Reserved */
  1421. cpp :8, /* Cores per processor */
  1422. reserved2 :8, /* Reserved */
  1423. ppid :8, /* Physical processor ID */
  1424. reserved1 :8; /* Reserved */
  1425. } overview_bits;
  1426. u64 overview_data;
  1427. } pal_log_overview_t;
  1428. typedef union pal_proc_n_log_info1_u{
  1429. struct {
  1430. u64 tid :16, /* Thread id */
  1431. reserved2 :16, /* Reserved */
  1432. cid :16, /* Core id */
  1433. reserved1 :16; /* Reserved */
  1434. } ppli1_bits;
  1435. u64 ppli1_data;
  1436. } pal_proc_n_log_info1_t;
  1437. typedef union pal_proc_n_log_info2_u {
  1438. struct {
  1439. u64 la :16, /* Logical address */
  1440. reserved :48; /* Reserved */
  1441. } ppli2_bits;
  1442. u64 ppli2_data;
  1443. } pal_proc_n_log_info2_t;
  1444. typedef struct pal_logical_to_physical_s
  1445. {
  1446. pal_log_overview_t overview;
  1447. pal_proc_n_log_info1_t ppli1;
  1448. pal_proc_n_log_info2_t ppli2;
  1449. } pal_logical_to_physical_t;
  1450. #define overview_num_log overview.overview_bits.num_log
  1451. #define overview_tpc overview.overview_bits.tpc
  1452. #define overview_cpp overview.overview_bits.cpp
  1453. #define overview_ppid overview.overview_bits.ppid
  1454. #define log1_tid ppli1.ppli1_bits.tid
  1455. #define log1_cid ppli1.ppli1_bits.cid
  1456. #define log2_la ppli2.ppli2_bits.la
  1457. /* Get information on logical to physical processor mappings. */
  1458. static inline s64
  1459. ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
  1460. {
  1461. struct ia64_pal_retval iprv;
  1462. PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
  1463. if (iprv.status == PAL_STATUS_SUCCESS)
  1464. {
  1465. mapping->overview.overview_data = iprv.v0;
  1466. mapping->ppli1.ppli1_data = iprv.v1;
  1467. mapping->ppli2.ppli2_data = iprv.v2;
  1468. }
  1469. return iprv.status;
  1470. }
  1471. typedef struct pal_cache_shared_info_s
  1472. {
  1473. u64 num_shared;
  1474. pal_proc_n_log_info1_t ppli1;
  1475. pal_proc_n_log_info2_t ppli2;
  1476. } pal_cache_shared_info_t;
  1477. /* Get information on logical to physical processor mappings. */
  1478. static inline s64
  1479. ia64_pal_cache_shared_info(u64 level,
  1480. u64 type,
  1481. u64 proc_number,
  1482. pal_cache_shared_info_t *info)
  1483. {
  1484. struct ia64_pal_retval iprv;
  1485. PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
  1486. if (iprv.status == PAL_STATUS_SUCCESS) {
  1487. info->num_shared = iprv.v0;
  1488. info->ppli1.ppli1_data = iprv.v1;
  1489. info->ppli2.ppli2_data = iprv.v2;
  1490. }
  1491. return iprv.status;
  1492. }
  1493. #endif /* __ASSEMBLY__ */
  1494. #endif /* _ASM_IA64_PAL_H */