pal.h 49 KB

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