/** @file\r
Declaration of internal functions in BaseLib.\r
\r
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
UINT64\r
EFIAPI\r
InternalMathLShiftU64 (\r
- IN UINT64 Operand,\r
- IN UINTN Count\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathRShiftU64 (\r
- IN UINT64 Operand,\r
- IN UINTN Count\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathARShiftU64 (\r
- IN UINT64 Operand,\r
- IN UINTN Count\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathLRotU64 (\r
- IN UINT64 Operand,\r
- IN UINTN Count\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathRRotU64 (\r
- IN UINT64 Operand,\r
- IN UINTN Count\r
+ IN UINT64 Operand,\r
+ IN UINTN Count\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathSwapBytes64 (\r
- IN UINT64 Operand\r
+ IN UINT64 Operand\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathMultU64x32 (\r
- IN UINT64 Multiplicand,\r
- IN UINT32 Multiplier\r
+ IN UINT64 Multiplicand,\r
+ IN UINT32 Multiplier\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathMultU64x64 (\r
- IN UINT64 Multiplicand,\r
- IN UINT64 Multiplier\r
+ IN UINT64 Multiplicand,\r
+ IN UINT64 Multiplier\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathDivU64x32 (\r
- IN UINT64 Dividend,\r
- IN UINT32 Divisor\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor\r
);\r
\r
/**\r
UINT32\r
EFIAPI\r
InternalMathModU64x32 (\r
- IN UINT64 Dividend,\r
- IN UINT32 Divisor\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathDivRemU64x32 (\r
- IN UINT64 Dividend,\r
- IN UINT32 Divisor,\r
- OUT UINT32 *Remainder OPTIONAL\r
+ IN UINT64 Dividend,\r
+ IN UINT32 Divisor,\r
+ OUT UINT32 *Remainder OPTIONAL\r
);\r
\r
/**\r
UINT64\r
EFIAPI\r
InternalMathDivRemU64x64 (\r
- IN UINT64 Dividend,\r
- IN UINT64 Divisor,\r
- OUT UINT64 *Remainder OPTIONAL\r
+ IN UINT64 Dividend,\r
+ IN UINT64 Divisor,\r
+ OUT UINT64 *Remainder OPTIONAL\r
);\r
\r
/**\r
INT64\r
EFIAPI\r
InternalMathDivRemS64x64 (\r
- IN INT64 Dividend,\r
- IN INT64 Divisor,\r
- OUT INT64 *Remainder OPTIONAL\r
+ IN INT64 Dividend,\r
+ IN INT64 Divisor,\r
+ OUT INT64 *Remainder OPTIONAL\r
);\r
\r
/**\r
EFIAPI\r
InternalSwitchStack (\r
IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
- IN VOID *Context1, OPTIONAL\r
- IN VOID *Context2, OPTIONAL\r
+ IN VOID *Context1 OPTIONAL,\r
+ IN VOID *Context2 OPTIONAL,\r
IN VOID *NewStack,\r
IN VA_LIST Marker\r
);\r
\r
-\r
/**\r
Worker function that returns a bit field from Operand.\r
\r
UINTN\r
EFIAPI\r
BitFieldReadUint (\r
- IN UINTN Operand,\r
- IN UINTN StartBit,\r
- IN UINTN EndBit\r
+ IN UINTN Operand,\r
+ IN UINTN StartBit,\r
+ IN UINTN EndBit\r
);\r
\r
-\r
/**\r
Worker function that reads a bit field from Operand, performs a bitwise OR,\r
and returns the result.\r
UINTN\r
EFIAPI\r
BitFieldOrUint (\r
- IN UINTN Operand,\r
- IN UINTN StartBit,\r
- IN UINTN EndBit,\r
- IN UINTN OrData\r
+ IN UINTN Operand,\r
+ IN UINTN StartBit,\r
+ IN UINTN EndBit,\r
+ IN UINTN OrData\r
);\r
\r
-\r
/**\r
Worker function that reads a bit field from Operand, performs a bitwise AND,\r
and returns the result.\r
UINTN\r
EFIAPI\r
BitFieldAndUint (\r
- IN UINTN Operand,\r
- IN UINTN StartBit,\r
- IN UINTN EndBit,\r
- IN UINTN AndData\r
+ IN UINTN Operand,\r
+ IN UINTN StartBit,\r
+ IN UINTN EndBit,\r
+ IN UINTN AndData\r
);\r
\r
-\r
/**\r
Worker function that checks ASSERT condition for JumpBuffer\r
\r
IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r
);\r
\r
-\r
/**\r
Restores the CPU context that was saved with SetJump().\r
\r
IN UINTN Value\r
);\r
\r
-\r
/**\r
Check if a Unicode character is a decimal character.\r
\r
BOOLEAN\r
EFIAPI\r
InternalIsDecimalDigitCharacter (\r
- IN CHAR16 Char\r
- );\r
-\r
-\r
-/**\r
- Convert a Unicode character to upper case only if\r
- it maps to a valid small-case ASCII character.\r
-\r
- This internal function only deal with Unicode character\r
- which maps to a valid small-case ASCII character, i.e.\r
- L'a' to L'z'. For other Unicode character, the input character\r
- is returned directly.\r
-\r
- @param Char The character to convert.\r
-\r
- @retval LowerCharacter If the Char is with range L'a' to L'z'.\r
- @retval Unchanged Otherwise.\r
-\r
-**/\r
-CHAR16\r
-EFIAPI\r
-InternalCharToUpper (\r
- IN CHAR16 Char\r
+ IN CHAR16 Char\r
);\r
\r
-\r
/**\r
Convert a Unicode character to numerical value.\r
\r
UINTN\r
EFIAPI\r
InternalHexCharToUintn (\r
- IN CHAR16 Char\r
+ IN CHAR16 Char\r
);\r
\r
-\r
/**\r
Check if a Unicode character is a hexadecimal character.\r
\r
BOOLEAN\r
EFIAPI\r
InternalIsHexaDecimalDigitCharacter (\r
- IN CHAR16 Char\r
+ IN CHAR16 Char\r
);\r
\r
-\r
/**\r
Check if a ASCII character is a decimal character.\r
\r
BOOLEAN\r
EFIAPI\r
InternalAsciiIsDecimalDigitCharacter (\r
- IN CHAR8 Char\r
- );\r
-\r
-\r
-/**\r
- Converts a lowercase Ascii character to upper one.\r
-\r
- If Chr is lowercase Ascii character, then converts it to upper one.\r
-\r
- If Value >= 0xA0, then ASSERT().\r
- If (Value & 0x0F) >= 0x0A, then ASSERT().\r
-\r
- @param Chr one Ascii character\r
-\r
- @return The uppercase value of Ascii character\r
-\r
-**/\r
-CHAR8\r
-EFIAPI\r
-InternalBaseLibAsciiToUpper (\r
- IN CHAR8 Chr\r
+ IN CHAR8 Char\r
);\r
\r
-\r
/**\r
Check if a ASCII character is a hexadecimal character.\r
\r
BOOLEAN\r
EFIAPI\r
InternalAsciiIsHexaDecimalDigitCharacter (\r
- IN CHAR8 Char\r
+ IN CHAR8 Char\r
);\r
\r
-\r
/**\r
Convert a ASCII character to numerical value.\r
\r
UINTN\r
EFIAPI\r
InternalAsciiHexCharToUintn (\r
- IN CHAR8 Char\r
+ IN CHAR8 Char\r
);\r
\r
-\r
//\r
// Ia32 and x64 specific functions\r
//\r
VOID\r
EFIAPI\r
InternalX86ReadGdtr (\r
- OUT IA32_DESCRIPTOR *Gdtr\r
+ OUT IA32_DESCRIPTOR *Gdtr\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86WriteGdtr (\r
- IN CONST IA32_DESCRIPTOR *Gdtr\r
+ IN CONST IA32_DESCRIPTOR *Gdtr\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86ReadIdtr (\r
- OUT IA32_DESCRIPTOR *Idtr\r
+ OUT IA32_DESCRIPTOR *Idtr\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86WriteIdtr (\r
- IN CONST IA32_DESCRIPTOR *Idtr\r
+ IN CONST IA32_DESCRIPTOR *Idtr\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86FxSave (\r
- OUT IA32_FX_BUFFER *Buffer\r
+ OUT IA32_FX_BUFFER *Buffer\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86FxRestore (\r
- IN CONST IA32_FX_BUFFER *Buffer\r
+ IN CONST IA32_FX_BUFFER *Buffer\r
);\r
\r
/**\r
EFIAPI\r
InternalX86EnablePaging32 (\r
IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
- IN VOID *Context1, OPTIONAL\r
- IN VOID *Context2, OPTIONAL\r
+ IN VOID *Context1 OPTIONAL,\r
+ IN VOID *Context2 OPTIONAL,\r
IN VOID *NewStack\r
);\r
\r
EFIAPI\r
InternalX86DisablePaging32 (\r
IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r
- IN VOID *Context1, OPTIONAL\r
- IN VOID *Context2, OPTIONAL\r
+ IN VOID *Context1 OPTIONAL,\r
+ IN VOID *Context2 OPTIONAL,\r
IN VOID *NewStack\r
);\r
\r
VOID\r
EFIAPI\r
InternalX86EnablePaging64 (\r
- IN UINT16 Cs,\r
- IN UINT64 EntryPoint,\r
- IN UINT64 Context1, OPTIONAL\r
- IN UINT64 Context2, OPTIONAL\r
- IN UINT64 NewStack\r
+ IN UINT16 Cs,\r
+ IN UINT64 EntryPoint,\r
+ IN UINT64 Context1 OPTIONAL,\r
+ IN UINT64 Context2 OPTIONAL,\r
+ IN UINT64 NewStack\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
InternalX86DisablePaging64 (\r
- IN UINT16 Cs,\r
- IN UINT32 EntryPoint,\r
- IN UINT32 Context1, OPTIONAL\r
- IN UINT32 Context2, OPTIONAL\r
- IN UINT32 NewStack\r
+ IN UINT16 Cs,\r
+ IN UINT32 EntryPoint,\r
+ IN UINT32 Context1 OPTIONAL,\r
+ IN UINT32 Context2 OPTIONAL,\r
+ IN UINT32 NewStack\r
);\r
\r
/**\r
BOOLEAN\r
EFIAPI\r
InternalX86RdRand16 (\r
- OUT UINT16 *Rand\r
+ OUT UINT16 *Rand\r
);\r
\r
/**\r
BOOLEAN\r
EFIAPI\r
InternalX86RdRand32 (\r
- OUT UINT32 *Rand\r
+ OUT UINT32 *Rand\r
);\r
\r
/**\r
BOOLEAN\r
EFIAPI\r
InternalX86RdRand64 (\r
- OUT UINT64 *Rand\r
+ OUT UINT64 *Rand\r
);\r
\r
#else\r