pal.h 49 KB

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