MdePkg/Library/BaseLib/BaseLibInternals.h File Reference


Functions

UINT64 EFIAPI InternalMathLShiftU64 (IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI InternalMathRShiftU64 (IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI InternalMathARShiftU64 (IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI InternalMathLRotU64 (IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI InternalMathRRotU64 (IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI InternalMathSwapBytes64 (IN UINT64 Operand)
UINT64 EFIAPI InternalMathMultU64x32 (IN UINT64 Multiplicand, IN UINT32 Multiplier)
UINT64 EFIAPI InternalMathMultU64x64 (IN UINT64 Multiplicand, IN UINT64 Multiplier)
UINT64 EFIAPI InternalMathDivU64x32 (IN UINT64 Dividend, IN UINT32 Divisor)
UINT32 EFIAPI InternalMathModU64x32 (IN UINT64 Dividend, IN UINT32 Divisor)
UINT64 EFIAPI InternalMathDivRemU64x32 (IN UINT64 Dividend, IN UINT32 Divisor, OUT UINT32 *Remainder)
UINT64 EFIAPI InternalMathDivRemU64x64 (IN UINT64 Dividend, IN UINT64 Divisor, OUT UINT64 *Remainder)
INT64 EFIAPI InternalMathDivRemS64x64 (IN INT64 Dividend, IN INT64 Divisor, OUT INT64 *Remainder)
VOID EFIAPI InternalSwitchStack (IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1, IN VOID *Context2, IN VOID *NewStack, IN VA_LIST Marker)
BOOLEAN EFIAPI IsNodeInList (IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI BitFieldReadUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit)
UINTN EFIAPI BitFieldOrUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINTN OrData)
UINTN EFIAPI BitFieldAndUint (IN UINTN Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINTN AndData)
VOID EFIAPI InternalAssertJumpBuffer (IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer)
VOID EFIAPI InternalLongJump (IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, IN UINTN Value)
VOID EFIAPI InternalX86ReadGdtr (OUT IA32_DESCRIPTOR *Gdtr)
VOID EFIAPI InternalX86WriteGdtr (IN CONST IA32_DESCRIPTOR *Gdtr)
VOID EFIAPI InternalX86ReadIdtr (OUT IA32_DESCRIPTOR *Idtr)
VOID EFIAPI InternalX86WriteIdtr (IN CONST IA32_DESCRIPTOR *Idtr)
VOID EFIAPI InternalX86FxSave (OUT IA32_FX_BUFFER *Buffer)
VOID EFIAPI InternalX86FxRestore (IN CONST IA32_FX_BUFFER *Buffer)
VOID EFIAPI InternalX86EnablePaging32 (IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1, IN VOID *Context2, IN VOID *NewStack)
VOID EFIAPI InternalX86DisablePaging32 (IN SWITCH_STACK_ENTRY_POINT EntryPoint, IN VOID *Context1, IN VOID *Context2, IN VOID *NewStack)
VOID EFIAPI InternalX86EnablePaging64 (IN UINT16 Cs, IN UINT64 EntryPoint, IN UINT64 Context1, IN UINT64 Context2, IN UINT64 NewStack)
VOID EFIAPI InternalX86DisablePaging64 (IN UINT16 Cs, IN UINT32 EntryPoint, IN UINT32 Context1, IN UINT32 Context2, IN UINT32 NewStack)

Detailed Description

Declaration of internal functions in BaseLib.

Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

UINTN EFIAPI BitFieldAndUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINTN  AndData 
)

Worker function that reads a bit field from Operand, performs a bitwise AND, and returns the result.

Performs a bitwise AND between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new value is returned.

Parameters:
Operand Operand on which to perform the bitfield operation.
StartBit The ordinal of the least significant bit in the bit field.
EndBit The ordinal of the most significant bit in the bit field.
AndData The value to And with the read value from the value
Returns:
The new value.

UINTN EFIAPI BitFieldOrUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit,
IN UINTN  OrData 
)

Worker function that reads a bit field from Operand, performs a bitwise OR, and returns the result.

Performs a bitwise OR between the bit field specified by StartBit and EndBit in Operand and the value specified by AndData. All other bits in Operand are preserved. The new value is returned.

Parameters:
Operand Operand on which to perform the bitfield operation.
StartBit The ordinal of the least significant bit in the bit field.
EndBit The ordinal of the most significant bit in the bit field.
OrData The value to OR with the read value from the value
Returns:
The new value.

UINTN EFIAPI BitFieldReadUint ( IN UINTN  Operand,
IN UINTN  StartBit,
IN UINTN  EndBit 
)

Worker function that returns a bit field from Operand.

Returns the bitfield specified by the StartBit and the EndBit from Operand.

Parameters:
Operand Operand on which to perform the bitfield operation.
StartBit The ordinal of the least significant bit in the bit field.
EndBit The ordinal of the most significant bit in the bit field.
Returns:
The bit field read.

VOID EFIAPI InternalAssertJumpBuffer ( IN BASE_LIBRARY_JUMP_BUFFER JumpBuffer  ) 

Worker function that checks ASSERT condition for JumpBuffer

Checks ASSERT condition for JumpBuffer.

If JumpBuffer is NULL, then ASSERT(). For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().

Parameters:
JumpBuffer A pointer to CPU context buffer.

Referenced by _declspec(), LongJump(), and SetJump().

VOID EFIAPI InternalLongJump ( IN BASE_LIBRARY_JUMP_BUFFER JumpBuffer,
IN UINTN  Value 
)

Restores the CPU context that was saved with SetJump().

Restores the CPU context from the buffer specified by JumpBuffer. This function never returns to the caller. Instead is resumes execution based on the state of JumpBuffer.

Parameters:
JumpBuffer A pointer to CPU context buffer.
Value The value to return when the SetJump() context is restored.
Restores the CPU context that was saved with SetJump().

Restores the CPU context from the buffer specified by JumpBuffer. This function never returns to the caller. Instead it resumes execution based on the state of JumpBuffer.

Parameters:
JumpBuffer A pointer to CPU context buffer.
Value The value to return when the SetJump() context is restored.

References ASSERT, and FALSE.

Referenced by LongJump().

UINT64 EFIAPI InternalMathARShiftU64 ( IN UINT64  Operand,
IN UINTN  Count 
)

Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled with original integer's bit 63. The shifted value is returned.

This function shifts the 64-bit value Operand to the right by Count bits. The high Count bits are set to bit 63 of Operand. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift right.
Count The number of bits to shift right.
Returns:
Operand arithmetically shifted right by Count
Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled with original integer's bit 63. The shifted value is returned.

This function shifts the 64-bit value Operand to the right by Count bits. The high Count bits are set to bit 63 of Operand. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift right.
Count The number of bits to shift right.
Returns:
Operand arithmetically shifted right by Count.

References eax, edx, and mov.

Referenced by ARShiftU64().

INT64 EFIAPI InternalMathDivRemS64x64 ( IN INT64  Dividend,
IN INT64  Divisor,
OUT INT64 Remainder 
)

Divides a 64-bit signed integer by a 64-bit signed integer and generates a 64-bit signed result and an optional 64-bit signed remainder.

This function divides the 64-bit signed value Dividend by the 64-bit signed value Divisor and generates a 64-bit signed quotient. If Remainder is not NULL, then the 64-bit signed remainder is returned in Remainder. This function returns the 64-bit signed quotient.

Parameters:
Dividend A 64-bit signed value.
Divisor A 64-bit signed value.
Remainder A pointer to a 64-bit signed value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor
Divides a 64-bit signed integer by a 64-bit signed integer and generates a 64-bit signed result and an optional 64-bit signed remainder.

This function divides the 64-bit signed value Dividend by the 64-bit signed value Divisor and generates a 64-bit signed quotient. If Remainder is not NULL, then the 64-bit signed remainder is returned in Remainder. This function returns the 64-bit signed quotient.

Parameters:
Dividend A 64-bit signed value.
Divisor A 64-bit signed value.
Remainder A pointer to a 64-bit signed value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor.
Worker function that Divides a 64-bit signed integer by a 64-bit signed integer and generates a 64-bit signed result and a optional 64-bit signed remainder.

This function divides the 64-bit signed value Dividend by the 64-bit signed value Divisor and generates a 64-bit signed quotient. If Remainder is not NULL, then the 64-bit signed remainder is returned in Remainder. This function returns the 64-bit signed quotient.

Parameters:
Dividend A 64-bit signed value.
Divisor A 64-bit signed value.
Remainder A pointer to a 64-bit signed value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor

References InternalMathDivRemU64x64(), and NULL.

Referenced by DivS64x64Remainder().

UINT64 EFIAPI InternalMathDivRemU64x32 ( IN UINT64  Dividend,
IN UINT32  Divisor,
OUT UINT32 Remainder 
)

Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder is not NULL, then the 32-bit unsigned remainder is returned in Remainder. This function returns the 64-bit unsigned quotient.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Remainder A pointer to a 32-bit unsigned value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder is not NULL, then the 32-bit unsigned remainder is returned in Remainder. This function returns the 64-bit unsigned quotient.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Remainder A pointer to a 32-bit unsigned value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor.

References eax, ecx, edx, mov, and NULL.

Referenced by DivU64x32Remainder().

UINT64 EFIAPI InternalMathDivRemU64x64 ( IN UINT64  Dividend,
IN UINT64  Divisor,
OUT UINT64 Remainder 
)

Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.

This function divides the 64-bit unsigned value Dividend by the 64-bit unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder is not NULL, then the 64-bit unsigned remainder is returned in Remainder. This function returns the 64-bit unsigned quotient.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 64-bit unsigned value.
Remainder A pointer to a 64-bit unsigned value. This parameter is optional and may be NULL.
Returns:
Dividend / Divisor

References NULL.

Referenced by DivU64x64Remainder(), and InternalMathDivRemS64x64().

UINT64 EFIAPI InternalMathDivU64x32 ( IN UINT64  Dividend,
IN UINT32  Divisor 
)

Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. This function returns the 64-bit unsigned quotient.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Returns:
Dividend / Divisor
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 64-bit unsigned quotient. This function returns the 64-bit unsigned quotient.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Returns:
Dividend / Divisor.

References eax, ecx, edx, and mov.

Referenced by DivU64x32().

UINT64 EFIAPI InternalMathLRotU64 ( IN UINT64  Operand,
IN UINTN  Count 
)

Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits with the high bits that were rotated.

This function rotates the 64-bit value Operand to the left by Count bits. The low Count bits are filled with the high Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate left.
Count The number of bits to rotate left.
Returns:
Operand <<< Count
Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits with the high bits that were rotated.

This function rotates the 64-bit value Operand to the left by Count bits. The low Count bits are fill with the high Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate left.
Count The number of bits to rotate left.
Returns:
Operand <<< Count.
Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits with the high bits that were rotated.

This function rotates the 64-bit value Operand to the left by Count bits. The low Count bits are fill with the high Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate left.
Count The number of bits to rotate left.
Returns:
Operand <<< Count

References eax, ebx, ecx, edx, and mov.

Referenced by LRotU64().

UINT64 EFIAPI InternalMathLShiftU64 ( IN UINT64  Operand,
IN UINTN  Count 
)

Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled with zeros. The shifted value is returned.

This function shifts the 64-bit value Operand to the left by Count bits. The low Count bits are set to zero. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift left.
Count The number of bits to shift left.
Returns:
Operand << Count
Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled with zeros. The shifted value is returned.

This function shifts the 64-bit value Operand to the left by Count bits. The low Count bits are set to zero. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift left.
Count The number of bits to shift left.
Returns:
Operand << Count.

References eax, edx, and mov.

Referenced by LShiftU64().

UINT32 EFIAPI InternalMathModU64x32 ( IN UINT64  Dividend,
IN UINT32  Divisor 
)

Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 32-bit unsigned remainder.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 32-bit remainder. This function returns the 32-bit unsigned remainder.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Returns:
Dividend % Divisor
Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 32-bit unsigned remainder.

This function divides the 64-bit unsigned value Dividend by the 32-bit unsigned value Divisor and generates a 32-bit remainder. This function returns the 32-bit unsigned remainder.

Parameters:
Dividend A 64-bit unsigned value.
Divisor A 32-bit unsigned value.
Returns:
Dividend % Divisor.

References eax, ecx, edx, and mov.

Referenced by ModU64x32().

UINT64 EFIAPI InternalMathMultU64x32 ( IN UINT64  Multiplicand,
IN UINT32  Multiplier 
)

Multiplies a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result.

This function multiplies the 64-bit unsigned value Multiplicand by the 32-bit unsigned value Multiplier and generates a 64-bit unsigned result. This 64- bit unsigned result is returned.

Parameters:
Multiplicand A 64-bit unsigned value.
Multiplier A 32-bit unsigned value.
Returns:
Multiplicand * Multiplier
Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and generates a 64-bit unsigned result.

This function multiples the 64-bit unsigned value Multiplicand by the 32-bit unsigned value Multiplier and generates a 64-bit unsigned result. This 64- bit unsigned result is returned.

Parameters:
Multiplicand A 64-bit unsigned value.
Multiplier A 32-bit unsigned value.
Returns:
Multiplicand * Multiplier

References eax, ecx, edx, and mov.

Referenced by MultU64x32().

UINT64 EFIAPI InternalMathMultU64x64 ( IN UINT64  Multiplicand,
IN UINT64  Multiplier 
)

Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and generates a 64-bit unsigned result.

This function multiples the 64-bit unsigned value Multiplicand by the 64-bit unsigned value Multiplier and generates a 64-bit unsigned result. This 64- bit unsigned result is returned.

Parameters:
Multiplicand A 64-bit unsigned value.
Multiplier A 64-bit unsigned value.
Returns:
Multiplicand * Multiplier
Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and generates a 64-bit unsigned result.

This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit unsigned value Multiplier and generates a 64-bit unsigned result. This 64- bit unsigned result is returned.

Parameters:
Multiplicand A 64-bit unsigned value.
Multiplier A 64-bit unsigned value.
Returns:
Multiplicand * Multiplier.
Multiplies a 64-bit unsigned integer by a 64-bit unsigned integer and generates a 64-bit unsigned result.

This function multiplies the 64-bit unsigned value Multiplicand by the 64-bit unsigned value Multiplier and generates a 64-bit unsigned result. This 64- bit unsigned result is returned.

Parameters:
Multiplicand A 64-bit unsigned value.
Multiplier A 64-bit unsigned value.
Returns:
Multiplicand * Multiplier

References eax, ebx, ecx, edx, and mov.

Referenced by MultU64x64().

UINT64 EFIAPI InternalMathRRotU64 ( IN UINT64  Operand,
IN UINTN  Count 
)

Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits with the high low bits that were rotated.

This function rotates the 64-bit value Operand to the right by Count bits. The high Count bits are filled with the low Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate right.
Count The number of bits to rotate right.
Returns:
Operand >>> Count
Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits with the high low bits that were rotated.

This function rotates the 64-bit value Operand to the right by Count bits. The high Count bits are fill with the low Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate right.
Count The number of bits to rotate right.
Returns:
Operand >>> Count.
Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits with the high low bits that were rotated.

This function rotates the 64-bit value Operand to the right by Count bits. The high Count bits are fill with the low Count bits of Operand. The rotated value is returned.

Parameters:
Operand The 64-bit operand to rotate right.
Count The number of bits to rotate right.
Returns:
Operand >>> Count

References eax, ebx, ecx, edx, and mov.

Referenced by RRotU64().

UINT64 EFIAPI InternalMathRShiftU64 ( IN UINT64  Operand,
IN UINTN  Count 
)

Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled with zeros. The shifted value is returned.

This function shifts the 64-bit value Operand to the right by Count bits. The high Count bits are set to zero. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift right.
Count The number of bits to shift right.
Returns:
Operand >> Count
Shifts a 64-bit integer right between 0 and 63 bits. This high bits are filled with zeros. The shifted value is returned.

This function shifts the 64-bit value Operand to the right by Count bits. The high Count bits are set to zero. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift right.
Count The number of bits to shift right.
Returns:
Operand >> Count.
Shifts a 64-bit integer right between 0 and 63 bits. This high bits are filled with zeros. The shifted value is returned.

This function shifts the 64-bit value Operand to the right by Count bits. The high Count bits are set to zero. The shifted value is returned.

Parameters:
Operand The 64-bit operand to shift right.
Count The number of bits to shift right.
Returns:
Operand >> Count

References eax, edx, and mov.

Referenced by RShiftU64().

UINT64 EFIAPI InternalMathSwapBytes64 ( IN UINT64  Operand  ) 

Switches the endianess of a 64-bit integer.

This function swaps the bytes in a 64-bit unsigned value to switch the value from little endian to big endian or vice versa. The byte swapped value is returned.

Parameters:
Operand A 64-bit unsigned value.
Returns:
The byte swapped Operand.
Switches the endianess of a 64-bit integer.

This function swaps the bytes in a 64-bit unsigned value to switch the value from little endian to big endian or vice versa. The byte swapped value is returned.

Parameters:
Operand A 64-bit unsigned value.
Returns:
The byte swaped Operand.

References eax, edx, mov, and SwapBytes32().

Referenced by SwapBytes64().

VOID EFIAPI InternalSwitchStack ( IN SWITCH_STACK_ENTRY_POINT  EntryPoint,
IN VOID *  Context1,
IN VOID *  Context2,
IN VOID *  NewStack,
IN VA_LIST  Marker 
)

Transfers control to a function starting with a new stack.

Transfers control to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be NULL. The function EntryPoint must never return. Marker will be ignored on IA-32, x64, and EBC. IPF CPUs expect one additional parameter of type VOID * that specifies the new backing store pointer.

If EntryPoint is NULL, then ASSERT(). If NewStack is NULL, then ASSERT().

Parameters:
EntryPoint A pointer to function to call with the new stack.
Context1 A pointer to the context to pass into the EntryPoint function.
Context2 A pointer to the context to pass into the EntryPoint function.
NewStack A pointer to the new stack to use for the EntryPoint function.
Marker VA_LIST marker for the variable argument list.
Transfers control to a function starting with a new stack.

Transfers control to the function specified by EntryPoint using the new stack specified by NewStack, and passes in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be NULL. The function EntryPoint must never return. Marker will be ignored on IA-32, x64, and EBC. IPF CPUs expect one additional parameter of type VOID * that specifies the new backing store pointer.

If EntryPoint is NULL, then ASSERT(). If NewStack is NULL, then ASSERT().

Parameters:
EntryPoint A pointer to function to call with the new stack.
Context1 A pointer to the context to pass into the EntryPoint function.
Context2 A pointer to the context to pass into the EntryPoint function.
NewStack A pointer to the new stack to use for the EntryPoint function.
Marker A VA_LIST marker for the variable argument list.
Transfers control to a function starting with a new stack.

Transfers control to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be NULL. The function EntryPoint must never return. Marker will be ignored on IA-32, x64, and EBC. IPF CPUs expect one additional parameter of type VOID * that specifies the new backing store pointer.

If EntryPoint is NULL, then ASSERT(). If NewStack is NULL, then ASSERT().

Parameters:
EntryPoint A pointer to function to call with the new stack.
Context1 A pointer to the context to pass into the EntryPoint function.
Context2 A pointer to the context to pass into the EntryPoint function.
NewStack A pointer to the new stack to use for the EntryPoint function.
Marker A VA_LIST marker for the variable argument list.

References ASSERT, CPU_STACK_ALIGNMENT, BASE_LIBRARY_JUMP_BUFFER::Eip, BASE_LIBRARY_JUMP_BUFFER::Esp, InternalSwitchStackAsm(), LongJump(), VA_ARG, and VOID.

Referenced by SwitchStack().

VOID EFIAPI InternalX86DisablePaging32 ( IN SWITCH_STACK_ENTRY_POINT  EntryPoint,
IN VOID *  Context1,
IN VOID *  Context2,
IN VOID *  NewStack 
)

Disables the 32-bit paging mode on the CPU.

Disables the 32-bit paging mode on the CPU and returns to 32-bit protected mode. This function assumes the current execution mode is 32-paged protected mode. This function is only available on IA-32. After the 32-bit paging mode is disabled, control is transferred to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be NULL. The function EntryPoint must never return.

There are a number of constraints that must be followed before calling this function: 1) Interrupts must be disabled. 2) The caller must be in 32-bit paged mode. 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode. 4) CR3 must point to valid page tables that guarantee that the pages for this function and the stack are identity mapped.

Parameters:
EntryPoint A pointer to function to call with the new stack after paging is disabled.
Context1 A pointer to the context to pass into the EntryPoint function as the first parameter after paging is disabled.
Context2 A pointer to the context to pass into the EntryPoint function as the second parameter after paging is disabled.
NewStack A pointer to the new stack to use for the EntryPoint function after paging is disabled.

References ASSERT, and FALSE.

Referenced by AsmDisablePaging32().

VOID EFIAPI InternalX86DisablePaging64 ( IN UINT16  CodeSelector,
IN UINT32  EntryPoint,
IN UINT32  Context1,
IN UINT32  Context2,
IN UINT32  NewStack 
)

Disables the 64-bit paging mode on the CPU.

Disables the 64-bit paging mode on the CPU and returns to 32-bit protected mode. This function assumes the current execution mode is 64-paging mode. This function is only available on x64. After the 64-bit paging mode is disabled, control is transferred to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be 0. The function EntryPoint must never return.

Parameters:
Cs The 16-bit selector to load in the CS before EntryPoint is called. The descriptor in the GDT that this selector references must be setup for 32-bit protected mode.
EntryPoint The 64-bit virtual address of the function to call with the new stack after paging is disabled.
Context1 The 64-bit virtual address of the context to pass into the EntryPoint function as the first parameter after paging is disabled.
Context2 The 64-bit virtual address of the context to pass into the EntryPoint function as the second parameter after paging is disabled.
NewStack The 64-bit virtual address of the new stack to use for the EntryPoint function after paging is disabled.
Disables the 64-bit paging mode on the CPU.

Disables the 64-bit paging mode on the CPU and returns to 32-bit protected mode. This function assumes the current execution mode is 64-paging mode. This function is only available on x64. After the 64-bit paging mode is disabled, control is transferred to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be 0. The function EntryPoint must never return.

Parameters:
CodeSelector The 16-bit selector to load in the CS before EntryPoint is called. The descriptor in the GDT that this selector references must be setup for 32-bit protected mode.
EntryPoint The 64-bit virtual address of the function to call with the new stack after paging is disabled.
Context1 The 64-bit virtual address of the context to pass into the EntryPoint function as the first parameter after paging is disabled.
Context2 The 64-bit virtual address of the context to pass into the EntryPoint function as the second parameter after paging is disabled.
NewStack The 64-bit virtual address of the new stack to use for the EntryPoint function after paging is disabled.

References ASSERT, and FALSE.

Referenced by AsmDisablePaging64().

VOID EFIAPI InternalX86EnablePaging32 ( IN SWITCH_STACK_ENTRY_POINT  EntryPoint,
IN VOID *  Context1,
IN VOID *  Context2,
IN VOID *  NewStack 
)

Enables the 32-bit paging mode on the CPU.

Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables must be properly initialized prior to calling this service. This function assumes the current execution mode is 32-bit protected mode. This function is only available on IA-32. After the 32-bit paging mode is enabled, control is transferred to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be NULL. The function EntryPoint must never return.

There are a number of constraints that must be followed before calling this function: 1) Interrupts must be disabled. 2) The caller must be in 32-bit protected mode with flat descriptors. This means all descriptors must have a base of 0 and a limit of 4GB. 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat descriptors. 4) CR3 must point to valid page tables that will be used once the transition is complete, and those page tables must guarantee that the pages for this function and the stack are identity mapped.

Parameters:
EntryPoint A pointer to function to call with the new stack after paging is enabled.
Context1 A pointer to the context to pass into the EntryPoint function as the first parameter after paging is enabled.
Context2 A pointer to the context to pass into the EntryPoint function as the second parameter after paging is enabled.
NewStack A pointer to the new stack to use for the EntryPoint function after paging is enabled.

References ASSERT, and FALSE.

Referenced by AsmEnablePaging32().

VOID EFIAPI InternalX86EnablePaging64 ( IN UINT16  Cs,
IN UINT64  EntryPoint,
IN UINT64  Context1,
IN UINT64  Context2,
IN UINT64  NewStack 
)

Enables the 64-bit paging mode on the CPU.

Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables must be properly initialized prior to calling this service. This function assumes the current execution mode is 32-bit protected mode with flat descriptors. This function is only available on IA-32. After the 64-bit paging mode is enabled, control is transferred to the function specified by EntryPoint using the new stack specified by NewStack and passing in the parameters specified by Context1 and Context2. Context1 and Context2 are optional and may be 0. The function EntryPoint must never return.

Parameters:
Cs The 16-bit selector to load in the CS before EntryPoint is called. The descriptor in the GDT that this selector references must be setup for long mode.
EntryPoint The 64-bit virtual address of the function to call with the new stack after paging is enabled.
Context1 The 64-bit virtual address of the context to pass into the EntryPoint function as the first parameter after paging is enabled.
Context2 The 64-bit virtual address of the context to pass into the EntryPoint function as the second parameter after paging is enabled.
NewStack The 64-bit virtual address of the new stack to use for the EntryPoint function after paging is enabled.

References ASSERT, and FALSE.

Referenced by AsmEnablePaging64().

VOID EFIAPI InternalX86FxRestore ( IN CONST IA32_FX_BUFFER Buffer  ) 

Restores the current floating point/SSE/SSE2 context from a buffer.

Restores the current floating point/SSE/SSE2 state from the buffer specified by Buffer. Buffer must be aligned on a 16-byte boundary. This function is only available on IA-32 and x64.

Parameters:
Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
Restores the current floating point/SSE/SSE2 context from a buffer.

Restores the current floating point/SSE/SSE2 state from the buffer specified by Buffer. Buffer must be aligned on a 16-byte boundary. This function is only available on IA-32 and X64.

Parameters:
Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.

References eax, and mov.

Referenced by AsmFxRestore().

VOID EFIAPI InternalX86FxSave ( OUT IA32_FX_BUFFER Buffer  ) 

Save the current floating point/SSE/SSE2 context to a buffer.

Saves the current floating point/SSE/SSE2 state to the buffer specified by Buffer. Buffer must be aligned on a 16-byte boundary. This function is only available on IA-32 and x64.

Parameters:
Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.
Save the current floating point/SSE/SSE2 context to a buffer.

Saves the current floating point/SSE/SSE2 state to the buffer specified by Buffer. Buffer must be aligned on a 16-byte boundary. This function is only available on IA-32 and X64.

Parameters:
Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context.

References eax, and mov.

Referenced by AsmFxSave().

VOID EFIAPI InternalX86ReadGdtr ( OUT IA32_DESCRIPTOR Gdtr  ) 

Reads the current Global Descriptor Table Register(GDTR) descriptor.

Reads and returns the current GDTR descriptor and returns it in Gdtr. This function is only available on IA-32 and x64.

Parameters:
Gdtr The pointer to a GDTR descriptor.
Reads the current Global Descriptor Table Register(GDTR) descriptor.

Reads and returns the current GDTR descriptor and returns it in Gdtr. This function is only available on IA-32 and X64.

Parameters:
Gdtr The pointer to a GDTR descriptor.

References eax, and mov.

Referenced by AsmReadGdtr().

VOID EFIAPI InternalX86ReadIdtr ( OUT IA32_DESCRIPTOR Idtr  ) 

Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.

Reads and returns the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64.

Parameters:
Idtr The pointer to an IDTR descriptor.
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.

Reads and returns the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and X64.

Parameters:
Idtr The pointer to a IDTR descriptor.
Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.

Reads and returns the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64.

Parameters:
Idtr The pointer to a IDTR descriptor.

References eax, and mov.

Referenced by AsmReadIdtr().

VOID EFIAPI InternalX86WriteGdtr ( IN CONST IA32_DESCRIPTOR Gdtr  ) 

Writes the current Global Descriptor Table Register (GDTR) descriptor.

Writes and the current GDTR descriptor specified by Gdtr. This function is only available on IA-32 and x64.

Parameters:
Gdtr The pointer to a GDTR descriptor.
Writes the current Global Descriptor Table Register (GDTR) descriptor.

Writes and the current GDTR descriptor specified by Gdtr. This function is only available on IA-32 and X64.

Parameters:
Gdtr The pointer to a GDTR descriptor.

References eax, and mov.

Referenced by AsmWriteGdtr().

VOID EFIAPI InternalX86WriteIdtr ( IN CONST IA32_DESCRIPTOR Idtr  ) 

Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.

Writes the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64.

Parameters:
Idtr The pointer to an IDTR descriptor.
Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.

Writes the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and X64.

Parameters:
Idtr The pointer to a IDTR descriptor.
Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.

Writes the current IDTR descriptor and returns it in Idtr. This function is only available on IA-32 and x64.

Parameters:
Idtr The pointer to a IDTR descriptor.

References cli, eax, and mov.

Referenced by AsmWriteIdtr().

BOOLEAN EFIAPI IsNodeInList ( IN CONST LIST_ENTRY List,
IN CONST LIST_ENTRY Node 
)

Worker function that locates the Node in the List.

By searching the List, finds the location of the Node in List. At the same time, verifies the validity of this list.

If List is NULL, then ASSERT(). If List->ForwardLink is NULL, then ASSERT(). If List->backLink is NULL, then ASSERT(). If Node is NULL, then ASSERT(); If PcdMaximumLinkedListLength is not zero, and prior to insertion the number of nodes in ListHead, including the ListHead node, is greater than or equal to PcdMaximumLinkedListLength, then ASSERT().

Parameters:
List A pointer to a node in a linked list.
Node A pointer to one nod.
Return values:
TRUE Node is in List.
FALSE Node isn't in List, or List is invalid.


Generated on Thu Sep 24 23:14:22 2015 for MdePkg[ALL] by  doxygen 1.5.7.1