/** @file\r
- Memory-only library functions with no library constructor/destructor\r
+ Provides string functions, linked list functions, math functions, synchronization\r
+ functions, and CPU architecture specific functions.\r
\r
- Copyright (c) 2006 - 2007, Intel Corporation\r
- All rights reserved. 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
+Copyright (c) 2006 - 2008, Intel Corporation\r
+All rights reserved. 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
+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
\r
**/\r
\r
LIST_ENTRY *\r
EFIAPI\r
InitializeListHead (\r
- IN LIST_ENTRY *ListHead\r
+ IN OUT LIST_ENTRY *ListHead\r
);\r
\r
\r
LIST_ENTRY *\r
EFIAPI\r
InsertHeadList (\r
- IN LIST_ENTRY *ListHead,\r
- IN LIST_ENTRY *Entry\r
+ IN OUT LIST_ENTRY *ListHead,\r
+ IN OUT LIST_ENTRY *Entry\r
);\r
\r
\r
LIST_ENTRY *\r
EFIAPI\r
InsertTailList (\r
- IN LIST_ENTRY *ListHead,\r
- IN LIST_ENTRY *Entry\r
+ IN OUT LIST_ENTRY *ListHead,\r
+ IN OUT LIST_ENTRY *Entry\r
);\r
\r
\r
\r
\r
/**\r
- Determines if a node in a doubly linked list is null.\r
+ Determines if a node in a doubly linked list is the head node of a the same\r
+ doubly linked list. This function is typically used to terminate a loop that\r
+ traverses all the nodes in a doubly linked list starting with the head node.\r
\r
- Returns FALSE if Node is one of the nodes in the doubly linked list specified\r
- by List. Otherwise, TRUE is returned. List must have been initialized with\r
- InitializeListHead().\r
+ Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the\r
+ nodes in the doubly linked list specified by List. List must have been\r
+ initialized with InitializeListHead().\r
\r
If List is NULL, then ASSERT().\r
If Node is NULL, then ASSERT().\r
LIST_ENTRY *\r
EFIAPI\r
SwapListEntries (\r
- IN LIST_ENTRY *FirstEntry,\r
- IN LIST_ENTRY *SecondEntry\r
+ IN OUT LIST_ENTRY *FirstEntry,\r
+ IN OUT LIST_ENTRY *SecondEntry\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint16 Pointer to a 16-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 16-bit value that may be unaligned.\r
\r
- @return *Uint16\r
+ @return The 16-bit value read from Buffer.\r
\r
**/\r
UINT16\r
EFIAPI\r
ReadUnaligned16 (\r
- IN CONST UINT16 *Uint16\r
+ IN CONST UINT16 *Buffer\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint16 Pointer to a 16-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 16-bit value that may be unaligned.\r
@param Value 16-bit value to write to Buffer.\r
\r
- @return Value\r
+ @return The 16-bit value to write to Buffer.\r
\r
**/\r
UINT16\r
EFIAPI\r
WriteUnaligned16 (\r
- OUT UINT16 *Uint16,\r
- IN UINT16 Value\r
+ OUT UINT16 *Buffer,\r
+ IN UINT16 Value\r
);\r
\r
\r
\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
\r
- @return The value read from Buffer.\r
+ @return The 24-bit value read from Buffer.\r
\r
**/\r
UINT32\r
EFIAPI\r
ReadUnaligned24 (\r
- IN CONST UINT32 *Buffer\r
+ IN CONST UINT32 *Buffer\r
);\r
\r
\r
@param Buffer Pointer to a 24-bit value that may be unaligned.\r
@param Value 24-bit value to write to Buffer.\r
\r
- @return The value written to Buffer.\r
+ @return The 24-bit value to write to Buffer.\r
\r
**/\r
UINT32\r
EFIAPI\r
WriteUnaligned24 (\r
- OUT UINT32 *Buffer,\r
- IN UINT32 Value\r
+ OUT UINT32 *Buffer,\r
+ IN UINT32 Value\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint32 Pointer to a 32-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 32-bit value that may be unaligned.\r
\r
- @return Value read from Uint32\r
+ @return The 32-bit value read from Buffer.\r
\r
**/\r
UINT32\r
EFIAPI\r
ReadUnaligned32 (\r
- IN CONST UINT32 *Uint32\r
+ IN CONST UINT32 *Buffer\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint32 Pointer to a 32-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 32-bit value that may be unaligned.\r
@param Value 32-bit value to write to Buffer.\r
\r
- @return Value written to Uint32.\r
+ @return The 32-bit value to write to Buffer.\r
\r
**/\r
UINT32\r
EFIAPI\r
WriteUnaligned32 (\r
- OUT UINT32 *Uint32,\r
- IN UINT32 Value\r
+ OUT UINT32 *Buffer,\r
+ IN UINT32 Value\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint64 Pointer to a 64-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 64-bit value that may be unaligned.\r
\r
- @return Value read from Uint64.\r
+ @return The 64-bit value read from Buffer.\r
\r
**/\r
UINT64\r
EFIAPI\r
ReadUnaligned64 (\r
- IN CONST UINT64 *Uint64\r
+ IN CONST UINT64 *Buffer\r
);\r
\r
\r
\r
If the Buffer is NULL, then ASSERT().\r
\r
- @param Uint64 Pointer to a 64-bit value that may be unaligned.\r
+ @param Buffer Pointer to a 64-bit value that may be unaligned.\r
@param Value 64-bit value to write to Buffer.\r
\r
- @return Value written to Uint64.\r
+ @return The 64-bit value to write to Buffer.\r
\r
**/\r
UINT64\r
EFIAPI\r
WriteUnaligned64 (\r
- OUT UINT64 *Uint64,\r
- IN UINT64 Value\r
+ OUT UINT64 *Buffer,\r
+ IN UINT64 Value\r
);\r
\r
\r
SPIN_LOCK *\r
EFIAPI\r
InitializeSpinLock (\r
- IN SPIN_LOCK *SpinLock\r
+ OUT SPIN_LOCK *SpinLock\r
);\r
\r
\r
SPIN_LOCK *\r
EFIAPI\r
AcquireSpinLock (\r
- IN SPIN_LOCK *SpinLock\r
+ IN OUT SPIN_LOCK *SpinLock\r
);\r
\r
\r
BOOLEAN\r
EFIAPI\r
AcquireSpinLockOrFail (\r
- IN SPIN_LOCK *SpinLock\r
+ IN OUT SPIN_LOCK *SpinLock\r
);\r
\r
\r
SPIN_LOCK *\r
EFIAPI\r
ReleaseSpinLock (\r
- IN SPIN_LOCK *SpinLock\r
+ IN OUT SPIN_LOCK *SpinLock\r
);\r
\r
\r
///\r
/// Byte packed structure for an Interrupt Gate Descriptor\r
///\r
+#if defined (MDE_CPU_IA32)\r
+\r
+typedef union {\r
+ struct {\r
+ UINT32 OffsetLow:16; // Offset bits 15..0\r
+ UINT32 Selector:16; // Selector\r
+ UINT32 Reserved_0:8; // Reserved\r
+ UINT32 GateType:8; // Gate Type. See #defines above\r
+ UINT32 OffsetHigh:16; // Offset bits 31..16\r
+ } Bits;\r
+ UINT64 Uint64;\r
+} IA32_IDT_GATE_DESCRIPTOR;\r
+\r
+#endif\r
+\r
+#if defined (MDE_CPU_X64)\r
+\r
typedef union {\r
struct {\r
- UINT32 OffsetLow:16; /// Offset bits 15..0\r
- UINT32 Selector:16; /// Selector\r
- UINT32 Reserved_0:8; /// Reserved\r
- UINT32 GateType:8; /// Gate Type. See #defines above\r
- UINT32 OffsetHigh:16; /// Offset bits 31..16\r
+ UINT32 OffsetLow:16; // Offset bits 15..0\r
+ UINT32 Selector:16; // Selector\r
+ UINT32 Reserved_0:8; // Reserved\r
+ UINT32 GateType:8; // Gate Type. See #defines above\r
+ UINT32 OffsetHigh:16; // Offset bits 31..16\r
+ UINT32 OffsetUpper:32; // Offset bits 63..32\r
+ UINT32 Reserved_1:32; // Reserved\r
} Bits;\r
UINT64 Uint64;\r
+ UINT64 Uint64_1;\r
} IA32_IDT_GATE_DESCRIPTOR;\r
\r
+#endif\r
+\r
///\r
/// Byte packed structure for an FP/SSE/SSE2 context\r
///\r