]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Synchronize BaseLib h files to c files.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Dec 2008 02:59:41 +0000 (02:59 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Dec 2008 02:59:41 +0000 (02:59 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6983 6f19259b-4bc3-4df7-8a09-765794883524

18 files changed:
MdePkg/Library/BaseLib/BitField.c
MdePkg/Library/BaseLib/CheckSum.c
MdePkg/Library/BaseLib/LinkedList.c
MdePkg/Library/BaseLib/Math64.c
MdePkg/Library/BaseLib/SetJump.c
MdePkg/Library/BaseLib/String.c
MdePkg/Library/BaseLib/SwapBytes16.c
MdePkg/Library/BaseLib/SwapBytes32.c
MdePkg/Library/BaseLib/SwapBytes64.c
MdePkg/Library/BaseLib/SwitchStack.c
MdePkg/Library/BaseLib/Synchronization.c
MdePkg/Library/BaseLib/SynchronizationGcc.c
MdePkg/Library/BaseLib/SynchronizationMsc.c
MdePkg/Library/BaseLib/X86FxRestore.c
MdePkg/Library/BaseLib/X86Msr.c
MdePkg/Library/BaseLib/X86ReadIdtr.c
MdePkg/Library/BaseLib/X86Thunk.c
MdePkg/Library/BaseLib/X86WriteIdtr.c

index e4104f5a70e8436af490cab0f04e45fc7fb40217..658dd97cda1df18f0a78d6e49bde067b4089121a 100644 (file)
@@ -15,7 +15,7 @@
 #include "BaseLibInternals.h"\r
 \r
 /**\r
-  Worker function that returns a bit field from Operand\r
+  Worker function that returns a bit field from Operand.\r
 \r
   Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
 \r
@@ -42,7 +42,7 @@ BitFieldReadUint (
 }\r
 \r
 /**\r
-  Worker function that reads a bit field from Operand, performs a bitwise OR, \r
+  Worker function that reads a bit field from Operand, performs a bitwise OR,\r
   and returns the result.\r
 \r
   Performs a bitwise OR between the bit field specified by StartBit and EndBit\r
@@ -74,7 +74,7 @@ BitFieldOrUint (
 }\r
 \r
 /**\r
-  Worker function that reads a bit field from Operand, performs a bitwise AND, \r
+  Worker function that reads a bit field from Operand, performs a bitwise AND,\r
   and returns the result.\r
 \r
   Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
index 7fad548aa98a2895065ef6cfd46728437bbb20d3..4acaf42a6f48a08eb2b2dcd593913f805fb7bcff 100644 (file)
@@ -36,8 +36,8 @@
 UINT8\r
 EFIAPI\r
 CalculateSum8 (\r
-  IN      CONST UINT8        *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT8     Sum;\r
@@ -75,8 +75,8 @@ CalculateSum8 (
 UINT8\r
 EFIAPI\r
 CalculateCheckSum8 (\r
-  IN      CONST UINT8        *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT8              *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT8     CheckSum;\r
@@ -111,8 +111,8 @@ CalculateCheckSum8 (
 UINT16\r
 EFIAPI\r
 CalculateSum16 (\r
-  IN      CONST UINT16       *Buffer,\r
-  IN      UINTN              Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT16    Sum;\r
@@ -156,8 +156,8 @@ CalculateSum16 (
 UINT16\r
 EFIAPI\r
 CalculateCheckSum16 (\r
-  IN      CONST UINT16         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT16             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT16     CheckSum;\r
@@ -193,8 +193,8 @@ CalculateCheckSum16 (
 UINT32\r
 EFIAPI\r
 CalculateSum32 (\r
-  IN      CONST UINT32         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT32    Sum;\r
@@ -238,8 +238,8 @@ CalculateSum32 (
 UINT32\r
 EFIAPI\r
 CalculateCheckSum32 (\r
-  IN      CONST UINT32         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT32             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT32     CheckSum;\r
@@ -275,8 +275,8 @@ CalculateCheckSum32 (
 UINT64\r
 EFIAPI\r
 CalculateSum64 (\r
-  IN      CONST UINT64         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT64    Sum;\r
@@ -320,8 +320,8 @@ CalculateSum64 (
 UINT64\r
 EFIAPI\r
 CalculateCheckSum64 (\r
-  IN      CONST UINT64         *Buffer,\r
-  IN      UINTN                Length\r
+  IN      CONST UINT64             *Buffer,\r
+  IN      UINTN                     Length\r
   )\r
 {\r
   UINT64     CheckSum;\r
index ef69d1827acb2ccacdfe283b20aaf283c0fa44ef..8069bd3550fc753a812bc6f11f2adc3049225a3a 100644 (file)
 #include "BaseLibInternals.h"\r
 \r
 /**\r
-  Worker function that locates the Node in the List\r
+  Worker function that locates the Node in the List.\r
 \r
   By searching the List, finds the location of the Node in List. At the same time,\r
   verifies the validity of this list.\r
 \r
   If List is NULL, then ASSERT().\r
   If List->ForwardLink is NULL, then ASSERT().\r
-  If List->BackLink is NULL, then ASSERT().\r
+  If List->backLink is NULL, then ASSERT().\r
   If Node is NULL, then ASSERT();\r
   If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number\r
   of nodes in ListHead, including the ListHead node, is greater than or\r
@@ -93,15 +93,15 @@ IsNodeInList (
 LIST_ENTRY *\r
 EFIAPI\r
 InitializeListHead (\r
-  IN OUT  LIST_ENTRY            *List\r
+  IN OUT  LIST_ENTRY                *ListHead\r
   )\r
 \r
 {\r
-  ASSERT (List != NULL);\r
+  ASSERT (ListHead != NULL);\r
 \r
-  List->ForwardLink = List;\r
-  List->BackLink = List;\r
-  return List;\r
+  ListHead->ForwardLink = ListHead;\r
+  ListHead->BackLink = ListHead;\r
+  return ListHead;\r
 }\r
 \r
 /**\r
@@ -129,20 +129,20 @@ InitializeListHead (
 LIST_ENTRY *\r
 EFIAPI\r
 InsertHeadList (\r
-  IN OUT  LIST_ENTRY            *List,\r
-  IN OUT  LIST_ENTRY            *Entry\r
+  IN OUT  LIST_ENTRY                *ListHead,\r
+  IN OUT  LIST_ENTRY                *Entry\r
   )\r
 {\r
   //\r
   // ASSERT List not too long and Entry is not one of the nodes of List\r
   //\r
-  ASSERT (!IsNodeInList (List, Entry));\r
+  ASSERT (!IsNodeInList (ListHead, Entry));\r
 \r
-  Entry->ForwardLink = List->ForwardLink;\r
-  Entry->BackLink = List;\r
+  Entry->ForwardLink = ListHead->ForwardLink;\r
+  Entry->BackLink = ListHead;\r
   Entry->ForwardLink->BackLink = Entry;\r
-  List->ForwardLink = Entry;\r
-  return List;\r
+  ListHead->ForwardLink = Entry;\r
+  return ListHead;\r
 }\r
 \r
 /**\r
@@ -170,20 +170,20 @@ InsertHeadList (
 LIST_ENTRY *\r
 EFIAPI\r
 InsertTailList (\r
-  IN OUT  LIST_ENTRY            *List,\r
-  IN OUT  LIST_ENTRY            *Entry\r
+  IN OUT  LIST_ENTRY                *ListHead,\r
+  IN OUT  LIST_ENTRY                *Entry\r
   )\r
 {\r
   //\r
   // ASSERT List not too long and Entry is not one of the nodes of List\r
   //\r
-  ASSERT (!IsNodeInList (List, Entry));\r
+  ASSERT (!IsNodeInList (ListHead, Entry));\r
 \r
-  Entry->ForwardLink = List;\r
-  Entry->BackLink = List->BackLink;\r
+  Entry->ForwardLink = ListHead;\r
+  Entry->BackLink = ListHead->BackLink;\r
   Entry->BackLink->ForwardLink = Entry;\r
-  List->BackLink = Entry;\r
-  return List;\r
+  ListHead->BackLink = Entry;\r
+  return ListHead;\r
 }\r
 \r
 /**\r
@@ -209,7 +209,7 @@ InsertTailList (
 LIST_ENTRY *\r
 EFIAPI\r
 GetFirstNode (\r
-  IN CONST LIST_ENTRY  *List\r
+  IN      CONST LIST_ENTRY          *List\r
   )\r
 {\r
   //\r
@@ -245,8 +245,8 @@ GetFirstNode (
 LIST_ENTRY *\r
 EFIAPI\r
 GetNextNode (\r
-  IN CONST LIST_ENTRY  *List,\r
-  IN CONST LIST_ENTRY  *Node\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
   )\r
 {\r
   //\r
@@ -279,15 +279,15 @@ GetNextNode (
 BOOLEAN\r
 EFIAPI\r
 IsListEmpty (\r
-  IN      CONST LIST_ENTRY      *List\r
+  IN      CONST LIST_ENTRY          *ListHead\r
   )\r
 {\r
   //\r
   // ASSERT List not too long\r
   //\r
-  ASSERT (IsNodeInList (List, List));\r
+  ASSERT (IsNodeInList (ListHead, ListHead));\r
 \r
-  return (BOOLEAN)(List->ForwardLink == List);\r
+  return (BOOLEAN)(ListHead->ForwardLink == ListHead);\r
 }\r
 \r
 /**\r
@@ -318,8 +318,8 @@ IsListEmpty (
 BOOLEAN\r
 EFIAPI\r
 IsNull (\r
-  IN      CONST LIST_ENTRY      *List,\r
-  IN      CONST LIST_ENTRY      *Node\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
   )\r
 {\r
   //\r
@@ -356,8 +356,8 @@ IsNull (
 BOOLEAN\r
 EFIAPI\r
 IsNodeAtEnd (\r
-  IN      CONST LIST_ENTRY      *List,\r
-  IN      CONST LIST_ENTRY      *Node\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
   )\r
 {\r
   //\r
@@ -389,15 +389,15 @@ IsNodeAtEnd (
 \r
   @param  FirstEntry  A pointer to a node in a linked list.\r
   @param  SecondEntry A pointer to another node in the same linked list.\r
-\r
+  \r
   @return SecondEntry.\r
 \r
 **/\r
 LIST_ENTRY *\r
 EFIAPI\r
 SwapListEntries (\r
-  IN OUT  LIST_ENTRY            *FirstEntry,\r
-  IN OUT  LIST_ENTRY            *SecondEntry\r
+  IN OUT  LIST_ENTRY                *FirstEntry,\r
+  IN OUT  LIST_ENTRY                *SecondEntry\r
   )\r
 {\r
   LIST_ENTRY                    *Ptr;\r
@@ -464,7 +464,7 @@ SwapListEntries (
 LIST_ENTRY *\r
 EFIAPI\r
 RemoveEntryList (\r
-  IN      CONST LIST_ENTRY      *Entry\r
+  IN      CONST LIST_ENTRY          *Entry\r
   )\r
 {\r
   ASSERT (!IsListEmpty (Entry));\r
index 0b127c70b1037541ab948c8e229d2bc6b200b98f..0001124f0637335f1826fa035f34939d83613344 100644 (file)
@@ -68,8 +68,6 @@ InternalMathRShiftU64 (
   This function shifts the 64-bit value Operand to the right by Count bits. The\r
   high Count bits are set to bit 63 of Operand.  The shifted value is returned.\r
 \r
-  If Count is greater than 63, then ASSERT().\r
-\r
   @param  Operand The 64-bit operand to shift right.\r
   @param  Count   The number of bits to shift right.\r
 \r
@@ -161,7 +159,7 @@ InternalMathRRotU64 (
 \r
   @param  Operand A 64-bit unsigned value.\r
 \r
-  @return The byte swaped Operand.\r
+  @return The byte swapped Operand.\r
 \r
 **/\r
 UINT64\r
@@ -236,7 +234,7 @@ InternalMathMultU64x64 (
   unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
   function returns the 64-bit unsigned quotient.\r
 \r
-   @param  Dividend  A 64-bit unsigned value.\r
+  @param  Dividend  A 64-bit unsigned value.\r
   @param  Divisor   A 32-bit unsigned value.\r
 \r
   @return Dividend / Divisor\r
@@ -253,8 +251,8 @@ InternalMathDivU64x32 (
 }\r
 \r
 /**\r
-  Divides a 64-bit unsigned integer by a 32-bit unsigned integer\r
-  and generates a 32-bit unsigned remainder.\r
+  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and\r
+  generates a 32-bit unsigned remainder.\r
 \r
   This function divides the 64-bit unsigned value Dividend by the 32-bit\r
   unsigned value Divisor and generates a 32-bit remainder. This function\r
@@ -298,7 +296,7 @@ EFIAPI
 InternalMathDivRemU64x32 (\r
   IN      UINT64                    Dividend,\r
   IN      UINT32                    Divisor,\r
-  OUT     UINT32                    *Remainder  OPTIONAL\r
+  OUT     UINT32                    *Remainder OPTIONAL\r
   )\r
 {\r
   if (Remainder != NULL) {\r
@@ -329,7 +327,7 @@ EFIAPI
 InternalMathDivRemU64x64 (\r
   IN      UINT64                    Dividend,\r
   IN      UINT64                    Divisor,\r
-  OUT     UINT64                    *Remainder  OPTIONAL\r
+  OUT     UINT64                    *Remainder OPTIONAL\r
   )\r
 {\r
   if (Remainder != NULL) {\r
@@ -340,7 +338,7 @@ InternalMathDivRemU64x64 (
 \r
 /**\r
   Divides a 64-bit signed integer by a 64-bit signed integer and\r
-  generates a 64-bit signed result and a optional 64-bit signed remainder.\r
+  generates a 64-bit signed result and an optional 64-bit signed remainder.\r
 \r
   This function divides the 64-bit signed value Dividend by the 64-bit\r
   signed value Divisor and generates a 64-bit signed quotient. If Remainder\r
index d4c88957552798890585fd11835b58e1e36a5157..6cf197d535d536978105e2e2399d1c6105aca5de 100644 (file)
@@ -23,8 +23,7 @@
   Checks ASSERT condition for JumpBuffer.\r
 \r
   If JumpBuffer is NULL, then ASSERT().\r
-  If JumpBuffer is not aligned on a BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT\r
-  boundary, then ASSERT().\r
+  For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
 \r
   @param  JumpBuffer    A pointer to CPU context buffer.\r
 \r
index 9f1ad6c482947847d3ac588663254885a3af75b2..b9c5c8c960b6f8b53e4ac56d69866f8f3292a982 100644 (file)
@@ -261,7 +261,7 @@ StrCmp (
 /**\r
   Compares up to a specified length the contents of two Null-terminated Unicode strings,\r
   and returns the difference between the first mismatched Unicode characters.\r
-\r
+  \r
   This function compares the Null-terminated Unicode string FirstString to the\r
   Null-terminated Unicode string SecondString. At most, Length Unicode\r
   characters will be compared. If Length is 0, then 0 is returned. If\r
@@ -451,8 +451,8 @@ StrnCat (
 CHAR16 *\r
 EFIAPI\r
 StrStr (\r
-  IN      CONST CHAR16                *String,\r
-  IN      CONST CHAR16                *SearchString\r
+  IN      CONST CHAR16              *String,\r
+  IN      CONST CHAR16              *SearchString\r
   )\r
 {\r
   CONST CHAR16 *FirstMatch;\r
@@ -632,7 +632,7 @@ InternalIsHexaDecimalDigitCharacter (
 UINTN\r
 EFIAPI\r
 StrDecimalToUintn (\r
-  IN      CONST CHAR16                *String\r
+  IN      CONST CHAR16              *String\r
   )\r
 {\r
   UINTN     Result;\r
@@ -714,7 +714,7 @@ StrDecimalToUintn (
 UINT64\r
 EFIAPI\r
 StrDecimalToUint64 (\r
-  IN      CONST CHAR16                *String\r
+  IN      CONST CHAR16              *String\r
   )\r
 {\r
   UINT64     Result;\r
@@ -796,7 +796,7 @@ StrDecimalToUint64 (
 UINTN\r
 EFIAPI\r
 StrHexToUintn (\r
-  IN      CONST CHAR16                *String\r
+  IN      CONST CHAR16              *String\r
   )\r
 {\r
   UINTN     Result;\r
@@ -886,11 +886,11 @@ StrHexToUintn (
 \r
   @retval Value translated from String.\r
 \r
-  **/\r
+**/\r
 UINT64\r
 EFIAPI\r
 StrHexToUint64 (\r
-  IN      CONST CHAR16                *String\r
+  IN      CONST CHAR16             *String\r
   )\r
 {\r
   UINT64    Result;\r
@@ -1027,8 +1027,8 @@ InternalAsciiIsHexaDecimalDigitCharacter (
 CHAR8 *\r
 EFIAPI\r
 UnicodeStrToAsciiStr (\r
-  IN      CONST CHAR16                *Source,\r
-  OUT     CHAR8                       *Destination\r
+  IN      CONST CHAR16              *Source,\r
+  OUT     CHAR8                     *Destination\r
   )\r
 {\r
   CHAR8                               *ReturnValue;\r
@@ -1421,7 +1421,7 @@ AsciiStriCmp (
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
   @param  Length        Maximum number of ASCII characters for compare.\r
-\r
+  \r
   @retval ==0       FirstString is identical to SecondString.\r
   @retval !=0       FirstString is not identical to SecondString.\r
 \r
@@ -1577,8 +1577,8 @@ AsciiStrnCat (
 CHAR8 *\r
 EFIAPI\r
 AsciiStrStr (\r
-  IN      CONST CHAR8             *String,\r
-  IN      CONST CHAR8             *SearchString\r
+  IN      CONST CHAR8               *String,\r
+  IN      CONST CHAR8               *SearchString\r
   )\r
 {\r
   CONST CHAR8 *FirstMatch;\r
@@ -1729,7 +1729,7 @@ AsciiStrDecimalToUintn (
 UINT64\r
 EFIAPI\r
 AsciiStrDecimalToUint64 (\r
-  IN      CONST CHAR8             *String\r
+  IN      CONST CHAR8               *String\r
   )\r
 {\r
   UINT64     Result;\r
@@ -1809,7 +1809,7 @@ AsciiStrDecimalToUint64 (
 UINTN\r
 EFIAPI\r
 AsciiStrHexToUintn (\r
-  IN      CONST CHAR8             *String\r
+  IN      CONST CHAR8               *String\r
   )\r
 {\r
   UINTN     Result;\r
@@ -1901,7 +1901,7 @@ AsciiStrHexToUintn (
 UINT64\r
 EFIAPI\r
 AsciiStrHexToUint64 (\r
-  IN      CONST CHAR8             *String\r
+  IN      CONST CHAR8                *String\r
   )\r
 {\r
   UINT64    Result;\r
index 872250bac13fd680bf3452468e6a54a94cf42a47..a656a8cea2ea49e7ec42f764cf1d0204e2f0e288 100644 (file)
   from little endian to big endian or vice versa. The byte swapped value is\r
   returned.\r
 \r
-  @param  Value Operand A 16-bit unsigned value.\r
+  @param  Value A 16-bit unsigned value.\r
 \r
-  @return The byte swapped Operand.\r
+  @return The byte swapped value.\r
 \r
 **/\r
 UINT16\r
 EFIAPI\r
 SwapBytes16 (\r
-  IN      UINT16                    Operand\r
+  IN      UINT16                    Value\r
   )\r
 {\r
-  return (UINT16) ((Operand << 8) | (Operand >> 8));\r
+  return (UINT16) ((Value<< 8) | (Value>> 8));\r
 }\r
index f1a1b8925e1048490d0dc88d29b3f5b7233013a1..9833111447eb5040f788c6872f15eba58eba4bcc 100644 (file)
   from little endian to big endian or vice versa. The byte swapped value is\r
   returned.\r
 \r
-  @param  Value Operand A 32-bit unsigned value.\r
+  @param  Value A 32-bit unsigned value.\r
 \r
-  @return The byte swapped Operand.\r
+  @return The byte swapped Value.\r
 \r
 **/\r
 UINT32\r
 EFIAPI\r
 SwapBytes32 (\r
-  IN      UINT32                    Operand\r
+  IN      UINT32                    Value\r
   )\r
 {\r
   UINT32  LowerBytes;\r
   UINT32  HigherBytes;\r
 \r
-  LowerBytes  = (UINT32) SwapBytes16 ((UINT16) Operand);\r
-  HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Operand >> 16));\r
+  LowerBytes  = (UINT32) SwapBytes16 ((UINT16) Value);\r
+  HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Value >> 16));\r
 \r
   return (LowerBytes << 16 | HigherBytes);\r
 }\r
index ccbdadf3062846db002b1638c2f0631318e8b714..5b54a9064b05737eb35c74f3959acbf7e211acc8 100644 (file)
   from little endian to big endian or vice versa. The byte swapped value is\r
   returned.\r
 \r
-  @param  Value Operand A 64-bit unsigned value.\r
+  @param  Value A 64-bit unsigned value.\r
 \r
-  @return The byte swapped Operand.\r
+  @return The byte swapped Value.\r
 \r
 **/\r
 UINT64\r
 EFIAPI\r
 SwapBytes64 (\r
-  IN      UINT64                    Operand\r
+  IN      UINT64                    Value\r
   )\r
 {\r
-  return InternalMathSwapBytes64 (Operand);\r
+  return InternalMathSwapBytes64 (Value);\r
 }\r
index a6e33aec6eb2362ee4b9382f3e14b0093881e0bf..32c64ca8d67c2fa6933c0a92a864b02fa55e85ac 100644 (file)
@@ -41,6 +41,7 @@
                       a single parameter of type VOID * that specifies the new backing \r
                       store pointer.\r
 \r
+\r
 **/\r
 VOID\r
 EFIAPI\r
index b84188e61869acdd12aa7f785e38c36350e1dc9d..6956237efc0a2b5c5fbb0d2e3a2c9f0ff60a2391 100644 (file)
@@ -61,7 +61,7 @@ GetSpinLockProperties (
 SPIN_LOCK *\r
 EFIAPI\r
 InitializeSpinLock (\r
-  OUT     SPIN_LOCK                 *SpinLock\r
+  OUT      SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
   ASSERT (SpinLock != NULL);\r
@@ -352,9 +352,8 @@ InterlockedCompareExchange64 (
                         operation.\r
   @param  CompareValue  Pointer value used in compare operation.\r
   @param  ExchangeValue Pointer value used in exchange operation.\r
-  \r
-  @return The original *Value before exchange.\r
 \r
+  @return The original *Value before exchange.\r
 **/\r
 VOID *\r
 EFIAPI\r
index b479123863d5b394b73cff75ae5fbe49a5153b36..49a09e747c43b3565898bf06ac7afc02e885a3ce 100644 (file)
@@ -69,7 +69,7 @@ GetSpinLockProperties (
 SPIN_LOCK *\r
 EFIAPI\r
 InitializeSpinLock (\r
-  OUT     SPIN_LOCK                 *SpinLock\r
+  OUT      SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
   ASSERT (SpinLock != NULL);\r
index 66b211a2b8d53617350dafe692901b374a34a10d..1d20954ca312fc673676b26399a9c5b98bd79fce 100644 (file)
@@ -72,7 +72,7 @@ GetSpinLockProperties (
 SPIN_LOCK *\r
 EFIAPI\r
 InitializeSpinLock (\r
-  OUT     SPIN_LOCK                 *SpinLock\r
+  OUT      SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
   ASSERT (SpinLock != NULL);\r
@@ -373,9 +373,8 @@ InterlockedCompareExchange64 (
                         operation.\r
   @param  CompareValue  Pointer value used in compare operation.\r
   @param  ExchangeValue Pointer value used in exchange operation.\r
-  \r
-  @return The original *Value before exchange.\r
 \r
+  @return The original *Value before exchange.\r
 **/\r
 VOID *\r
 EFIAPI\r
index a484b878366788fa3f9a7f25a2bb03781963f2fc..5af4ed959bee3141d64f4eaae73136a35cb31c75 100644 (file)
@@ -34,7 +34,7 @@
 VOID\r
 EFIAPI\r
 AsmFxRestore (\r
-  IN CONST IA32_FX_BUFFER  *Buffer\r
+  IN      CONST IA32_FX_BUFFER      *Buffer\r
   )\r
 {\r
   ASSERT (Buffer != NULL);\r
index 612b29c0e6b2ff233114c3f152d6d90c09b75f36..410ab2eb9ed3a675c94b8338f3b55baaa8005c57 100644 (file)
@@ -40,7 +40,8 @@ AsmReadMsr32 (
 }\r
 \r
 /**\r
-  Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).\r
+  Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value.\r
+  The upper 32-bits of the MSR are set to zero.\r
 \r
   Writes the 32-bit value specified by Value to the MSR specified by Index. The\r
   upper 32-bits of the MSR write are set to zero. The 32-bit value written to\r
@@ -192,7 +193,7 @@ AsmMsrBitFieldRead32 (
 /**\r
   Writes a bit field to an MSR.\r
 \r
-  Writes Value to a bit field in the lower 32-bits of a  64-bit MSR. The bit\r
+  Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit\r
   field is specified by the StartBit and the EndBit. All other bits in the\r
   destination MSR are preserved. The lower 32-bits of the MSR written is\r
   returned. The caller must either guarantee that Index and the data written \r
@@ -464,7 +465,7 @@ AsmMsrAndThenOr64 (
   @param  EndBit    The ordinal of the most significant bit in the bit field.\r
                     Range 0..63.\r
 \r
-  @return The value written back to the MSR.\r
+  @return The value read from the MSR.\r
 \r
 **/\r
 UINT64\r
index 94b2b10a208f5774618226557d07dd8d73926d9e..e0ad60b7a63118f81879be00cf7850eb2a8d3958 100644 (file)
@@ -18,7 +18,7 @@
 #include "BaseLibInternals.h"\r
 \r
 /**\r
-  Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
+  Reads the current Interrupt Descriptor Table Register(IDTR) descriptor.\r
 \r
   Reads and returns the current IDTR descriptor and returns it in Idtr. This\r
   function is only available on IA-32 and x64.\r
index 7bcde8389d1a553cf796acad3b774bcc5aaba39a..019524b6053c22aea56e42c054b63a70fc0265e7 100644 (file)
@@ -185,11 +185,47 @@ AsmPrepareThunk16 (
   Transfers control to a 16-bit real mode entry point and returns the results.\r
 \r
   Transfers control to a 16-bit real mode entry point and returns the results.\r
-  AsmPrepareThunk16() must be called with ThunkContext before this function is\r
-  used. This function must be called with interrupts disabled.\r
-\r
+  AsmPrepareThunk16() must be called with ThunkContext before this function is used.\r
+  This function must be called with interrupts disabled.\r
+\r
+  The register state from the RealModeState field of ThunkContext is restored just prior \r
+  to calling the 16-bit real mode entry point.  This includes the EFLAGS field of RealModeState, \r
+  which is used to set the interrupt state when a 16-bit real mode entry point is called.\r
+  Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState.\r
+  The stack is initialized to the SS and ESP fields of RealModeState.  Any parameters passed to \r
+  the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function.  \r
+  The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction,\r
+  so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment \r
+  and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry \r
+  point must exit with a RETF instruction. The register state is captured into RealModeState immediately \r
+  after the RETF instruction is executed.\r
+  \r
+  If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, \r
+  or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure \r
+  the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode. \r
+  \r
+  If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, \r
+  then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode.  \r
+  This includes the base vectors, the interrupt masks, and the edge/level trigger mode.\r
+  \r
+  If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code \r
+  is invoked in big real mode.  Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits.\r
+  \r
+  If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in \r
+  ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to \r
+  disable the A20 mask.\r
+  \r
+  If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in \r
+  ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask.  If this INT 15 call fails, \r
+  then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.\r
+  \r
+  If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in \r
+  ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports.\r
+    \r
   If ThunkContext is NULL, then ASSERT().\r
   If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().\r
+  If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in \r
+  ThunkAttributes, then ASSERT().\r
 \r
   @param  ThunkContext  A pointer to the context structure that describes the\r
                         16-bit real mode code to call.\r
@@ -225,10 +261,9 @@ AsmThunk16 (
   caller only need to perform a single 16-bit real mode thunk, then this\r
   service should be used. If the caller intends to make more than one 16-bit\r
   real mode thunk, then it is more efficient if AsmPrepareThunk16() is called\r
-  once and AsmThunk16() can be called for each 16-bit real mode thunk. This\r
-  function must be called with interrupts disabled.\r
+  once and AsmThunk16() can be called for each 16-bit real mode thunk.\r
 \r
-  If ThunkContext is NULL, then ASSERT().\r
+  See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions.\r
 \r
   @param  ThunkContext  A pointer to the context structure that describes the\r
                         16-bit real mode code to call.\r
index a2c5b545b945df0b9d5328f9876a9b0085c22704..626ffaa75c6651efa519a849389f28a65a8a9dd7 100644 (file)
@@ -18,7 +18,7 @@
 #include "BaseLibInternals.h"\r
 \r
 /**\r
-  Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
+  Writes the current Interrupt Descriptor Table Register(IDTR) descriptor.\r
 \r
   Writes the current IDTR descriptor and returns it in Idtr. This function is\r
   only available on IA-32 and x64.\r