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