]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PalCallLib.h
Checked in PalCallLib.h. The patch does not remove the "/IndustryStandard/Pal.h"...
[mirror_edk2.git] / MdePkg / Include / Library / PalCallLib.h
CommitLineData
fb3df220 1/** @file\r
2 PAL Call Services\r
3\r
c13f09d0 4 Copyright (c) 2006 -2007, Intel Corporation All rights\r
5 reserved. This program and the accompanying materials are\r
6 licensed and made available under the terms and conditions of\r
7 the BSD License which accompanies this distribution. The full\r
8 text of the license may be found at\r
fb3df220 9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
c13f09d0 14 Module Name: PalCallLib.h\r
15\r
fb3df220 16**/\r
17\r
18#ifndef __PAL_CALL_LIB_H__\r
19#define __PAL_CALL_LIB_H__\r
20\r
c13f09d0 21typedef int PAL_CALL_RETURN;\r
22//\r
23// CacheType of PAL_CACHE_FLUSH.\r
24//\r
25#define PAL_CACHE_FLUSH_INSTRUCTION_ALL 1\r
26#define PAL_CACHE_FLUSH_DATA_ALL 2\r
27#define PAL_CACHE_FLUSH_ALL 3\r
28#define PAL_CACHE_FLUSH_SYNC_TO_DATA 4\r
29\r
30\r
31//\r
32// Bitmask of Opearation of PAL_CACHE_FLUSH.\r
33// \r
34#define PAL_CACHE_FLUSH_INVIDED_LINES BIT0\r
35#define PAL_CACHE_FLUSH_PROBE_INTERRUPT BIT1\r
36\r
37/**\r
38 \r
39 PAL Procedure - PAL_CACHE_FLUSH.\r
40 \r
41 Flush the instruction or data caches. It is required by IPF.\r
42 The PAL procedure supports the Static Registers calling\r
43 convention. It could be called at virtual mode and physical\r
44 mode.\r
45\r
46 @param Index Index of PAL_CACHE_FLUSH within the\r
47 list of PAL procedures.\r
48 \r
49 @param CacheType Unsigned 64-bit integer indicating\r
50 which cache to flush.\r
51\r
52 @param Operation Formatted bit vector indicating the\r
53 operation of this call.\r
54\r
55 @param ProgressIndicator Unsigned 64-bit integer specifying\r
56 the starting position of the flush\r
57 operation.\r
58 \r
59 @return R9 Unsigned 64-bit integer specifying the vector\r
60 number of the pending interrupt.\r
61 \r
62 @return R10 Unsigned 64-bit integer specifying the\r
63 starting position of the flush operation.\r
64 \r
65 @return R11 Unsigned 64-bit integer specifying the vector\r
66 number of the pending interrupt.\r
67 \r
68 @return Status 2 - Call completed without error, but a PMI\r
69 was taken during the execution of this\r
70 procedure.\r
71\r
72 @return Status 1 - Call has not completed flushing due to\r
73 a pending interrupt.\r
74\r
75 @return Status 0 - Call completed without error\r
76\r
77 @return Status -2 - Invalid argument\r
78\r
79 @return Status -3 - Call completed with error\r
80 \r
81**/\r
82#define PAL_CACHE_FLUSH 1\r
83\r
84\r
85//\r
86// Attributes of PAL_CACHE_CONFIG_INFO1\r
87// \r
88#define PAL_CACHE_ATTR_WT 0\r
89#define PAL_CACHE_ATTR_WB 1\r
90\r
91//\r
92// PAL_CACHE_CONFIG_INFO1.StoreHint\r
93// \r
94#define PAL_CACHE_STORE_TEMPORAL 0\r
95#define PAL_CACHE_STORE_NONE_TEMPORAL 3\r
96\r
97//\r
98// PAL_CACHE_CONFIG_INFO1.StoreHint\r
99// \r
100#define PAL_CACHE_STORE_TEMPORAL_LVL_1 0\r
101#define PAL_CACHE_STORE_NONE_TEMPORAL_LVL_ALL 3\r
102\r
103//\r
104// PAL_CACHE_CONFIG_INFO1.StoreHint\r
105// \r
106#define PAL_CACHE_LOAD_TEMPORAL_LVL_1 0\r
107#define PAL_CACHE_LOAD_NONE_TEMPORAL_LVL_1 1\r
108#define PAL_CACHE_LOAD_NONE_TEMPORAL_LVL_ALL 3\r
109\r
110//\r
111// Detail the characteristics of a given processor controlled\r
112// cache in the cache hierarchy.\r
113// \r
114typedef struct {\r
115 UINT64 IsUnified : 1;\r
116 UINT64 Attributes : 2;\r
117 UINT64 Associativity:8;\r
118 UINT64 LineSize:8;\r
119 UINT64 Stride:8;\r
120 UINT64 StoreLatency:8;\r
121 UINT64 StoreHint:8;\r
122 UINT64 LoadHint:8;\r
123} PAL_CACHE_INFO_RETURN1;\r
124\r
125//\r
126// Detail the characteristics of a given processor controlled\r
127// cache in the cache hierarchy.\r
128// \r
129typedef struct {\r
130 UINT64 CacheSize:32;\r
131 UINT64 AliasBoundary:8;\r
132 UINT64 TagLsBits:8;\r
133 UINT64 TagMsBits:8;\r
134} PAL_CACHE_INFO_RETURN2;\r
135\r
136/**\r
137 \r
138 PAL Procedure - PAL_CACHE_INFO.\r
139 \r
140 Return detailed instruction or data cache information. It is\r
141 required by IPF. The PAL procedure supports the Static\r
142 Registers calling convention. It could be called at virtual\r
143 mode and physical mode.\r
144 \r
145 @param Index Index of PAL_CACHE_INFO within the list of\r
146 PAL procedures.\r
147 \r
148 @param CacheLevel Unsigned 64-bit integer specifying the\r
149 level in the cache hierarchy for which\r
150 information is requested. This value must\r
151 be between 0 and one less than the value\r
152 returned in the cache_levels return value\r
153 from PAL_CACHE_SUMMARY.\r
154 \r
155 @param CacheType Unsigned 64-bit integer with a value of 1\r
156 for instruction cache and 2 for data or\r
157 unified cache. All other values are\r
158 reserved.\r
159 \r
160 @param Reserved Should be 0.\r
161 \r
162 \r
163 @return R9 Detail the characteristics of a given\r
164 processor controlled cache in the cache\r
165 hierarchy. See PAL_CACHE_INFO_RETURN1.\r
166 \r
167 @return R10 Detail the characteristics of a given\r
168 processor controlled cache in the cache\r
169 hierarchy. See PAL_CACHE_INFO_RETURN2.\r
170 \r
171 @return R11 Reserved with 0.\r
172 \r
173 \r
174 @return Status 0 - Call completed without error\r
175\r
176 @return Status -2 - Invalid argument\r
177\r
178 @return Status -3 - Call completed with error\r
179 \r
180**/\r
181#define PAL_CACHE_INFO 2\r
182\r
183\r
184\r
185//\r
186// Level of PAL_CACHE_INIT.\r
187// \r
188#define PAL_CACHE_INIT_ALL 0xffffffffffffffffULL\r
189\r
190//\r
191// Restrict of PAL_CACHE_INIT.\r
192// \r
193#define PAL_CACHE_INIT_NO_RESTRICT 0\r
194#define PAL_CACHE_INIT_RESTRICTED 1\r
195\r
196/**\r
197 \r
198 PAL Procedure - PAL_CACHE_INIT.\r
199 \r
200 Initialize the instruction or data caches. It is required by\r
201 IPF. The PAL procedure supports the Static Registers calling\r
202 convention. It could be called at physical mode.\r
203\r
204 @param Index Index of PAL_CACHE_INIT within the list of PAL\r
205 procedures.\r
206 \r
207 @param Level Unsigned 64-bit integer containing the level of\r
208 cache to initialize. If the cache level can be\r
209 initialized independently, only that level will\r
210 be initialized. Otherwise\r
211 implementation-dependent side-effects will\r
212 occur.\r
213 \r
214 @param CacheType Unsigned 64-bit integer with a value of 1 to\r
215 initialize the instruction cache, 2 to\r
216 initialize the data cache, or 3 to\r
217 initialize both. All other values are\r
218 reserved.\r
219\r
220 @param Restrict Unsigned 64-bit integer with a value of 0 or\r
221 1. All other values are reserved. If\r
222 restrict is 1 and initializing the specified\r
223 level and cache_type of the cache would\r
224 cause side-effects, PAL_CACHE_INIT will\r
225 return -4 instead of initializing the cache.\r
226 \r
227 \r
228 @return Status 0 - Call completed without error\r
229\r
230 @return Status -2 - Invalid argument\r
231\r
232 @return Status -3 - Call completed with error.\r
233 \r
234 @return Status -4 - Call could not initialize the specified\r
235 level and cache_type of the cache without\r
236 side-effects and restrict was 1. \r
237 \r
238**/\r
239#define PAL_CACHE_INIT 3 \r
240\r
241\r
242//\r
243// PAL_CACHE_PROTECTION.Method.\r
244// \r
245#define PAL_CACHE_PROTECTION_NONE_PROTECT 0\r
246#define PAL_CACHE_PROTECTION_ODD_PROTECT 1\r
247#define PAL_CACHE_PROTECTION_EVEN_PROTECT 2\r
248#define PAL_CACHE_PROTECTION_ECC_PROTECT 3\r
249\r
250\r
251\r
252//\r
253// PAL_CACHE_PROTECTION.TagOrData.\r
254// \r
255#define PAL_CACHE_PROTECTION_PROTECT_DATA 0\r
256#define PAL_CACHE_PROTECTION_PROTECT_TAG 1\r
257#define PAL_CACHE_PROTECTION_PROTECT_TAG_ANDTHEN_DATA 2\r
258#define PAL_CACHE_PROTECTION_PROTECT_DATA_ANDTHEN_TAG 3\r
259\r
260//\r
261// 32-bit protection information structures.\r
262// \r
263typedef struct {\r
264 UINT32 DataBits:8;\r
265 UINT32 TagProtLsb:6;\r
266 UINT32 TagProtMsb:6;\r
267 UINT32 ProtBits:6;\r
268 UINT32 Method:4;\r
269 UINT32 TagOrData:2;\r
270} PAL_CACHE_PROTECTION;\r
271\r
272/**\r
273 \r
274 PAL Procedure - PAL_CACHE_PROT_INFO.\r
275 \r
276 Return instruction or data cache protection information. It is\r
277 required by IPF. The PAL procedure supports the Static\r
278 Registers calling convention. It could be called at physical\r
279 mode and Virtual mode.\r
280\r
281 @param Index Index of PAL_CACHE_PROT_INFO within the list of\r
282 PAL procedures.\r
283\r
284 @param CacheLevel Unsigned 64-bit integer specifying the level\r
285 in the cache hierarchy for which information\r
286 is requested. This value must be between 0\r
287 and one less than the value returned in the\r
288 cache_levels return value from\r
289 PAL_CACHE_SUMMARY.\r
290\r
291 @param CacheType Unsigned 64-bit integer with a value of 1\r
292 for instruction cache and 2 for data or\r
293 unified cache. All other values are\r
294 reserved.\r
295 \r
296 @return R9 Detail the characteristics of a given\r
297 processor controlled cache in the cache\r
298 hierarchy. See PAL_CACHE_PROTECTION[0..1].\r
299 \r
300 @return R10 Detail the characteristics of a given\r
301 processor controlled cache in the cache\r
302 hierarchy. See PAL_CACHE_PROTECTION[2..3].\r
303 \r
304 @return R11 Detail the characteristics of a given\r
305 processor controlled cache in the cache\r
306 hierarchy. See PAL_CACHE_PROTECTION[4..5].\r
307 \r
308 \r
309 @return Status 0 - Call completed without error\r
310\r
311 @return Status -2 - Invalid argument\r
312\r
313 @return Status -3 - Call completed with error.\r
314 \r
315**/\r
316#define PAL_CACHE_PROT_INFO 38\r
317\r
318/**\r
319 \r
320 @param ThreadId The thread identifier of the logical\r
321 processor for which information is being\r
322 returned. This value will be unique on a per\r
323 core basis.\r
324\r
325 @param CoreId The core identifier of the logical processor\r
326 for which information is being returned.\r
327 This value will be unique on a per physical\r
328 processor package basis.\r
329\r
330**/\r
331typedef struct {\r
332 UINT64 ThreadId : 16;\r
333 UINT64 Reserved1: 16;\r
334 UINT64 CoreId: 16;\r
335 UINT64 Reserved2: 16;\r
336} PAL_PCOC_N_CACHE_INFO1;\r
337\r
338/**\r
339 \r
340 @param LogicalAddress Logical address: geographical address\r
341 of the logical processor for which\r
342 information is being returned. This is\r
343 the same value that is returned by the\r
344 PAL_FIXED_ADDR procedure when it is\r
345 called on the logical processor.\r
346\r
347**/\r
348typedef struct {\r
349 UINT64 LogicalAddress : 16;\r
350 UINT64 Reserved1: 16;\r
351 UINT64 Reserved2: 32;\r
352} PAL_PCOC_N_CACHE_INFO2;\r
353\r
354/**\r
355 \r
356 PAL Procedure - PAL_CACHE_SHARED_INFO.\r
357 \r
358 Returns information on which logical processors share caches.\r
359 It is optional. The PAL procedure supports the Static\r
360 Registers calling convention. It could be called at physical\r
361 mode and Virtual mode.\r
362 \r
363 @param Index Index of PAL_CACHE_SHARED_INFO within the list\r
364 of PAL procedures.\r
365 \r
366 @param CacheLevel Unsigned 64-bit integer specifying the\r
367 level in the cache hierarchy for which\r
368 information is requested. This value must\r
369 be between 0 and one less than the value\r
370 returned in the cache_levels return value\r
371 from PAL_CACHE_SUMMARY.\r
372 \r
373 @param CacheType Unsigned 64-bit integer with a value of 1\r
374 for instruction cache and 2 for data or\r
375 unified cache. All other values are\r
376 reserved.\r
377 \r
378 @param ProcNumber Unsigned 64-bit integer that specifies for\r
379 which logical processor information is\r
380 being requested. This input argument must\r
381 be zero for the first call to this\r
382 procedure and can be a maximum value of\r
383 one less than the number of logical\r
384 processors sharing this cache, which is\r
385 returned by the num_shared return value.\r
386 \r
387 @return R9 Unsigned integer that returns the number of\r
388 logical processors that share the processor\r
389 cache level and type, for which information was\r
390 requested.\r
391\r
392 @return R10 The format of PAL_PCOC_N_CACHE_INFO1.\r
393\r
394 @return R11 The format of PAL_PCOC_N_CACHE_INFO2.\r
395\r
396 @return Status 0 - Call completed without error\r
397\r
398 @return Status -1 - Unimplemented procedure\r
399\r
400 @return Status -2 - Invalid argument\r
401\r
402 @return Status -3 - Call completed with error.\r
403 \r
404**/\r
405#define PAL_CACHE_SHARED_INFO 43\r
406\r
407\r
408/**\r
409 \r
410 PAL Procedure - PAL_CACHE_SUMMARY.\r
411 \r
412 Return a summary of the cache hierarchy. It is required by\r
413 IPF. The PAL procedure supports the Static Registers calling\r
414 convention. It could be called at physical mode and Virtual\r
415 mode.\r
416 \r
417 @param Index Index of PAL_CACHE_SUMMARY within the list of\r
418 PAL procedures.\r
419\r
420 \r
421 @return R9 CacheLevels Unsigned 64-bit integer denoting the\r
422 number of levels of cache\r
423 implemented by the processor.\r
424 Strictly, this is the number of\r
425 levels for which the cache\r
426 controller is integrated into the\r
427 processor (the cache SRAMs may be\r
428 external to the processor).\r
429\r
430 @return R10 UniqueCaches Unsigned 64-bit integer denoting the\r
431 number of unique caches implemented\r
432 by the processor. This has a maximum\r
433 of 2*cache_levels, but may be less\r
434 if any of the levels in the cache\r
435 hierarchy are unified caches or do\r
436 not have both instruction and data\r
437 caches.\r
438\r
439 @return Status 0 - Call completed without error\r
440\r
441 @return Status -2 - Invalid argument\r
442\r
443 @return Status -3 - Call completed with error.\r
444 \r
445**/\r
446#define PAL_CACHE_SUMMARY 4\r
447\r
448\r
449//\r
450// Virtual Memory Attributes implemented by processor. \r
451// \r
452#define PAL_MEMORY_ATTR_WB 0\r
453#define PAL_MEMORY_ATTR_WC 6\r
454#define PAL_MEMORY_ATTR_UC 4\r
455#define PAL_MEMORY_ATTR_UCE 5\r
456#define PAL_MEMORY_ATTR_NATPAGE 7\r
457\r
458/**\r
459 \r
460 PAL Procedure - PAL_MEM_ATTRIB.\r
461 \r
462 Return a list of supported memory attributes.. It is required\r
463 by IPF. The PAL procedure supports the Static Registers calling\r
464 convention. It could be called at physical mode and Virtual\r
465 mode.\r
466 \r
467 @param Index Index of PAL_MEM_ATTRIB within the list of PAL\r
468 procedures.\r
469\r
470 \r
471 @return R9 Attributes 8-bit vector of memory attributes\r
472 implemented by processor. See Virtual\r
473 Memory Attributes above.\r
474\r
475 @return Status 0 - Call completed without error\r
476\r
477 @return Status -2 - Invalid argument\r
478\r
479 @return Status -3 - Call completed with error.\r
480 \r
481**/\r
482\r
483#define PAL_MEM_ATTRIB 5\r
484\r
485/**\r
486 \r
487 PAL Procedure - PAL_PREFETCH_VISIBILITY.\r
488 \r
489 Used in architected sequence to transition pages from a\r
490 cacheable, speculative attribute to an uncacheable attribute.\r
491 It is required by IPF. The PAL procedure supports the Static\r
492 Registers calling convention. It could be called at physical\r
493 mode and Virtual mode.\r
494 \r
495 @param Index Index of PAL_PREFETCH_VISIBILITY within the list\r
496 of PAL procedures.\r
497\r
498 @param TransitionType Unsigned integer specifying the type\r
499 of memory attribute transition that is\r
500 being performed.\r
501 \r
502 @return Status 1 Call completed without error; this\r
503 call is not necessary on remote\r
504 processors.\r
505\r
506 @return Status 0 - Call completed without error\r
507\r
508 @return Status -2 - Invalid argument\r
509\r
510 @return Status -3 - Call completed with error.\r
511 \r
512**/\r
513#define PAL_PREFETCH_VISIBILITY 41\r
514\r
515/**\r
516 \r
517 PAL Procedure - PAL_PTCE_INFO.\r
518 \r
519 Return information needed for ptc.e instruction to purge\r
520 entire TC. It is required by IPF. The PAL procedure supports\r
521 the Static Registers calling convention. It could be called at\r
522 physical mode and Virtual mode.\r
523 \r
524 @param Index Index of PAL_PTCE_INFO within the list\r
525 of PAL procedures.\r
526\r
527 @return R9 Unsigned 64-bit integer denoting the beginning\r
528 address to be used by the first PTCE instruction\r
529 in the purge loop.\r
530 \r
531 @return R10 Two unsigned 32-bit integers denoting the loop\r
532 counts of the outer (loop 1) and inner (loop 2)\r
533 purge loops. count1 (loop 1) is contained in bits\r
534 63:32 of the parameter, and count2 (loop 2) is\r
535 contained in bits 31:0 of the parameter.\r
536 \r
537 @return R11 Two unsigned 32-bit integers denoting the loop\r
538 strides of the outer (loop 1) and inner (loop 2)\r
539 purge loops. stride1 (loop 1) is contained in bits\r
540 63:32 of the parameter, and stride2 (loop 2) is\r
541 contained in bits 31:0 of the parameter.\r
542\r
543 @return Status 0 - Call completed without error\r
544\r
545 @return Status -2 - Invalid argument\r
546\r
547 @return Status -3 - Call completed with error.\r
548 \r
549**/\r
550#define PAL_PTCE_INFO 6\r
551\r
552\r
553\r
554/**\r
555 \r
556 @param NumberSets Unsigned 8-bit integer denoting the number\r
557 of hash sets for the specified level\r
558 (1=fully associative)\r
559\r
560 @param NumberWays Unsigned 8-bit integer denoting the\r
561 associativity of the specified level\r
562 (1=direct).\r
563\r
564 @param NumberEntries Unsigned 16-bit integer denoting the\r
565 number of entries in the specified TC.\r
566\r
567\r
568 @param PageSizeIsOptimized Flag denoting whether the\r
569 specified level is optimized for\r
570 the region's preferred page size\r
571 (1=optimized) tc_pages indicates\r
572 which page sizes are usable by\r
573 this translation cache.\r
574\r
575 @param TcIsUnified Flag denoting whether the specified TC is\r
576 unified (1=unified).\r
577\r
578 @param EntriesReduction Flag denoting whether installed\r
579 translation registers will reduce\r
580 the number of entries within the\r
581 specified TC.\r
582\r
583**/\r
584typedef struct {\r
585 UINT64 NumberSets:8;\r
586 UINT64 NumberWays:8;\r
587 UINT64 NumberEntries:16;\r
588 UINT64 PageSizeIsOptimized:1;\r
589 UINT64 TcIsUnified:1;\r
590 UINT64 EntriesReduction:1;\r
591} PAL_TC_INFO;\r
592\r
593/**\r
594 \r
595 PAL Procedure - PAL_VM_INFO.\r
596 \r
597 Return detailed information about virtual memory features\r
598 supported in the processor. It is required by IPF. The PAL\r
599 procedure supports the Static Registers calling convention. It\r
600 could be called at physical mode and Virtual mode.\r
601 \r
602 @param Index Index of PAL_VM_INFO within the list\r
603 of PAL procedures.\r
604 \r
605 @param TcLevel Unsigned 64-bit integer specifying the level\r
606 in the TLB hierarchy for which information is\r
607 required. This value must be between 0 and one\r
608 less than the value returned in the\r
609 vm_info_1.num_tc_levels return value from\r
610 PAL_VM_SUMMARY.\r
611 \r
612 @param TcType Unsigned 64-bit integer with a value of 1 for\r
613 instruction translation cache and 2 for data\r
614 or unified translation cache. All other values\r
615 are reserved.\r
616\r
617 @return R9 8-byte formatted value returning information\r
618 about the specified TC. See PAL_TC_INFO above.\r
619\r
620 @return R10 64-bit vector containing a bit for each page\r
621 size supported in the specified TC, where bit\r
622 position n indicates a page size of 2**n.\r
623\r
624 @return Status 0 - Call completed without error\r
625\r
626 @return Status -2 - Invalid argument\r
627\r
628 @return Status -3 - Call completed with error.\r
629 \r
630**/\r
631#define PAL_VM_INFO 7\r
632\r
633\r
634/**\r
635 \r
636 PAL Procedure - PAL_VM_PAGE_SIZE.\r
637 \r
638 Return virtual memory TC and hardware walker page sizes\r
639 supported in the processor. It is required by IPF. The PAL\r
640 procedure supports the Static Registers calling convention. It\r
641 could be called at physical mode and Virtual mode.\r
642 \r
643 @param Index Index of PAL_VM_PAGE_SIZE within the list\r
644 of PAL procedures.\r
645 \r
646\r
647 @return R9 64-bit vector containing a bit for each\r
648 architected page size that is supported for\r
649 TLB insertions and region registers.\r
650\r
651 @return R10 64-bit vector containing a bit for each\r
652 architected page size supported for TLB purge\r
653 operations.\r
654\r
655 @return Status 0 - Call completed without error\r
656\r
657 @return Status -2 - Invalid argument\r
658\r
659 @return Status -3 - Call completed with error.\r
660 \r
661**/\r
662#define PAL_VM_PAGE_SIZE 34\r
663\r
664/**\r
665 \r
666 @param WalkerPresent 1-bit flag indicating whether a hardware\r
667 TLB walker is implemented (1 = walker\r
668 present).\r
669\r
670 @param WidthOfPhysicalAddress Unsigned 7-bit integer\r
671 denoting the number of bits of\r
672 physical address implemented.\r
673\r
674 @param WidthOfKey Unsigned 8-bit integer denoting the number\r
675 of bits mplemented in the PKR.key field.\r
676\r
677 @param MaxPkrIndex Unsigned 8-bit integer denoting the\r
678 maximum PKR index (number of PKRs-1).\r
679\r
680 @param HashTagId Unsigned 8-bit integer which uniquely\r
681 identifies the processor hash and tag\r
682 algorithm.\r
683\r
684 @param MaxDtrIndex Unsigned 8 bit integer denoting the\r
685 maximum data translation register index\r
686 (number of dtr entries - 1).\r
687\r
688 @param MaxItrIndex Unsigned 8 bit integer denoting the\r
689 maximum instruction translation register\r
690 index (number of itr entries - 1).\r
691\r
692 @param NumberOfUniqueTc Unsigned 8-bit integer denoting the\r
693 number of unique TCs implemented.\r
694 This is a maximum of\r
695 2*num_tc_levels.\r
696\r
697 @param NumberOfTcLevels Unsigned 8-bit integer denoting the\r
698 number of TC levels.\r
699\r
700**/\r
701typedef struct {\r
702 UINT64 WalkerPresent:1;\r
703 UINT64 WidthOfPhysicalAddress: 7;\r
704 UINT64 WidthOfKey:8;\r
705 UINT64 MaxPkrIndex:8;\r
706 UINT64 HashTagId:8;\r
707 UINT64 MaxDtrIndex:8;\r
708 UINT64 MaxItrIndex:8;\r
709 UINT64 NumberOfUniqueTc:8;\r
710 UINT64 NumberOfTcLevels:8;\r
711} PAL_VM_INFO1;\r
712\r
713/**\r
714 \r
715 @param WidthOfVirtualAddress Unsigned 8-bit integer denoting\r
716 is the total number of virtual\r
717 address bits - 1.\r
718\r
719 @param WidthOfRid Unsigned 8-bit integer denoting the number\r
720 of bits implemented in the RR.rid field.\r
721\r
722 @param MaxPurgedTlbs Unsigned 16 bit integer denoting the\r
723 maximum number of concurrent outstanding\r
724 TLB purges allowed by the processor. A\r
725 value of 0 indicates one outstanding\r
726 purge allowed. A value of 216-1\r
727 indicates no limit on outstanding\r
728 purges. All other values indicate the\r
729 actual number of concurrent outstanding\r
730 purges allowed.\r
731\r
732**/\r
733typedef struct {\r
734 UINT64 WidthOfVirtualAddress:8;\r
735 UINT64 WidthOfRid:8;\r
736 UINT64 MaxPurgedTlbs:16;\r
737 UINT64 Reserved:32;\r
738} PAL_VM_INFO2;\r
739\r
740/**\r
741 \r
742 PAL Procedure - PAL_VM_SUMMARY.\r
743 \r
744 Return summary information about virtual memory features\r
745 supported in the processor. It is required by IPF. The PAL\r
746 procedure supports the Static Registers calling convention. It\r
747 could be called at physical mode and Virtual mode.\r
748 \r
749 @param Index Index of PAL_VM_SUMMARY within the list\r
750 of PAL procedures.\r
751 \r
752\r
753 @return R9 8-byte formatted value returning global virtual\r
754 memory information. See PAL_VM_INFO1 above.\r
755\r
756 @return R10 8-byte formatted value returning global virtual\r
757 memory information. See PAL_VM_INFO2 above.\r
758\r
759 @return Status 0 - Call completed without error\r
760\r
761 @return Status -2 - Invalid argument\r
762\r
763 @return Status -3 - Call completed with error.\r
764 \r
765**/\r
766#define PAL_VM_SUMMARY 8\r
767\r
fb3df220 768\r
fb3df220 769//\r
c13f09d0 770// Bit mask of TR_valid flag.\r
771// \r
772#define PAL_TR_ACCESS_RIGHT_IS_VALID BIT0\r
773#define PAL_TR_PRIVILEGE_LEVEL_IS_VALID BIT1\r
774#define PAL_TR_DIRTY_IS_VALID BIT2\r
775#define PAL_TR_MEMORY_ATTR_IS_VALID BIT3\r
776\r
777\r
778/**\r
779 \r
780 PAL Procedure - PAL_VM_TR_READ.\r
781 \r
782 Read contents of a translation register. It is required by\r
783 IPF. The PAL procedure supports the Stacked Register calling\r
784 convention. It could be called at physical mode.\r
785 \r
786 @param Index Index of PAL_VM_TR_READ within the list\r
787 of PAL procedures.\r
788\r
789 @param RegNumber Unsigned 64-bit number denoting which TR to\r
790 read.\r
791\r
792 @param TrType Unsigned 64-bit number denoting whether to\r
793 read an ITR (0) or DTR (1). All other values\r
794 are reserved.\r
795\r
796 @param TrBuffer 64-bit pointer to the 32-byte memory buffer in\r
797 which translation data is returned.\r
798\r
799 @return R9 Formatted bit vector denoting which fields are\r
800 valid. See TR_valid above.\r
801\r
802 @return Status 0 - Call completed without error\r
803\r
804 @return Status -2 - Invalid argument\r
805\r
806 @return Status -3 - Call completed with error.\r
807 \r
808**/\r
809#define PAL_VM_TR_READ 261 \r
810\r
811\r
812\r
813\r
fb3df220 814//\r
c13f09d0 815// Bit Mask of Processor Bus Fesatures .\r
816// \r
817\r
818/**\r
819 \r
820 When 0, bus data errors are detected and single bit errors are\r
821 corrected. When 1, no error detection or correction is done.\r
822\r
823**/\r
824#define PAL_BUS_DISABLE_DATA_ERROR_SIGNALLING BIT63\r
825\r
826\r
827/**\r
828 \r
829 When 0, bus address errors are signalled on the bus. When 1,\r
830 no bus errors are signalled on the bus. If Disable Bus Address\r
831 Error Checking is 1, this bit is ignored.\r
832\r
833**/\r
834#define PAL_BUS_DISABLE_ADDRESS_ERROR_SIGNALLING BIT62\r
835\r
836\r
837\r
838\r
839/**\r
840 \r
841 When 0, bus errors are detected, single bit errors are\r
842 corrected., and a CMCI or MCA is generated internally to the\r
843 processor. When 1, no bus address errors are detected or\r
844 corrected.\r
845\r
846**/\r
847#define PAL_BUS_DISABLE_ADDRESS_ERROR_CHECK BIT61\r
848\r
849\r
850/**\r
851 \r
852 When 0, bus protocol errors (BINIT#) are signaled by the\r
853 processor on the bus. When 1, bus protocol errors (BINIT#) are\r
854 not signaled on the bus. If Disable Bus Initialization Event\r
855 Checking is 1, this bit is ignored.\r
856\r
857**/\r
858#define PAL_BUS_DISABLE_INITIALIZATION_EVENT_SIGNALLING BIT60\r
859\r
860\r
861/**\r
862 \r
863 When 0, bus protocol errors (BINIT#) are detected and sampled\r
864 and an MCA is generated internally to the processor. When 1,\r
865 the processor will ignore bus protocol error conditions\r
866 (BINIT#).\r
867\r
868**/\r
869#define PAL_BUS_DISABLE_INITIALIZATION_EVENT_CHECK BIT59\r
870\r
871\r
872\r
873/**\r
874 \r
875 When 0, BERR# is signalled if a bus error is detected. When 1,\r
876 bus errors are not signalled on the bus.\r
877\r
878**/\r
879#define PAL_BUS_DISABLE_ERROR_SIGNALLING BIT58\r
880\r
881\r
882\r
883\r
884/**\r
885 \r
886 When 0, BERR# is signalled when internal processor requestor\r
887 initiated bus errors are detected. When 1, internal requester\r
888 bus errors are not signalled on the bus.\r
889 \r
890**/\r
891#define PAL_BUS_DISABLE__INTERNAL_ERROR_SIGNALLING BIT57\r
892\r
893\r
894/**\r
895 \r
896 When 0, the processor takes an MCA if BERR# is asserted. When\r
897 1, the processor ignores the BERR# signal.\r
898\r
899**/\r
900#define PAL_BUS_DISABLE_ERROR_CHECK BIT56\r
901\r
902\r
903/**\r
904 \r
905 When 0, the processor asserts BINIT# if it detects a parity\r
906 error on the signals which identify the transactions to which\r
907 this is a response. When 1, the processor ignores parity on\r
908 these signals.\r
909 \r
910**/\r
911#define PAL_BUS_DISABLE_RSP_ERROR_CHECK BIT55\r
912\r
913\r
914/**\r
915 \r
916 When 0, the in-order transaction queue is limited only by the\r
917 number of hardware entries. When 1, the processor's in-order\r
918 transactions queue is limited to one entry.\r
919\r
920**/\r
921#define PAL_BUS_DISABLE_TRANSACTION_QUEUE BIT54\r
922\r
923/**\r
924 \r
925 Enable a bus cache line replacement transaction when a cache\r
926 line in the exclusive state is replaced from the highest level\r
927 processor cache and is not present in the lower level processor\r
928 caches. When 0, no bus cache line replacement transaction will\r
929 be seen on the bus. When 1, bus cache line replacement\r
930 transactions will be seen on the bus when the above condition is\r
931 detected.\r
932\r
933**/\r
934#define PAL_BUS_ENABLE_EXCLUSIVE_CACHE_LINE_REPLACEMENT BIT53\r
935\r
936\r
937/**\r
938 \r
939 Enable a bus cache line replacement transaction when a cache\r
940 line in the shared or exclusive state is replaced from the\r
941 highest level processor cache and is not present in the lower\r
942 level processor caches.\r
943 When 0, no bus cache line replacement transaction will be seen\r
944 on the bus. When 1, bus cache line replacement transactions\r
945 will be seen on the bus when the above condition is detected.\r
946\r
947**/\r
948#define PAL_BUS_ENABLE_SHARED_CACHE_LINE_REPLACEMENT BIT52\r
949\r
950\r
951 \r
952/**\r
953 \r
954 When 0, the data bus is configured at the 2x data transfer\r
955 rate.When 1, the data bus is configured at the 1x data\r
956 transfer rate, 30 Opt. Req. Disable Bus Lock Mask. When 0, the\r
957 processor executes locked transactions atomically. When 1, the\r
958 processor masks the bus lock signal and executes locked\r
959 transactions as a non-atomic series of transactions.\r
960\r
961**/\r
962#define PAL_BUS_ENABLE_HALF_TRANSFER BIT30\r
963\r
964/**\r
965 \r
966 When 0, the processor will deassert bus request when finished\r
967 with each transaction. When 1, the processor will continue to\r
968 assert bus request after it has finished, if it was the last\r
969 agent to own the bus and if there are no other pending\r
970 requests.\r
971\r
972**/\r
973#define PAL_BUS_REQUEST_BUS_PARKING BIT29\r
974\r
975\r
976/**\r
977 \r
978 PAL Procedure - PAL_BUS_GET_FEATURES.\r
979 \r
980 Return configurable processor bus interface features and their\r
981 current settings. It is required by IPF. The PAL procedure\r
982 supports the Stacked Register calling convention. It could be\r
983 called at physical mode.\r
984 \r
985 @param Index Index of PAL_BUS_GET_FEATURES within the list\r
986 of PAL procedures.\r
987\r
988 @return R9 64-bit vector of features implemented.\r
989 (1=implemented, 0=not implemented)\r
990\r
991 @return R10 64-bit vector of current feature settings.\r
992\r
993 @return R11 64-bit vector of features controllable by\r
994 software. (1=controllable, 0= not controllable)\r
995\r
996 @return Status 0 - Call completed without error\r
997\r
998 @return Status -2 - Invalid argument\r
999\r
1000 @return Status -3 - Call completed with error.\r
1001 \r
1002**/\r
1003#define PAL_BUS_GET_FEATURES 9\r
1004\r
1005/**\r
1006 \r
1007 PAL Procedure - PAL_BUS_SET_FEATURES.\r
1008 \r
1009 Enable or disable configurable features in processor bus\r
1010 interface. It is required by IPF. It is required by IPF. The PAL procedure\r
1011 supports the Static Registers calling convention. It could be\r
1012 called at physical mode.\r
1013 \r
1014 @param Index Index of PAL_BUS_SET_FEATURES within the list\r
1015 of PAL procedures.\r
1016 \r
1017 @param FeatureSelect 64-bit vector denoting desired state of\r
1018 each feature (1=select, 0=non-select).\r
1019\r
1020 @return Status 0 - Call completed without error\r
1021\r
1022 @return Status -2 - Invalid argument\r
1023\r
1024 @return Status -3 - Call completed with error.\r
1025 \r
1026**/\r
1027#define PAL_BUS_SET_FEATURES 10\r
1028\r
1029\r
1030/**\r
1031 \r
1032 PAL Procedure - PAL_DEBUG_INFO.\r
1033 \r
1034 Return the number of instruction and data breakpoint\r
1035 registers. It is required by IPF. It is required by IPF. The\r
1036 PAL procedure supports the Static Registers calling\r
1037 convention. It could be called at physical mode and virtual\r
1038 mode.\r
1039 \r
1040 @param Index Index of PAL_DEBUG_INFO within the list of PAL\r
1041 procedures.\r
1042 \r
1043 @return R9 Unsigned 64-bit integer denoting the number of\r
1044 pairs of instruction debug registers implemented\r
1045 by the processor. \r
1046 \r
1047 @return R10 Unsigned 64-bit integer denoting the number of\r
1048 pairs of data debug registers implemented by the\r
1049 processor.\r
1050 \r
1051 @return Status 0 - Call completed without error\r
1052\r
1053 @return Status -2 - Invalid argument\r
1054\r
1055 @return Status -3 - Call completed with error.\r
1056 \r
1057**/\r
1058#define PAL_DEBUG_INFO 11\r
1059\r
1060/**\r
1061 \r
1062 PAL Procedure - PAL_FIXED_ADDR.\r
1063 \r
1064