pal.h 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694
  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. se : 1, /* Shared error. MCA in a
  392. shared structure */
  393. reserved2 : 10,
  394. cc : 1, /* Cache check */
  395. tc : 1, /* TLB check */
  396. bc : 1, /* Bus check */
  397. rc : 1, /* Register file check */
  398. uc : 1; /* Uarch check */
  399. } pal_processor_state_info_t;
  400. typedef struct pal_cache_check_info_s {
  401. u64 op : 4, /* Type of cache
  402. * operation that
  403. * caused the machine
  404. * check.
  405. */
  406. level : 2, /* Cache level */
  407. reserved1 : 2,
  408. dl : 1, /* Failure in data part
  409. * of cache line
  410. */
  411. tl : 1, /* Failure in tag part
  412. * of cache line
  413. */
  414. dc : 1, /* Failure in dcache */
  415. ic : 1, /* Failure in icache */
  416. mesi : 3, /* Cache line state */
  417. mv : 1, /* mesi valid */
  418. way : 5, /* Way in which the
  419. * error occurred
  420. */
  421. wiv : 1, /* Way field valid */
  422. reserved2 : 1,
  423. dp : 1, /* Data poisoned on MBE */
  424. reserved3 : 8,
  425. index : 20, /* Cache line index */
  426. reserved4 : 2,
  427. is : 1, /* instruction set (1 == ia32) */
  428. iv : 1, /* instruction set field valid */
  429. pl : 2, /* privilege level */
  430. pv : 1, /* privilege level field valid */
  431. mcc : 1, /* Machine check corrected */
  432. tv : 1, /* Target address
  433. * structure is valid
  434. */
  435. rq : 1, /* Requester identifier
  436. * structure is valid
  437. */
  438. rp : 1, /* Responder identifier
  439. * structure is valid
  440. */
  441. pi : 1; /* Precise instruction pointer
  442. * structure is valid
  443. */
  444. } pal_cache_check_info_t;
  445. typedef struct pal_tlb_check_info_s {
  446. u64 tr_slot : 8, /* Slot# of TR where
  447. * error occurred
  448. */
  449. trv : 1, /* tr_slot field is valid */
  450. reserved1 : 1,
  451. level : 2, /* TLB level where failure occurred */
  452. reserved2 : 4,
  453. dtr : 1, /* Fail in data TR */
  454. itr : 1, /* Fail in inst TR */
  455. dtc : 1, /* Fail in data TC */
  456. itc : 1, /* Fail in inst. TC */
  457. op : 4, /* Cache operation */
  458. reserved3 : 30,
  459. is : 1, /* instruction set (1 == ia32) */
  460. iv : 1, /* instruction set field valid */
  461. pl : 2, /* privilege level */
  462. pv : 1, /* privilege level field valid */
  463. mcc : 1, /* Machine check corrected */
  464. tv : 1, /* Target address
  465. * structure is valid
  466. */
  467. rq : 1, /* Requester identifier
  468. * structure is valid
  469. */
  470. rp : 1, /* Responder identifier
  471. * structure is valid
  472. */
  473. pi : 1; /* Precise instruction pointer
  474. * structure is valid
  475. */
  476. } pal_tlb_check_info_t;
  477. typedef struct pal_bus_check_info_s {
  478. u64 size : 5, /* Xaction size */
  479. ib : 1, /* Internal bus error */
  480. eb : 1, /* External bus error */
  481. cc : 1, /* Error occurred
  482. * during cache-cache
  483. * transfer.
  484. */
  485. type : 8, /* Bus xaction type*/
  486. sev : 5, /* Bus error severity*/
  487. hier : 2, /* Bus hierarchy level */
  488. dp : 1, /* Data poisoned on MBE */
  489. bsi : 8, /* Bus error status
  490. * info
  491. */
  492. reserved2 : 22,
  493. is : 1, /* instruction set (1 == ia32) */
  494. iv : 1, /* instruction set field valid */
  495. pl : 2, /* privilege level */
  496. pv : 1, /* privilege level field valid */
  497. mcc : 1, /* Machine check corrected */
  498. tv : 1, /* Target address
  499. * structure is valid
  500. */
  501. rq : 1, /* Requester identifier
  502. * structure is valid
  503. */
  504. rp : 1, /* Responder identifier
  505. * structure is valid
  506. */
  507. pi : 1; /* Precise instruction pointer
  508. * structure is valid
  509. */
  510. } pal_bus_check_info_t;
  511. typedef struct pal_reg_file_check_info_s {
  512. u64 id : 4, /* Register file identifier */
  513. op : 4, /* Type of register
  514. * operation that
  515. * caused the machine
  516. * check.
  517. */
  518. reg_num : 7, /* Register number */
  519. rnv : 1, /* reg_num valid */
  520. reserved2 : 38,
  521. is : 1, /* instruction set (1 == ia32) */
  522. iv : 1, /* instruction set field valid */
  523. pl : 2, /* privilege level */
  524. pv : 1, /* privilege level field valid */
  525. mcc : 1, /* Machine check corrected */
  526. reserved3 : 3,
  527. pi : 1; /* Precise instruction pointer
  528. * structure is valid
  529. */
  530. } pal_reg_file_check_info_t;
  531. typedef struct pal_uarch_check_info_s {
  532. u64 sid : 5, /* Structure identification */
  533. level : 3, /* Level of failure */
  534. array_id : 4, /* Array identification */
  535. op : 4, /* Type of
  536. * operation that
  537. * caused the machine
  538. * check.
  539. */
  540. way : 6, /* Way of structure */
  541. wv : 1, /* way valid */
  542. xv : 1, /* index valid */
  543. reserved1 : 8,
  544. index : 8, /* Index or set of the uarch
  545. * structure that failed.
  546. */
  547. reserved2 : 24,
  548. is : 1, /* instruction set (1 == ia32) */
  549. iv : 1, /* instruction set field valid */
  550. pl : 2, /* privilege level */
  551. pv : 1, /* privilege level field valid */
  552. mcc : 1, /* Machine check corrected */
  553. tv : 1, /* Target address
  554. * structure is valid
  555. */
  556. rq : 1, /* Requester identifier
  557. * structure is valid
  558. */
  559. rp : 1, /* Responder identifier
  560. * structure is valid
  561. */
  562. pi : 1; /* Precise instruction pointer
  563. * structure is valid
  564. */
  565. } pal_uarch_check_info_t;
  566. typedef union pal_mc_error_info_u {
  567. u64 pmei_data;
  568. pal_processor_state_info_t pme_processor;
  569. pal_cache_check_info_t pme_cache;
  570. pal_tlb_check_info_t pme_tlb;
  571. pal_bus_check_info_t pme_bus;
  572. pal_reg_file_check_info_t pme_reg_file;
  573. pal_uarch_check_info_t pme_uarch;
  574. } pal_mc_error_info_t;
  575. #define pmci_proc_unknown_check pme_processor.uc
  576. #define pmci_proc_bus_check pme_processor.bc
  577. #define pmci_proc_tlb_check pme_processor.tc
  578. #define pmci_proc_cache_check pme_processor.cc
  579. #define pmci_proc_dynamic_state_size pme_processor.dsize
  580. #define pmci_proc_gpr_valid pme_processor.gr
  581. #define pmci_proc_preserved_bank0_gpr_valid pme_processor.b0
  582. #define pmci_proc_preserved_bank1_gpr_valid pme_processor.b1
  583. #define pmci_proc_fp_valid pme_processor.fp
  584. #define pmci_proc_predicate_regs_valid pme_processor.pr
  585. #define pmci_proc_branch_regs_valid pme_processor.br
  586. #define pmci_proc_app_regs_valid pme_processor.ar
  587. #define pmci_proc_region_regs_valid pme_processor.rr
  588. #define pmci_proc_translation_regs_valid pme_processor.tr
  589. #define pmci_proc_debug_regs_valid pme_processor.dr
  590. #define pmci_proc_perf_counters_valid pme_processor.pc
  591. #define pmci_proc_control_regs_valid pme_processor.cr
  592. #define pmci_proc_machine_check_expected pme_processor.ex
  593. #define pmci_proc_machine_check_corrected pme_processor.cm
  594. #define pmci_proc_rse_valid pme_processor.rs
  595. #define pmci_proc_machine_check_or_init pme_processor.in
  596. #define pmci_proc_dynamic_state_valid pme_processor.dy
  597. #define pmci_proc_operation pme_processor.op
  598. #define pmci_proc_trap_lost pme_processor.tl
  599. #define pmci_proc_hardware_damage pme_processor.hd
  600. #define pmci_proc_uncontained_storage_damage pme_processor.us
  601. #define pmci_proc_machine_check_isolated pme_processor.ci
  602. #define pmci_proc_continuable pme_processor.co
  603. #define pmci_proc_storage_intergrity_synced pme_processor.sy
  604. #define pmci_proc_min_state_save_area_regd pme_processor.mn
  605. #define pmci_proc_distinct_multiple_errors pme_processor.me
  606. #define pmci_proc_pal_attempted_rendezvous pme_processor.ra
  607. #define pmci_proc_pal_rendezvous_complete pme_processor.rz
  608. #define pmci_cache_level pme_cache.level
  609. #define pmci_cache_line_state pme_cache.mesi
  610. #define pmci_cache_line_state_valid pme_cache.mv
  611. #define pmci_cache_line_index pme_cache.index
  612. #define pmci_cache_instr_cache_fail pme_cache.ic
  613. #define pmci_cache_data_cache_fail pme_cache.dc
  614. #define pmci_cache_line_tag_fail pme_cache.tl
  615. #define pmci_cache_line_data_fail pme_cache.dl
  616. #define pmci_cache_operation pme_cache.op
  617. #define pmci_cache_way_valid pme_cache.wv
  618. #define pmci_cache_target_address_valid pme_cache.tv
  619. #define pmci_cache_way pme_cache.way
  620. #define pmci_cache_mc pme_cache.mc
  621. #define pmci_tlb_instr_translation_cache_fail pme_tlb.itc
  622. #define pmci_tlb_data_translation_cache_fail pme_tlb.dtc
  623. #define pmci_tlb_instr_translation_reg_fail pme_tlb.itr
  624. #define pmci_tlb_data_translation_reg_fail pme_tlb.dtr
  625. #define pmci_tlb_translation_reg_slot pme_tlb.tr_slot
  626. #define pmci_tlb_mc pme_tlb.mc
  627. #define pmci_bus_status_info pme_bus.bsi
  628. #define pmci_bus_req_address_valid pme_bus.rq
  629. #define pmci_bus_resp_address_valid pme_bus.rp
  630. #define pmci_bus_target_address_valid pme_bus.tv
  631. #define pmci_bus_error_severity pme_bus.sev
  632. #define pmci_bus_transaction_type pme_bus.type
  633. #define pmci_bus_cache_cache_transfer pme_bus.cc
  634. #define pmci_bus_transaction_size pme_bus.size
  635. #define pmci_bus_internal_error pme_bus.ib
  636. #define pmci_bus_external_error pme_bus.eb
  637. #define pmci_bus_mc pme_bus.mc
  638. /*
  639. * NOTE: this min_state_save area struct only includes the 1KB
  640. * architectural state save area. The other 3 KB is scratch space
  641. * for PAL.
  642. */
  643. typedef struct pal_min_state_area_s {
  644. u64 pmsa_nat_bits; /* nat bits for saved GRs */
  645. u64 pmsa_gr[15]; /* GR1 - GR15 */
  646. u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */
  647. u64 pmsa_bank1_gr[16]; /* GR16 - GR31 */
  648. u64 pmsa_pr; /* predicate registers */
  649. u64 pmsa_br0; /* branch register 0 */
  650. u64 pmsa_rsc; /* ar.rsc */
  651. u64 pmsa_iip; /* cr.iip */
  652. u64 pmsa_ipsr; /* cr.ipsr */
  653. u64 pmsa_ifs; /* cr.ifs */
  654. u64 pmsa_xip; /* previous iip */
  655. u64 pmsa_xpsr; /* previous psr */
  656. u64 pmsa_xfs; /* previous ifs */
  657. u64 pmsa_br1; /* branch register 1 */
  658. u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */
  659. } pal_min_state_area_t;
  660. struct ia64_pal_retval {
  661. /*
  662. * A zero status value indicates call completed without error.
  663. * A negative status value indicates reason of call failure.
  664. * A positive status value indicates success but an
  665. * informational value should be printed (e.g., "reboot for
  666. * change to take effect").
  667. */
  668. s64 status;
  669. u64 v0;
  670. u64 v1;
  671. u64 v2;
  672. };
  673. /*
  674. * Note: Currently unused PAL arguments are generally labeled
  675. * "reserved" so the value specified in the PAL documentation
  676. * (generally 0) MUST be passed. Reserved parameters are not optional
  677. * parameters.
  678. */
  679. extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
  680. extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
  681. extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
  682. extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
  683. extern void ia64_save_scratch_fpregs (struct ia64_fpreg *);
  684. extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
  685. #define PAL_CALL(iprv,a0,a1,a2,a3) do { \
  686. struct ia64_fpreg fr[6]; \
  687. ia64_save_scratch_fpregs(fr); \
  688. iprv = ia64_pal_call_static(a0, a1, a2, a3); \
  689. ia64_load_scratch_fpregs(fr); \
  690. } while (0)
  691. #define PAL_CALL_STK(iprv,a0,a1,a2,a3) do { \
  692. struct ia64_fpreg fr[6]; \
  693. ia64_save_scratch_fpregs(fr); \
  694. iprv = ia64_pal_call_stacked(a0, a1, a2, a3); \
  695. ia64_load_scratch_fpregs(fr); \
  696. } while (0)
  697. #define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) do { \
  698. struct ia64_fpreg fr[6]; \
  699. ia64_save_scratch_fpregs(fr); \
  700. iprv = ia64_pal_call_phys_static(a0, a1, a2, a3); \
  701. ia64_load_scratch_fpregs(fr); \
  702. } while (0)
  703. #define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) do { \
  704. struct ia64_fpreg fr[6]; \
  705. ia64_save_scratch_fpregs(fr); \
  706. iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3); \
  707. ia64_load_scratch_fpregs(fr); \
  708. } while (0)
  709. typedef int (*ia64_pal_handler) (u64, ...);
  710. extern ia64_pal_handler ia64_pal;
  711. extern void ia64_pal_handler_init (void *);
  712. extern ia64_pal_handler ia64_pal;
  713. extern pal_cache_config_info_t l0d_cache_config_info;
  714. extern pal_cache_config_info_t l0i_cache_config_info;
  715. extern pal_cache_config_info_t l1_cache_config_info;
  716. extern pal_cache_config_info_t l2_cache_config_info;
  717. extern pal_cache_protection_info_t l0d_cache_protection_info;
  718. extern pal_cache_protection_info_t l0i_cache_protection_info;
  719. extern pal_cache_protection_info_t l1_cache_protection_info;
  720. extern pal_cache_protection_info_t l2_cache_protection_info;
  721. extern pal_cache_config_info_t pal_cache_config_info_get(pal_cache_level_t,
  722. pal_cache_type_t);
  723. extern pal_cache_protection_info_t pal_cache_protection_info_get(pal_cache_level_t,
  724. pal_cache_type_t);
  725. extern void pal_error(int);
  726. /* Useful wrappers for the current list of pal procedures */
  727. typedef union pal_bus_features_u {
  728. u64 pal_bus_features_val;
  729. struct {
  730. u64 pbf_reserved1 : 29;
  731. u64 pbf_req_bus_parking : 1;
  732. u64 pbf_bus_lock_mask : 1;
  733. u64 pbf_enable_half_xfer_rate : 1;
  734. u64 pbf_reserved2 : 22;
  735. u64 pbf_disable_xaction_queueing : 1;
  736. u64 pbf_disable_resp_err_check : 1;
  737. u64 pbf_disable_berr_check : 1;
  738. u64 pbf_disable_bus_req_internal_err_signal : 1;
  739. u64 pbf_disable_bus_req_berr_signal : 1;
  740. u64 pbf_disable_bus_init_event_check : 1;
  741. u64 pbf_disable_bus_init_event_signal : 1;
  742. u64 pbf_disable_bus_addr_err_check : 1;
  743. u64 pbf_disable_bus_addr_err_signal : 1;
  744. u64 pbf_disable_bus_data_err_check : 1;
  745. } pal_bus_features_s;
  746. } pal_bus_features_u_t;
  747. extern void pal_bus_features_print (u64);
  748. /* Provide information about configurable processor bus features */
  749. static inline s64
  750. ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
  751. pal_bus_features_u_t *features_status,
  752. pal_bus_features_u_t *features_control)
  753. {
  754. struct ia64_pal_retval iprv;
  755. PAL_CALL_PHYS(iprv, PAL_BUS_GET_FEATURES, 0, 0, 0);
  756. if (features_avail)
  757. features_avail->pal_bus_features_val = iprv.v0;
  758. if (features_status)
  759. features_status->pal_bus_features_val = iprv.v1;
  760. if (features_control)
  761. features_control->pal_bus_features_val = iprv.v2;
  762. return iprv.status;
  763. }
  764. /* Enables/disables specific processor bus features */
  765. static inline s64
  766. ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
  767. {
  768. struct ia64_pal_retval iprv;
  769. PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
  770. return iprv.status;
  771. }
  772. /* Get detailed cache information */
  773. static inline s64
  774. ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_info_t *conf)
  775. {
  776. struct ia64_pal_retval iprv;
  777. PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
  778. if (iprv.status == 0) {
  779. conf->pcci_status = iprv.status;
  780. conf->pcci_info_1.pcci1_data = iprv.v0;
  781. conf->pcci_info_2.pcci2_data = iprv.v1;
  782. conf->pcci_reserved = iprv.v2;
  783. }
  784. return iprv.status;
  785. }
  786. /* Get detailed cche protection information */
  787. static inline s64
  788. ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_info_t *prot)
  789. {
  790. struct ia64_pal_retval iprv;
  791. PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
  792. if (iprv.status == 0) {
  793. prot->pcpi_status = iprv.status;
  794. prot->pcp_info[0].pcpi_data = iprv.v0 & 0xffffffff;
  795. prot->pcp_info[1].pcpi_data = iprv.v0 >> 32;
  796. prot->pcp_info[2].pcpi_data = iprv.v1 & 0xffffffff;
  797. prot->pcp_info[3].pcpi_data = iprv.v1 >> 32;
  798. prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
  799. prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
  800. }
  801. return iprv.status;
  802. }
  803. /*
  804. * Flush the processor instruction or data caches. *PROGRESS must be
  805. * initialized to zero before calling this for the first time..
  806. */
  807. static inline s64
  808. ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
  809. {
  810. struct ia64_pal_retval iprv;
  811. PAL_CALL(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
  812. if (vector)
  813. *vector = iprv.v0;
  814. *progress = iprv.v1;
  815. return iprv.status;
  816. }
  817. /* Initialize the processor controlled caches */
  818. static inline s64
  819. ia64_pal_cache_init (u64 level, u64 cache_type, u64 rest)
  820. {
  821. struct ia64_pal_retval iprv;
  822. PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, rest);
  823. return iprv.status;
  824. }
  825. /* Initialize the tags and data of a data or unified cache line of
  826. * processor controlled cache to known values without the availability
  827. * of backing memory.
  828. */
  829. static inline s64
  830. ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
  831. {
  832. struct ia64_pal_retval iprv;
  833. PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
  834. return iprv.status;
  835. }
  836. /* Read the data and tag of a processor controlled cache line for diags */
  837. static inline s64
  838. ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
  839. {
  840. struct ia64_pal_retval iprv;
  841. PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data,
  842. 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_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data,
  863. physical_addr, data);
  864. return iprv.status;
  865. }
  866. /* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
  867. static inline s64
  868. ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
  869. u64 *buffer_size, u64 *buffer_align)
  870. {
  871. struct ia64_pal_retval iprv;
  872. PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
  873. if (buffer_size)
  874. *buffer_size = iprv.v0;
  875. if (buffer_align)
  876. *buffer_align = iprv.v1;
  877. return iprv.status;
  878. }
  879. /* Copy relocatable PAL procedures from ROM to memory */
  880. static inline s64
  881. ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
  882. {
  883. struct ia64_pal_retval iprv;
  884. PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
  885. if (pal_proc_offset)
  886. *pal_proc_offset = iprv.v0;
  887. return iprv.status;
  888. }
  889. /* Return the number of instruction and data debug register pairs */
  890. static inline s64
  891. ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
  892. {
  893. struct ia64_pal_retval iprv;
  894. PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
  895. if (inst_regs)
  896. *inst_regs = iprv.v0;
  897. if (data_regs)
  898. *data_regs = iprv.v1;
  899. return iprv.status;
  900. }
  901. #ifdef TBD
  902. /* Switch from IA64-system environment to IA-32 system environment */
  903. static inline s64
  904. ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
  905. {
  906. struct ia64_pal_retval iprv;
  907. PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
  908. return iprv.status;
  909. }
  910. #endif
  911. /* Get unique geographical address of this processor on its bus */
  912. static inline s64
  913. ia64_pal_fixed_addr (u64 *global_unique_addr)
  914. {
  915. struct ia64_pal_retval iprv;
  916. PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
  917. if (global_unique_addr)
  918. *global_unique_addr = iprv.v0;
  919. return iprv.status;
  920. }
  921. /* Get base frequency of the platform if generated by the processor */
  922. static inline s64
  923. ia64_pal_freq_base (u64 *platform_base_freq)
  924. {
  925. struct ia64_pal_retval iprv;
  926. PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
  927. if (platform_base_freq)
  928. *platform_base_freq = iprv.v0;
  929. return iprv.status;
  930. }
  931. /*
  932. * Get the ratios for processor frequency, bus frequency and interval timer to
  933. * to base frequency of the platform
  934. */
  935. static inline s64
  936. ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
  937. struct pal_freq_ratio *itc_ratio)
  938. {
  939. struct ia64_pal_retval iprv;
  940. PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
  941. if (proc_ratio)
  942. *(u64 *)proc_ratio = iprv.v0;
  943. if (bus_ratio)
  944. *(u64 *)bus_ratio = iprv.v1;
  945. if (itc_ratio)
  946. *(u64 *)itc_ratio = iprv.v2;
  947. return iprv.status;
  948. }
  949. /* Make the processor enter HALT or one of the implementation dependent low
  950. * power states where prefetching and execution are suspended and cache and
  951. * TLB coherency is not maintained.
  952. */
  953. static inline s64
  954. ia64_pal_halt (u64 halt_state)
  955. {
  956. struct ia64_pal_retval iprv;
  957. PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
  958. return iprv.status;
  959. }
  960. typedef union pal_power_mgmt_info_u {
  961. u64 ppmi_data;
  962. struct {
  963. u64 exit_latency : 16,
  964. entry_latency : 16,
  965. power_consumption : 28,
  966. im : 1,
  967. co : 1,
  968. reserved : 2;
  969. } pal_power_mgmt_info_s;
  970. } pal_power_mgmt_info_u_t;
  971. /* Return information about processor's optional power management capabilities. */
  972. static inline s64
  973. ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
  974. {
  975. struct ia64_pal_retval iprv;
  976. PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
  977. return iprv.status;
  978. }
  979. /* Get the current P-state information */
  980. static inline s64
  981. ia64_pal_get_pstate (u64 *pstate_index)
  982. {
  983. struct ia64_pal_retval iprv;
  984. PAL_CALL_STK(iprv, PAL_GET_PSTATE, 0, 0, 0);
  985. *pstate_index = iprv.v0;
  986. return iprv.status;
  987. }
  988. /* Set the P-state */
  989. static inline s64
  990. ia64_pal_set_pstate (u64 pstate_index)
  991. {
  992. struct ia64_pal_retval iprv;
  993. PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0);
  994. return iprv.status;
  995. }
  996. /* Processor branding information*/
  997. static inline s64
  998. ia64_pal_get_brand_info (char *brand_info)
  999. {
  1000. struct ia64_pal_retval iprv;
  1001. PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0);
  1002. return iprv.status;
  1003. }
  1004. /* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
  1005. * suspended, but cache and TLB coherency is maintained.
  1006. */
  1007. static inline s64
  1008. ia64_pal_halt_light (void)
  1009. {
  1010. struct ia64_pal_retval iprv;
  1011. PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
  1012. return iprv.status;
  1013. }
  1014. /* Clear all the processor error logging registers and reset the indicator that allows
  1015. * the error logging registers to be written. This procedure also checks the pending
  1016. * machine check bit and pending INIT bit and reports their states.
  1017. */
  1018. static inline s64
  1019. ia64_pal_mc_clear_log (u64 *pending_vector)
  1020. {
  1021. struct ia64_pal_retval iprv;
  1022. PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
  1023. if (pending_vector)
  1024. *pending_vector = iprv.v0;
  1025. return iprv.status;
  1026. }
  1027. /* Ensure that all outstanding transactions in a processor are completed or that any
  1028. * MCA due to thes outstanding transaction is taken.
  1029. */
  1030. static inline s64
  1031. ia64_pal_mc_drain (void)
  1032. {
  1033. struct ia64_pal_retval iprv;
  1034. PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
  1035. return iprv.status;
  1036. }
  1037. /* Return the machine check dynamic processor state */
  1038. static inline s64
  1039. ia64_pal_mc_dynamic_state (u64 offset, u64 *size, u64 *pds)
  1040. {
  1041. struct ia64_pal_retval iprv;
  1042. PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, offset, 0, 0);
  1043. if (size)
  1044. *size = iprv.v0;
  1045. if (pds)
  1046. *pds = iprv.v1;
  1047. return iprv.status;
  1048. }
  1049. /* Return processor machine check information */
  1050. static inline s64
  1051. ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
  1052. {
  1053. struct ia64_pal_retval iprv;
  1054. PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
  1055. if (size)
  1056. *size = iprv.v0;
  1057. if (error_info)
  1058. *error_info = iprv.v1;
  1059. return iprv.status;
  1060. }
  1061. /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
  1062. * attempt to correct any expected machine checks.
  1063. */
  1064. static inline s64
  1065. ia64_pal_mc_expected (u64 expected, u64 *previous)
  1066. {
  1067. struct ia64_pal_retval iprv;
  1068. PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
  1069. if (previous)
  1070. *previous = iprv.v0;
  1071. return iprv.status;
  1072. }
  1073. /* Register a platform dependent location with PAL to which it can save
  1074. * minimal processor state in the event of a machine check or initialization
  1075. * event.
  1076. */
  1077. static inline s64
  1078. ia64_pal_mc_register_mem (u64 physical_addr)
  1079. {
  1080. struct ia64_pal_retval iprv;
  1081. PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, 0, 0);
  1082. return iprv.status;
  1083. }
  1084. /* Restore minimal architectural processor state, set CMC interrupt if necessary
  1085. * and resume execution
  1086. */
  1087. static inline s64
  1088. ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
  1089. {
  1090. struct ia64_pal_retval iprv;
  1091. PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
  1092. return iprv.status;
  1093. }
  1094. /* Return the memory attributes implemented by the processor */
  1095. static inline s64
  1096. ia64_pal_mem_attrib (u64 *mem_attrib)
  1097. {
  1098. struct ia64_pal_retval iprv;
  1099. PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
  1100. if (mem_attrib)
  1101. *mem_attrib = iprv.v0 & 0xff;
  1102. return iprv.status;
  1103. }
  1104. /* Return the amount of memory needed for second phase of processor
  1105. * self-test and the required alignment of memory.
  1106. */
  1107. static inline s64
  1108. ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
  1109. {
  1110. struct ia64_pal_retval iprv;
  1111. PAL_CALL(iprv, PAL_MEM_FOR_TEST, 0, 0, 0);
  1112. if (bytes_needed)
  1113. *bytes_needed = iprv.v0;
  1114. if (alignment)
  1115. *alignment = iprv.v1;
  1116. return iprv.status;
  1117. }
  1118. typedef union pal_perf_mon_info_u {
  1119. u64 ppmi_data;
  1120. struct {
  1121. u64 generic : 8,
  1122. width : 8,
  1123. cycles : 8,
  1124. retired : 8,
  1125. reserved : 32;
  1126. } pal_perf_mon_info_s;
  1127. } pal_perf_mon_info_u_t;
  1128. /* Return the performance monitor information about what can be counted
  1129. * and how to configure the monitors to count the desired events.
  1130. */
  1131. static inline s64
  1132. ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
  1133. {
  1134. struct ia64_pal_retval iprv;
  1135. PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
  1136. if (pm_info)
  1137. pm_info->ppmi_data = iprv.v0;
  1138. return iprv.status;
  1139. }
  1140. /* Specifies the physical address of the processor interrupt block
  1141. * and I/O port space.
  1142. */
  1143. static inline s64
  1144. ia64_pal_platform_addr (u64 type, u64 physical_addr)
  1145. {
  1146. struct ia64_pal_retval iprv;
  1147. PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
  1148. return iprv.status;
  1149. }
  1150. /* Set the SAL PMI entrypoint in memory */
  1151. static inline s64
  1152. ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
  1153. {
  1154. struct ia64_pal_retval iprv;
  1155. PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
  1156. return iprv.status;
  1157. }
  1158. struct pal_features_s;
  1159. /* Provide information about configurable processor features */
  1160. static inline s64
  1161. ia64_pal_proc_get_features (u64 *features_avail,
  1162. u64 *features_status,
  1163. u64 *features_control)
  1164. {
  1165. struct ia64_pal_retval iprv;
  1166. PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0);
  1167. if (iprv.status == 0) {
  1168. *features_avail = iprv.v0;
  1169. *features_status = iprv.v1;
  1170. *features_control = iprv.v2;
  1171. }
  1172. return iprv.status;
  1173. }
  1174. /* Enable/disable processor dependent features */
  1175. static inline s64
  1176. ia64_pal_proc_set_features (u64 feature_select)
  1177. {
  1178. struct ia64_pal_retval iprv;
  1179. PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
  1180. return iprv.status;
  1181. }
  1182. /*
  1183. * Put everything in a struct so we avoid the global offset table whenever
  1184. * possible.
  1185. */
  1186. typedef struct ia64_ptce_info_s {
  1187. u64 base;
  1188. u32 count[2];
  1189. u32 stride[2];
  1190. } ia64_ptce_info_t;
  1191. /* Return the information required for the architected loop used to purge
  1192. * (initialize) the entire TC
  1193. */
  1194. static inline s64
  1195. ia64_get_ptce (ia64_ptce_info_t *ptce)
  1196. {
  1197. struct ia64_pal_retval iprv;
  1198. if (!ptce)
  1199. return -1;
  1200. PAL_CALL(iprv, PAL_PTCE_INFO, 0, 0, 0);
  1201. if (iprv.status == 0) {
  1202. ptce->base = iprv.v0;
  1203. ptce->count[0] = iprv.v1 >> 32;
  1204. ptce->count[1] = iprv.v1 & 0xffffffff;
  1205. ptce->stride[0] = iprv.v2 >> 32;
  1206. ptce->stride[1] = iprv.v2 & 0xffffffff;
  1207. }
  1208. return iprv.status;
  1209. }
  1210. /* Return info about implemented application and control registers. */
  1211. static inline s64
  1212. ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
  1213. {
  1214. struct ia64_pal_retval iprv;
  1215. PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
  1216. if (reg_info_1)
  1217. *reg_info_1 = iprv.v0;
  1218. if (reg_info_2)
  1219. *reg_info_2 = iprv.v1;
  1220. return iprv.status;
  1221. }
  1222. typedef union pal_hints_u {
  1223. u64 ph_data;
  1224. struct {
  1225. u64 si : 1,
  1226. li : 1,
  1227. reserved : 62;
  1228. } pal_hints_s;
  1229. } pal_hints_u_t;
  1230. /* Return information about the register stack and RSE for this processor
  1231. * implementation.
  1232. */
  1233. static inline s64
  1234. ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
  1235. {
  1236. struct ia64_pal_retval iprv;
  1237. PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
  1238. if (num_phys_stacked)
  1239. *num_phys_stacked = iprv.v0;
  1240. if (hints)
  1241. hints->ph_data = iprv.v1;
  1242. return iprv.status;
  1243. }
  1244. /* Cause the processor to enter SHUTDOWN state, where prefetching and execution are
  1245. * suspended, but cause cache and TLB coherency to be maintained.
  1246. * This is usually called in IA-32 mode.
  1247. */
  1248. static inline s64
  1249. ia64_pal_shutdown (void)
  1250. {
  1251. struct ia64_pal_retval iprv;
  1252. PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
  1253. return iprv.status;
  1254. }
  1255. /* Perform the second phase of processor self-test. */
  1256. static inline s64
  1257. ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
  1258. {
  1259. struct ia64_pal_retval iprv;
  1260. PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
  1261. if (self_test_state)
  1262. *self_test_state = iprv.v0;
  1263. return iprv.status;
  1264. }
  1265. typedef union pal_version_u {
  1266. u64 pal_version_val;
  1267. struct {
  1268. u64 pv_pal_b_rev : 8;
  1269. u64 pv_pal_b_model : 8;
  1270. u64 pv_reserved1 : 8;
  1271. u64 pv_pal_vendor : 8;
  1272. u64 pv_pal_a_rev : 8;
  1273. u64 pv_pal_a_model : 8;
  1274. u64 pv_reserved2 : 16;
  1275. } pal_version_s;
  1276. } pal_version_u_t;
  1277. /*
  1278. * Return PAL version information. While the documentation states that
  1279. * PAL_VERSION can be called in either physical or virtual mode, some
  1280. * implementations only allow physical calls. We don't call it very often,
  1281. * so the overhead isn't worth eliminating.
  1282. */
  1283. static inline s64
  1284. ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
  1285. {
  1286. struct ia64_pal_retval iprv;
  1287. PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
  1288. if (pal_min_version)
  1289. pal_min_version->pal_version_val = iprv.v0;
  1290. if (pal_cur_version)
  1291. pal_cur_version->pal_version_val = iprv.v1;
  1292. return iprv.status;
  1293. }
  1294. typedef union pal_tc_info_u {
  1295. u64 pti_val;
  1296. struct {
  1297. u64 num_sets : 8,
  1298. associativity : 8,
  1299. num_entries : 16,
  1300. pf : 1,
  1301. unified : 1,
  1302. reduce_tr : 1,
  1303. reserved : 29;
  1304. } pal_tc_info_s;
  1305. } pal_tc_info_u_t;
  1306. #define tc_reduce_tr pal_tc_info_s.reduce_tr
  1307. #define tc_unified pal_tc_info_s.unified
  1308. #define tc_pf pal_tc_info_s.pf
  1309. #define tc_num_entries pal_tc_info_s.num_entries
  1310. #define tc_associativity pal_tc_info_s.associativity
  1311. #define tc_num_sets pal_tc_info_s.num_sets
  1312. /* Return information about the virtual memory characteristics of the processor
  1313. * implementation.
  1314. */
  1315. static inline s64
  1316. ia64_pal_vm_info (u64 tc_level, u64 tc_type, pal_tc_info_u_t *tc_info, u64 *tc_pages)
  1317. {
  1318. struct ia64_pal_retval iprv;
  1319. PAL_CALL(iprv, PAL_VM_INFO, tc_level, tc_type, 0);
  1320. if (tc_info)
  1321. tc_info->pti_val = iprv.v0;
  1322. if (tc_pages)
  1323. *tc_pages = iprv.v1;
  1324. return iprv.status;
  1325. }
  1326. /* Get page size information about the virtual memory characteristics of the processor
  1327. * implementation.
  1328. */
  1329. static inline s64
  1330. ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
  1331. {
  1332. struct ia64_pal_retval iprv;
  1333. PAL_CALL(iprv, PAL_VM_PAGE_SIZE, 0, 0, 0);
  1334. if (tr_pages)
  1335. *tr_pages = iprv.v0;
  1336. if (vw_pages)
  1337. *vw_pages = iprv.v1;
  1338. return iprv.status;
  1339. }
  1340. typedef union pal_vm_info_1_u {
  1341. u64 pvi1_val;
  1342. struct {
  1343. u64 vw : 1,
  1344. phys_add_size : 7,
  1345. key_size : 8,
  1346. max_pkr : 8,
  1347. hash_tag_id : 8,
  1348. max_dtr_entry : 8,
  1349. max_itr_entry : 8,
  1350. max_unique_tcs : 8,
  1351. num_tc_levels : 8;
  1352. } pal_vm_info_1_s;
  1353. } pal_vm_info_1_u_t;
  1354. typedef union pal_vm_info_2_u {
  1355. u64 pvi2_val;
  1356. struct {
  1357. u64 impl_va_msb : 8,
  1358. rid_size : 8,
  1359. reserved : 48;
  1360. } pal_vm_info_2_s;
  1361. } pal_vm_info_2_u_t;
  1362. /* Get summary information about the virtual memory characteristics of the processor
  1363. * implementation.
  1364. */
  1365. static inline s64
  1366. ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
  1367. {
  1368. struct ia64_pal_retval iprv;
  1369. PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
  1370. if (vm_info_1)
  1371. vm_info_1->pvi1_val = iprv.v0;
  1372. if (vm_info_2)
  1373. vm_info_2->pvi2_val = iprv.v1;
  1374. return iprv.status;
  1375. }
  1376. typedef union pal_itr_valid_u {
  1377. u64 piv_val;
  1378. struct {
  1379. u64 access_rights_valid : 1,
  1380. priv_level_valid : 1,
  1381. dirty_bit_valid : 1,
  1382. mem_attr_valid : 1,
  1383. reserved : 60;
  1384. } pal_tr_valid_s;
  1385. } pal_tr_valid_u_t;
  1386. /* Read a translation register */
  1387. static inline s64
  1388. ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
  1389. {
  1390. struct ia64_pal_retval iprv;
  1391. PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)ia64_tpa(tr_buffer));
  1392. if (tr_valid)
  1393. tr_valid->piv_val = iprv.v0;
  1394. return iprv.status;
  1395. }
  1396. /*
  1397. * PAL_PREFETCH_VISIBILITY transaction types
  1398. */
  1399. #define PAL_VISIBILITY_VIRTUAL 0
  1400. #define PAL_VISIBILITY_PHYSICAL 1
  1401. /*
  1402. * PAL_PREFETCH_VISIBILITY return codes
  1403. */
  1404. #define PAL_VISIBILITY_OK 1
  1405. #define PAL_VISIBILITY_OK_REMOTE_NEEDED 0
  1406. #define PAL_VISIBILITY_INVAL_ARG -2
  1407. #define PAL_VISIBILITY_ERROR -3
  1408. static inline s64
  1409. ia64_pal_prefetch_visibility (s64 trans_type)
  1410. {
  1411. struct ia64_pal_retval iprv;
  1412. PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0);
  1413. return iprv.status;
  1414. }
  1415. /* data structure for getting information on logical to physical mappings */
  1416. typedef union pal_log_overview_u {
  1417. struct {
  1418. u64 num_log :16, /* Total number of logical
  1419. * processors on this die
  1420. */
  1421. tpc :8, /* Threads per core */
  1422. reserved3 :8, /* Reserved */
  1423. cpp :8, /* Cores per processor */
  1424. reserved2 :8, /* Reserved */
  1425. ppid :8, /* Physical processor ID */
  1426. reserved1 :8; /* Reserved */
  1427. } overview_bits;
  1428. u64 overview_data;
  1429. } pal_log_overview_t;
  1430. typedef union pal_proc_n_log_info1_u{
  1431. struct {
  1432. u64 tid :16, /* Thread id */
  1433. reserved2 :16, /* Reserved */
  1434. cid :16, /* Core id */
  1435. reserved1 :16; /* Reserved */
  1436. } ppli1_bits;
  1437. u64 ppli1_data;
  1438. } pal_proc_n_log_info1_t;
  1439. typedef union pal_proc_n_log_info2_u {
  1440. struct {
  1441. u64 la :16, /* Logical address */
  1442. reserved :48; /* Reserved */
  1443. } ppli2_bits;
  1444. u64 ppli2_data;
  1445. } pal_proc_n_log_info2_t;
  1446. typedef struct pal_logical_to_physical_s
  1447. {
  1448. pal_log_overview_t overview;
  1449. pal_proc_n_log_info1_t ppli1;
  1450. pal_proc_n_log_info2_t ppli2;
  1451. } pal_logical_to_physical_t;
  1452. #define overview_num_log overview.overview_bits.num_log
  1453. #define overview_tpc overview.overview_bits.tpc
  1454. #define overview_cpp overview.overview_bits.cpp
  1455. #define overview_ppid overview.overview_bits.ppid
  1456. #define log1_tid ppli1.ppli1_bits.tid
  1457. #define log1_cid ppli1.ppli1_bits.cid
  1458. #define log2_la ppli2.ppli2_bits.la
  1459. /* Get information on logical to physical processor mappings. */
  1460. static inline s64
  1461. ia64_pal_logical_to_phys(u64 proc_number, pal_logical_to_physical_t *mapping)
  1462. {
  1463. struct ia64_pal_retval iprv;
  1464. PAL_CALL(iprv, PAL_LOGICAL_TO_PHYSICAL, proc_number, 0, 0);
  1465. if (iprv.status == PAL_STATUS_SUCCESS)
  1466. {
  1467. mapping->overview.overview_data = iprv.v0;
  1468. mapping->ppli1.ppli1_data = iprv.v1;
  1469. mapping->ppli2.ppli2_data = iprv.v2;
  1470. }
  1471. return iprv.status;
  1472. }
  1473. typedef struct pal_cache_shared_info_s
  1474. {
  1475. u64 num_shared;
  1476. pal_proc_n_log_info1_t ppli1;
  1477. pal_proc_n_log_info2_t ppli2;
  1478. } pal_cache_shared_info_t;
  1479. /* Get information on logical to physical processor mappings. */
  1480. static inline s64
  1481. ia64_pal_cache_shared_info(u64 level,
  1482. u64 type,
  1483. u64 proc_number,
  1484. pal_cache_shared_info_t *info)
  1485. {
  1486. struct ia64_pal_retval iprv;
  1487. PAL_CALL(iprv, PAL_CACHE_SHARED_INFO, level, type, proc_number);
  1488. if (iprv.status == PAL_STATUS_SUCCESS) {
  1489. info->num_shared = iprv.v0;
  1490. info->ppli1.ppli1_data = iprv.v1;
  1491. info->ppli2.ppli2_data = iprv.v2;
  1492. }
  1493. return iprv.status;
  1494. }
  1495. #endif /* __ASSEMBLY__ */
  1496. #endif /* _ASM_IA64_PAL_H */