2 Declaration of internal functions in BaseLib.
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __BASE_LIB_INTERNALS__
16 #define __BASE_LIB_INTERNALS__
19 #include <Library/BaseLib.h>
20 #include <Library/BaseMemoryLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PcdLib.h>
29 Shifts a 64-bit integer left between 0 and 63 bits. The low bits
30 are filled with zeros. The shifted value is returned.
32 This function shifts the 64-bit value Operand to the left by Count bits. The
33 low Count bits are set to zero. The shifted value is returned.
35 @param Operand The 64-bit operand to shift left.
36 @param Count The number of bits to shift left.
38 @return Operand << Count
43 InternalMathLShiftU64 (
49 Shifts a 64-bit integer right between 0 and 63 bits. The high bits
50 are filled with zeros. The shifted value is returned.
52 This function shifts the 64-bit value Operand to the right by Count bits. The
53 high Count bits are set to zero. The shifted value is returned.
55 @param Operand The 64-bit operand to shift right.
56 @param Count The number of bits to shift right.
58 @return Operand >> Count
63 InternalMathRShiftU64 (
69 Shifts a 64-bit integer right between 0 and 63 bits. The high bits
70 are filled with original integer's bit 63. The shifted value is returned.
72 This function shifts the 64-bit value Operand to the right by Count bits. The
73 high Count bits are set to bit 63 of Operand. The shifted value is returned.
75 @param Operand The 64-bit operand to shift right.
76 @param Count The number of bits to shift right.
78 @return Operand arithmetically shifted right by Count
83 InternalMathARShiftU64 (
89 Rotates a 64-bit integer left between 0 and 63 bits, filling
90 the low bits with the high bits that were rotated.
92 This function rotates the 64-bit value Operand to the left by Count bits. The
93 low Count bits are filled with the high Count bits of Operand. The rotated
96 @param Operand The 64-bit operand to rotate left.
97 @param Count The number of bits to rotate left.
99 @return Operand <<< Count
104 InternalMathLRotU64 (
110 Rotates a 64-bit integer right between 0 and 63 bits, filling
111 the high bits with the high low bits that were rotated.
113 This function rotates the 64-bit value Operand to the right by Count bits.
114 The high Count bits are filled with the low Count bits of Operand. The rotated
117 @param Operand The 64-bit operand to rotate right.
118 @param Count The number of bits to rotate right.
120 @return Operand >>> Count
125 InternalMathRRotU64 (
131 Switches the endianess of a 64-bit integer.
133 This function swaps the bytes in a 64-bit unsigned value to switch the value
134 from little endian to big endian or vice versa. The byte swapped value is
137 @param Operand A 64-bit unsigned value.
139 @return The byte swapped Operand.
144 InternalMathSwapBytes64 (
149 Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer
150 and generates a 64-bit unsigned result.
152 This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit
153 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
154 bit unsigned result is returned.
156 @param Multiplicand A 64-bit unsigned value.
157 @param Multiplier A 32-bit unsigned value.
159 @return Multiplicand * Multiplier
164 InternalMathMultU64x32 (
165 IN UINT64 Multiplicand
,
170 Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer
171 and generates a 64-bit unsigned result.
173 This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
174 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
175 bit unsigned result is returned.
177 @param Multiplicand A 64-bit unsigned value.
178 @param Multiplier A 64-bit unsigned value.
180 @return Multiplicand * Multiplier
185 InternalMathMultU64x64 (
186 IN UINT64 Multiplicand
,
191 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
192 generates a 64-bit unsigned result.
194 This function divides the 64-bit unsigned value Dividend by the 32-bit
195 unsigned value Divisor and generates a 64-bit unsigned quotient. This
196 function returns the 64-bit unsigned quotient.
198 @param Dividend A 64-bit unsigned value.
199 @param Divisor A 32-bit unsigned value.
201 @return Dividend / Divisor
206 InternalMathDivU64x32 (
212 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
213 generates a 32-bit unsigned remainder.
215 This function divides the 64-bit unsigned value Dividend by the 32-bit
216 unsigned value Divisor and generates a 32-bit remainder. This function
217 returns the 32-bit unsigned remainder.
219 @param Dividend A 64-bit unsigned value.
220 @param Divisor A 32-bit unsigned value.
222 @return Dividend % Divisor
227 InternalMathModU64x32 (
233 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
234 generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
236 This function divides the 64-bit unsigned value Dividend by the 32-bit
237 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
238 is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
239 This function returns the 64-bit unsigned quotient.
241 @param Dividend A 64-bit unsigned value.
242 @param Divisor A 32-bit unsigned value.
243 @param Remainder A pointer to a 32-bit unsigned value. This parameter is
244 optional and may be NULL.
246 @return Dividend / Divisor
251 InternalMathDivRemU64x32 (
254 OUT UINT32
*Remainder OPTIONAL
258 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
259 generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
261 This function divides the 64-bit unsigned value Dividend by the 64-bit
262 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
263 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
264 This function returns the 64-bit unsigned quotient.
266 @param Dividend A 64-bit unsigned value.
267 @param Divisor A 64-bit unsigned value.
268 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
269 optional and may be NULL.
271 @return Dividend / Divisor
276 InternalMathDivRemU64x64 (
279 OUT UINT64
*Remainder OPTIONAL
283 Divides a 64-bit signed integer by a 64-bit signed integer and
284 generates a 64-bit signed result and an optional 64-bit signed remainder.
286 This function divides the 64-bit signed value Dividend by the 64-bit
287 signed value Divisor and generates a 64-bit signed quotient. If Remainder
288 is not NULL, then the 64-bit signed remainder is returned in Remainder.
289 This function returns the 64-bit signed quotient.
291 @param Dividend A 64-bit signed value.
292 @param Divisor A 64-bit signed value.
293 @param Remainder A pointer to a 64-bit signed value. This parameter is
294 optional and may be NULL.
296 @return Dividend / Divisor
301 InternalMathDivRemS64x64 (
304 OUT INT64
*Remainder OPTIONAL
308 Transfers control to a function starting with a new stack.
310 Transfers control to the function specified by EntryPoint using the
311 new stack specified by NewStack and passing in the parameters specified
312 by Context1 and Context2. Context1 and Context2 are optional and may
313 be NULL. The function EntryPoint must never return.
314 Marker will be ignored on IA-32, x64, and EBC.
315 IPF CPUs expect one additional parameter of type VOID * that specifies
316 the new backing store pointer.
318 If EntryPoint is NULL, then ASSERT().
319 If NewStack is NULL, then ASSERT().
321 @param EntryPoint A pointer to function to call with the new stack.
322 @param Context1 A pointer to the context to pass into the EntryPoint
324 @param Context2 A pointer to the context to pass into the EntryPoint
326 @param NewStack A pointer to the new stack to use for the EntryPoint
328 @param Marker VA_LIST marker for the variable argument list.
333 InternalSwitchStack (
334 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
335 IN VOID
*Context1
, OPTIONAL
336 IN VOID
*Context2
, OPTIONAL
343 Worker function that locates the Node in the List.
345 By searching the List, finds the location of the Node in List. At the same time,
346 verifies the validity of this list.
348 If List is NULL, then ASSERT().
349 If List->ForwardLink is NULL, then ASSERT().
350 If List->backLink is NULL, then ASSERT().
351 If Node is NULL, then ASSERT();
352 If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
353 of nodes in ListHead, including the ListHead node, is greater than or
354 equal to PcdMaximumLinkedListLength, then ASSERT().
356 @param List A pointer to a node in a linked list.
357 @param Node A pointer to one nod.
359 @retval TRUE Node is in List.
360 @retval FALSE Node isn't in List, or List is invalid.
366 IN CONST LIST_ENTRY
*List
,
367 IN CONST LIST_ENTRY
*Node
371 Worker function that returns a bit field from Operand.
373 Returns the bitfield specified by the StartBit and the EndBit from Operand.
375 @param Operand Operand on which to perform the bitfield operation.
376 @param StartBit The ordinal of the least significant bit in the bit field.
377 @param EndBit The ordinal of the most significant bit in the bit field.
379 @return The bit field read.
392 Worker function that reads a bit field from Operand, performs a bitwise OR,
393 and returns the result.
395 Performs a bitwise OR between the bit field specified by StartBit and EndBit
396 in Operand and the value specified by AndData. All other bits in Operand are
397 preserved. The new value is returned.
399 @param Operand Operand on which to perform the bitfield operation.
400 @param StartBit The ordinal of the least significant bit in the bit field.
401 @param EndBit The ordinal of the most significant bit in the bit field.
402 @param OrData The value to OR with the read value from the value
404 @return The new value.
418 Worker function that reads a bit field from Operand, performs a bitwise AND,
419 and returns the result.
421 Performs a bitwise AND between the bit field specified by StartBit and EndBit
422 in Operand and the value specified by AndData. All other bits in Operand are
423 preserved. The new value is returned.
425 @param Operand Operand on which to perform the bitfield operation.
426 @param StartBit The ordinal of the least significant bit in the bit field.
427 @param EndBit The ordinal of the most significant bit in the bit field.
428 @param AndData The value to And with the read value from the value
430 @return The new value.
444 Worker function that checks ASSERT condition for JumpBuffer
446 Checks ASSERT condition for JumpBuffer.
448 If JumpBuffer is NULL, then ASSERT().
449 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
451 @param JumpBuffer A pointer to CPU context buffer.
456 InternalAssertJumpBuffer (
457 IN BASE_LIBRARY_JUMP_BUFFER
*JumpBuffer
462 Restores the CPU context that was saved with SetJump().
464 Restores the CPU context from the buffer specified by JumpBuffer.
465 This function never returns to the caller.
466 Instead is resumes execution based on the state of JumpBuffer.
468 @param JumpBuffer A pointer to CPU context buffer.
469 @param Value The value to return when the SetJump() context is restored.
475 IN BASE_LIBRARY_JUMP_BUFFER
*JumpBuffer
,
481 // Ia32 and x64 specific functions
483 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
486 Reads the current Global Descriptor Table Register(GDTR) descriptor.
488 Reads and returns the current GDTR descriptor and returns it in Gdtr. This
489 function is only available on IA-32 and x64.
491 @param Gdtr The pointer to a GDTR descriptor.
496 InternalX86ReadGdtr (
497 OUT IA32_DESCRIPTOR
*Gdtr
501 Writes the current Global Descriptor Table Register (GDTR) descriptor.
503 Writes and the current GDTR descriptor specified by Gdtr. This function is
504 only available on IA-32 and x64.
506 @param Gdtr The pointer to a GDTR descriptor.
511 InternalX86WriteGdtr (
512 IN CONST IA32_DESCRIPTOR
*Gdtr
516 Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
518 Reads and returns the current IDTR descriptor and returns it in Idtr. This
519 function is only available on IA-32 and x64.
521 @param Idtr The pointer to an IDTR descriptor.
526 InternalX86ReadIdtr (
527 OUT IA32_DESCRIPTOR
*Idtr
531 Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
533 Writes the current IDTR descriptor and returns it in Idtr. This function is
534 only available on IA-32 and x64.
536 @param Idtr The pointer to an IDTR descriptor.
541 InternalX86WriteIdtr (
542 IN CONST IA32_DESCRIPTOR
*Idtr
546 Save the current floating point/SSE/SSE2 context to a buffer.
548 Saves the current floating point/SSE/SSE2 state to the buffer specified by
549 Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
550 available on IA-32 and x64.
552 @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
558 OUT IA32_FX_BUFFER
*Buffer
562 Restores the current floating point/SSE/SSE2 context from a buffer.
564 Restores the current floating point/SSE/SSE2 state from the buffer specified
565 by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
566 only available on IA-32 and x64.
568 @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
573 InternalX86FxRestore (
574 IN CONST IA32_FX_BUFFER
*Buffer
578 Enables the 32-bit paging mode on the CPU.
580 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
581 must be properly initialized prior to calling this service. This function
582 assumes the current execution mode is 32-bit protected mode. This function is
583 only available on IA-32. After the 32-bit paging mode is enabled, control is
584 transferred to the function specified by EntryPoint using the new stack
585 specified by NewStack and passing in the parameters specified by Context1 and
586 Context2. Context1 and Context2 are optional and may be NULL. The function
587 EntryPoint must never return.
589 There are a number of constraints that must be followed before calling this
591 1) Interrupts must be disabled.
592 2) The caller must be in 32-bit protected mode with flat descriptors. This
593 means all descriptors must have a base of 0 and a limit of 4GB.
594 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
596 4) CR3 must point to valid page tables that will be used once the transition
597 is complete, and those page tables must guarantee that the pages for this
598 function and the stack are identity mapped.
600 @param EntryPoint A pointer to function to call with the new stack after
602 @param Context1 A pointer to the context to pass into the EntryPoint
603 function as the first parameter after paging is enabled.
604 @param Context2 A pointer to the context to pass into the EntryPoint
605 function as the second parameter after paging is enabled.
606 @param NewStack A pointer to the new stack to use for the EntryPoint
607 function after paging is enabled.
612 InternalX86EnablePaging32 (
613 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
614 IN VOID
*Context1
, OPTIONAL
615 IN VOID
*Context2
, OPTIONAL
620 Disables the 32-bit paging mode on the CPU.
622 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
623 mode. This function assumes the current execution mode is 32-paged protected
624 mode. This function is only available on IA-32. After the 32-bit paging mode
625 is disabled, control is transferred to the function specified by EntryPoint
626 using the new stack specified by NewStack and passing in the parameters
627 specified by Context1 and Context2. Context1 and Context2 are optional and
628 may be NULL. The function EntryPoint must never return.
630 There are a number of constraints that must be followed before calling this
632 1) Interrupts must be disabled.
633 2) The caller must be in 32-bit paged mode.
634 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
635 4) CR3 must point to valid page tables that guarantee that the pages for
636 this function and the stack are identity mapped.
638 @param EntryPoint A pointer to function to call with the new stack after
640 @param Context1 A pointer to the context to pass into the EntryPoint
641 function as the first parameter after paging is disabled.
642 @param Context2 A pointer to the context to pass into the EntryPoint
643 function as the second parameter after paging is
645 @param NewStack A pointer to the new stack to use for the EntryPoint
646 function after paging is disabled.
651 InternalX86DisablePaging32 (
652 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
653 IN VOID
*Context1
, OPTIONAL
654 IN VOID
*Context2
, OPTIONAL
659 Enables the 64-bit paging mode on the CPU.
661 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
662 must be properly initialized prior to calling this service. This function
663 assumes the current execution mode is 32-bit protected mode with flat
664 descriptors. This function is only available on IA-32. After the 64-bit
665 paging mode is enabled, control is transferred to the function specified by
666 EntryPoint using the new stack specified by NewStack and passing in the
667 parameters specified by Context1 and Context2. Context1 and Context2 are
668 optional and may be 0. The function EntryPoint must never return.
670 @param Cs The 16-bit selector to load in the CS before EntryPoint
671 is called. The descriptor in the GDT that this selector
672 references must be setup for long mode.
673 @param EntryPoint The 64-bit virtual address of the function to call with
674 the new stack after paging is enabled.
675 @param Context1 The 64-bit virtual address of the context to pass into
676 the EntryPoint function as the first parameter after
678 @param Context2 The 64-bit virtual address of the context to pass into
679 the EntryPoint function as the second parameter after
681 @param NewStack The 64-bit virtual address of the new stack to use for
682 the EntryPoint function after paging is enabled.
687 InternalX86EnablePaging64 (
689 IN UINT64 EntryPoint
,
690 IN UINT64 Context1
, OPTIONAL
691 IN UINT64 Context2
, OPTIONAL
696 Disables the 64-bit paging mode on the CPU.
698 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
699 mode. This function assumes the current execution mode is 64-paging mode.
700 This function is only available on x64. After the 64-bit paging mode is
701 disabled, control is transferred to the function specified by EntryPoint
702 using the new stack specified by NewStack and passing in the parameters
703 specified by Context1 and Context2. Context1 and Context2 are optional and
704 may be 0. The function EntryPoint must never return.
706 @param Cs The 16-bit selector to load in the CS before EntryPoint
707 is called. The descriptor in the GDT that this selector
708 references must be setup for 32-bit protected mode.
709 @param EntryPoint The 64-bit virtual address of the function to call with
710 the new stack after paging is disabled.
711 @param Context1 The 64-bit virtual address of the context to pass into
712 the EntryPoint function as the first parameter after
714 @param Context2 The 64-bit virtual address of the context to pass into
715 the EntryPoint function as the second parameter after
717 @param NewStack The 64-bit virtual address of the new stack to use for
718 the EntryPoint function after paging is disabled.
723 InternalX86DisablePaging64 (
725 IN UINT32 EntryPoint
,
726 IN UINT32 Context1
, OPTIONAL
727 IN UINT32 Context2
, OPTIONAL
732 #elif defined (MDE_CPU_IPF)
735 // IPF specific functions
739 Reads control register DCR.
741 This is a worker function for AsmReadControlRegister()
742 when its parameter Index is IPF_CONTROL_REGISTER_DCR.
744 @return The 64-bit control register DCR.
749 AsmReadControlRegisterDcr (
755 Reads control register ITM.
757 This is a worker function for AsmReadControlRegister()
758 when its parameter Index is IPF_CONTROL_REGISTER_ITM.
760 @return The 64-bit control register ITM.
765 AsmReadControlRegisterItm (
771 Reads control register IVA.
773 This is a worker function for AsmReadControlRegister()
774 when its parameter Index is IPF_CONTROL_REGISTER_IVA.
776 @return The 64-bit control register IVA.
781 AsmReadControlRegisterIva (
787 Reads control register PTA.
789 This is a worker function for AsmReadControlRegister()
790 when its parameter Index is IPF_CONTROL_REGISTER_PTA.
792 @return The 64-bit control register PTA.
797 AsmReadControlRegisterPta (
803 Reads control register IPSR.
805 This is a worker function for AsmReadControlRegister()
806 when its parameter Index is IPF_CONTROL_REGISTER_IPSR.
808 @return The 64-bit control register IPSR.
813 AsmReadControlRegisterIpsr (
819 Reads control register ISR.
821 This is a worker function for AsmReadControlRegister()
822 when its parameter Index is IPF_CONTROL_REGISTER_ISR.
824 @return The 64-bit control register ISR.
829 AsmReadControlRegisterIsr (
835 Reads control register IIP.
837 This is a worker function for AsmReadControlRegister()
838 when its parameter Index is IPF_CONTROL_REGISTER_IIP.
840 @return The 64-bit control register IIP.
845 AsmReadControlRegisterIip (
851 Reads control register IFA.
853 This is a worker function for AsmReadControlRegister()
854 when its parameter Index is IPF_CONTROL_REGISTER_IFA.
856 @return The 64-bit control register IFA.
861 AsmReadControlRegisterIfa (
867 Reads control register ITIR.
869 This is a worker function for AsmReadControlRegister()
870 when its parameter Index is IPF_CONTROL_REGISTER_ITIR.
872 @return The 64-bit control register ITIR.
877 AsmReadControlRegisterItir (
883 Reads control register IIPA.
885 This is a worker function for AsmReadControlRegister()
886 when its parameter Index is IPF_CONTROL_REGISTER_IIPA.
888 @return The 64-bit control register IIPA.
893 AsmReadControlRegisterIipa (
899 Reads control register IFS.
901 This is a worker function for AsmReadControlRegister()
902 when its parameter Index is IPF_CONTROL_REGISTER_IFS.
904 @return The 64-bit control register IFS.
909 AsmReadControlRegisterIfs (
915 Reads control register IIM.
917 This is a worker function for AsmReadControlRegister()
918 when its parameter Index is IPF_CONTROL_REGISTER_IIM.
920 @return The 64-bit control register IIM.
925 AsmReadControlRegisterIim (
931 Reads control register IHA.
933 This is a worker function for AsmReadControlRegister()
934 when its parameter Index is IPF_CONTROL_REGISTER_IHA.
936 @return The 64-bit control register IHA.
941 AsmReadControlRegisterIha (
947 Reads control register LID.
949 This is a worker function for AsmReadControlRegister()
950 when its parameter Index is IPF_CONTROL_REGISTER_LID.
952 @return The 64-bit control register LID.
957 AsmReadControlRegisterLid (
963 Reads control register IVR.
965 This is a worker function for AsmReadControlRegister()
966 when its parameter Index is IPF_CONTROL_REGISTER_IVR.
968 @return The 64-bit control register IVR.
973 AsmReadControlRegisterIvr (
979 Reads control register TPR.
981 This is a worker function for AsmReadControlRegister()
982 when its parameter Index is IPF_CONTROL_REGISTER_TPR.
984 @return The 64-bit control register TPR.
989 AsmReadControlRegisterTpr (
995 Reads control register EOI.
997 This is a worker function for AsmReadControlRegister()
998 when its parameter Index is IPF_CONTROL_REGISTER_EOI.
1000 @return The 64-bit control register EOI.
1005 AsmReadControlRegisterEoi (
1011 Reads control register IRR0.
1013 This is a worker function for AsmReadControlRegister()
1014 when its parameter Index is IPF_CONTROL_REGISTER_IRR0.
1016 @return The 64-bit control register IRR0.
1021 AsmReadControlRegisterIrr0 (
1027 Reads control register IRR1.
1029 This is a worker function for AsmReadControlRegister()
1030 when its parameter Index is IPF_CONTROL_REGISTER_IRR1.
1032 @return The 64-bit control register IRR1.
1037 AsmReadControlRegisterIrr1 (
1043 Reads control register IRR2.
1045 This is a worker function for AsmReadControlRegister()
1046 when its parameter Index is IPF_CONTROL_REGISTER_IRR2.
1048 @return The 64-bit control register IRR2.
1053 AsmReadControlRegisterIrr2 (
1059 Reads control register IRR3.
1061 This is a worker function for AsmReadControlRegister()
1062 when its parameter Index is IPF_CONTROL_REGISTER_IRR3.
1064 @return The 64-bit control register IRR3.
1069 AsmReadControlRegisterIrr3 (
1075 Reads control register ITV.
1077 This is a worker function for AsmReadControlRegister()
1078 when its parameter Index is IPF_CONTROL_REGISTER_ITV.
1080 @return The 64-bit control register ITV.
1085 AsmReadControlRegisterItv (
1091 Reads control register PMV.
1093 This is a worker function for AsmReadControlRegister()
1094 when its parameter Index is IPF_CONTROL_REGISTER_PMV.
1096 @return The 64-bit control register PMV.
1101 AsmReadControlRegisterPmv (
1107 Reads control register CMCV.
1109 This is a worker function for AsmReadControlRegister()
1110 when its parameter Index is IPF_CONTROL_REGISTER_CMCV.
1112 @return The 64-bit control register CMCV.
1117 AsmReadControlRegisterCmcv (
1123 Reads control register LRR0.
1125 This is a worker function for AsmReadControlRegister()
1126 when its parameter Index is IPF_CONTROL_REGISTER_LRR0.
1128 @return The 64-bit control register LRR0.
1133 AsmReadControlRegisterLrr0 (
1139 Reads control register LRR1.
1141 This is a worker function for AsmReadControlRegister()
1142 when its parameter Index is IPF_CONTROL_REGISTER_LRR1.
1144 @return The 64-bit control register LRR1.
1149 AsmReadControlRegisterLrr1 (
1155 Reads application register K0.
1157 This is a worker function for AsmReadApplicationRegister()
1158 when its parameter Index is IPF_APPLICATION_REGISTER_K0.
1160 @return The 64-bit application register K0.
1165 AsmReadApplicationRegisterK0 (
1172 Reads application register K1.
1174 This is a worker function for AsmReadApplicationRegister()
1175 when its parameter Index is IPF_APPLICATION_REGISTER_K1.
1177 @return The 64-bit application register K1.
1182 AsmReadApplicationRegisterK1 (
1188 Reads application register K2.
1190 This is a worker function for AsmReadApplicationRegister()
1191 when its parameter Index is IPF_APPLICATION_REGISTER_K2.
1193 @return The 64-bit application register K2.
1198 AsmReadApplicationRegisterK2 (
1204 Reads application register K3.
1206 This is a worker function for AsmReadApplicationRegister()
1207 when its parameter Index is IPF_APPLICATION_REGISTER_K3.
1209 @return The 64-bit application register K3.
1214 AsmReadApplicationRegisterK3 (
1220 Reads application register K4.
1222 This is a worker function for AsmReadApplicationRegister()
1223 when its parameter Index is IPF_APPLICATION_REGISTER_K4.
1225 @return The 64-bit application register K4.
1230 AsmReadApplicationRegisterK4 (
1236 Reads application register K5.
1238 This is a worker function for AsmReadApplicationRegister()
1239 when its parameter Index is IPF_APPLICATION_REGISTER_K5.
1241 @return The 64-bit application register K5.
1246 AsmReadApplicationRegisterK5 (
1252 Reads application register K6.
1254 This is a worker function for AsmReadApplicationRegister()
1255 when its parameter Index is IPF_APPLICATION_REGISTER_K6.
1257 @return The 64-bit application register K6.
1262 AsmReadApplicationRegisterK6 (
1268 Reads application register K7.
1270 This is a worker function for AsmReadApplicationRegister()
1271 when its parameter Index is IPF_APPLICATION_REGISTER_K7.
1273 @return The 64-bit application register K7.
1278 AsmReadApplicationRegisterK7 (
1284 Reads application register RSC.
1286 This is a worker function for AsmReadApplicationRegister()
1287 when its parameter Index is IPF_APPLICATION_REGISTER_RSC.
1289 @return The 64-bit application register RSC.
1294 AsmReadApplicationRegisterRsc (
1300 Reads application register BSP.
1302 This is a worker function for AsmReadApplicationRegister()
1303 when its parameter Index is IPF_APPLICATION_REGISTER_BSP.
1305 @return The 64-bit application register BSP.
1310 AsmReadApplicationRegisterBsp (
1316 Reads application register BSPSTORE.
1318 This is a worker function for AsmReadApplicationRegister()
1319 when its parameter Index is IPF_APPLICATION_REGISTER_BSPSTORE.
1321 @return The 64-bit application register BSPSTORE.
1326 AsmReadApplicationRegisterBspstore (
1332 Reads application register RNAT.
1334 This is a worker function for AsmReadApplicationRegister()
1335 when its parameter Index is IPF_APPLICATION_REGISTER_RNAT.
1337 @return The 64-bit application register RNAT.
1342 AsmReadApplicationRegisterRnat (
1348 Reads application register FCR.
1350 This is a worker function for AsmReadApplicationRegister()
1351 when its parameter Index is IPF_APPLICATION_REGISTER_FCR.
1353 @return The 64-bit application register FCR.
1358 AsmReadApplicationRegisterFcr (
1364 Reads application register EFLAG.
1366 This is a worker function for AsmReadApplicationRegister()
1367 when its parameter Index is IPF_APPLICATION_REGISTER_EFLAG.
1369 @return The 64-bit application register EFLAG.
1374 AsmReadApplicationRegisterEflag (
1380 Reads application register CSD.
1382 This is a worker function for AsmReadApplicationRegister()
1383 when its parameter Index is IPF_APPLICATION_REGISTER_CSD.
1385 @return The 64-bit application register CSD.
1390 AsmReadApplicationRegisterCsd (
1396 Reads application register SSD.
1398 This is a worker function for AsmReadApplicationRegister()
1399 when its parameter Index is IPF_APPLICATION_REGISTER_SSD.
1401 @return The 64-bit application register SSD.
1406 AsmReadApplicationRegisterSsd (
1412 Reads application register CFLG.
1414 This is a worker function for AsmReadApplicationRegister()
1415 when its parameter Index is IPF_APPLICATION_REGISTER_CFLG.
1417 @return The 64-bit application register CFLG.
1422 AsmReadApplicationRegisterCflg (
1428 Reads application register FSR.
1430 This is a worker function for AsmReadApplicationRegister()
1431 when its parameter Index is IPF_APPLICATION_REGISTER_FSR.
1433 @return The 64-bit application register FSR.
1438 AsmReadApplicationRegisterFsr (
1444 Reads application register FIR.
1446 This is a worker function for AsmReadApplicationRegister()
1447 when its parameter Index is IPF_APPLICATION_REGISTER_FIR.
1449 @return The 64-bit application register FIR.
1454 AsmReadApplicationRegisterFir (
1460 Reads application register FDR.
1462 This is a worker function for AsmReadApplicationRegister()
1463 when its parameter Index is IPF_APPLICATION_REGISTER_FDR.
1465 @return The 64-bit application register FDR.
1470 AsmReadApplicationRegisterFdr (
1476 Reads application register CCV.
1478 This is a worker function for AsmReadApplicationRegister()
1479 when its parameter Index is IPF_APPLICATION_REGISTER_CCV.
1481 @return The 64-bit application register CCV.
1486 AsmReadApplicationRegisterCcv (
1492 Reads application register UNAT.
1494 This is a worker function for AsmReadApplicationRegister()
1495 when its parameter Index is IPF_APPLICATION_REGISTER_UNAT.
1497 @return The 64-bit application register UNAT.
1502 AsmReadApplicationRegisterUnat (
1508 Reads application register FPSR.
1510 This is a worker function for AsmReadApplicationRegister()
1511 when its parameter Index is IPF_APPLICATION_REGISTER_FPSR.
1513 @return The 64-bit application register FPSR.
1518 AsmReadApplicationRegisterFpsr (
1524 Reads application register ITC.
1526 This is a worker function for AsmReadApplicationRegister()
1527 when its parameter Index is IPF_APPLICATION_REGISTER_ITC.
1529 @return The 64-bit application register ITC.
1534 AsmReadApplicationRegisterItc (
1540 Reads application register PFS.
1542 This is a worker function for AsmReadApplicationRegister()
1543 when its parameter Index is IPF_APPLICATION_REGISTER_PFS.
1545 @return The 64-bit application register PFS.
1550 AsmReadApplicationRegisterPfs (
1556 Reads application register LC.
1558 This is a worker function for AsmReadApplicationRegister()
1559 when its parameter Index is IPF_APPLICATION_REGISTER_LC.
1561 @return The 64-bit application register LC.
1566 AsmReadApplicationRegisterLc (
1572 Reads application register EC.
1574 This is a worker function for AsmReadApplicationRegister()
1575 when its parameter Index is IPF_APPLICATION_REGISTER_EC.
1577 @return The 64-bit application register EC.
1582 AsmReadApplicationRegisterEc (
1589 Transfers control to a function starting with a new stack.
1591 Transfers control to the function specified by EntryPoint using the new stack
1592 specified by NewStack and passing in the parameters specified by Context1 and
1593 Context2. Context1 and Context2 are optional and may be NULL. The function
1594 EntryPoint must never return.
1596 If EntryPoint is NULL, then ASSERT().
1597 If NewStack is NULL, then ASSERT().
1599 @param EntryPoint A pointer to function to call with the new stack.
1600 @param Context1 A pointer to the context to pass into the EntryPoint
1602 @param Context2 A pointer to the context to pass into the EntryPoint
1604 @param NewStack A pointer to the new stack to use for the EntryPoint
1606 @param NewBsp A pointer to the new memory location for RSE backing
1612 AsmSwitchStackAndBackingStore (
1613 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1614 IN VOID
*Context1
, OPTIONAL
1615 IN VOID
*Context2
, OPTIONAL
1621 Internal worker function to invalidate a range of instruction cache lines
1622 in the cache coherency domain of the calling CPU.
1624 Internal worker function to invalidate the instruction cache lines specified
1625 by Address and Length. If Address is not aligned on a cache line boundary,
1626 then entire instruction cache line containing Address is invalidated. If
1627 Address + Length is not aligned on a cache line boundary, then the entire
1628 instruction cache line containing Address + Length -1 is invalidated. This
1629 function may choose to invalidate the entire instruction cache if that is more
1630 efficient than invalidating the specified range. If Length is 0, the no instruction
1631 cache lines are invalidated. Address is returned.
1632 This function is only available on IPF.
1634 @param Address The base address of the instruction cache lines to
1635 invalidate. If the CPU is in a physical addressing mode, then
1636 Address is a physical address. If the CPU is in a virtual
1637 addressing mode, then Address is a virtual address.
1639 @param Length The number of bytes to invalidate from the instruction cache.
1646 InternalFlushCacheRange (