2 Declaration of internal functions in BaseLib.
4 Copyright (c) 2006 - 2008, Intel Corporation<BR>
5 All rights reserved. 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/TimerLib.h>
23 #include <Library/PcdLib.h>
30 Shifts a 64-bit integer left between 0 and 63 bits. The low bits
31 are filled with zeros. The shifted value is returned.
33 This function shifts the 64-bit value Operand to the left by Count bits. The
34 low Count bits are set to zero. The shifted value is returned.
36 @param Operand The 64-bit operand to shift left.
37 @param Count The number of bits to shift left.
39 @return Operand << Count
44 InternalMathLShiftU64 (
50 Shifts a 64-bit integer right between 0 and 63 bits. This high bits
51 are filled with zeros. The shifted value is returned.
53 This function shifts the 64-bit value Operand to the right by Count bits. The
54 high Count bits are set to zero. The shifted value is returned.
56 @param Operand The 64-bit operand to shift right.
57 @param Count The number of bits to shift right.
59 @return Operand >> Count
64 InternalMathRShiftU64 (
70 Shifts a 64-bit integer right between 0 and 63 bits. The high bits
71 are filled with original integer's bit 63. The shifted value is returned.
73 This function shifts the 64-bit value Operand to the right by Count bits. The
74 high Count bits are set to bit 63 of Operand. The shifted value is returned.
76 @param Operand The 64-bit operand to shift right.
77 @param Count The number of bits to shift right.
79 @return Operand arithmetically shifted right by Count
84 InternalMathARShiftU64 (
90 Rotates a 64-bit integer left between 0 and 63 bits, filling
91 the low bits with the high bits that were rotated.
93 This function rotates the 64-bit value Operand to the left by Count bits. The
94 low Count bits are fill with the high Count bits of Operand. The rotated
97 @param Operand The 64-bit operand to rotate left.
98 @param Count The number of bits to rotate left.
100 @return Operand <<< Count
105 InternalMathLRotU64 (
111 Rotates a 64-bit integer right between 0 and 63 bits, filling
112 the high bits with the high low bits that were rotated.
114 This function rotates the 64-bit value Operand to the right by Count bits.
115 The high Count bits are fill with the low Count bits of Operand. The rotated
118 @param Operand The 64-bit operand to rotate right.
119 @param Count The number of bits to rotate right.
121 @return Operand >>> Count
126 InternalMathRRotU64 (
132 Switches the endianess of a 64-bit integer.
134 This function swaps the bytes in a 64-bit unsigned value to switch the value
135 from little endian to big endian or vice versa. The byte swapped value is
138 @param Operand A 64-bit unsigned value.
140 @return The byte swapped Operand.
145 InternalMathSwapBytes64 (
150 Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
151 and generates a 64-bit unsigned result.
153 This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
154 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
155 bit unsigned result is returned.
157 @param Multiplicand A 64-bit unsigned value.
158 @param Multiplier A 32-bit unsigned value.
160 @return Multiplicand * Multiplier
165 InternalMathMultU64x32 (
166 IN UINT64 Multiplicand
,
171 Multiples a 64-bit unsigned integer by a 64-bit unsigned integer
172 and generates a 64-bit unsigned result.
174 This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
175 unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
176 bit unsigned result is returned.
178 @param Multiplicand A 64-bit unsigned value.
179 @param Multiplier A 64-bit unsigned value.
181 @return Multiplicand * Multiplier
186 InternalMathMultU64x64 (
187 IN UINT64 Multiplicand
,
192 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
193 generates a 64-bit unsigned result.
195 This function divides the 64-bit unsigned value Dividend by the 32-bit
196 unsigned value Divisor and generates a 64-bit unsigned quotient. This
197 function returns the 64-bit unsigned quotient.
199 @param Dividend A 64-bit unsigned value.
200 @param Divisor A 32-bit unsigned value.
202 @return Dividend / Divisor
207 InternalMathDivU64x32 (
213 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
214 generates a 32-bit unsigned remainder.
216 This function divides the 64-bit unsigned value Dividend by the 32-bit
217 unsigned value Divisor and generates a 32-bit remainder. This function
218 returns the 32-bit unsigned remainder.
220 @param Dividend A 64-bit unsigned value.
221 @param Divisor A 32-bit unsigned value.
223 @return Dividend % Divisor
228 InternalMathModU64x32 (
234 Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
235 generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
237 This function divides the 64-bit unsigned value Dividend by the 32-bit
238 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
239 is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
240 This function returns the 64-bit unsigned quotient.
242 @param Dividend A 64-bit unsigned value.
243 @param Divisor A 32-bit unsigned value.
244 @param Remainder A pointer to a 32-bit unsigned value. This parameter is
245 optional and may be NULL.
247 @return Dividend / Divisor
252 InternalMathDivRemU64x32 (
255 OUT UINT32
*Remainder OPTIONAL
259 Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
260 generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
262 This function divides the 64-bit unsigned value Dividend by the 64-bit
263 unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
264 is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
265 This function returns the 64-bit unsigned quotient.
267 @param Dividend A 64-bit unsigned value.
268 @param Divisor A 64-bit unsigned value.
269 @param Remainder A pointer to a 64-bit unsigned value. This parameter is
270 optional and may be NULL.
272 @return Dividend / Divisor
277 InternalMathDivRemU64x64 (
280 OUT UINT64
*Remainder OPTIONAL
284 Divides a 64-bit signed integer by a 64-bit signed integer and
285 generates a 64-bit signed result and an optional 64-bit signed remainder.
287 This function divides the 64-bit signed value Dividend by the 64-bit
288 signed value Divisor and generates a 64-bit signed quotient. If Remainder
289 is not NULL, then the 64-bit signed remainder is returned in Remainder.
290 This function returns the 64-bit signed quotient.
292 @param Dividend A 64-bit signed value.
293 @param Divisor A 64-bit signed value.
294 @param Remainder A pointer to a 64-bit signed value. This parameter is
295 optional and may be NULL.
297 @return Dividend / Divisor
302 InternalMathDivRemS64x64 (
305 OUT INT64
*Remainder OPTIONAL
309 Transfers control to a function starting with a new stack.
311 Transfers control to the function specified by EntryPoint using the
312 new stack specified by NewStack and passing in the parameters specified
313 by Context1 and Context2. Context1 and Context2 are optional and may
314 be NULL. The function EntryPoint must never return.
315 Marker will be ignored on IA-32, x64, and EBC.
316 IPF CPUs expect one additional parameter of type VOID * that specifies
317 the new backing store pointer.
319 If EntryPoint is NULL, then ASSERT().
320 If NewStack is NULL, then ASSERT().
322 @param EntryPoint A pointer to function to call with the new stack.
323 @param Context1 A pointer to the context to pass into the EntryPoint
325 @param Context2 A pointer to the context to pass into the EntryPoint
327 @param NewStack A pointer to the new stack to use for the EntryPoint
329 @param Marker VA_LIST marker for the variable argument list.
334 InternalSwitchStack (
335 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
336 IN VOID
*Context1
, OPTIONAL
337 IN VOID
*Context2
, OPTIONAL
344 Worker function that locates the Node in the List.
346 By searching the List, finds the location of the Node in List. At the same time,
347 verifies the validity of this list.
349 If List is NULL, then ASSERT().
350 If List->ForwardLink is NULL, then ASSERT().
351 If List->backLink is NULL, then ASSERT().
352 If Node is NULL, then ASSERT();
353 If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
354 of nodes in ListHead, including the ListHead node, is greater than or
355 equal to PcdMaximumLinkedListLength, then ASSERT().
357 @param List A pointer to a node in a linked list.
358 @param Node A pointer to one nod.
360 @retval TRUE Node is in List
361 @retval FALSE Node isn't in List, or List is invalid
367 IN CONST LIST_ENTRY
*List
,
368 IN CONST LIST_ENTRY
*Node
373 Performs an atomic increment of an 32-bit unsigned integer.
375 Performs an atomic increment of the 32-bit unsigned integer specified by
376 Value and returns the incremented value. The increment operation must be
377 performed using MP safe mechanisms. The state of the return value is not
378 guaranteed to be MP safe.
380 @param Value A pointer to the 32-bit value to increment.
382 @return The incremented value.
387 InternalSyncIncrement (
388 IN
volatile UINT32
*Value
393 Performs an atomic decrement of an 32-bit unsigned integer.
395 Performs an atomic decrement of the 32-bit unsigned integer specified by
396 Value and returns the decrement value. The decrement operation must be
397 performed using MP safe mechanisms. The state of the return value is not
398 guaranteed to be MP safe.
400 @param Value A pointer to the 32-bit value to decrement.
402 @return The decrement value.
407 InternalSyncDecrement (
408 IN
volatile UINT32
*Value
413 Performs an atomic compare exchange operation on a 32-bit unsigned integer.
415 Performs an atomic compare exchange operation on the 32-bit unsigned integer
416 specified by Value. If Value is equal to CompareValue, then Value is set to
417 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
418 then Value is returned. The compare exchange operation must be performed using
421 @param Value A pointer to the 32-bit value for the compare exchange
423 @param CompareValue 32-bit value used in compare operation.
424 @param ExchangeValue 32-bit value used in exchange operation.
426 @return The original *Value before exchange.
431 InternalSyncCompareExchange32 (
432 IN
volatile UINT32
*Value
,
433 IN UINT32 CompareValue
,
434 IN UINT32 ExchangeValue
439 Performs an atomic compare exchange operation on a 64-bit unsigned integer.
441 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
442 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
443 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
444 The compare exchange operation must be performed using MP safe mechanisms.
446 @param Value A pointer to the 64-bit value for the compare exchange
448 @param CompareValue 64-bit value used in compare operation.
449 @param ExchangeValue 64-bit value used in exchange operation.
451 @return The original *Value before exchange.
456 InternalSyncCompareExchange64 (
457 IN
volatile UINT64
*Value
,
458 IN UINT64 CompareValue
,
459 IN UINT64 ExchangeValue
464 Worker function that returns a bit field from Operand.
466 Returns the bitfield specified by the StartBit and the EndBit from Operand.
468 @param Operand Operand on which to perform the bitfield operation.
469 @param StartBit The ordinal of the least significant bit in the bit field.
470 @param EndBit The ordinal of the most significant bit in the bit field.
472 @return The bit field read.
485 Worker function that reads a bit field from Operand, performs a bitwise OR,
486 and returns the result.
488 Performs a bitwise OR between the bit field specified by StartBit and EndBit
489 in Operand and the value specified by AndData. All other bits in Operand are
490 preserved. The new value is returned.
492 @param Operand Operand on which to perform the bitfield operation.
493 @param StartBit The ordinal of the least significant bit in the bit field.
494 @param EndBit The ordinal of the most significant bit in the bit field.
495 @param OrData The value to OR with the read value from the value
497 @return The new value.
511 Worker function that reads a bit field from Operand, performs a bitwise AND,
512 and returns the result.
514 Performs a bitwise AND between the bit field specified by StartBit and EndBit
515 in Operand and the value specified by AndData. All other bits in Operand are
516 preserved. The new value is returned.
518 @param Operand Operand on which to perform the bitfield operation.
519 @param StartBit The ordinal of the least significant bit in the bit field.
520 @param EndBit The ordinal of the most significant bit in the bit field.
521 @param AndData The value to And with the read value from the value
523 @return The new value.
537 Worker function that checks ASSERT condition for JumpBuffer
539 Checks ASSERT condition for JumpBuffer.
541 If JumpBuffer is NULL, then ASSERT().
542 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
544 @param JumpBuffer A pointer to CPU context buffer.
549 InternalAssertJumpBuffer (
550 IN BASE_LIBRARY_JUMP_BUFFER
*JumpBuffer
555 Restores the CPU context that was saved with SetJump().
557 Restores the CPU context from the buffer specified by JumpBuffer.
558 This function never returns to the caller.
559 Instead is resumes execution based on the state of JumpBuffer.
561 @param JumpBuffer A pointer to CPU context buffer.
562 @param Value The value to return when the SetJump() context is restored.
568 IN BASE_LIBRARY_JUMP_BUFFER
*JumpBuffer
,
574 // Ia32 and x64 specific functions
576 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
579 Reads the current Global Descriptor Table Register(GDTR) descriptor.
581 Reads and returns the current GDTR descriptor and returns it in Gdtr. This
582 function is only available on IA-32 and x64.
584 @param Gdtr Pointer to a GDTR descriptor.
589 InternalX86ReadGdtr (
590 OUT IA32_DESCRIPTOR
*Gdtr
594 Writes the current Global Descriptor Table Register (GDTR) descriptor.
596 Writes and the current GDTR descriptor specified by Gdtr. This function is
597 only available on IA-32 and x64.
599 @param Gdtr Pointer to a GDTR descriptor.
604 InternalX86WriteGdtr (
605 IN CONST IA32_DESCRIPTOR
*Gdtr
609 Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
611 Reads and returns the current IDTR descriptor and returns it in Idtr. This
612 function is only available on IA-32 and x64.
614 @param Idtr Pointer to a IDTR descriptor.
619 InternalX86ReadIdtr (
620 OUT IA32_DESCRIPTOR
*Idtr
624 Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
626 Writes the current IDTR descriptor and returns it in Idtr. This function is
627 only available on IA-32 and x64.
629 @param Idtr Pointer to a IDTR descriptor.
634 InternalX86WriteIdtr (
635 IN CONST IA32_DESCRIPTOR
*Idtr
639 Save the current floating point/SSE/SSE2 context to a buffer.
641 Saves the current floating point/SSE/SSE2 state to the buffer specified by
642 Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
643 available on IA-32 and x64.
645 @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
651 OUT IA32_FX_BUFFER
*Buffer
655 Restores the current floating point/SSE/SSE2 context from a buffer.
657 Restores the current floating point/SSE/SSE2 state from the buffer specified
658 by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
659 only available on IA-32 and x64.
661 @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
666 InternalX86FxRestore (
667 IN CONST IA32_FX_BUFFER
*Buffer
671 Enables the 32-bit paging mode on the CPU.
673 Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
674 must be properly initialized prior to calling this service. This function
675 assumes the current execution mode is 32-bit protected mode. This function is
676 only available on IA-32. After the 32-bit paging mode is enabled, control is
677 transferred to the function specified by EntryPoint using the new stack
678 specified by NewStack and passing in the parameters specified by Context1 and
679 Context2. Context1 and Context2 are optional and may be NULL. The function
680 EntryPoint must never return.
682 There are a number of constraints that must be followed before calling this
684 1) Interrupts must be disabled.
685 2) The caller must be in 32-bit protected mode with flat descriptors. This
686 means all descriptors must have a base of 0 and a limit of 4GB.
687 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
689 4) CR3 must point to valid page tables that will be used once the transition
690 is complete, and those page tables must guarantee that the pages for this
691 function and the stack are identity mapped.
693 @param EntryPoint A pointer to function to call with the new stack after
695 @param Context1 A pointer to the context to pass into the EntryPoint
696 function as the first parameter after paging is enabled.
697 @param Context2 A pointer to the context to pass into the EntryPoint
698 function as the second parameter after paging is enabled.
699 @param NewStack A pointer to the new stack to use for the EntryPoint
700 function after paging is enabled.
705 InternalX86EnablePaging32 (
706 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
707 IN VOID
*Context1
, OPTIONAL
708 IN VOID
*Context2
, OPTIONAL
713 Disables the 32-bit paging mode on the CPU.
715 Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
716 mode. This function assumes the current execution mode is 32-paged protected
717 mode. This function is only available on IA-32. After the 32-bit paging mode
718 is disabled, control is transferred to the function specified by EntryPoint
719 using the new stack specified by NewStack and passing in the parameters
720 specified by Context1 and Context2. Context1 and Context2 are optional and
721 may be NULL. The function EntryPoint must never return.
723 There are a number of constraints that must be followed before calling this
725 1) Interrupts must be disabled.
726 2) The caller must be in 32-bit paged mode.
727 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
728 4) CR3 must point to valid page tables that guarantee that the pages for
729 this function and the stack are identity mapped.
731 @param EntryPoint A pointer to function to call with the new stack after
733 @param Context1 A pointer to the context to pass into the EntryPoint
734 function as the first parameter after paging is disabled.
735 @param Context2 A pointer to the context to pass into the EntryPoint
736 function as the second parameter after paging is
738 @param NewStack A pointer to the new stack to use for the EntryPoint
739 function after paging is disabled.
744 InternalX86DisablePaging32 (
745 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
746 IN VOID
*Context1
, OPTIONAL
747 IN VOID
*Context2
, OPTIONAL
752 Enables the 64-bit paging mode on the CPU.
754 Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
755 must be properly initialized prior to calling this service. This function
756 assumes the current execution mode is 32-bit protected mode with flat
757 descriptors. This function is only available on IA-32. After the 64-bit
758 paging mode is enabled, control is transferred to the function specified by
759 EntryPoint using the new stack specified by NewStack and passing in the
760 parameters specified by Context1 and Context2. Context1 and Context2 are
761 optional and may be 0. The function EntryPoint must never return.
763 @param Cs The 16-bit selector to load in the CS before EntryPoint
764 is called. The descriptor in the GDT that this selector
765 references must be setup for long mode.
766 @param EntryPoint The 64-bit virtual address of the function to call with
767 the new stack after paging is enabled.
768 @param Context1 The 64-bit virtual address of the context to pass into
769 the EntryPoint function as the first parameter after
771 @param Context2 The 64-bit virtual address of the context to pass into
772 the EntryPoint function as the second parameter after
774 @param NewStack The 64-bit virtual address of the new stack to use for
775 the EntryPoint function after paging is enabled.
780 InternalX86EnablePaging64 (
782 IN UINT64 EntryPoint
,
783 IN UINT64 Context1
, OPTIONAL
784 IN UINT64 Context2
, OPTIONAL
789 Disables the 64-bit paging mode on the CPU.
791 Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
792 mode. This function assumes the current execution mode is 64-paging mode.
793 This function is only available on x64. After the 64-bit paging mode is
794 disabled, control is transferred to the function specified by EntryPoint
795 using the new stack specified by NewStack and passing in the parameters
796 specified by Context1 and Context2. Context1 and Context2 are optional and
797 may be 0. The function EntryPoint must never return.
799 @param Cs The 16-bit selector to load in the CS before EntryPoint
800 is called. The descriptor in the GDT that this selector
801 references must be setup for 32-bit protected mode.
802 @param EntryPoint The 64-bit virtual address of the function to call with
803 the new stack after paging is disabled.
804 @param Context1 The 64-bit virtual address of the context to pass into
805 the EntryPoint function as the first parameter after
807 @param Context2 The 64-bit virtual address of the context to pass into
808 the EntryPoint function as the second parameter after
810 @param NewStack The 64-bit virtual address of the new stack to use for
811 the EntryPoint function after paging is disabled.
816 InternalX86DisablePaging64 (
818 IN UINT32 EntryPoint
,
819 IN UINT32 Context1
, OPTIONAL
820 IN UINT32 Context2
, OPTIONAL
825 #elif defined (MDE_CPU_IPF)
828 // IPF specific functions
832 // Structure definition for look up table.
836 UINT64 (*Function
) (VOID
);
841 Reads control register DCR.
843 This is a worker function for AsmReadControlRegister()
844 when its parameter Index is IPF_CONTROL_REGISTER_DCR
846 @return The 64-bit control register DCR.
851 AsmReadControlRegisterDcr (
857 Reads control register ITM.
859 This is a worker function for AsmReadControlRegister()
860 when its parameter Index is IPF_CONTROL_REGISTER_ITM
862 @return The 64-bit control register ITM.
867 AsmReadControlRegisterItm (
873 Reads control register IVA.
875 This is a worker function for AsmReadControlRegister()
876 when its parameter Index is IPF_CONTROL_REGISTER_IVA
878 @return The 64-bit control register IVA.
883 AsmReadControlRegisterIva (
889 Reads control register PTA.
891 This is a worker function for AsmReadControlRegister()
892 when its parameter Index is IPF_CONTROL_REGISTER_PTA
894 @return The 64-bit control register PTA.
899 AsmReadControlRegisterPta (
905 Reads control register IPSR.
907 This is a worker function for AsmReadControlRegister()
908 when its parameter Index is IPF_CONTROL_REGISTER_IPSR
910 @return The 64-bit control register IPSR.
915 AsmReadControlRegisterIpsr (
921 Reads control register ISR.
923 This is a worker function for AsmReadControlRegister()
924 when its parameter Index is IPF_CONTROL_REGISTER_ISR
926 @return The 64-bit control register ISR.
931 AsmReadControlRegisterIsr (
937 Reads control register IIP.
939 This is a worker function for AsmReadControlRegister()
940 when its parameter Index is IPF_CONTROL_REGISTER_IIP
942 @return The 64-bit control register IIP.
947 AsmReadControlRegisterIip (
953 Reads control register IFA.
955 This is a worker function for AsmReadControlRegister()
956 when its parameter Index is IPF_CONTROL_REGISTER_IFA
958 @return The 64-bit control register IFA.
963 AsmReadControlRegisterIfa (
969 Reads control register ITIR.
971 This is a worker function for AsmReadControlRegister()
972 when its parameter Index is IPF_CONTROL_REGISTER_ITIR
974 @return The 64-bit control register ITIR.
979 AsmReadControlRegisterItir (
985 Reads control register IIPA.
987 This is a worker function for AsmReadControlRegister()
988 when its parameter Index is IPF_CONTROL_REGISTER_IIPA
990 @return The 64-bit control register IIPA.
995 AsmReadControlRegisterIipa (
1001 Reads control register IFS.
1003 This is a worker function for AsmReadControlRegister()
1004 when its parameter Index is IPF_CONTROL_REGISTER_IFS
1006 @return The 64-bit control register IFS.
1011 AsmReadControlRegisterIfs (
1017 Reads control register IIM.
1019 This is a worker function for AsmReadControlRegister()
1020 when its parameter Index is IPF_CONTROL_REGISTER_IIM
1022 @return The 64-bit control register IIM.
1027 AsmReadControlRegisterIim (
1033 Reads control register IHA.
1035 This is a worker function for AsmReadControlRegister()
1036 when its parameter Index is IPF_CONTROL_REGISTER_IHA
1038 @return The 64-bit control register IHA.
1043 AsmReadControlRegisterIha (
1049 Reads control register LID.
1051 This is a worker function for AsmReadControlRegister()
1052 when its parameter Index is IPF_CONTROL_REGISTER_LID
1054 @return The 64-bit control register LID.
1059 AsmReadControlRegisterLid (
1065 Reads control register IVR.
1067 This is a worker function for AsmReadControlRegister()
1068 when its parameter Index is IPF_CONTROL_REGISTER_IVR
1070 @return The 64-bit control register IVR.
1075 AsmReadControlRegisterIvr (
1081 Reads control register TPR.
1083 This is a worker function for AsmReadControlRegister()
1084 when its parameter Index is IPF_CONTROL_REGISTER_TPR
1086 @return The 64-bit control register TPR.
1091 AsmReadControlRegisterTpr (
1097 Reads control register EOI.
1099 This is a worker function for AsmReadControlRegister()
1100 when its parameter Index is IPF_CONTROL_REGISTER_EOI
1102 @return The 64-bit control register EOI.
1107 AsmReadControlRegisterEoi (
1113 Reads control register IRR0.
1115 This is a worker function for AsmReadControlRegister()
1116 when its parameter Index is IPF_CONTROL_REGISTER_IRR0
1118 @return The 64-bit control register IRR0.
1123 AsmReadControlRegisterIrr0 (
1129 Reads control register IRR1.
1131 This is a worker function for AsmReadControlRegister()
1132 when its parameter Index is IPF_CONTROL_REGISTER_IRR1
1134 @return The 64-bit control register IRR1.
1139 AsmReadControlRegisterIrr1 (
1145 Reads control register IRR2.
1147 This is a worker function for AsmReadControlRegister()
1148 when its parameter Index is IPF_CONTROL_REGISTER_IRR2
1150 @return The 64-bit control register IRR2.
1155 AsmReadControlRegisterIrr2 (
1161 Reads control register IRR3.
1163 This is a worker function for AsmReadControlRegister()
1164 when its parameter Index is IPF_CONTROL_REGISTER_IRR3
1166 @return The 64-bit control register IRR3.
1171 AsmReadControlRegisterIrr3 (
1177 Reads control register ITV.
1179 This is a worker function for AsmReadControlRegister()
1180 when its parameter Index is IPF_CONTROL_REGISTER_ITV
1182 @return The 64-bit control register ITV.
1187 AsmReadControlRegisterItv (
1193 Reads control register PMV.
1195 This is a worker function for AsmReadControlRegister()
1196 when its parameter Index is IPF_CONTROL_REGISTER_PMV
1198 @return The 64-bit control register PMV.
1203 AsmReadControlRegisterPmv (
1209 Reads control register CMCV.
1211 This is a worker function for AsmReadControlRegister()
1212 when its parameter Index is IPF_CONTROL_REGISTER_CMCV
1214 @return The 64-bit control register CMCV.
1219 AsmReadControlRegisterCmcv (
1225 Reads control register LRR0.
1227 This is a worker function for AsmReadControlRegister()
1228 when its parameter Index is IPF_CONTROL_REGISTER_LRR0
1230 @return The 64-bit control register LRR0.
1235 AsmReadControlRegisterLrr0 (
1241 Reads control register LRR1.
1243 This is a worker function for AsmReadControlRegister()
1244 when its parameter Index is IPF_CONTROL_REGISTER_LRR1
1246 @return The 64-bit control register LRR1.
1251 AsmReadControlRegisterLrr1 (
1257 Reads application register K0.
1259 This is a worker function for AsmReadApplicationRegister()
1260 when its parameter Index is IPF_APPLICATION_REGISTER_K0
1262 @return The 64-bit application register K0.
1267 AsmReadApplicationRegisterK0 (
1274 Reads application register K1.
1276 This is a worker function for AsmReadApplicationRegister()
1277 when its parameter Index is IPF_APPLICATION_REGISTER_K1
1279 @return The 64-bit application register K1.
1284 AsmReadApplicationRegisterK1 (
1290 Reads application register K2.
1292 This is a worker function for AsmReadApplicationRegister()
1293 when its parameter Index is IPF_APPLICATION_REGISTER_K2
1295 @return The 64-bit application register K2.
1300 AsmReadApplicationRegisterK2 (
1306 Reads application register K3.
1308 This is a worker function for AsmReadApplicationRegister()
1309 when its parameter Index is IPF_APPLICATION_REGISTER_K3
1311 @return The 64-bit application register K3.
1316 AsmReadApplicationRegisterK3 (
1322 Reads application register K4.
1324 This is a worker function for AsmReadApplicationRegister()
1325 when its parameter Index is IPF_APPLICATION_REGISTER_K4
1327 @return The 64-bit application register K4.
1332 AsmReadApplicationRegisterK4 (
1338 Reads application register K5.
1340 This is a worker function for AsmReadApplicationRegister()
1341 when its parameter Index is IPF_APPLICATION_REGISTER_K5
1343 @return The 64-bit application register K5.
1348 AsmReadApplicationRegisterK5 (
1354 Reads application register K6.
1356 This is a worker function for AsmReadApplicationRegister()
1357 when its parameter Index is IPF_APPLICATION_REGISTER_K6
1359 @return The 64-bit application register K6.
1364 AsmReadApplicationRegisterK6 (
1370 Reads application register K7.
1372 This is a worker function for AsmReadApplicationRegister()
1373 when its parameter Index is IPF_APPLICATION_REGISTER_K7
1375 @return The 64-bit application register K7.
1380 AsmReadApplicationRegisterK7 (
1386 Reads application register RSC.
1388 This is a worker function for AsmReadApplicationRegister()
1389 when its parameter Index is IPF_APPLICATION_REGISTER_RSC
1391 @return The 64-bit application register RSC.
1396 AsmReadApplicationRegisterRsc (
1402 Reads application register BSP.
1404 This is a worker function for AsmReadApplicationRegister()
1405 when its parameter Index is IPF_APPLICATION_REGISTER_BSP
1407 @return The 64-bit application register BSP.
1412 AsmReadApplicationRegisterBsp (
1418 Reads application register BSPSTORE.
1420 This is a worker function for AsmReadApplicationRegister()
1421 when its parameter Index is IPF_APPLICATION_REGISTER_BSPSTORE
1423 @return The 64-bit application register BSPSTORE.
1428 AsmReadApplicationRegisterBspstore (
1434 Reads application register RNAT.
1436 This is a worker function for AsmReadApplicationRegister()
1437 when its parameter Index is IPF_APPLICATION_REGISTER_RNAT
1439 @return The 64-bit application register RNAT.
1444 AsmReadApplicationRegisterRnat (
1450 Reads application register FCR.
1452 This is a worker function for AsmReadApplicationRegister()
1453 when its parameter Index is IPF_APPLICATION_REGISTER_FCR
1455 @return The 64-bit application register FCR.
1460 AsmReadApplicationRegisterFcr (
1466 Reads application register EFLAG.
1468 This is a worker function for AsmReadApplicationRegister()
1469 when its parameter Index is IPF_APPLICATION_REGISTER_EFLAG
1471 @return The 64-bit application register EFLAG.
1476 AsmReadApplicationRegisterEflag (
1482 Reads application register CSD.
1484 This is a worker function for AsmReadApplicationRegister()
1485 when its parameter Index is IPF_APPLICATION_REGISTER_CSD
1487 @return The 64-bit application register CSD.
1492 AsmReadApplicationRegisterCsd (
1498 Reads application register SSD.
1500 This is a worker function for AsmReadApplicationRegister()
1501 when its parameter Index is IPF_APPLICATION_REGISTER_SSD
1503 @return The 64-bit application register SSD.
1508 AsmReadApplicationRegisterSsd (
1514 Reads application register CFLG.
1516 This is a worker function for AsmReadApplicationRegister()
1517 when its parameter Index is IPF_APPLICATION_REGISTER_CFLG
1519 @return The 64-bit application register CFLG.
1524 AsmReadApplicationRegisterCflg (
1530 Reads application register FSR.
1532 This is a worker function for AsmReadApplicationRegister()
1533 when its parameter Index is IPF_APPLICATION_REGISTER_FSR
1535 @return The 64-bit application register FSR.
1540 AsmReadApplicationRegisterFsr (
1546 Reads application register FIR.
1548 This is a worker function for AsmReadApplicationRegister()
1549 when its parameter Index is IPF_APPLICATION_REGISTER_FIR
1551 @return The 64-bit application register FIR.
1556 AsmReadApplicationRegisterFir (
1562 Reads application register FDR.
1564 This is a worker function for AsmReadApplicationRegister()
1565 when its parameter Index is IPF_APPLICATION_REGISTER_FDR
1567 @return The 64-bit application register FDR.
1572 AsmReadApplicationRegisterFdr (
1578 Reads application register CCV.
1580 This is a worker function for AsmReadApplicationRegister()
1581 when its parameter Index is IPF_APPLICATION_REGISTER_CCV
1583 @return The 64-bit application register CCV.
1588 AsmReadApplicationRegisterCcv (
1594 Reads application register UNAT.
1596 This is a worker function for AsmReadApplicationRegister()
1597 when its parameter Index is IPF_APPLICATION_REGISTER_UNAT
1599 @return The 64-bit application register UNAT.
1604 AsmReadApplicationRegisterUnat (
1610 Reads application register FPSR.
1612 This is a worker function for AsmReadApplicationRegister()
1613 when its parameter Index is IPF_APPLICATION_REGISTER_FPSR
1615 @return The 64-bit application register FPSR.
1620 AsmReadApplicationRegisterFpsr (
1626 Reads application register ITC.
1628 This is a worker function for AsmReadApplicationRegister()
1629 when its parameter Index is IPF_APPLICATION_REGISTER_ITC
1631 @return The 64-bit application register ITC.
1636 AsmReadApplicationRegisterItc (
1642 Reads application register PFS.
1644 This is a worker function for AsmReadApplicationRegister()
1645 when its parameter Index is IPF_APPLICATION_REGISTER_PFS
1647 @return The 64-bit application register PFS.
1652 AsmReadApplicationRegisterPfs (
1658 Reads application register LC.
1660 This is a worker function for AsmReadApplicationRegister()
1661 when its parameter Index is IPF_APPLICATION_REGISTER_LC
1663 @return The 64-bit application register LC.
1668 AsmReadApplicationRegisterLc (
1674 Reads application register EC.
1676 This is a worker function for AsmReadApplicationRegister()
1677 when its parameter Index is IPF_APPLICATION_REGISTER_EC
1679 @return The 64-bit application register EC.
1684 AsmReadApplicationRegisterEc (
1691 Transfers control to a function starting with a new stack.
1693 Transfers control to the function specified by EntryPoint using the new stack
1694 specified by NewStack and passing in the parameters specified by Context1 and
1695 Context2. Context1 and Context2 are optional and may be NULL. The function
1696 EntryPoint must never return.
1698 If EntryPoint is NULL, then ASSERT().
1699 If NewStack is NULL, then ASSERT().
1701 @param EntryPoint A pointer to function to call with the new stack.
1702 @param Context1 A pointer to the context to pass into the EntryPoint
1704 @param Context2 A pointer to the context to pass into the EntryPoint
1706 @param NewStack A pointer to the new stack to use for the EntryPoint
1708 @param NewBsp A pointer to the new memory location for RSE backing
1714 AsmSwitchStackAndBackingStore (
1715 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1716 IN VOID
*Context1
, OPTIONAL
1717 IN VOID
*Context2
, OPTIONAL