]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Perfect libraries MSA files
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 30 Mar 2007 06:15:19 +0000 (06:15 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 30 Mar 2007 06:15:19 +0000 (06:15 +0000)
2. Use MemoryAllocationLib to replace gBS memory services in EdkEt32Pkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2517 6f19259b-4bc3-4df7-8a09-765794883524

43 files changed:
EdkNt32Pkg/Dxe/Nt32Platform/MiscSubclass/MiscSubclassDriverEntryPoint.c
EdkNt32Pkg/Dxe/PlatformBds/BdsPlatform.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BBSsupport.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BmLib.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootMaint.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootOption.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/UpdatePage.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMngr/BootManager.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/DeviceMngr/DeviceManager.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/FrontPage.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/Language.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/MemoryTest.c
EdkNt32Pkg/Dxe/PlatformBds/Generic/String.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/BlockIo/DriverDiagnostics.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/BlockIo/WinNtBlockIo.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/BlockIo/WinNtBlockIo.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Console/Console.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Console/ConsoleIn.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Console/WinNtConsole.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Gop/WinNtGop.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Gop/WinNtGopDriver.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Gop/WinNtGopScreen.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SerialIo/WinNtSerialIo.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SerialIo/WinNtSerialIo.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SimpleFileSystem/WinNtSimpleFileSystem.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SimpleFileSystem/WinNtSimpleFileSystem.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/WinNtUga.msa
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/WinNtUgaDriver.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/WinNtUgaScreen.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.msa
EdkNt32Pkg/Dxe/WinNtThunk/Cpu/Cpu.c
EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c
EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c
EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c
EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c
EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa
EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c
EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa
EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa
EdkNt32Pkg/RuntimeDxe/FvbServices/FWBlockService.c

index f0e09a61528c3d7e0a1356587c3cccacf7321aa9..240a24e0b88a74623c902f6c5ecaa71b7dc44e32 100644 (file)
@@ -1,19 +1,19 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
   MiscSubclassDriverEntryPoint.c\r
-  \r
-Abstract: \r
+\r
+Abstract:\r
 \r
   This driver parses the mMiscSubclassDataTable structure and reports\r
   any generated data to the DataHub.\r
@@ -201,7 +201,7 @@ Returns:
   //\r
   PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings);\r
   EfiStatus   = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   if (EFI_ERROR (EfiStatus)) {\r
     DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii.  %r\n", EfiStatus));\r
@@ -351,8 +351,8 @@ Routine Description:
 Arguments:\r
   String - Unicode string.\r
 \r
-Returns: \r
-  UINTN of the number represented by String.  \r
+Returns:\r
+  UINTN of the number represented by String.\r
 \r
 --*/\r
 {\r
index 846ba8e8ed7d8c8766813216bb495eb6589312a4..1d6f9139c6818e02d2f40c74f0f10f66f1122f30 100644 (file)
@@ -445,7 +445,7 @@ Returns:
   TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));\r
   if (TmpStr != NULL) {\r
     BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);\r
-    gBS->FreePool (TmpStr);\r
+    FreePool (TmpStr);\r
   }\r
 }\r
 \r
@@ -487,7 +487,7 @@ Returns:
   TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));\r
   if (TmpStr != NULL) {\r
     BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);\r
-    gBS->FreePool (TmpStr);\r
+    FreePool (TmpStr);\r
   }\r
 \r
 }\r
index c9f2402eb140de7171062caf5b28cad425d20ba9..37c0475ba78ef6542f15661dd640a9ab5aed4370 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -486,19 +486,19 @@ BdsDeleteAllInvalidLegacyBootOptions (
       Index++;\r
       continue;\r
     }\r
\r
+\r
     //\r
     // Check if BBS Description String is changed\r
     //\r
     DescStringMatch = FALSE;\r
-    \r
+\r
     BdsBuildLegacyDevNameString (\r
-      &LocalBbsTable[BbsIndex], \r
-      BbsIndex, \r
-      sizeof(BootDesc), \r
+      &LocalBbsTable[BbsIndex],\r
+      BbsIndex,\r
+      sizeof(BootDesc),\r
       BootDesc\r
       );\r
-    \r
+\r
     if (StrCmp (BootDesc, (UINT16*)(BootOptionVar + sizeof (UINT32) + sizeof (UINT16))) == 0) {\r
       DescStringMatch = TRUE;\r
     }\r
@@ -634,7 +634,7 @@ BdsCreateOneLegacyBootOption (
             );\r
   BbsItem->BootPriority = 0x00;\r
 \r
-  gBS->FreePool (DevPath);\r
+  FreePool (DevPath);\r
 \r
   return Status;\r
 }\r
index b4f6d481ce1a025903a4c2cdfc3a8df1b9b0e087..8804b141aec17204894a55f261b9ade793442a05 100644 (file)
@@ -1,18 +1,18 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
   BmLib.c\r
-    \r
+\r
 AgBStract:\r
 \r
   Boot Maintainence Helper functions\r
@@ -30,13 +30,13 @@ EfiLibLocateProtocol (
 \r
 Routine Description:\r
 \r
-  Find the first instance of this Protocol \r
+  Find the first instance of this Protocol\r
   in the system and return it's interface\r
 \r
 Arguments:\r
 \r
   ProtocolGuid    - Provides the protocol to search for\r
-  Interface       - On return, a pointer to the first interface \r
+  Interface       - On return, a pointer to the first interface\r
                     that matches ProtocolGuid\r
 \r
 Returns:\r
@@ -72,7 +72,7 @@ Arguments:
   DeviceHandle         - A handle for a device\r
 \r
 Returns:\r
-  \r
+\r
   A valid file handle or NULL is returned\r
 \r
 --*/\r
@@ -118,7 +118,7 @@ EfiGrowBuffer (
 Routine Description:\r
 \r
     Helper function called as part of the code needed\r
-    to allocate the proper sized buffer for various \r
+    to allocate the proper sized buffer for various\r
     EFI interfaces.\r
 \r
 Arguments:\r
@@ -128,10 +128,10 @@ Arguments:
     Buffer      - Current allocated buffer, or NULL\r
 \r
     BufferSize  - Current buffer size needed\r
-    \r
+\r
 Returns:\r
-    \r
-    TRUE - if the buffer was reallocated and the caller \r
+\r
+    TRUE - if the buffer was reallocated and the caller\r
     should try the API again.\r
 \r
 --*/\r
@@ -182,7 +182,7 @@ Routine Description:
   Function returns the value of the specified variable.\r
 \r
 Arguments:\r
-  Name                - A Null-terminated Unicode string that is \r
+  Name                - A Null-terminated Unicode string that is\r
                         the name of the vendor's variable.\r
 \r
   VendorGuid          - A unique identifier for the vendor.\r
@@ -209,7 +209,7 @@ Routine Description:
   Function deletes the variable specified by VarName and VarGuid.\r
 \r
 Arguments:\r
-  VarName              - A Null-terminated Unicode string that is \r
+  VarName              - A Null-terminated Unicode string that is\r
                          the name of the vendor's variable.\r
 \r
   VendorGuid           - A unique identifier for the vendor.\r
@@ -252,7 +252,7 @@ EfiLibFileSystemVolumeLabelInfo (
 \r
 Routine Description:\r
 \r
-  Function gets the file system information from an open file descriptor, \r
+  Function gets the file system information from an open file descriptor,\r
   and stores it in a buffer allocated from pool.\r
 \r
 Arguments:\r
@@ -260,7 +260,7 @@ Arguments:
   Fhand         - A file handle\r
 \r
 Returns:\r
-  \r
+\r
   A pointer to a buffer with file information or NULL is returned\r
 \r
 --*/\r
@@ -315,7 +315,7 @@ EfiLibFileInfo (
 \r
 Routine Description:\r
 \r
-  Function gets the file information from an open file descriptor, and stores it \r
+  Function gets the file information from an open file descriptor, and stores it\r
   in a buffer allocated from pool.\r
 \r
 Arguments:\r
@@ -323,7 +323,7 @@ Arguments:
   Fhand         - A file handle\r
 \r
 Returns:\r
-  \r
+\r
   A pointer to a buffer with file information or NULL is returned\r
 \r
 --*/\r
@@ -360,7 +360,7 @@ EfiDevicePathInstanceCount (
 /*++\r
 \r
 Routine Description:\r
-  Function is used to determine the number of device path instances \r
+  Function is used to determine the number of device path instances\r
   that exist in a device path.\r
 \r
 Arguments:\r
@@ -368,7 +368,7 @@ Arguments:
 \r
 Returns:\r
 \r
-  This function counts and returns the number of device path instances \r
+  This function counts and returns the number of device path instances\r
   in DevicePath.\r
 \r
 --*/\r
@@ -437,15 +437,15 @@ EfiLibGetStringFromToken (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Acquire the string associated with the ProducerGuid and return it.\r
 \r
 Arguments:\r
-  \r
+\r
   ProducerGuid - The Guid to search the HII database for\r
   Token        - The token value of the string to extract\r
   String       - The string that is extracted\r
-  \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS           -  Buffer filled with the requested forms. BufferLength\r
@@ -469,7 +469,7 @@ Returns:
   //\r
   HandleBufferLength  = 0;\r
   HiiHandleBuffer     = NULL;\r
-  \r
+\r
   Status = gBS->LocateProtocol (\r
                   &gEfiHiiProtocolGuid,\r
                   NULL,\r
@@ -484,7 +484,7 @@ Returns:
   //\r
   Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandleBuffer);\r
   ASSERT_EFI_ERROR (Status);\r
-  \r
+\r
   //\r
   // Get the Hii Handle that matches the StructureNode->ProducerName\r
   //\r
@@ -518,7 +518,7 @@ Returns:
                   *String\r
                   );\r
 \r
-  gBS->FreePool (HiiHandleBuffer);\r
+  FreePool (HiiHandleBuffer);\r
 \r
   return Status;\r
 }\r
@@ -541,7 +541,7 @@ Arguments:
 Returns:\r
   TRUE              The FirstTime is not later than the SecondTime.\r
   FALSE             The FirstTime is later than the SecondTime.\r
-  \r
+\r
 --*/\r
 {\r
   if (FirstTime->Year != SecondTime->Year) {\r
index 2f90e3c6b271198c34d71a982495167f2a46e4f6..77b530dc57f5a38448fcc3699bcd3b0234112300 100644 (file)
@@ -1,18 +1,18 @@
-/*++ \r
+/*++\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
 \r
-Copyright (c) 2006, 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
 Module Name:\r
 \r
   BootMaint.c\r
-    \r
+\r
 Abstract:\r
 \r
   Boot Maintainence Main File\r
@@ -58,15 +58,15 @@ Routine Description:
 Arguments:\r
 \r
   HiiHandle       - Hii Handle of the package to be updated.\r
-  \r
+\r
   MenuOption      - The Menu whose string tokens need to be created\r
 \r
 Returns:\r
 \r
   EFI_SUCCESS     - string tokens created successfully\r
-  \r
+\r
   others          - contain some errors\r
-  \r
+\r
 --*/\r
 {\r
   BM_MENU_ENTRY *NewMenuEntry;\r
@@ -113,7 +113,7 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  This            - File explorer callback protocol pointer.     \r
+  This            - File explorer callback protocol pointer.\r
   KeyValue        - Key value to identify the type of data to expect.\r
   Data            - A pointer to the data being sent to the original exporting driver.\r
   Packet          - A pointer to a packet of information which a driver passes back to the browser.\r
@@ -122,7 +122,7 @@ Returns:
 \r
   EFI_SUCCESS     - Callback ended successfully.\r
   Others          - Contain some errors.\r
-  \r
+\r
 --*/\r
 {\r
   BMM_CALLBACK_DATA *Private;\r
@@ -729,15 +729,15 @@ Routine Description:
 Arguments:\r
 \r
   ImageHandle     - caller provided handle\r
-  \r
+\r
   SystemTable     - caller provided system tables\r
 \r
 Returns:\r
 \r
   EFI_SUCCESS     - utility ended successfully\r
-  \r
+\r
   others          - contain some errors\r
-  \r
+\r
 --*/\r
 {\r
   EFI_LEGACY_BIOS_PROTOCOL  *LegacyBios;\r
@@ -849,13 +849,13 @@ Returns:
   //\r
   PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin);\r
   Status      = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   BmmCallbackInfo->BmmHiiHandle = HiiHandle;\r
 \r
   PackageList                   = PreparePackages (1, &gBdsStringPackGuid, FEBin);\r
   Status                        = Hii->NewPack (Hii, PackageList, &HiiHandle);\r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   BmmCallbackInfo->FeHiiHandle = HiiHandle;\r
 \r
@@ -1036,7 +1036,7 @@ Arguments:
   None.\r
 \r
 Returns:\r
-  None.  \r
+  None.\r
 --*/\r
 {\r
   STRING_DEPOSITORY *StringDepository;\r
index 3fccd99e4a2c2d5e89767e0124c06c61f7728cd7..b5afc7c7fea7359ae8d2bc94e7cb4802546f3c96 100644 (file)
@@ -1,17 +1,17 @@
 /*++\r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
   BootOption.c\r
-  \r
+\r
 Abstract:\r
 \r
   Provide boot option support for Application "BootMaint"\r
@@ -19,7 +19,7 @@ Abstract:
   Include file system navigation, system handle selection\r
 \r
   Boot option manipulation\r
-  \r
+\r
 Revision History\r
 \r
 --*/\r
@@ -42,7 +42,7 @@ Arguments:
                       Menu type\r
 \r
 Returns:\r
-  NULL                Cannot allocate memory for current menu \r
+  NULL                Cannot allocate memory for current menu\r
                       entry\r
   Others              A valid pointer pointing to the allocated\r
                       memory pool for current menu entry\r
@@ -195,11 +195,11 @@ BOpt_GetMenuEntry (
   )\r
 /*++\r
   Rountine Description :\r
-    Use this routine to get one particular menu entry in specified \r
+    Use this routine to get one particular menu entry in specified\r
     menu\r
 \r
   Arguments :\r
-    MenuOption        The menu that we will search \r
+    MenuOption        The menu that we will search\r
 \r
     MenuNumber        The menunubmer that we want\r
 \r
@@ -238,7 +238,7 @@ Routine Description
   protocol, Load File protocol.\r
 \r
   Building up the FileSystem Menu for user selection\r
-  All file system will be stored in FsOptionMenu \r
+  All file system will be stored in FsOptionMenu\r
   for future use.\r
 \r
 Arguments:\r
@@ -303,7 +303,7 @@ Returns:
         //\r
         // If block IO exists check to see if it's remobable media\r
         //\r
-        RemovableMedia = BlkIo->Media->RemovableMedia; \r
+        RemovableMedia = BlkIo->Media->RemovableMedia;\r
       }\r
 \r
       //\r
@@ -311,12 +311,12 @@ Returns:
       //\r
       MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);\r
       if (NULL == MenuEntry) {\r
-        SafeFreePool (SimpleFsHandle);    \r
+        SafeFreePool (SimpleFsHandle);\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
 \r
       FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;\r
-            \r
+\r
       FileContext->Handle     = SimpleFsHandle[Index];\r
       MenuEntry->OptionNumber = Index;\r
       FileContext->FHandle    = EfiLibOpenRoot (FileContext->Handle);\r
@@ -364,7 +364,7 @@ Returns:
         TempStr\r
         );\r
       OptionNumber++;\r
-      InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);      \r
+      InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);\r
     }\r
   }\r
 \r
@@ -386,7 +386,7 @@ Returns:
     for (Index = 0; Index < NoLoadFileHandles; Index++) {\r
       MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);\r
       if (NULL == MenuEntry) {\r
-        SafeFreePool (LoadFileHandle);    \r
+        SafeFreePool (LoadFileHandle);\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
 \r
@@ -494,7 +494,7 @@ Arguments:
 \r
 Returns:\r
   VOID\r
-  \r
+\r
 --*/\r
 {\r
   BM_MENU_ENTRY *MenuEntry;\r
@@ -675,15 +675,15 @@ BOpt_GetLegacyOptions (
   )\r
 /*++\r
 Routine Description:\r
-  \r
+\r
   Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().\r
-    \r
+\r
 Arguments:\r
   None\r
 \r
 Returns:\r
   The device info of legacy device.\r
-  \r
+\r
 --*/\r
 {\r
   BM_MENU_ENTRY             *NewMenuEntry;\r
@@ -832,16 +832,16 @@ BOpt_GetBootOptions (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Build the BootOptionMenu according to BootOrder Variable.\r
-  This Routine will access the Boot#### to get EFI_LOAD_OPTION \r
-  \r
+  This Routine will access the Boot#### to get EFI_LOAD_OPTION\r
+\r
 Arguments:\r
   None\r
 \r
 Returns:\r
   The number of the Var Boot####\r
-  \r
+\r
 --*/\r
 {\r
   UINTN                     Index;\r
@@ -1148,7 +1148,7 @@ BOpt_IsEfiImageName (
 /*++\r
 \r
 Routine Description\r
-  Check whether current FileName point to a valid \r
+  Check whether current FileName point to a valid\r
   Efi Image File.\r
 \r
 Arguments:\r
@@ -1157,7 +1157,7 @@ Arguments:
 Returns:\r
   TRUE  -   Is Efi Image\r
   FALSE -   Not a valid Efi Image\r
-  \r
+\r
 --*/\r
 {\r
   //\r
@@ -1198,7 +1198,7 @@ IsEfiAppReadFromFile (
 {\r
   EFI_STATUS        Status;\r
   EFI_FILE_HANDLE   File;\r
-    \r
+\r
   File = (EFI_FILE_HANDLE)FileHandle;\r
   Status = File->SetPosition (File, FileOffset);\r
   if (EFI_ERROR (Status)) {\r
@@ -1219,15 +1219,15 @@ BOpt_IsEfiApp (
 \r
 Routine Description:\r
   Check whether current FileName point to a valid Efi Application\r
-  \r
+\r
 Arguments:\r
   Dir       -   Pointer to current Directory\r
   FileName  -   Pointer to current File name.\r
-  \r
+\r
 Returns:\r
   TRUE      -   Is a valid Efi Application\r
   FALSE     -   not a valid Efi Application\r
-  \r
+\r
 --*/\r
 {\r
   EFI_STATUS                            Status;\r
@@ -1268,7 +1268,7 @@ Routine Description
   in current system environment\r
   All valid handles in the system except those consume SimpleFs, LoadFile\r
   are stored in DriverMenu for future use.\r
-  \r
+\r
 Arguments:\r
   None\r
 \r
@@ -1363,13 +1363,13 @@ BOpt_GetBootOptionNumber (
 /*++\r
 \r
 Routine Description:\r
-  Get the Option Number that does not used \r
-  \r
+  Get the Option Number that does not used\r
+\r
 Arguments:\r
 \r
 Returns:\r
   The Option Number\r
-  \r
+\r
 --*/\r
 {\r
   BM_MENU_ENTRY *NewMenuEntry;\r
@@ -1415,7 +1415,7 @@ Returns:
                 &gEfiGlobalVariableGuid,\r
                 &OptionSize\r
                 );\r
-      if (NULL == OptionBuffer) \r
+      if (NULL == OptionBuffer)\r
         break;\r
       }\r
     }\r
@@ -1440,13 +1440,13 @@ BOpt_GetDriverOptionNumber (
 /*++\r
 \r
 Routine Description:\r
-  Get the Option Number that does not used \r
-  \r
+  Get the Option Number that does not used\r
+\r
 Arguments:\r
 \r
 Returns:\r
   The Option Number\r
-  \r
+\r
 --*/\r
 {\r
   BM_MENU_ENTRY *NewMenuEntry;\r
@@ -1507,12 +1507,12 @@ BOpt_GetDriverOptions (
 \r
 Routine Description:\r
   Build up all DriverOptionMenu\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r
   The Option Number\r
-  \r
+\r
 --*/\r
 {\r
   UINTN           Index;\r
@@ -1671,7 +1671,7 @@ SafeFreePool (
 Routine Description:\r
   Wrap original FreePool gBS call\r
   in order to decrease code length\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r
@@ -1679,7 +1679,7 @@ Returns:
 --*/\r
 {\r
   if (Buffer != NULL) {\r
-    gBS->FreePool (Buffer);\r
+    FreePool (Buffer);\r
     Buffer = NULL;\r
   }\r
 }\r
index 9c72f23768f680c70d84d10b6712bfa836ae6ce5..1134c950e5aa73e723e4506611360df0f998b114 100644 (file)
@@ -1,18 +1,18 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
   UpdatePage.c\r
-    \r
+\r
 AgBStract:\r
 \r
   Dynamically Update the pages\r
@@ -179,7 +179,8 @@ BootThisFile (
   CHAR16            *ExitData;\r
   BDS_COMMON_OPTION *Option;\r
 \r
-  Status                  = gBS->AllocatePool (EfiBootServicesData, sizeof (BDS_COMMON_OPTION), &Option);\r
+  Option                  = AllocatePool (sizeof (BDS_COMMON_OPTION));\r
+\r
   Option->Description     = FileContext->FileName;\r
   Option->DevicePath      = FileContext->DevicePath;\r
   Option->LoadOptionsSize = 0;\r
@@ -218,7 +219,7 @@ UpdateConCOMPage (
   if (!EFI_ERROR (Status)) {\r
     for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {\r
       NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);\r
\r
+\r
       CreateGotoOpCode (\r
         FORM_CON_COM_SETUP_ID,\r
         NewMenuEntry->DisplayStringToken,\r
index 23b878961716537e29a9dd8ebe2bd77ffc926a10..77e079ee72a3db4b07a8969c0db4e034b729fe0d 100644 (file)
@@ -1,15 +1,15 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
 \r
-Module Name: \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
+Module Name:\r
 \r
   BootManager.c\r
 \r
@@ -47,7 +47,7 @@ Routine Description:
 \r
   This is the function that is called to provide results data to the driver.  This data\r
   consists of a unique key which is used to identify what data is either being passed back\r
-  or being asked for. \r
+  or being asked for.\r
 \r
 Arguments:\r
 \r
@@ -57,7 +57,7 @@ Arguments:
 \r
   Data -            A pointer to the data being sent to the original exporting driver.\r
 \r
-Returns: \r
+Returns:\r
 \r
 --*/\r
 {\r
@@ -170,7 +170,7 @@ Returns:
   //\r
   PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, BdsStrings);\r
   Status      = Hii->NewPack (Hii, PackageList, &gBootManagerHandle);\r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   //\r
   // This example does not implement worker functions\r
@@ -296,20 +296,20 @@ Returns:
 \r
   Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);\r
 \r
-  gBS->FreePool (UpdateData);\r
+  FreePool (UpdateData);\r
 \r
   ASSERT (gBrowser);\r
 \r
   BootMngrMenuResetRequired = FALSE;\r
   gBrowser->SendForm (\r
-              gBrowser, \r
-              TRUE, \r
-              &gBootManagerHandle, \r
-              1, \r
-              NULL, \r
-              NULL, \r
-              NULL, \r
-              NULL, \r
+              gBrowser,\r
+              TRUE,\r
+              &gBootManagerHandle,\r
+              1,\r
+              NULL,\r
+              NULL,\r
+              NULL,\r
+              NULL,\r
               &BootMngrMenuResetRequired\r
               );\r
 \r
@@ -322,12 +322,12 @@ Returns:
   if (gOption == NULL) {\r
     return ;\r
   }\r
-  \r
+\r
   //\r
   //Will leave browser, check any reset required change is applied? if yes, reset system\r
   //\r
   SetupResetReminder ();\r
-  \r
+\r
   //\r
   // BugBug: This code looks repeated from the BDS. Need to save code space.\r
   //\r
index 2da9c6fa369b6a6cc097218499148854be13ca01..7189a6e9b9120542d015bb33c2a1b4ea034b62df 100644 (file)
@@ -1,15 +1,15 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
 \r
-Module Name: \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
+Module Name:\r
 \r
   DeviceManager.c\r
 \r
@@ -51,7 +51,7 @@ Routine Description:
 \r
   This is the function that is called to provide results data to the driver.  This data\r
   consists of a unique key which is used to identify what data is either being passed back\r
-  or being asked for. \r
+  or being asked for.\r
 \r
 Arguments:\r
 \r
@@ -61,7 +61,7 @@ Arguments:
 \r
   Data -            A pointer to the data being sent to the original exporting driver.\r
 \r
-Returns: \r
+Returns:\r
 \r
 --*/\r
 {\r
@@ -103,7 +103,7 @@ Routine Description:
 \r
 Arguments:\r
   None\r
-            \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -120,7 +120,7 @@ Returns:
 \r
   PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin);\r
   Status      = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle);\r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   //\r
   // This example does not implement worker functions for the NV accessor functions.  Only a callback evaluator\r
@@ -157,7 +157,7 @@ Returns:
   //\r
   Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);\r
 \r
-  gBS->FreePool (UpdateData);\r
+  FreePool (UpdateData);\r
   return Status;\r
 }\r
 \r
@@ -168,17 +168,17 @@ CallDeviceManager (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Call the browser and display the device manager\r
 \r
 Arguments:\r
-  \r
+\r
   None\r
-  \r
+\r
 Returns:\r
   EFI_SUCCESS            - Operation is successful.\r
   EFI_INVALID_PARAMETER  - If the inputs to SendForm function is not valid.\r
-  \r
+\r
 --*/\r
 {\r
   EFI_STATUS          Status;\r
@@ -337,7 +337,7 @@ Returns:
           }\r
         }\r
 \r
-        gBS->FreePool (String);\r
+        FreePool (String);\r
 \r
         CreateGotoOpCode (\r
           0x1000,     // Device Manager Page\r
@@ -391,7 +391,7 @@ Returns:
       //\r
       // Reset Buffer pointer to original location\r
       //\r
-      gBS->FreePool (Buffer);\r
+      FreePool (Buffer);\r
     }\r
   }\r
   //\r
@@ -406,12 +406,12 @@ Returns:
     FPCallbackInfo.Data.VideoBIOS = 0;\r
   } else {\r
     FPCallbackInfo.Data.VideoBIOS = VideoOption[0];\r
-    gBS->FreePool (VideoOption);\r
+    FreePool (VideoOption);\r
   }\r
 \r
   ASSERT (FPCallbackInfo.Data.VideoBIOS <= 1);\r
 \r
-  Status = gBS->AllocatePool (EfiBootServicesData, 2 * sizeof (IFR_OPTION), &IfrOptionList);\r
+  IfrOptionList = AllocatePool (2 * sizeof (IFR_OPTION));\r
   if (IfrOptionList != NULL) {\r
     IfrOptionList[0].Flags        = EFI_IFR_FLAG_INTERACTIVE;\r
     IfrOptionList[0].Key          = SET_VIDEO_BIOS_TYPE_QUESTION_ID + 0x2000;\r
@@ -437,7 +437,7 @@ Returns:
 \r
     UpdateData->DataCount = 4;\r
     Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData);\r
-    gBS->FreePool (IfrOptionList);\r
+    FreePool (IfrOptionList);\r
   }\r
 \r
   BootDeviceMngrMenuResetRequired = FALSE;\r
@@ -490,8 +490,8 @@ Returns:
     gCallbackKey = 4;\r
   }\r
 \r
-  gBS->FreePool (UpdateData);\r
-  gBS->FreePool (HiiHandles);\r
+  FreePool (UpdateData);\r
+  FreePool (HiiHandles);\r
 \r
   return Status;\r
 }\r
index c659384d4d487e6a0d261069a3a8784fba7aca6f..62ffd8f1bd338ac2dfd4e08ab269913915e4490c 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -16,7 +16,7 @@ Module Name:
 Abstract:\r
 \r
   FrontPage routines to handle the callbacks and browser calls\r
-  \r
+\r
 --*/\r
 \r
 #include "Bds.h"\r
@@ -53,7 +53,7 @@ Routine Description:
 \r
   This is the function that is called to provide results data to the driver.  This data\r
   consists of a unique key which is used to identify what data is either being passed back\r
-  or being asked for. \r
+  or being asked for.\r
 \r
 Arguments:\r
 \r
@@ -63,7 +63,7 @@ Arguments:
 \r
   Data -            A pointer to the data being sent to the original exporting driver.\r
 \r
-Returns: \r
+Returns:\r
 \r
 --*/\r
 {\r
@@ -136,7 +136,7 @@ Returns:
                     Lang\r
                     );\r
 \r
-    gBS->FreePool (LanguageString);\r
+    FreePool (LanguageString);\r
     gCallbackKey = 2;\r
     break;\r
 \r
@@ -179,7 +179,7 @@ Returns:
         (UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data),\r
         0\r
         );\r
-      gBS->FreePool (TmpStr);\r
+      FreePool (TmpStr);\r
     }\r
     break;\r
 \r
@@ -198,12 +198,12 @@ InitializeFrontPage (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Initialize HII information for the FrontPage\r
 \r
 Arguments:\r
   None\r
-            \r
+\r
 Returns:\r
   EFI_SUCCESS       - The operation is successful.\r
   EFI_DEVICE_ERROR  - If the dynamic opcode creation failed.\r
@@ -254,7 +254,7 @@ Returns:
 \r
   Status        = Hii->NewPack (Hii, PackageList, &gFrontPageHandle);\r
 \r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 \r
   //\r
   // There will be only one FormConfig in the system\r
@@ -364,11 +364,11 @@ ReInitStrings:
     OptionCount++;\r
   }\r
 \r
-  gBS->FreePool (LanguageString);\r
+  FreePool (LanguageString);\r
 \r
   if (ReInitializeStrings) {\r
-    gBS->FreePool (StringBuffer);\r
-    gBS->FreePool (OptionList);\r
+    FreePool (StringBuffer);\r
+    FreePool (OptionList);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -389,11 +389,11 @@ ReInitStrings:
 \r
   Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);\r
 \r
-  gBS->FreePool (UpdateData);\r
+  FreePool (UpdateData);\r
   //\r
-  // gBS->FreePool (OptionList);\r
+  // FreePool (OptionList);\r
   //\r
-  gBS->FreePool (StringBuffer);\r
+  FreePool (StringBuffer);\r
   return Status;\r
 }\r
 \r
@@ -404,13 +404,13 @@ CallFrontPage (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Call the browser and display the front page\r
 \r
 Arguments:\r
-  \r
+\r
   None\r
-  \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -442,7 +442,7 @@ Returns:
                       );\r
   //\r
   // Check whether user change any option setting which needs a reset to be effective\r
-  //                      \r
+  //\r
   if (FrontPageMenuResetRequired) {\r
     EnableResetRequired ();\r
   }\r
@@ -461,15 +461,15 @@ GetStringFromToken (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Acquire the string associated with the ProducerGuid and return it.\r
 \r
 Arguments:\r
-  \r
+\r
   ProducerGuid - The Guid to search the HII database for\r
   Token - The token value of the string to extract\r
   String - The string that is extracted\r
-  \r
+\r
 Returns:\r
 \r
   EFI_SUCCESS - The function returns EFI_SUCCESS always.\r
@@ -529,11 +529,11 @@ Returns:
                   );\r
 \r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (*String);\r
+    FreePool (*String);\r
     *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
   }\r
 \r
-  gBS->FreePool (HiiHandleBuffer);\r
+  FreePool (HiiHandleBuffer);\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -545,14 +545,14 @@ ConvertProcessorToString (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Convert Processor Frequency Data to a string\r
 \r
 Arguments:\r
-  \r
+\r
   ProcessorFrequency - The frequency data to process\r
   String - The string that is created\r
-  \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -590,14 +590,14 @@ ConvertMemorySizeToString (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Convert Memory Size to a string\r
 \r
 Arguments:\r
-  \r
+\r
   MemorySize - The size of the memory to process\r
   String - The string that is created\r
-  \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -621,13 +621,13 @@ UpdateFrontPageStrings (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Update the banner information for the Front Page based on DataHub information\r
 \r
 Arguments:\r
-  \r
+\r
   None\r
-  \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -689,7 +689,7 @@ Returns:
         GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString);\r
         TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION;\r
         Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);\r
-        gBS->FreePool (NewString);\r
+        FreePool (NewString);\r
         Find[0] = TRUE;\r
       }\r
 \r
@@ -700,7 +700,7 @@ Returns:
         GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString);\r
         TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL;\r
         Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);\r
-        gBS->FreePool (NewString);\r
+        FreePool (NewString);\r
         Find[1] = TRUE;\r
       }\r
 \r
@@ -711,7 +711,7 @@ Returns:
         GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString);\r
         TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL;\r
         Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);\r
-        gBS->FreePool (NewString);\r
+        FreePool (NewString);\r
         Find[2] = TRUE;\r
       }\r
 \r
@@ -722,7 +722,7 @@ Returns:
         ConvertProcessorToString (ProcessorFrequency, &NewString);\r
         TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED;\r
         Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);\r
-        gBS->FreePool (NewString);\r
+        FreePool (NewString);\r
         Find[3] = TRUE;\r
       }\r
 \r
@@ -730,12 +730,12 @@ Returns:
           (DataHeader->RecordType == EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER)\r
           ) {\r
         MemoryArray = (EFI_MEMORY_ARRAY_START_ADDRESS_DATA *) (DataHeader + 1);\r
-        ConvertMemorySizeToString((UINT32)(RShiftU64((MemoryArray->MemoryArrayEndAddress - \r
+        ConvertMemorySizeToString((UINT32)(RShiftU64((MemoryArray->MemoryArrayEndAddress -\r
                                   MemoryArray->MemoryArrayStartAddress + 1), 20)),\r
                                   &NewString);\r
         TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE;\r
         Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);\r
-        gBS->FreePool (NewString);\r
+        FreePool (NewString);\r
         Find[4] = TRUE;\r
       }\r
     }\r
@@ -753,15 +753,15 @@ PlatformBdsEnterFrontPage (
 \r
 Routine Description:\r
   This function is the main entry of the platform setup entry.\r
-  The function will present the main menu of the system setup, \r
+  The function will present the main menu of the system setup,\r
   this is the platform reference part and can be customize.\r
-  \r
+\r
 Arguments:\r
   TimeoutDefault     - The fault time out value before the system\r
                        continue to boot.\r
   ConnectAllHappened - The indicater to check if the connect all have\r
                        already happended.\r
-  \r
+\r
 Returns:\r
   None\r
 \r
@@ -890,7 +890,7 @@ Returns:
   //Will leave browser, check any reset required change is applied? if yes, reset system\r
   //\r
   SetupResetReminder ();\r
-  \r
+\r
   //\r
   // Automatically load current entry\r
   // Note: The following lines of code only execute when Auto boot\r
index 21d61f11358351450c429e4901e2b505bcb0fc94..7057cab3deead1eb6fa99404ff0d48dc15001835 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -16,7 +16,7 @@ Module Name:
 Abstract:\r
 \r
  Language settings\r
-  \r
+\r
 Revision History\r
 \r
 --*/\r
@@ -311,7 +311,7 @@ Routine Description:
 \r
 Arguments:\r
   None\r
-            \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -326,7 +326,7 @@ Returns:
   HiiHandle = 0;\r
   Hii->NewPack (Hii, PackageList, &HiiHandle);\r
 \r
-  gBS->FreePool (PackageList);\r
+  FreePool (PackageList);\r
 }\r
 \r
 VOID\r
@@ -336,12 +336,12 @@ InitializeLanguage (
 /*++\r
 \r
 Routine Description:\r
-  Determine the current language that will be used \r
+  Determine the current language that will be used\r
   based on language related EFI Variables\r
 \r
 Arguments:\r
   LangCodesSettingRequired - If required to set LangCode variable\r
-            \r
+\r
 Returns:\r
 \r
 --*/\r
@@ -421,11 +421,11 @@ Returns:
   }\r
 \r
   if (LangCodes) {\r
-    gBS->FreePool (LangCodes);\r
+    FreePool (LangCodes);\r
   }\r
 \r
   if (LanguageString != NULL) {\r
-    gBS->FreePool (LanguageString);\r
+    FreePool (LanguageString);\r
   }\r
 \r
 }\r
index d4e5bc50efc0dad52310450c9e6271713ac9d756..40467c0e4f30454dcc917a84d3336b34978ce783 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -38,19 +38,19 @@ PlatformBdsShowProgress (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Show progress bar with title above it. It only works in UGA mode.\r
 \r
 Arguments:\r
-  \r
+\r
   TitleForeground - Foreground color for Title.\r
   TitleBackground - Background color for Title.\r
   Title           - Title above progress bar.\r
   ProgressColor   - Progress bar color.\r
   Progress        - Progress (0-100)\r
 \r
-Returns: \r
-  \r
+Returns:\r
+\r
   EFI_STATUS      - Success update the progress bar\r
 \r
 --*/\r
@@ -203,19 +203,19 @@ BdsMemoryTest (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  Perform the memory test base on the memory test intensive level, \r
+\r
+  Perform the memory test base on the memory test intensive level,\r
   and update the memory resource.\r
 \r
 Arguments:\r
-  \r
+\r
   Level  - The memory test intensive level.\r
 \r
-Returns: \r
-  \r
+Returns:\r
+\r
   EFI_STATUS      - Success test all the system memory and update\r
                     the memory resource\r
-                    \r
+\r
 --*/\r
 {\r
   EFI_STATUS                        Status;\r
@@ -274,7 +274,7 @@ Returns:
                   &GenMemoryTest\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (Pos);\r
+    FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -291,7 +291,7 @@ Returns:
     // do the test, and then the status of EFI_NO_MEDIA will be returned by\r
     // "MemoryTestInit". So it does not need to test memory again, just return.\r
     //\r
-    gBS->FreePool (Pos);\r
+    FreePool (Pos);\r
     return EFI_SUCCESS;\r
   }\r
 \r
@@ -300,7 +300,7 @@ Returns:
 \r
   if (TmpStr != NULL) {\r
     gST->ConOut->OutputString (gST->ConOut, TmpStr);\r
-    gBS->FreePool (TmpStr);\r
+    FreePool (TmpStr);\r
   }\r
 \r
   do {\r
@@ -317,7 +317,7 @@ Returns:
         PrintXY (10, 10, NULL, NULL, TmpStr);\r
         gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4);\r
         gST->ConOut->OutputString (gST->ConOut, TmpStr);\r
-        gBS->FreePool (TmpStr);\r
+        FreePool (TmpStr);\r
       }\r
 \r
       ASSERT (0);\r
@@ -333,7 +333,7 @@ Returns:
       TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));\r
       if (TmpStr != NULL) {\r
         BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL);\r
-        gBS->FreePool (TmpStr);\r
+        FreePool (TmpStr);\r
       }\r
 \r
       TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));\r
@@ -346,7 +346,7 @@ Returns:
           TestPercent,\r
           (UINTN) PreviousValue\r
           );\r
-        gBS->FreePool (TmpStr);\r
+        FreePool (TmpStr);\r
       }\r
     }\r
 \r
@@ -365,7 +365,7 @@ Returns:
             100,\r
             (UINTN) PreviousValue\r
             );\r
-          gBS->FreePool (TmpStr);\r
+          FreePool (TmpStr);\r
         }\r
 \r
         gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);\r
@@ -389,7 +389,7 @@ Done:
   TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));\r
   if (TmpStr != NULL) {\r
     StrCat (StrTotalMemory, TmpStr);\r
-    gBS->FreePool (TmpStr);\r
+    FreePool (TmpStr);\r
   }\r
 \r
   gST->ConOut->ClearScreen (gST->ConOut);\r
@@ -405,7 +405,7 @@ Done:
     (UINTN) PreviousValue\r
     );\r
 \r
-  gBS->FreePool (Pos);\r
+  FreePool (Pos);\r
 \r
   DataSize = sizeof (Value);\r
   Status = gRT->GetVariable (\r
index 412b7f8f17909da9dab28a670ae5e1744e989734..604528d96a7fea501ced551760b1e29c02854854 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -36,7 +36,7 @@ InitializeStringSupport (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Initialize HII global accessor for string support\r
 \r
 Arguments:\r
@@ -60,7 +60,7 @@ Returns:
   if (!EFI_ERROR (Status)) {\r
     PackageList = PreparePackages (1, &gBdsStringPackGuid, BdsStrings);\r
     Status      = Hii->NewPack (Hii, PackageList, &gStringPackHandle);\r
-    gBS->FreePool (PackageList);\r
+    FreePool (PackageList);\r
   }\r
 \r
   return Status;\r
@@ -79,7 +79,7 @@ Routine Description:
 Arguments:\r
 \r
   Id       - String ID.\r
-           \r
+\r
 Returns:\r
 \r
   CHAR16 * - String from ID.\r
@@ -112,7 +112,7 @@ Returns:
       //\r
       // Free the old pool\r
       //\r
-      gBS->FreePool (String);\r
+      FreePool (String);\r
 \r
       //\r
       // Allocate new pool with correct value\r
index dd815789c656c114f839ff20a192b230b7f5ab63..83532e222b701e87047947ab16912836320db32e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation\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
@@ -148,7 +148,7 @@ WinNtBlockIoDriverDiagnosticsRunDiagnostics (
   if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {\r
     *ErrorType  = &gEfiBlockIoProtocolGuid;\r
     *BufferSize = 0x60;\r
-    gBS->AllocatePool (EfiBootServicesData, (UINTN) (*BufferSize), Buffer);\r
+    Buffer = AllocatePool ((UINTN) (*BufferSize));\r
     CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);\r
     return EFI_DEVICE_ERROR;\r
   }\r
index 5e7a985ed6cbe40d68ab68371350a80115898d21..5666ec28ec3c90d06814c5b3de3020b52db9ad76 100644 (file)
@@ -346,7 +346,7 @@ Returns:
     //\r
     FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-    gBS->FreePool (Private);\r
+    FreePool (Private);\r
   }\r
 \r
   return Status;\r
@@ -430,12 +430,8 @@ Returns:
 \r
   WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS);\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_BLOCK_IO_PRIVATE),\r
-                  &Private\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  Private = AllocatePool (sizeof (WIN_NT_BLOCK_IO_PRIVATE));\r
+  ASSERT (Private != NULL);\r
 \r
   EfiInitializeLock (&Private->Lock, EFI_TPL_NOTIFY);\r
 \r
@@ -518,7 +514,7 @@ Returns:
                     );\r
     if (EFI_ERROR (Status)) {\r
       FreeUnicodeStringTable (Private->ControllerNameTable);\r
-      gBS->FreePool (Private);\r
+      FreePool (Private);\r
     }\r
 \r
     DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename));\r
index 305184531c4fcb4686d6ee7e23db26936d393523..e6ba0f0bb72083a5de0b976a7e681a56bb8709bf 100644 (file)
@@ -46,6 +46,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtBlockIo.h</Filename>\r
index 0027069b7aa433f15bfeaae4838f4b2847a204e5..e32ffe80d55efd60605ce900ff8c85ac91e0244e 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -15,7 +15,7 @@ Module Name:
 \r
 Abstract:\r
 \r
-  Console based on Win32 APIs. \r
+  Console based on Win32 APIs.\r
 \r
 --*/\r
 \r
@@ -164,12 +164,8 @@ Returns:
     return Status;\r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA),\r
-                  &Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  Private = AllocatePool (sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA));\r
+  if (Private == NULL) {\r
     goto Done;\r
   }\r
 \r
@@ -214,7 +210,7 @@ Done:
       gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
     }\r
 \r
-    gBS->FreePool (Private);\r
+    FreePool (Private);\r
   }\r
 \r
   return Status;\r
@@ -300,7 +296,7 @@ Returns:
     //\r
     FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-    gBS->FreePool (Private);\r
+    FreePool (Private);\r
   }\r
 \r
   return Status;\r
index 3af1ce657034b15821ed437f33eda3de789e6576..a4e2b3fece7114203ae1bbdb3601c412ac5df8e5 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -15,15 +15,15 @@ Module Name:
 \r
 Abstract:\r
 \r
-  Console based on Win32 APIs. \r
+  Console based on Win32 APIs.\r
 \r
   This file attaches a SimpleTextIn protocol to a previously open window.\r
-  \r
+\r
   The constructor for this protocol depends on an open window. Currently\r
   the SimpleTextOut protocol creates a window when it's constructor is called.\r
-  Thus this code must run after the constructor for the SimpleTextOut \r
+  Thus this code must run after the constructor for the SimpleTextOut\r
   protocol\r
-  \r
+\r
 --*/\r
 \r
 #include "Console.h"\r
@@ -102,7 +102,7 @@ Returns:
   } else {\r
     return EFI_NOT_READY;\r
   }\r
-  \r
+\r
   //\r
   // Check to see if we should return a scan code in place of Unicode character.\r
   //\r
@@ -280,12 +280,8 @@ Returns:
     goto Done;\r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (INPUT_RECORD) * NtEventCount,\r
-                  &InputRecord\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  InputRecord = AllocatePool (sizeof (INPUT_RECORD) * NtEventCount);\r
+  if (InputRecord == NULL) {\r
     Status = EFI_NOT_READY;\r
     goto Done;\r
   }\r
@@ -315,7 +311,7 @@ Returns:
 \r
 Done:\r
   if (InputRecord != NULL) {\r
-    gBS->FreePool (InputRecord);\r
+    FreePool (InputRecord);\r
   }\r
 \r
   return Status;\r
index 8d8375b9d67c22423d9e18d64ed2b3fa4a625dc8..f60a5d1a66ee2df110ba40e695efa96c4a1c5866 100644 (file)
@@ -43,6 +43,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>Console.h</Filename>\r
index d820d9aea94342f7197dad8a9f7f2bedb096c441..387425279120f4f641889c17d7cc548c10d0daa0 100644 (file)
@@ -46,6 +46,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtGopScreen.c</Filename>\r
index 60131659967eb2a9fe00bb86bfe8bf6a58db9675..bf2abc40673f680258f329b96b717863e41eb352 100644 (file)
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, 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
@@ -125,12 +125,8 @@ WinNtGopDriverBindingStart (
   // Allocate Private context data for SGO inteface.
   //
   Private = NULL;
-  Status = gBS->AllocatePool (
-                  EfiBootServicesData,
-                  sizeof (GOP_PRIVATE_DATA),
-                  &Private
-                  );
-  if (EFI_ERROR (Status)) {
+  Private = AllocatePool (sizeof (GOP_PRIVATE_DATA));
+  if (Private == NULL) {
     goto Done;
   }
   //
@@ -185,7 +181,7 @@ Done:
         FreeUnicodeStringTable (Private->ControllerNameTable);
       }
 
-      gBS->FreePool (Private);
+      FreePool (Private);
     }
   }
 
@@ -270,7 +266,7 @@ WinNtGopDriverBindingStop (
     //
     FreeUnicodeStringTable (Private->ControllerNameTable);
 
-    gBS->FreePool (Private);
+    FreePool (Private);
 
   }
 
index 47d849bd0a7352080f1d0df8d6aa1bdbe7e7ac1e..89a5e4d29817861a457b9ec4c9013f21ed31e3a6 100644 (file)
@@ -85,7 +85,6 @@ WinNtGopQuerytMode (
   OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info
   )
 {
-  EFI_STATUS        Status;
   GOP_PRIVATE_DATA  *Private;
 
   Private = GOP_PRIVATE_DATA_FROM_THIS (This);
@@ -94,13 +93,9 @@ WinNtGopQuerytMode (
     return EFI_INVALID_PARAMETER;
   }
 
-  Status = gBS->AllocatePool (
-                  EfiBootServicesData,
-                  sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
-                  Info
-                  );
-  if (EFI_ERROR (Status)) {
-    return Status;
+  *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+  if (*Info == NULL) {
+    return EFI_OUT_OF_RESOURCES;
   }
 
   *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
@@ -242,17 +237,13 @@ WinNtGopSetMode (
 
   }
 
-  Status = gBS->AllocatePool (
-                  EfiBootServicesData,
-                  sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution,
-                  &NewFillLine
-                  );
-  if (EFI_ERROR (Status)) {
+  NewFillLine = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution);
+  if (NewFillLine == NULL) {
     return EFI_DEVICE_ERROR;
   }
 
   if (Private->FillLine != NULL) {
-    gBS->FreePool (Private->FillLine);
+    FreePool (Private->FillLine);
   }
 
   Private->FillLine             = NewFillLine;
@@ -637,7 +628,7 @@ WinNtGopThreadWindowProc (
     case VK_F8:   Key.ScanCode = SCAN_F8;   break;
     case VK_F9:   Key.ScanCode = SCAN_F9;   break;
     case VK_F11:  Key.ScanCode = SCAN_F11;  break;
-    case VK_F12:  Key.ScanCode = SCAN_F12;  break;    
+    case VK_F12:  Key.ScanCode = SCAN_F12;  break;
     }
 
     if (Key.ScanCode != 0) {
@@ -885,8 +876,6 @@ WinNtGopConstructor (
   GOP_PRIVATE_DATA    *Private
   )
 {
-  EFI_STATUS                             Status;
-
   Private->ModeData = mGopModeData;
 
   Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode;
@@ -896,22 +885,15 @@ WinNtGopConstructor (
   //
   // Allocate buffer for Graphics Output Protocol mode information
   //
-  Status = gBS->AllocatePool (
-                EfiBootServicesData,
-                sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE),
-                (VOID **) &Private->GraphicsOutput.Mode
-                );
-  if (EFI_ERROR (Status)) {
-    return Status;
+  Private->GraphicsOutput.Mode = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
+  if (Private->GraphicsOutput.Mode == NULL) {
+    return EFI_OUT_OF_RESOURCES;
   }
-  Status = gBS->AllocatePool (
-                EfiBootServicesData,
-                sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
-                (VOID **) &Private->GraphicsOutput.Mode->Info
-                );
-  if (EFI_ERROR (Status)) {
-    return Status;
+  Private->GraphicsOutput.Mode->Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
+  if (Private->GraphicsOutput.Mode->Info == NULL) {
+    return EFI_OUT_OF_RESOURCES;
   }
+
   Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA);
   //
   // Till now, we have no idea about the window size.
@@ -982,9 +964,9 @@ WinNtGopDestructor (
   //
   if (Private->GraphicsOutput.Mode != NULL) {
     if (Private->GraphicsOutput.Mode->Info != NULL) {
-        gBS->FreePool (Private->GraphicsOutput.Mode->Info);
+      FreePool (Private->GraphicsOutput.Mode->Info);
     }
-    gBS->FreePool (Private->GraphicsOutput.Mode);
+    FreePool (Private->GraphicsOutput.Mode);
   }
 
   return EFI_SUCCESS;
index a4a7a32b5416307875a9c2759caae2f7ca975dd8..3de4a86128f559970b478f568e8ecfa437bc9339 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -20,7 +20,7 @@ Abstract:
 \r
   Handle(1) - WinNtIo - DevicePath(1)\r
 \r
-  If a serial port is added to the system this driver creates a new handle. \r
+  If a serial port is added to the system this driver creates a new handle.\r
   The new handle is required, since the serial device must add an UART device\r
   pathnode.\r
 \r
@@ -32,15 +32,15 @@ Abstract:
 \r
   Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort\r
 \r
-  If the driver is unloaded Handle(2) is removed from the system and \r
+  If the driver is unloaded Handle(2) is removed from the system and\r
   gEfiWinNtSerialPortGuid is removed from Handle(1).\r
 \r
   Note: Handle(1) is any handle created by the Win NT Bus driver that is passed\r
   into the DriverBinding member functions of this driver. This driver requires\r
-  a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and \r
-  the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid. \r
-  \r
-  If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is \r
+  a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and\r
+  the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid.\r
+\r
+  If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is\r
   loaded on the device.\r
 \r
 --*/\r
@@ -135,7 +135,7 @@ Returns:
     Status = EFI_UNSUPPORTED;\r
     goto Error;\r
   }\r
-  \r
+\r
   //\r
   // Check the GUID to see if this is a handle type the driver supports\r
   //\r
@@ -309,7 +309,7 @@ Returns:
       }\r
     }\r
 \r
-    gBS->FreePool (OpenInfoBuffer);\r
+    FreePool (OpenInfoBuffer);\r
     return Status;\r
   }\r
 \r
@@ -334,12 +334,8 @@ Returns:
   //\r
   // Construct Private data\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA),\r
-                  &Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));\r
+  if (Private == NULL) {\r
     goto Error;\r
   }\r
 \r
@@ -474,12 +470,12 @@ Error:
       }\r
 \r
       if (Private->DevicePath != NULL) {\r
-        gBS->FreePool (Private->DevicePath);\r
+        FreePool (Private->DevicePath);\r
       }\r
 \r
       FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-      gBS->FreePool (Private);\r
+      FreePool (Private);\r
     }\r
   }\r
 \r
@@ -592,11 +588,11 @@ Returns:
       } else {\r
         Private->WinNtThunk->CloseHandle (Private->NtHandle);\r
 \r
-        gBS->FreePool (Private->DevicePath);\r
+        FreePool (Private->DevicePath);\r
 \r
         FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-        gBS->FreePool (Private);\r
+        FreePool (Private);\r
       }\r
     }\r
 \r
@@ -683,7 +679,7 @@ Routine Description:
 \r
 Arguments:\r
 \r
-  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.    \r
+  This              - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.\r
   BaudRate          - The Baud rate of the serial device.\r
   ReceiveFifoDepth  - The request depth of fifo on receive side.\r
   Timeout           - the request timeout for a single charact.\r
@@ -869,7 +865,7 @@ Returns:
   }\r
 \r
   if (Private->DevicePath != NULL) {\r
-    gBS->FreePool (Private->DevicePath);\r
+    FreePool (Private->DevicePath);\r
   }\r
 \r
   Private->DevicePath = NewDevicePath;\r
@@ -1029,7 +1025,7 @@ Returns:
   if (ModemStatus & MS_RLSD_ON) {\r
     Bits |= EFI_SERIAL_CARRIER_DETECT;\r
   }\r
-  \r
+\r
   //\r
   // Get ctrl status\r
   //\r
@@ -1059,7 +1055,7 @@ Returns:
   if (Private->HardwareLoopbackEnable) {\r
     Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
   }\r
-  \r
+\r
   //\r
   //  Get input buffer status\r
   //\r
@@ -1145,7 +1141,7 @@ Returns:
         Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
         WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
       }\r
-      \r
+\r
       //\r
       //  Do the write\r
       //\r
@@ -1285,10 +1281,10 @@ IsaSerialFifoFull (
 \r
   Routine Description:\r
   Detect whether specific FIFO is full or not\r
-  \r
+\r
   Arguments:\r
   Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    \r
+\r
   Returns:\r
   TRUE:  the FIFO is full\r
   FALSE: the FIFO is not full\r
@@ -1310,10 +1306,10 @@ IsaSerialFifoEmpty (
 \r
   Routine Description:\r
   Detect whether specific FIFO is empty or not\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    \r
+\r
   Returns:\r
     TRUE:  the FIFO is empty\r
     FALSE: the FIFO is not empty\r
@@ -1336,14 +1332,14 @@ IsaSerialFifoAdd (
 \r
   Routine Description:\r
   Add data to specific FIFO\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8: the data added to FIFO  \r
-  \r
+    Data  UINT8: the data added to FIFO\r
+\r
   Returns:\r
     EFI_SUCCESS:  Add data to specific FIFO successfully\r
-    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full \r
+    EFI_OUT_RESOURCE: Failed to add data because FIFO is already full\r
 \r
 --*/\r
 // TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
@@ -1354,7 +1350,7 @@ IsaSerialFifoAdd (
   if (IsaSerialFifoFull (Fifo)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // FIFO is not full can add data\r
   //\r
@@ -1377,11 +1373,11 @@ IsaSerialFifoRemove (
 \r
   Routine Description:\r
   Remove data from specific FIFO\r
-  \r
+\r
   Arguments:\r
     Fifo  SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO\r
-    Data  UINT8*: the data removed from FIFO  \r
-  \r
+    Data  UINT8*: the data removed from FIFO\r
+\r
   Returns:\r
     EFI_SUCCESS:  Remove data from specific FIFO successfully\r
     EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty\r
@@ -1395,7 +1391,7 @@ IsaSerialFifoRemove (
   if (IsaSerialFifoEmpty (Fifo)) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // FIFO is not empty, can remove data\r
   //\r
index 63614a1d1ac38da49405b0baaa44375e6a4047d5..e2cf66e2d1a60bcf7b39b89b632be3b22d80003e 100644 (file)
@@ -47,6 +47,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>DevicePathLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtSerialIo.h</Filename>\r
index d55a153f9b9900c5656fed7b9cde0214305c9953..28fd819b1d38bff77f4c40c4f57a10ffa2555be4 100644 (file)
@@ -1,13 +1,13 @@
 /*++\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
-                                                                                          \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 - 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
+\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
 Module Name:\r
 \r
@@ -16,8 +16,8 @@ Module Name:
 Abstract:\r
 \r
   Produce Simple File System abstractions for directories on your PC using Win32 APIs.\r
-  The configuration of what devices to mount or emulate comes from NT \r
-  environment variables. The variables must be visible to the Microsoft* \r
+  The configuration of what devices to mount or emulate comes from NT\r
+  environment variables. The variables must be visible to the Microsoft*\r
   Developer Studio for them to work.\r
 \r
   * Other names and brands may be claimed as the property of others.\r
@@ -142,7 +142,7 @@ Returns:
     for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
       *Pointer = *(Pointer + Count);\r
     }\r
-    *Pointer = *(Pointer + Count);    \r
+    *Pointer = *(Pointer + Count);\r
   }\r
 }\r
 \r
@@ -284,12 +284,10 @@ Returns:
     goto Done;\r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE),\r
-                  &Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  Private = AllocatePool (sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE));\r
+  if (Private == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
+\r
     goto Done;\r
   }\r
 \r
@@ -298,14 +296,9 @@ Returns:
 \r
   Private->FilePath = WinNtIo->EnvString;\r
 \r
-  Private->VolumeLabel      = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (L"EFI_EMULATED"),\r
-                  &Private->VolumeLabel\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  Private->VolumeLabel = AllocatePool (StrSize (L"EFI_EMULATED"));\r
+  if (Private->VolumeLabel == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -339,7 +332,7 @@ Done:
 \r
       FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-      gBS->FreePool (Private);\r
+      FreePool (Private);\r
     }\r
 \r
     gBS->CloseProtocol (\r
@@ -431,7 +424,7 @@ Returns:
     //\r
     FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-    gBS->FreePool (Private);\r
+    FreePool (Private);\r
   }\r
 \r
   return Status;\r
@@ -489,33 +482,21 @@ Returns:
 \r
   Private     = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  PrivateFile = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_EFI_FILE_PRIVATE),\r
-                  &PrivateFile\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  PrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
+  if (PrivateFile == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
-  PrivateFile->FileName = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (Private->FilePath),\r
-                  &PrivateFile->FileName\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  PrivateFile->FileName = AllocatePool (StrSize (Private->FilePath));\r
+  if (PrivateFile->FileName == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
-  PrivateFile->FilePath = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (Private->FilePath),\r
-                  &PrivateFile->FilePath\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  PrivateFile->FilePath = AllocatePool (StrSize (Private->FilePath));\r
+  if (PrivateFile->FilePath == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -541,7 +522,7 @@ Returns:
   PrivateFile->LHandle              = INVALID_HANDLE_VALUE;\r
   PrivateFile->DirHandle            = INVALID_HANDLE_VALUE;\r
   PrivateFile->IsValidFindBuf       = FALSE;\r
-  \r
+\r
   *Root = &PrivateFile->EfiFile;\r
 \r
   Status = EFI_SUCCESS;\r
@@ -550,14 +531,14 @@ Done:
   if (EFI_ERROR (Status)) {\r
     if (PrivateFile) {\r
       if (PrivateFile->FileName) {\r
-        gBS->FreePool (PrivateFile->FileName);\r
+        FreePool (PrivateFile->FileName);\r
       }\r
 \r
       if (PrivateFile->FilePath) {\r
-        gBS->FreePool (PrivateFile->FilePath);\r
+        FreePool (PrivateFile->FilePath);\r
       }\r
 \r
-      gBS->FreePool (PrivateFile);\r
+      FreePool (PrivateFile);\r
     }\r
   }\r
 \r
@@ -675,13 +656,9 @@ Returns:
   //\r
   // Allocate buffer for FileName as the passed in FileName may be read only\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (FileName),\r
-                  &TempFileName\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return  Status;\r
+  TempFileName = AllocatePool (StrSize (FileName));\r
+  if (TempFileName == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
   }\r
   StrCpy (TempFileName, FileName);\r
   FileName = TempFileName;\r
@@ -705,7 +682,7 @@ OpenRoot:
   }\r
 \r
   //\r
-  // If file name does not equal to "." or "..", \r
+  // If file name does not equal to "." or "..",\r
   // then we trim the leading/trailing blanks and trailing dots\r
   //\r
   if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0) {\r
@@ -722,7 +699,7 @@ OpenRoot:
     //\r
     // Trim trailing dots and blanks\r
     //\r
-    for (TempFileName = FileName + StrLen (FileName) - 1; \r
+    for (TempFileName = FileName + StrLen (FileName) - 1;\r
       TempFileName >= FileName && (*TempFileName == L' ' || *TempFileName == L'.');\r
       TempFileName--) {\r
       ;\r
@@ -733,27 +710,17 @@ OpenRoot:
   //\r
   // Attempt to open the file\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (WIN_NT_EFI_FILE_PRIVATE),\r
-                  &NewPrivateFile\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  NewPrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
+  if (NewPrivateFile == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
   CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE));\r
 \r
-  NewPrivateFile->FilePath = NULL;\r
-\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (PrivateFile->FileName),\r
-                  &NewPrivateFile->FilePath\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  NewPrivateFile->FilePath = AllocatePool (StrSize (PrivateFile->FileName));\r
+  if (NewPrivateFile->FilePath == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -763,14 +730,9 @@ OpenRoot:
     StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath);\r
   }\r
 \r
-  NewPrivateFile->FileName = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName),\r
-                  &NewPrivateFile->FileName\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  NewPrivateFile->FileName = AllocatePool (StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName));\r
+  if (NewPrivateFile->FileName == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -783,7 +745,7 @@ OpenRoot:
     if (StrCmp (FileName, L"") != 0) {\r
       //\r
       // In case the filename becomes empty, especially after trimming dots and blanks\r
-      //    \r
+      //\r
       StrCat (NewPrivateFile->FileName, L"\\");\r
       StrCat (NewPrivateFile->FileName, FileName);\r
     }\r
@@ -847,9 +809,9 @@ OpenRoot:
 \r
   if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) {\r
     NewPrivateFile->IsRootDirectory = TRUE;\r
-    gBS->FreePool (NewPrivateFile->FilePath);\r
-    gBS->FreePool (NewPrivateFile->FileName);\r
-    gBS->FreePool (NewPrivateFile);\r
+    FreePool (NewPrivateFile->FilePath);\r
+    FreePool (NewPrivateFile->FileName);\r
+    FreePool (NewPrivateFile);\r
     goto OpenRoot;\r
   }\r
 \r
@@ -861,15 +823,11 @@ OpenRoot:
   TempChar            = *(RealFileName - 1);\r
   *(RealFileName - 1) = 0;\r
 \r
-  gBS->FreePool (NewPrivateFile->FilePath);\r
+  FreePool (NewPrivateFile->FilePath);\r
   NewPrivateFile->FilePath = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (NewPrivateFile->FileName),\r
-                  &NewPrivateFile->FilePath\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  NewPrivateFile->FilePath = AllocatePool (StrSize (NewPrivateFile->FileName));\r
+  if (NewPrivateFile->FilePath == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -923,13 +881,9 @@ OpenRoot:
   //\r
   if (NewPrivateFile->IsDirectoryPath) {\r
 \r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"),\r
-                    &TempFileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    TempFileName = AllocatePool (StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"));\r
+    if (TempFileName == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -943,7 +897,7 @@ OpenRoot:
 \r
         LastError = PrivateFile->WinNtThunk->GetLastError ();\r
         if (LastError != ERROR_ALREADY_EXISTS) {\r
-          gBS->FreePool (TempFileName);\r
+          FreePool (TempFileName);\r
           Status = EFI_ACCESS_DENIED;\r
           goto Done;\r
         }\r
@@ -1059,13 +1013,9 @@ OpenRoot:
       goto Done;\r
     }\r
 \r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    InfoSize,\r
-                    &Info\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    Info = AllocatePool (InfoSize);\r
+    if (Info == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -1081,19 +1031,19 @@ OpenRoot:
   }\r
 \r
 Done: ;\r
-  gBS->FreePool (FileName);\r
+  FreePool (FileName);\r
 \r
   if (EFI_ERROR (Status)) {\r
     if (NewPrivateFile) {\r
       if (NewPrivateFile->FileName) {\r
-        gBS->FreePool (NewPrivateFile->FileName);\r
+        FreePool (NewPrivateFile->FileName);\r
       }\r
 \r
       if (NewPrivateFile->FilePath) {\r
-        gBS->FreePool (NewPrivateFile->FilePath);\r
+        FreePool (NewPrivateFile->FilePath);\r
       }\r
 \r
-      gBS->FreePool (NewPrivateFile);\r
+      FreePool (NewPrivateFile);\r
     }\r
   } else {\r
     *NewHandle = &NewPrivateFile->EfiFile;\r
@@ -1132,7 +1082,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {\r
@@ -1151,13 +1101,13 @@ Returns:
   }\r
 \r
   if (PrivateFile->FileName) {\r
-    gBS->FreePool (PrivateFile->FileName);\r
+    FreePool (PrivateFile->FileName);\r
   }\r
 \r
-  gBS->FreePool (PrivateFile);\r
+  FreePool (PrivateFile);\r
 \r
   gBS->RestoreTPL (OldTpl);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -1194,7 +1144,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   Status      = EFI_WARN_DELETE_FAILURE;\r
@@ -1223,8 +1173,8 @@ Returns:
     }\r
   }\r
 \r
-  gBS->FreePool (PrivateFile->FileName);\r
-  gBS->FreePool (PrivateFile);\r
+  FreePool (PrivateFile->FileName);\r
+  FreePool (PrivateFile);\r
 \r
   gBS->RestoreTPL (OldTpl);\r
 \r
@@ -1328,7 +1278,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
@@ -1344,11 +1294,7 @@ Returns:
     }\r
 \r
     FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO;\r
-    gBS->AllocatePool (\r
-          EfiBootServicesData,\r
-          FileInfoSize,\r
-          &FileInfo\r
-          );\r
+    FileInfo = AllocatePool (FileInfoSize);\r
 \r
     Status = This->GetInfo (\r
                     This,\r
@@ -1358,12 +1304,8 @@ Returns:
                     );\r
 \r
     if (Status == EFI_BUFFER_TOO_SMALL) {\r
-      gBS->FreePool (FileInfo);\r
-      gBS->AllocatePool (\r
-            EfiBootServicesData,\r
-            FileInfoSize,\r
-            &FileInfo\r
-            );\r
+      FreePool (FileInfo);\r
+      FileInfo = AllocatePool (FileInfoSize);\r
       Status = This->GetInfo (\r
                       This,\r
                       &gEfiFileInfoGuid,\r
@@ -1379,7 +1321,7 @@ Returns:
 \r
     FileSize = FileInfo->FileSize;\r
 \r
-    gBS->FreePool (FileInfo);\r
+    FreePool (FileInfo);\r
 \r
     if (Pos >= FileSize) {\r
       *BufferSize = 0;\r
@@ -1545,7 +1487,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
@@ -1619,7 +1561,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   if (PrivateFile->IsDirectoryPath) {\r
@@ -1628,13 +1570,9 @@ Returns:
       goto Done;\r
     }\r
 \r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (PrivateFile->FileName) + StrSize (L"\\*"),\r
-                    &FileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    FileName = AllocatePool (StrSize (PrivateFile->FileName) + StrSize (L"\\*"));\r
+    if (FileName == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -1653,7 +1591,7 @@ Returns:
       PrivateFile->IsValidFindBuf = TRUE;\r
     }\r
 \r
-    gBS->FreePool (FileName);\r
+    FreePool (FileName);\r
 \r
     Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS;\r
   } else {\r
@@ -1956,14 +1894,10 @@ Returns:
     //\r
     // Try to get the drive name\r
     //\r
-    DriveName       = NULL;\r
     DriveNameFound  = FALSE;\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (PrivateFile->FilePath) + 1,\r
-                    &DriveName\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
+    DriveName = AllocatePool (StrSize (PrivateFile->FilePath) + 1);\r
+    if (DriveName == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -2003,7 +1937,7 @@ Returns:
                                           &TotalClusters\r
                                           );\r
     if (DriveName) {\r
-      gBS->FreePool (DriveName);\r
+      FreePool (DriveName);\r
     }\r
 \r
     if (NtStatus) {\r
@@ -2161,16 +2095,10 @@ Returns:
 \r
     NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer;\r
 \r
-    gBS->FreePool (PrivateRoot->VolumeLabel);\r
-\r
-    PrivateRoot->VolumeLabel = NULL;\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (NewFileSystemInfo->VolumeLabel),\r
-                    &PrivateRoot->VolumeLabel\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    FreePool (PrivateRoot->VolumeLabel);\r
+    PrivateRoot->VolumeLabel = AllocatePool (StrSize (NewFileSystemInfo->VolumeLabel));\r
+    if (PrivateRoot->VolumeLabel == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -2240,9 +2168,9 @@ Returns:
     goto Done;\r
   }\r
 \r
-  Status = gBS->AllocatePool (EfiBootServicesData, OldInfoSize, &OldFileInfo);\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  OldFileInfo = AllocatePool (OldInfoSize);\r
+  if (OldFileInfo == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -2252,13 +2180,9 @@ Returns:
     goto Done;\r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  StrSize (PrivateFile->FileName),\r
-                  &OldFileName\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
+  OldFileName = AllocatePool (StrSize (PrivateFile->FileName));\r
+  if (OldFileName == NULL) {\r
+    Status = EFI_OUT_OF_RESOURCES;\r
     goto Done;\r
   }\r
 \r
@@ -2268,13 +2192,9 @@ Returns:
   // Make full pathname from new filename and rootpath.\r
   //\r
   if (NewFileInfo->FileName[0] == '\\') {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName),\r
-                    &NewFileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    NewFileName = AllocatePool (StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));\r
+    if (NewFileName == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -2282,13 +2202,9 @@ Returns:
     StrCat (NewFileName, L"\\");\r
     StrCat (NewFileName, NewFileInfo->FileName + 1);\r
   } else {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName),\r
-                    &NewFileName\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
+    NewFileName = AllocatePool (StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));\r
+    if (NewFileName == NULL) {\r
+      Status = EFI_OUT_OF_RESOURCES;\r
       goto Done;\r
     }\r
 \r
@@ -2394,30 +2310,22 @@ Returns:
       //\r
       // modify file name\r
       //\r
-      gBS->FreePool (PrivateFile->FileName);\r
-\r
-      Status = gBS->AllocatePool (\r
-                      EfiBootServicesData,\r
-                      StrSize (NewFileName),\r
-                      &PrivateFile->FileName\r
-                      );\r
+      FreePool (PrivateFile->FileName);\r
 \r
-      if (EFI_ERROR (Status)) {\r
+      PrivateFile->FileName = AllocatePool (StrSize (NewFileName));\r
+      if (PrivateFile->FileName == NULL) {\r
+        Status = EFI_OUT_OF_RESOURCES;\r
         goto Done;\r
       }\r
 \r
       StrCpy (PrivateFile->FileName, NewFileName);\r
 \r
-      Status = gBS->AllocatePool (\r
-                      EfiBootServicesData,\r
-                      StrSize (NewFileName) + StrSize (L"\\*"),\r
-                      &TempFileName\r
-                      );\r
+      TempFileName = AllocatePool (StrSize (NewFileName) + StrSize (L"\\*"));\r
 \r
       StrCpy (TempFileName, NewFileName);\r
 \r
       if (!PrivateFile->IsDirectoryPath) {\r
-        PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (\r
+       PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (\r
                                                           TempFileName,\r
                                                           PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,\r
                                                           FILE_SHARE_READ | FILE_SHARE_WRITE,\r
@@ -2427,7 +2335,7 @@ Returns:
                                                           NULL\r
                                                           );\r
 \r
-        gBS->FreePool (TempFileName);\r
+        FreePool (TempFileName);\r
 \r
         //\r
         //  Flush buffers just in case\r
@@ -2450,7 +2358,7 @@ Returns:
         StrCat (TempFileName, L"\\*");\r
         PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);\r
 \r
-        gBS->FreePool (TempFileName);\r
+        FreePool (TempFileName);\r
       }\r
     } else {\r
 Reopen: ;\r
@@ -2462,11 +2370,7 @@ Reopen: ;
         goto Done;\r
       }\r
 \r
-      Status = gBS->AllocatePool (\r
-                      EfiBootServicesData,\r
-                      StrSize (OldFileName) + StrSize (L"\\*"),\r
-                      &TempFileName\r
-                      );\r
+      TempFileName = AllocatePool (StrSize (OldFileName) + StrSize (L"\\*"));\r
 \r
       StrCpy (TempFileName, OldFileName);\r
 \r
@@ -2495,7 +2399,7 @@ Reopen: ;
         PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);\r
       }\r
 \r
-      gBS->FreePool (TempFileName);\r
+      FreePool (TempFileName);\r
 \r
       goto Done;\r
 \r
@@ -2637,15 +2541,15 @@ Reopen: ;
 \r
 Done:\r
   if (OldFileInfo != NULL) {\r
-    gBS->FreePool (OldFileInfo);\r
+    FreePool (OldFileInfo);\r
   }\r
 \r
   if (OldFileName != NULL) {\r
-    gBS->FreePool (OldFileName);\r
+    FreePool (OldFileName);\r
   }\r
 \r
   if (NewFileName != NULL) {\r
-    gBS->FreePool (NewFileName);\r
+    FreePool (NewFileName);\r
   }\r
 \r
   gBS->RestoreTPL (OldTpl);\r
@@ -2696,7 +2600,7 @@ Returns:
   }\r
 \r
   OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);\r
-  \r
+\r
   PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {\r
index 725d7d0dd29e3e2a6860db452e6c99af7df49e17..6c0ef4867f27a7684c689a1c79c23ec5aafd9008 100644 (file)
@@ -46,6 +46,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtSimpleFileSystem.h</Filename>\r
index 13c38296c35bb8d7e5214f125ebcba0671b03819..86b667bfc4aa7911f5d7a8acc065588a4aa784a1 100644 (file)
@@ -43,6 +43,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>UefiBootServicesTableLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtUga.h</Filename>\r
index a270ec7b0d0a1806a6d539f2e2f3fdc2dbd0a96a..520856007d9413c26281354be83b2ef0ce746109 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -19,9 +19,9 @@ Abstract:
 \r
   UGA is short hand for Universal Graphics Abstraction protocol.\r
 \r
-  This file is a verision of UgaIo the uses WinNtThunk system calls as an IO \r
+  This file is a verision of UgaIo the uses WinNtThunk system calls as an IO\r
   abstraction. For a PCI device WinNtIo would be replaced with\r
-  a PCI IO abstraction that abstracted a specific PCI device. \r
+  a PCI IO abstraction that abstracted a specific PCI device.\r
 \r
 --*/\r
 \r
@@ -137,13 +137,8 @@ Returns:
   //\r
   // Allocate Private context data for SGO inteface.\r
   //\r
-  Private = NULL;\r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (UGA_PRIVATE_DATA),\r
-                  &Private\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  Private = AllocatePool (sizeof (UGA_PRIVATE_DATA));\r
+  if (Private == NULL) {\r
     goto Done;\r
   }\r
   //\r
@@ -198,7 +193,7 @@ Done:
         FreeUnicodeStringTable (Private->ControllerNameTable);\r
       }\r
 \r
-      gBS->FreePool (Private);\r
+      FreePool (Private);\r
     }\r
   }\r
 \r
@@ -287,7 +282,7 @@ Returns:
     //\r
     FreeUnicodeStringTable (Private->ControllerNameTable);\r
 \r
-    gBS->FreePool (Private);\r
+    FreePool (Private);\r
 \r
   }\r
 \r
@@ -308,9 +303,9 @@ Arguments:
 \r
   String - Unicode string.\r
 \r
-Returns: \r
+Returns:\r
 \r
-  UINTN of the number represented by String.  \r
+  UINTN of the number represented by String.\r
 \r
 --*/\r
 {\r
index 7d40eb7d8be04f4e307723bef7726da34210af7b..b6c1ce26b83e0068eedabd8afbf7cc21cf4ee6b5 100644 (file)
@@ -1,22 +1,22 @@
 /*++\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
-                                                                                          \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 - 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
+\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
 Module Name:\r
-  \r
+\r
     WinNtUgaScreen.c\r
 \r
 Abstract:\r
 \r
-  This file produces the graphics abstration of UGA. It is called by \r
-  WinNtUgaDriver.c file which deals with the EFI 1.1 driver model. \r
+  This file produces the graphics abstration of UGA. It is called by\r
+  WinNtUgaDriver.c file which deals with the EFI 1.1 driver model.\r
   This file just does graphics.\r
 \r
 --*/\r
@@ -72,7 +72,7 @@ WinNtUgaGetMode (
 \r
   Returns:\r
     EFI_SUCCESS     - Mode information returned.\r
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode () \r
+    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()\r
     EFI_INVALID_PARAMETER - One of the input args was NULL.\r
 \r
 --*/\r
@@ -123,7 +123,7 @@ WinNtUgaSetMode (
 \r
   Returns:\r
     EFI_SUCCESS     - Mode information returned.\r
-    EFI_NOT_STARTED - Video display is not initialized. Call SetMode () \r
+    EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()\r
     EFI_INVALID_PARAMETER - One of the input args was NULL.\r
 \r
 --*/\r
@@ -224,17 +224,13 @@ WinNtUgaSetMode (
 \r
   }\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (EFI_UGA_PIXEL) * HorizontalResolution,\r
-                  &NewFillLine\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
+  NewFillLine = AllocatePool (sizeof (EFI_UGA_PIXEL) * HorizontalResolution);\r
+  if (NewFillLine == NULL) {\r
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
   if (Private->FillLine != NULL) {\r
-    gBS->FreePool (Private->FillLine);\r
+    FreePool (Private->FillLine);\r
   }\r
 \r
   Private->FillLine             = NewFillLine;\r
@@ -281,19 +277,19 @@ WinNtUgaBlt (
   Routine Description:\r
     Blt pixels from the rectangle (Width X Height) formed by the BltBuffer\r
     onto the graphics screen starting a location (X, Y). (0, 0) is defined as\r
-    the upper left hand side of the screen. (X, Y) can be outside of the \r
-    current screen geometry and the BltBuffer will be cliped when it is \r
-    displayed. X and Y can be negative or positive. If Width or Height is \r
+    the upper left hand side of the screen. (X, Y) can be outside of the\r
+    current screen geometry and the BltBuffer will be cliped when it is\r
+    displayed. X and Y can be negative or positive. If Width or Height is\r
     bigger than the current video screen the image will be clipped.\r
 \r
   Arguments:\r
     This          - Protocol instance pointer.\r
-    X             - X location on graphics screen. \r
+    X             - X location on graphics screen.\r
     Y             - Y location on the graphics screen.\r
     Width         - Width of BltBuffer.\r
     Height        - Hight of BltBuffer\r
     BltOperation  - Operation to perform on BltBuffer and video memory\r
-    BltBuffer     - Buffer containing data to blt into video buffer. This \r
+    BltBuffer     - Buffer containing data to blt into video buffer. This\r
                     buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
     SourceX       - If the BltOperation is a EfiCopyBlt this is the source\r
                     of the copy. For other BLT operations this argument is not\r
@@ -301,11 +297,11 @@ WinNtUgaBlt (
     SourceX       - If the BltOperation is a EfiCopyBlt this is the source\r
                     of the copy. For other BLT operations this argument is not\r
                     used.\r
-      \r
+\r
   Returns:\r
     EFI_SUCCESS           - The palette is updated with PaletteArray.\r
     EFI_INVALID_PARAMETER - BltOperation is not valid.\r
-    EFI_DEVICE_ERROR      - A hardware error occured writting to the video \r
+    EFI_DEVICE_ERROR      - A hardware error occured writting to the video\r
                              buffer.\r
 \r
 --*/\r
@@ -445,7 +441,7 @@ WinNtUgaBlt (
     // we may miss some data for a short period of time this is no different than\r
     // a write combining on writes to a frame buffer.\r
     //\r
-  \r
+\r
     Private->WinNtThunk->UpdateWindow (Private->WindowHandle);\r
   }\r
 \r
@@ -501,7 +497,7 @@ WinNtUgaThreadWindowProc (
 /*++\r
 \r
 Routine Description:\r
-  Win32 Windows event handler. \r
+  Win32 Windows event handler.\r
 \r
 Arguments:\r
   See Win32 Book\r
@@ -631,7 +627,7 @@ Returns:
     case VK_F8:   Key.ScanCode = SCAN_F8;   break;\r
     case VK_F9:   Key.ScanCode = SCAN_F9;   break;\r
     case VK_F11:  Key.ScanCode = SCAN_F11;  break;\r
-    case VK_F12:  Key.ScanCode = SCAN_F12;  break;    \r
+    case VK_F12:  Key.ScanCode = SCAN_F12;  break;\r
     }\r
 \r
     if (Key.ScanCode != 0) {\r
@@ -693,7 +689,7 @@ WinNtUgaThreadWinMain (
 Routine Description:\r
 \r
   This thread simulates the end of WinMain () aplication. Each Winow nededs\r
-  to process it's events. The messages are dispatched to \r
+  to process it's events. The messages are dispatched to\r
   WinNtUgaThreadWindowProc ().\r
 \r
   Be very careful sine WinNtUgaThreadWinMain () and WinNtUgaThreadWindowProc ()\r
@@ -974,8 +970,8 @@ KillNtUgaThread (
 /*++\r
 \r
 Routine Description:\r
-  \r
-  This is the UGA screen's callback notification function for exit-boot-services. \r
+\r
+  This is the UGA screen's callback notification function for exit-boot-services.\r
   All we do here is call WinNtUgaDestructor().\r
 \r
 Arguments:\r
index 1e2b3709009a865e01539885b5274406f3af9083..b0e1c2b8160b1715376e2f029ab6adec3e42c53c 100644 (file)
@@ -136,18 +136,11 @@ AllocateMemory (
   IN  UINTN   Size\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
   VOID        *Buffer;\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  Size,\r
-                  (VOID *)&Buffer\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT (FALSE);\r
-    return NULL;\r
-  }\r
+  Buffer = AllocatePool (Size);\r
+  ASSERT (Buffer != NULL);\r
+\r
   return Buffer;\r
 }\r
 \r
@@ -341,13 +334,9 @@ Returns:
   }\r
 \r
   if (Status != EFI_ALREADY_STARTED) {\r
-    Status = gBS->AllocatePool (\r
-                    EfiBootServicesData,\r
-                    sizeof (WIN_NT_BUS_DEVICE),\r
-                    (VOID *) &WinNtBusDevice\r
-                    );\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
+    WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));\r
+    if (WinNtBusDevice == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
     WinNtBusDevice->Signature           = WIN_NT_BUS_DEVICE_SIGNATURE;\r
@@ -368,7 +357,7 @@ Returns:
                     );\r
     if (EFI_ERROR (Status)) {\r
       FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
-      gBS->FreePool (WinNtBusDevice);\r
+      FreePool (WinNtBusDevice);\r
       return Status;\r
     }\r
   }\r
@@ -464,7 +453,7 @@ Returns:
                                     Count\r
                                     );\r
         if (WinNtDevice->DevicePath == NULL) {\r
-          gBS->FreePool (WinNtDevice);\r
+          FreePool (WinNtDevice);\r
           return EFI_OUT_OF_RESOURCES;\r
         }\r
 \r
@@ -490,7 +479,7 @@ Returns:
                         );\r
         if (EFI_ERROR (Status)) {\r
           FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-          gBS->FreePool (WinNtDevice);\r
+          FreePool (WinNtDevice);\r
         } else {\r
           //\r
           // Open For Child Device\r
@@ -516,7 +505,7 @@ Returns:
       StartString = SubString;\r
     }\r
 \r
-    gBS->FreePool (TempStr);\r
+    FreePool (TempStr);\r
   }\r
 \r
   return EFI_SUCCESS;\r
@@ -588,7 +577,7 @@ Returns:
 \r
     FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
 \r
-    gBS->FreePool (WinNtBusDevice);\r
+    FreePool (WinNtBusDevice);\r
 \r
     gBS->CloseProtocol (\r
           ControllerHandle,\r
@@ -652,7 +641,7 @@ Returns:
         // Close the child handle\r
         //\r
         FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
-        gBS->FreePool (WinNtDevice);\r
+        FreePool (WinNtDevice);\r
       }\r
     }\r
 \r
index 61da7b0cf399a742096095fedcb52d4d16abcb44..39d6c7b2aae170af17b573b7a67c08cb91b081b9 100644 (file)
@@ -51,6 +51,9 @@
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
       <Keyword>DevicePathLib</Keyword>\r
     </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>WinNtBusDriver.h</Filename>\r
index 05a2eebae307e5e8295443bc0223c7ee16f2d1df..c777ec7c33094a5396c23b418c5c59ac0c5851c9 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -114,7 +114,7 @@ WinNtEnableInterrupt (
 Routine Description:\r
 \r
   This routine provides support for emulation of the interrupt enable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer \r
+  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
   Architectural Protocol observes in order to defer behaviour while in its\r
   emulated interrupt, or timer tick.\r
 \r
@@ -148,7 +148,7 @@ WinNtDisableInterrupt (
 Routine Description:\r
 \r
   This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer \r
+  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
   Architectural Protocol observes in order to defer behaviour while in its\r
   emulated interrupt, or timer tick.\r
 \r
@@ -183,7 +183,7 @@ WinNtGetInterruptState (
 Routine Description:\r
 \r
   This routine provides support for emulation of the interrupt disable of the\r
-  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer \r
+  the system.  For our purposes, CPU enable is just a BOOLEAN that the Timer\r
   Architectural Protocol observes in order to defer behaviour while in its\r
   emulated interrupt, or timer tick.\r
 \r
@@ -223,8 +223,8 @@ WinNtInit (
 \r
 Routine Description:\r
 \r
-  This routine would support generation of a CPU INIT.  At \r
-  present, this code does not provide emulation.  \r
+  This routine would support generation of a CPU INIT.  At\r
+  present, this code does not provide emulation.\r
 \r
 Arguments:\r
 \r
@@ -258,8 +258,8 @@ WinNtRegisterInterruptHandler (
 \r
 Routine Description:\r
 \r
-  This routine would support registration of an interrupt handler.  At \r
-  present, this code does not provide emulation.  \r
+  This routine would support registration of an interrupt handler.  At\r
+  present, this code does not provide emulation.\r
 \r
 Arguments:\r
 \r
@@ -305,8 +305,8 @@ WinNtGetTimerValue (
 \r
 Routine Description:\r
 \r
-  This routine would support querying of an on-CPU timer.  At present, \r
-  this code does not provide timer emulation.  \r
+  This routine would support querying of an on-CPU timer.  At present,\r
+  this code does not provide timer emulation.\r
 \r
 Arguments:\r
 \r
@@ -325,7 +325,7 @@ Returns:
   if (TimerValue == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // No timer supported\r
   //\r
@@ -345,8 +345,8 @@ WinNtSetMemoryAttributes (
 \r
 Routine Description:\r
 \r
-  This routine would support querying of an on-CPU timer.  At present, \r
-  this code does not provide timer emulation.  \r
+  This routine would support querying of an on-CPU timer.  At present,\r
+  this code does not provide timer emulation.\r
 \r
 Arguments:\r
 \r
@@ -405,7 +405,7 @@ Returns:
 \r
   Status\r
 \r
-  EFI_SUCCESS           - protocol instance can be published \r
+  EFI_SUCCESS           - protocol instance can be published\r
   EFI_OUT_OF_RESOURCES  - cannot allocate protocol data structure\r
   EFI_DEVICE_ERROR      - cannot create the thread\r
 \r
@@ -417,12 +417,8 @@ Returns:
   CPU_ARCH_PROTOCOL_PRIVATE *Private;\r
   VOID                      *Registration;\r
 \r
-  Status = gBS->AllocatePool (\r
-                  EfiBootServicesData,\r
-                  sizeof (CPU_ARCH_PROTOCOL_PRIVATE),\r
-                  &Private\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  Private = AllocatePool (sizeof (CPU_ARCH_PROTOCOL_PRIVATE));\r
+  ASSERT (Private != NULL);\r
 \r
   Private->Signature                    = CPU_ARCH_PROT_PRIVATE_SIGNATURE;\r
   Private->Cpu.FlushDataCache           = WinNtFlushCpuDataCache;\r
@@ -479,7 +475,7 @@ Returns:
   DEBUG ((EFI_D_ERROR, "CPU Architectural Protocol Loaded\n"));\r
 \r
 \r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -495,8 +491,8 @@ Routine Description:
 Arguments:\r
   String - Unicode string.\r
 \r
-Returns: \r
-  UINTN of the number represented by String.  \r
+Returns:\r
+  UINTN of the number represented by String.\r
 \r
 --*/\r
 {\r
@@ -656,7 +652,7 @@ Returns:
       Status      = Hii->NewPack (Hii, PackageList, &StringHandle);\r
       ASSERT (!EFI_ERROR (Status));\r
 \r
-      gBS->FreePool (PackageList);\r
+      FreePool (PackageList);\r
 \r
       //\r
       // Store processor version data record to data hub\r
@@ -717,7 +713,7 @@ Returns:
                           TotalSize\r
                           );\r
 \r
-      gBS->FreePool (RecordBuffer.Raw);\r
+      FreePool (RecordBuffer.Raw);\r
     }\r
 \r
     gBS->CloseProtocol (\r
index 23d7157d8b015b9f16d9daf96a304a1c5aa378c2..4ae0d0c10c50262c5ec847d3f4147920f9df02b7 100644 (file)
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
   <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <SupportedArchitectures>IA32</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
     <OutputFileBasename>DxeWinNtLib</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
       <Keyword>WinNtLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
index 0c744db224cba44eaa2ce6f8c5a11965b4108ac2..05c8e7d1e3de2ed879a5e7e00b1e5bd28e0b6c9c 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -30,7 +30,7 @@ BdsLibDoLegacyBoot (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Boot the legacy system with the boot option\r
 \r
 Arguments:\r
@@ -41,7 +41,7 @@ Returns:
 \r
   EFI_UNSUPPORTED  - There is no legacybios protocol, do not support\r
                      legacy boot.\r
-                         \r
+\r
   EFI_STATUS       - Return the status of LegacyBios->LegacyBoot ().\r
 \r
 --*/\r
@@ -89,15 +89,15 @@ BdsLibBootViaBootOption (
 \r
 Routine Description:\r
 \r
-  Process the boot option follow the EFI 1.1 specification and \r
+  Process the boot option follow the EFI 1.1 specification and\r
   special treat the legacy boot option with BBS_DEVICE_PATH.\r
 \r
 Arguments:\r
 \r
   Option       - The boot option need to be processed\r
-  \r
-  DevicePath   - The device path which describe where to load \r
-                 the boot image or the legcy BBS device path \r
+\r
+  DevicePath   - The device path which describe where to load\r
+                 the boot image or the legcy BBS device path\r
                  to boot the legacy OS\r
 \r
   ExitDataSize - Returned directly from gBS->StartImage ()\r
@@ -167,7 +167,7 @@ Returns:
   // Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event\r
   //\r
   EfiSignalEventReadyToBoot ();\r
-  \r
+\r
   //\r
   // Set Boot Current\r
   //\r
@@ -240,7 +240,7 @@ Returns:
                      BlkIo->Media->BlockSize,\r
                      Buffer\r
                      );\r
-            gBS->FreePool (Buffer);\r
+            FreePool (Buffer);\r
           }\r
         }\r
 \r
@@ -324,8 +324,8 @@ BdsBootByDiskSignatureAndPartition (
 Routine Description:\r
 \r
   Check to see if a hard ware device path was passed in. If it was then search\r
-  all the block IO devices for the passed in hard drive device path. \r
-  \r
+  all the block IO devices for the passed in hard drive device path.\r
+\r
 Arguments:\r
 \r
   Option - The current processing boot option.\r
@@ -347,7 +347,7 @@ Returns:
 \r
   EFI_SUCCESS   - Status from gBS->StartImage (),\r
                   or BootByDiskSignatureAndPartition ()\r
-                  \r
+\r
   EFI_NOT_FOUND - If the Device Path is not found in the system\r
 \r
 --*/\r
@@ -406,7 +406,7 @@ Returns:
     // find HardDriver device path node\r
     //\r
     while (!IsDevicePathEnd (DevicePath)) {\r
-      if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && \r
+      if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) &&\r
           (DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)\r
           ) {\r
         BlockIoHdDevicePath = DevicePath;\r
@@ -460,7 +460,7 @@ Returns:
     }\r
   }\r
 \r
-  gBS->FreePool (BlockIoBuffer);\r
+  FreePool (BlockIoBuffer);\r
   return Status;\r
 }\r
 \r
@@ -532,7 +532,7 @@ Returns:
                       &BootOptionSize\r
                       );\r
     if (NULL == BootOptionVar) {\r
-      gBS->FreePool (BootOrder);\r
+      FreePool (BootOrder);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -549,11 +549,11 @@ Returns:
     if ((OptionDevicePathSize == DevicePathSize) &&\r
         (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {\r
       BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);\r
-      gBS->FreePool (BootOptionVar);\r
+      FreePool (BootOptionVar);\r
       break;\r
     }\r
 \r
-    gBS->FreePool (BootOptionVar);\r
+    FreePool (BootOptionVar);\r
     Index++;\r
   }\r
 \r
@@ -565,7 +565,7 @@ Returns:
                   BootOrder\r
                   );\r
 \r
-  gBS->FreePool (BootOrder);\r
+  FreePool (BootOrder);\r
 \r
   return Status;\r
 }\r
@@ -636,7 +636,7 @@ Returns:
                       &BootOptionSize\r
                       );\r
     if (NULL == BootOptionVar) {\r
-      gBS->FreePool (BootOrder);\r
+      FreePool (BootOrder);\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
@@ -652,7 +652,7 @@ Returns:
     //\r
     if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&\r
         (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {\r
-      gBS->FreePool (BootOptionVar);\r
+      FreePool (BootOptionVar);\r
       Index++;\r
       continue;\r
     }\r
@@ -664,7 +664,7 @@ Returns:
       TempDevicePath = EfiNextDevicePathNode (TempDevicePath);\r
     }\r
     //\r
-    // Skip the boot option that point to a file, since the device path in \r
+    // Skip the boot option that point to a file, since the device path in\r
     // removable media boot option doesn't contains a file name.\r
     //\r
     if (((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&\r
@@ -673,7 +673,7 @@ Returns:
         // Skip boot option for internal Shell, it's always valid\r
         //\r
         (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) {\r
-      gBS->FreePool (BootOptionVar);\r
+      FreePool (BootOptionVar);\r
       Index++;\r
       continue;\r
     }\r
@@ -721,7 +721,7 @@ Returns:
       BootOrder[Index] = 0xffff;\r
     }\r
 \r
-    gBS->FreePool (BootOptionVar);\r
+    FreePool (BootOptionVar);\r
     Index++;\r
   }\r
 \r
@@ -743,7 +743,7 @@ Returns:
                   BootOrder\r
                   );\r
 \r
-  gBS->FreePool (BootOrder);\r
+  FreePool (BootOrder);\r
 \r
   return Status;\r
 }\r
@@ -877,7 +877,7 @@ Returns:
   }\r
 \r
   if (NumberFileSystemHandles) {\r
-    gBS->FreePool (FileSystemHandles);\r
+    FreePool (FileSystemHandles);\r
   }\r
   //\r
   // Parse Network Boot Device\r
@@ -904,7 +904,7 @@ Returns:
   }\r
 \r
   if (NumberLoadFileHandles) {\r
-    gBS->FreePool (LoadFileHandles);\r
+    FreePool (LoadFileHandles);\r
   }\r
   //\r
   // Check if we have on flash shell\r
@@ -946,7 +946,7 @@ Returns:
   }\r
 \r
   if (FvHandleCount) {\r
-    gBS->FreePool (FvHandleBuffer);\r
+   FreePool (FvHandleBuffer);\r
   }\r
   //\r
   // Make sure every boot only have one time\r
@@ -966,13 +966,13 @@ BdsLibBuildOptionFromHandle (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Build the boot option with the handle parsed in\r
-  \r
+\r
 Arguments:\r
 \r
   Handle - The handle which present the device path to create boot option\r
-  \r
+\r
   BdsBootOptionList - The header of the link list which indexed all current\r
                       boot options\r
 \r
@@ -1002,14 +1002,14 @@ BdsLibBuildOptionFromShell (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Build the on flash shell boot option with the handle parsed in\r
-  \r
+\r
 Arguments:\r
 \r
   Handle - The handle which present the device path to create on flash shell\r
            boot option\r
-  \r
+\r
   BdsBootOptionList - The header of the link list which indexed all current\r
                       boot options\r
 \r
@@ -1044,13 +1044,13 @@ BdsLibBootNext (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Boot from the EFI1.1 spec defined "BootNext" variable\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
-  \r
+\r
 Returns:\r
 \r
   None\r
index 9c649f1f82e410052fbdfbfee24d635e6f7f056d..772b339f9b1dacfc3de7ccc3d3f0621bbd4d67ec 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -26,12 +26,12 @@ BdsLibConnectAll (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This function will connect all the system driver to controller\r
   first, and then special connect the default console, this make\r
   sure all the system controller avialbe and the platform default\r
   console connected.\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
@@ -66,12 +66,12 @@ BdsLibGenericConnectAll (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This function will connect all the system drivers to all controllers\r
-  first, and then connect all the console devices the system current \r
+  first, and then connect all the console devices the system current\r
   have. After this we should get all the device work and console avariable\r
   if the system have console device.\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
@@ -100,7 +100,7 @@ Routine Description:
   path node. If the handle associate with one device path node can not\r
   be created success, then still give one chance to do the dispatch,\r
   which load the missing drivers if possible.\r
-  \r
+\r
 Arguments:\r
 \r
   DevicePathToConnect  - The device path which will be connected, it can\r
@@ -108,12 +108,12 @@ Arguments:
 \r
 Returns:\r
 \r
-  EFI_SUCCESS          - All handles associate with every device path \r
+  EFI_SUCCESS          - All handles associate with every device path\r
                          node have been created\r
-  \r
+\r
   EFI_OUT_OF_RESOURCES - There is no resource to create new handles\r
-  \r
-  EFI_NOT_FOUND        - Create the handle associate with one device \r
+\r
+  EFI_NOT_FOUND        - Create the handle associate with one device\r
                          path node failed\r
 \r
 --*/\r
@@ -206,7 +206,7 @@ Returns:
   } while (DevicePath != NULL);\r
 \r
   if (CopyOfDevicePath != NULL) {\r
-    gBS->FreePool (CopyOfDevicePath);\r
+    FreePool (CopyOfDevicePath);\r
   }\r
   //\r
   // All handle with DevicePath exists in the handle database\r
@@ -224,7 +224,7 @@ Routine Description:
 \r
   This function will connect all current system handles recursively. The\r
   connection will finish until every handle's child handle created if it have.\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
@@ -232,8 +232,8 @@ Arguments:
 Returns:\r
 \r
   EFI_SUCCESS          - All handles and it's child handle have been connected\r
-  \r
-  EFI_STATUS           - Return the status of gBS->LocateHandleBuffer(). \r
+\r
+  EFI_STATUS           - Return the status of gBS->LocateHandleBuffer().\r
 \r
 --*/\r
 {\r
@@ -257,7 +257,7 @@ Returns:
     Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  FreePool (HandleBuffer);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -272,7 +272,7 @@ Routine Description:
 \r
   This function will disconnect all current system handles. The disconnection\r
   will finish until every handle have been disconnected.\r
-  \r
+\r
 Arguments:\r
 \r
   None\r
@@ -280,8 +280,8 @@ Arguments:
 Returns:\r
 \r
   EFI_SUCCESS          - All handles have been disconnected\r
-  \r
-  EFI_STATUS           - Return the status of gBS->LocateHandleBuffer(). \r
+\r
+  EFI_STATUS           - Return the status of gBS->LocateHandleBuffer().\r
 \r
 --*/\r
 {\r
@@ -308,7 +308,7 @@ Returns:
     Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
   }\r
 \r
-  gBS->FreePool (HandleBuffer);\r
+  FreePool (HandleBuffer);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -321,19 +321,19 @@ BdsLibConnectAllDriversToAllControllers (
 \r
 Routine Description:\r
 \r
-  Connects all drivers to all controllers. \r
+  Connects all drivers to all controllers.\r
   This function make sure all the current system driver will manage\r
   the correspoinding controllers if have. And at the same time, make\r
-  sure all the system controllers have driver to manage it if have. \r
-  \r
+  sure all the system controllers have driver to manage it if have.\r
+\r
 Arguments:\r
-  \r
+\r
   None\r
-  \r
+\r
 Returns:\r
-  \r
+\r
   None\r
-  \r
+\r
 --*/\r
 {\r
   EFI_STATUS  Status;\r
index 47a79ff34e068b692853bee72847e4369352b203..96a1f4b9fd48d84ddc2889e7d1ab25f8ceb165fe 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -25,9 +25,9 @@ IsNvNeed (
   )\r
 {\r
   CHAR16 *Ptr;\r
-  \r
+\r
   Ptr = ConVarName;\r
-  \r
+\r
   //\r
   // If the variable includes "Dev" at last, we consider\r
   // it does not support NV attribute.\r
@@ -35,7 +35,7 @@ IsNvNeed (
   while (*Ptr) {\r
     Ptr++;\r
   }\r
-  \r
+\r
   if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {\r
     return FALSE;\r
   } else {\r
@@ -53,7 +53,7 @@ BdsLibUpdateConsoleVariable (
 \r
 Routine Description:\r
 \r
-  This function update console variable based on ConVarName, it can \r
+  This function update console variable based on ConVarName, it can\r
   add or remove one specific console device path from the variable\r
 \r
 Arguments:\r
@@ -71,8 +71,8 @@ Arguments:
 Returns:\r
 \r
   EFI_UNSUPPORTED         - Add or remove the same device path.\r
-  \r
-  EFI_SUCCESS             - Success add or remove the device path from \r
+\r
+  EFI_SUCCESS             - Success add or remove the device path from\r
                             the console variable.\r
 \r
 --*/\r
@@ -103,12 +103,12 @@ Returns:
                 &gEfiGlobalVariableGuid,\r
                 &DevicePathSize\r
                 );\r
-                \r
+\r
   //\r
   // Initialize NewDevicePath\r
   //\r
   NewDevicePath  = VarConsole;\r
-  \r
+\r
   //\r
   // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.\r
   // In the end, NewDevicePath is the final device path.\r
@@ -134,7 +134,7 @@ Returns:
       BdsLibSafeFreePool(TempNewDevicePath);\r
     }\r
   }\r
-  \r
+\r
   //\r
   // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.\r
   //\r
@@ -149,7 +149,7 @@ Returns:
     //\r
     Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;\r
   }\r
-  \r
+\r
   //\r
   // Finally, Update the variable of the default console by NewDevicePath\r
   //\r
@@ -192,7 +192,7 @@ Arguments:
 Returns:\r
 \r
   EFI_NOT_FOUND           - There is not any console devices connected success\r
-  \r
+\r
   EFI_SUCCESS             - Success connect any one instance of the console\r
                             device path base on the variable ConVarName.\r
 \r
@@ -250,7 +250,7 @@ Returns:
     BdsLibSafeFreePool(Instance);\r
   } while (CopyOfDevicePath != NULL);\r
 \r
-  gBS->FreePool (StartDevicePath);\r
+  FreePool (StartDevicePath);\r
 \r
   if (DeviceExist == FALSE) {\r
     return EFI_NOT_FOUND;\r
@@ -346,7 +346,7 @@ BdsLibConnectAllDefaultConsoles (
 \r
 Routine Description:\r
 \r
-  This function will connect console device base on the console \r
+  This function will connect console device base on the console\r
   device variable ConIn, ConOut and ErrOut.\r
 \r
 Arguments:\r
@@ -357,7 +357,7 @@ Returns:
 \r
   EFI_SUCCESS      - At least one of the ConIn and ConOut device have\r
                      been connected success.\r
-                     \r
+\r
   EFI_STATUS       - Return the status of BdsLibConnectConsoleVariable ().\r
 \r
 --*/\r
@@ -370,12 +370,12 @@ Returns:
 \r
   //\r
   // Because possibly the platform is legacy free, in such case,\r
-  // ConIn devices (Serial Port and PS2 Keyboard ) does not exist, \r
+  // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,\r
   // so we need not check the status.\r
-  //  \r
+  //\r
   BdsLibConnectConsoleVariable (L"ConIn");\r
 \r
-  // \r
+  //\r
   // It seems impossible not to have any ConOut device on platform,\r
   // so we check the status here.\r
   //\r
index 6a3ec058bf978ec6c4ec3b1f7daa5ba45cf5199f..e0b5d08c96f571a23a4bd2be2200498e214c82f9 100644 (file)
@@ -1,13 +1,13 @@
 /*++\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
-                                                                                          \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 - 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
+\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
 Module Name:\r
 \r
@@ -31,7 +31,7 @@ BdsLibGetTimeout (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Return the default value for system Timeout variable.\r
 \r
 Arguments:\r
@@ -39,7 +39,7 @@ Arguments:
   None\r
 \r
 Returns:\r
-  \r
+\r
   Timeout value.\r
 \r
 --*/\r
@@ -85,7 +85,7 @@ BdsLibLoadDrivers (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   The function will go through the driver optoin link list, load and start\r
   every driver the driver optoin device path point to.\r
 \r
@@ -94,7 +94,7 @@ Arguments:
   BdsDriverLists   - The header of the current driver option link list\r
 \r
 Returns:\r
-  \r
+\r
   None\r
 \r
 --*/\r
@@ -198,7 +198,7 @@ BdsLibRegisterNewOption (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   This function will register the new boot#### or driver#### option base on\r
   the VariableName. The new registered boot#### or driver#### will be linked\r
   to BdsOptionList and also update to the VariableName. After the boot#### or\r
@@ -207,18 +207,18 @@ Routine Description:
 Arguments:\r
 \r
   BdsOptionList    - The header of the boot#### or driver#### link list\r
-  \r
+\r
   DevicePath       - The device path which the boot####\r
                      or driver#### option present\r
-                     \r
+\r
   String           - The description of the boot#### or driver####\r
-  \r
+\r
   VariableName     - Indicate if the boot#### or driver#### option\r
 \r
 Returns:\r
-  \r
+\r
   EFI_SUCCESS      - The boot#### or driver#### have been success registered\r
-  \r
+\r
   EFI_STATUS       - Return the status of gRT->SetVariable ().\r
 \r
 --*/\r
@@ -249,11 +249,13 @@ Returns:
   ZeroMem (OptionName, sizeof (OptionName));\r
 \r
   TempOptionSize = 0;\r
+\r
   TempOptionPtr = BdsLibGetVariableAndSize (\r
                     VariableName,\r
                     &gEfiGlobalVariableGuid,\r
                     &TempOptionSize\r
                     );\r
+\r
   //\r
   // Compare with current option variable\r
   //\r
@@ -290,8 +292,8 @@ Returns:
         //\r
         // Got the option, so just return\r
         //\r
-        gBS->FreePool (OptionPtr);\r
-        gBS->FreePool (TempOptionPtr);\r
+        FreePool (OptionPtr);\r
+        FreePool (TempOptionPtr);\r
         return EFI_SUCCESS;\r
       } else {\r
         //\r
@@ -302,7 +304,7 @@ Returns:
       }\r
     }\r
 \r
-    gBS->FreePool (OptionPtr);\r
+    FreePool (OptionPtr);\r
   }\r
 \r
   OptionSize          = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath);\r
@@ -342,12 +344,12 @@ Returns:
                   OptionPtr\r
                   );\r
   if (EFI_ERROR (Status) || UpdateBootDevicePath) {\r
-    gBS->FreePool (OptionPtr);\r
-    gBS->FreePool (TempOptionPtr);\r
+    FreePool (OptionPtr);\r
+    FreePool (TempOptionPtr);\r
     return Status;\r
   }\r
 \r
-  gBS->FreePool (OptionPtr);\r
+  FreePool (OptionPtr);\r
 \r
   //\r
   // Update the option order variable\r
@@ -363,13 +365,15 @@ Returns:
                   OptionOrderPtr\r
                   );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (TempOptionPtr);\r
-    gBS->FreePool (OptionOrderPtr);\r
+    FreePool (TempOptionPtr);\r
+    FreePool (OptionOrderPtr);\r
     return Status;\r
   }\r
 \r
-  gBS->FreePool (TempOptionPtr);\r
-  gBS->FreePool (OptionOrderPtr);\r
+  if (TempOptionPtr != NULL) {\r
+    FreePool (TempOptionPtr);\r
+  }\r
+  FreePool (OptionOrderPtr);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -383,9 +387,9 @@ BdsLibVariableToOption (
 \r
 Routine Description:\r
 \r
-  Build the boot#### or driver#### option from the VariableName, the \r
+  Build the boot#### or driver#### option from the VariableName, the\r
   build boot#### or driver#### will also be linked to BdsCommonOptionList\r
-  \r
+\r
 Arguments:\r
 \r
   BdsCommonOptionList - The header of the boot#### or driver#### option link list\r
@@ -482,12 +486,12 @@ Returns:
   //\r
   if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {\r
     InsertTailList (BdsCommonOptionList, &Option->Link);\r
-    gBS->FreePool (Variable);\r
+    FreePool (Variable);\r
     return Option;\r
   }\r
 \r
-  gBS->FreePool (Variable);\r
-  gBS->FreePool (Option);\r
+  FreePool (Variable);\r
+  FreePool (Option);\r
   return NULL;\r
 \r
 }\r
@@ -553,7 +557,7 @@ Returns:
 \r
   }\r
 \r
-  gBS->FreePool (OptionOrder);\r
+  FreePool (OptionOrder);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -631,7 +635,7 @@ Routine Description:
   Free pool safely.\r
 \r
 Arguments:\r
-  \r
+\r
   Buffer          - The allocated pool entry to free\r
 \r
 Returns:\r
@@ -641,7 +645,7 @@ Returns:
 --*/\r
 {\r
   if (Buffer != NULL) {\r
-    gBS->FreePool (Buffer);\r
+    FreePool (Buffer);\r
     Buffer = NULL;\r
   }\r
 }\r
@@ -665,7 +669,7 @@ Arguments:
 \r
 Returns:\r
 \r
-  This function will remove the device path instances in Multi which partly \r
+  This function will remove the device path instances in Multi which partly\r
   match with the Single, and return the result device path. If there is no\r
   remaining device path as a result, this function will return NULL.\r
 \r
@@ -675,24 +679,24 @@ Returns:
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *TempNewDevicePath;\r
   UINTN                     InstanceSize;\r
-  UINTN                     SingleDpSize;  \r
-  UINTN                     Size; \r
-  \r
+  UINTN                     SingleDpSize;\r
+  UINTN                     Size;\r
+\r
   NewDevicePath     = NULL;\r
   TempNewDevicePath = NULL;\r
 \r
   if (Multi == NULL || Single == NULL) {\r
     return Multi;\r
   }\r
-  \r
+\r
   Instance        =  GetNextDevicePathInstance (&Multi, &InstanceSize);\r
   SingleDpSize    =  GetDevicePathSize (Single) - END_DEVICE_PATH_LENGTH;\r
   InstanceSize    -= END_DEVICE_PATH_LENGTH;\r
 \r
   while (Instance != NULL) {\r
 \r
-    Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize;    \r
-        \r
+    Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize;\r
+\r
     if ((CompareMem (Instance, Single, Size) != 0)) {\r
       //\r
       // Append the device path instance which does not match with Single\r
@@ -705,7 +709,7 @@ Returns:
     Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);\r
     InstanceSize  -= END_DEVICE_PATH_LENGTH;\r
   }\r
-  \r
+\r
   return NewDevicePath;\r
 }\r
 \r
@@ -730,9 +734,9 @@ Arguments:
 Returns:\r
 \r
   TRUE   - If the Single is contained within Multi\r
-  \r
+\r
   FALSE  - The Single is not match within Multi\r
-  \r
+\r
 \r
 --*/\r
 {\r
@@ -756,11 +760,11 @@ Returns:
     // return success\r
     //\r
     if (CompareMem (Single, DevicePathInst, Size) == 0) {\r
-      gBS->FreePool (DevicePathInst);\r
+      FreePool (DevicePathInst);\r
       return TRUE;\r
     }\r
 \r
-    gBS->FreePool (DevicePathInst);\r
+    FreePool (DevicePathInst);\r
     DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);\r
   }\r
 \r
@@ -788,7 +792,7 @@ Arguments:
 Returns:\r
 \r
   EFI_SUCCESS          - Success print out the string using ConOut.\r
-  \r
+\r
   EFI_STATUS           - Return the status of the ConOut->OutputString ().\r
 \r
 --*/\r
@@ -821,7 +825,7 @@ Returns:
 \r
 //\r
 //  Following are BDS Lib functions which  contain all the code about setup browser reset reminder feature.\r
-//  Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser  if \r
+//  Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser  if\r
 //  user change any option setting which needs a reset to be effective, and  the reset will be applied according to  the user selection.\r
 //\r
 \r
@@ -832,7 +836,7 @@ EnableResetReminderFeature (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Enable the setup browser reset reminder feature.\r
   This routine is used in platform tip. If the platform policy need the feature, use the routine to enable it.\r
 \r
@@ -847,7 +851,7 @@ Returns:
 --*/\r
 {\r
   mFeaturerSwitch = TRUE;\r
-} \r
+}\r
 \r
 VOID\r
 DisableResetReminderFeature (\r
@@ -856,10 +860,10 @@ DisableResetReminderFeature (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Disable the setup browser reset reminder feature.\r
   This routine is used in platform tip. If the platform policy do not want the feature, use the routine to disable it.\r
-  \r
+\r
 Arguments:\r
 \r
   VOID\r
@@ -871,7 +875,7 @@ Returns:
 --*/\r
 {\r
   mFeaturerSwitch = FALSE;\r
-} \r
+}\r
 \r
 VOID\r
 EnableResetRequired (\r
@@ -880,10 +884,10 @@ EnableResetRequired (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
    Record the info that  a reset is required.\r
-   A  module boolean variable is used to record whether a reset is required. \r
-  \r
+   A  module boolean variable is used to record whether a reset is required.\r
+\r
 Arguments:\r
 \r
   VOID\r
@@ -895,7 +899,7 @@ Returns:
 --*/\r
 {\r
   mResetRequired = TRUE;\r
-} \r
+}\r
 \r
 VOID\r
 DisableResetRequired (\r
@@ -906,7 +910,7 @@ DisableResetRequired (
 Routine Description:\r
 \r
    Record the info that  no reset is required.\r
-   A  module boolean variable is used to record whether a reset is required. \r
+   A  module boolean variable is used to record whether a reset is required.\r
 \r
 Arguments:\r
 \r
@@ -919,7 +923,7 @@ Returns:
 --*/\r
 {\r
   mResetRequired = FALSE;\r
-} \r
+}\r
 \r
 BOOLEAN\r
 IsResetReminderFeatureEnable (\r
@@ -928,7 +932,7 @@ IsResetReminderFeatureEnable (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Check whether platform policy enable the reset reminder feature. The default is enabled.\r
 \r
 Arguments:\r
@@ -951,9 +955,9 @@ IsResetRequired (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Check if  user changed any option setting which needs a system reset to be effective.\r
-  \r
+\r
 Arguments:\r
 \r
   VOID\r
@@ -974,9 +978,9 @@ SetupResetReminder (
 /*++\r
 \r
 Routine Description:\r
\r
+\r
   Check whether a reset is needed, and finish the reset reminder feature.\r
-  If a reset is needed, Popup a menu to notice user, and finish the feature \r
+  If a reset is needed, Popup a menu to notice user, and finish the feature\r
   according to the user selection.\r
 \r
 Arguments:\r
@@ -991,9 +995,9 @@ Returns:
 {\r
   EFI_STATUS                    Status;\r
   EFI_FORM_BROWSER_PROTOCOL     *Browser;\r
-  EFI_INPUT_KEY                 Key;  \r
+  EFI_INPUT_KEY                 Key;\r
   CHAR16                        *StringBuffer1;\r
-  CHAR16                        *StringBuffer2;    \r
+  CHAR16                        *StringBuffer2;\r
 \r
 \r
   //\r
@@ -1001,28 +1005,28 @@ Returns:
   //\r
   if (IsResetReminderFeatureEnable ()) {\r
     if (IsResetRequired ()) {\r
-    \r
+\r
       Status = gBS->LocateProtocol (\r
                       &gEfiFormBrowserProtocolGuid,\r
                       NULL,\r
                       &Browser\r
-                      );      \r
-                      \r
+                      );\r
+\r
       StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));\r
       ASSERT (StringBuffer1 != NULL);\r
       StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));\r
-      ASSERT (StringBuffer2 != NULL);      \r
+      ASSERT (StringBuffer2 != NULL);\r
       StrCpy (StringBuffer1, L"Configuration changed. Reset to apply it Now ? ");\r
-      StrCpy (StringBuffer2, L"Enter (YES)  /   Esc (NO)");      \r
+      StrCpy (StringBuffer2, L"Enter (YES)  /   Esc (NO)");\r
       //\r
       // Popup a menu to notice user\r
-      // \r
+      //\r
       do {\r
         Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2);\r
-      } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN)); \r
-      \r
-      gBS->FreePool (StringBuffer1);      \r
-      gBS->FreePool (StringBuffer2);            \r
+      } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));\r
+\r
+      FreePool (StringBuffer1);\r
+      FreePool (StringBuffer2);\r
       //\r
       // If the user hits the YES Response key, reset\r
       //\r
@@ -1030,9 +1034,9 @@ Returns:
         gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);\r
       }\r
       gST->ConOut->ClearScreen (gST->ConOut);\r
-    } \r
-  } \r
-} \r
+    }\r
+  }\r
+}\r
 \r
 EFI_STATUS\r
 BdsLibGetHiiHandles (\r
@@ -1050,7 +1054,7 @@ Routine Description:
 Arguments:\r
 \r
   This                  - A pointer to the EFI_HII_PROTOCOL instance.\r
-  HandleBufferLength    - On input, a pointer to the length of the handle buffer. On output, \r
+  HandleBufferLength    - On input, a pointer to the length of the handle buffer. On output,\r
                           the length of the handle buffer that is required for the handles found.\r
   HiiHandleBuffer       - Pointer to an array of EFI_HII_PROTOCOL instances returned.\r
 \r
@@ -1059,19 +1063,19 @@ Returns:
   EFI_SUCCESS           - Get an array of EFI_HII_PROTOCOL instances successfully.\r
   EFI_INVALID_PARAMETER - Hii is NULL.\r
   EFI_NOT_FOUND         - Database not found.\r
-  \r
+\r
 --*/\r
 {\r
   UINT16      TempBufferLength;\r
   EFI_STATUS  Status;\r
-  \r
+\r
   TempBufferLength = 0;\r
-  \r
+\r
   //\r
   // Try to find the actual buffer size for HiiHandle Buffer.\r
   //\r
   Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);\r
-  \r
+\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     *HiiHandleBuffer = AllocateZeroPool (TempBufferLength);\r
     Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);\r
@@ -1080,9 +1084,9 @@ Returns:
     //\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
-  \r
+\r
   *HandleBufferLength = TempBufferLength;\r
-  \r
+\r
   return Status;\r
-  \r
+\r
 }\r
index 5a80471927f7faf3494e8cdb4784f44b90206738..e893046c4efe60a62d1bd012e1177a5b5c30a9b8 100644 (file)
@@ -71,7 +71,7 @@ Returns:
       CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
     }\r
 \r
-    gBS->FreePool (OldPool);\r
+    FreePool (OldPool);\r
   }\r
 \r
   return NewPool;\r
@@ -137,7 +137,7 @@ Returns:
     Str->len = strsize - sizeof (UINT16);\r
   }\r
 \r
-  gBS->FreePool (AppendStr);\r
+  FreePool (AppendStr);\r
   return Str->str;\r
 }\r
 \r
@@ -1059,7 +1059,7 @@ DevicePathToStr (
   //\r
   // Shrink pool used for string allocation\r
   //\r
-  gBS->FreePool (DevPath);\r
+  FreePool (DevPath);\r
 \r
 Done:\r
   NewSize = (Str.len + 1) * sizeof (CHAR16);\r
index 0357fcb69c4eec74ac6a9c8b4934d889e758ab45..d9420e43855049cf56d3b071276b432a053bd372 100644 (file)
@@ -6,7 +6,7 @@
     <GuidValue>1ec995b2-d15b-44f6-abd2-050ea7dd37d2</GuidValue>\r
     <Version>1.0</Version>\r
     <Abstract>EDK Generic BDS Common APIs Library Instance.</Abstract>\r
-    <Description>The library instance provides common library routines help in \r
+    <Description>The library instance provides common library routines help in\r
     performance measurement, device path debug print, boot device selections,\r
     boot device connection, console supports in BDS phase and boot from boot\r
     device.</Description>\r
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
   <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <SupportedArchitectures>IA32</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
     <OutputFileBasename>EdkGenericBdsLib</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER">\r
       <Keyword>EdkGenericBdsLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
@@ -76,7 +76,6 @@
     <Filename>Performance.h</Filename>\r
     <Filename>Performance.c</Filename>\r
     <Filename>BdsMisc.c</Filename>\r
-    <Filename SupArchList="IPF">Ipf/ShadowRom.c</Filename>\r
   </SourceFiles>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
index f0ac12e0d6ad53da64e4af640ed3f54c6991b863..2d157aebb3563271aef90135bd45b23fb5fabf04 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
@@ -33,7 +33,7 @@ GetShortPdbFileName (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
 Arguments:\r
 \r
 Returns:\r
@@ -176,13 +176,13 @@ WriteBootToOsPerformanceData (
 /*++\r
 \r
 Routine Description:\r
-  \r
+\r
   Allocates a block of memory and writes performance data of booting to OS into it.\r
 \r
 Arguments:\r
-  \r
+\r
   None\r
-  \r
+\r
 Returns:\r
 \r
   None\r
@@ -328,7 +328,7 @@ Returns:
     }\r
   }\r
 \r
-  gBS->FreePool (Handles);\r
+  FreePool (Handles);\r
 \r
   //\r
   // Get inserted performance data\r
index 624f928e7d3d09e2f4420ecc0a25635f11ce1de4..79fc9ec7c723bff19ae63e3b3c10402d5dd5f9b1 100644 (file)
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
   <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <SupportedArchitectures>IA32</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
     <OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+    <LibraryClass Usage="ALWAYS_PRODUCED"  SupModuleList="PEI_CORE PEIM">\r
       <Keyword>PeCoffGetEntryPointLib</Keyword>\r
     </LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">\r
index e57dff1dc81a1d7646e9bcd746285be143484a95..1a76e04341b62f6ed4cbaa2310b48cab90913eb5 100644 (file)
     <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
   </MsaHeader>\r
   <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <SupportedArchitectures>IA32</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
     <OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE PEIM">\r
       <Keyword>EdkPeCoffLoaderLib</Keyword>\r
     </LibraryClass>\r
   </LibraryClassDefinitions>\r
index 8824dc412afd89cd368cf70559c8d91e2fdf851a..e71fadaa1c44a4120988f02875a7008ad143aa6e 100644 (file)
@@ -1,18 +1,18 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
+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
+\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
 Module Name:\r
 \r
   FWBlockService.c\r
-    \r
+\r
 Abstract:\r
 \r
 Revision History\r
@@ -81,14 +81,14 @@ Routine Description:
   date items to there virtual address.\r
 \r
   mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]  - Physical copy of instance data\r
-  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]   - Virtual pointer to common \r
+  mFvbModuleGlobal->FvInstance[FVB_VIRTUAL]   - Virtual pointer to common\r
                                                 instance data.\r
 \r
 Arguments:\r
 \r
   (Standard EFI notify event - EFI_EVENT_NOTIFY)\r
 \r
-Returns: \r
+Returns:\r
 \r
   None\r
 \r
@@ -138,7 +138,7 @@ Arguments:
   FwhInstance           - The EFI_FW_VOL_INSTANCE fimrware instance structure\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
   EFI_INVALID_PARAMETER - Instance not found\r
 \r
@@ -182,14 +182,14 @@ Routine Description:
 Arguments:\r
   Instance              - The FV instance whose base address is going to be\r
                           returned\r
-  Address               - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS \r
+  Address               - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
                           that on successful return, contains the base address\r
-                          of the firmware volume. \r
+                          of the firmware volume.\r
   Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
   EFI_INVALID_PARAMETER - Instance not found\r
 \r
@@ -222,14 +222,14 @@ Routine Description:
   resulting attributes in output parameter\r
 \r
 Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
+  Instance              - The FV instance whose attributes is going to be\r
                           returned\r
   Attributes            - Output buffer which contains attributes\r
   Global                - Pointer to ESAL_FWB_GLOBAL that contains all\r
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
   EFI_INVALID_PARAMETER - Instance not found\r
 \r
@@ -266,7 +266,7 @@ Routine Description:
 Arguments:\r
   Instance              - The FV instance which the Lba belongs to\r
   Lba                   - The logical block address\r
-  LbaAddress            - On output, contains the physical starting address \r
+  LbaAddress            - On output, contains the physical starting address\r
                           of the Lba\r
   LbaLength             - On output, contains the length of the block\r
   NumOfBlocks           - A pointer to a caller allocated UINTN in which the\r
@@ -277,7 +277,7 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
   EFI_INVALID_PARAMETER - Instance not found\r
 \r
@@ -369,14 +369,14 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
+Returns:\r
+  EFI_SUCCESS           - The firmware volume was read successfully and\r
                           contents are in Buffer\r
   EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
                           NumBytes contains the total number of bytes returned\r
                           in Buffer\r
   EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be read\r
   EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
 \r
@@ -455,13 +455,13 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The firmware volume was written successfully\r
   EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
                           NumBytes contains the total number of bytes\r
                           actually written\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written\r
   EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL\r
 \r
@@ -533,10 +533,10 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The erase request was successfully completed\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written. Firmware device may have been\r
                           partially erased\r
   EFI_INVALID_PARAMETER - Instance not found\r
@@ -596,7 +596,7 @@ Routine Description:
 Arguments:\r
   Instance              - The FV instance to be erased\r
   StartLba              - The starting logical block index to be erased\r
-  OffsetStartLba        - Offset into the starting block at which to \r
+  OffsetStartLba        - Offset into the starting block at which to\r
                           begin erasing\r
   LastLba               - The last logical block index to be erased\r
   OffsetStartLba        - Offset into the last block at which to end erasing\r
@@ -604,10 +604,10 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The firmware volume was erased successfully\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written. Firmware device may have been\r
                           partially erased\r
   EFI_INVALID_PARAMETER - Instance not found\r
@@ -681,13 +681,13 @@ FvbSetVolumeAttributes (
 /*++\r
 \r
 Routine Description:\r
-  Modifies the current settings of the firmware volume according to the \r
+  Modifies the current settings of the firmware volume according to the\r
   input parameter, and returns the new setting of the volume\r
 \r
 Arguments:\r
-  Instance              - The FV instance whose attributes is going to be \r
+  Instance              - The FV instance whose attributes is going to be\r
                           modified\r
-  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES \r
+  Attributes            - On input, it is a pointer to EFI_FVB_ATTRIBUTES\r
                           containing the desired firmware volume settings.\r
                           On successful return, it contains the new settings\r
                           of the firmware volume\r
@@ -695,7 +695,7 @@ Arguments:
                           instance data\r
   Virtual               - Whether CPU is in virtual or physical mode\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
   EFI_ACCESS_DENIED     - The volume setting is locked and cannot be modified\r
   EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are\r
@@ -801,7 +801,7 @@ Arguments:
 \r
 Returns:\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
 \r
 --*/\r
@@ -836,8 +836,8 @@ Arguments:
                           returned. All blocks in this range have a size of\r
                           BlockSize\r
 \r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
+Returns:\r
+  EFI_SUCCESS           - The firmware volume was read successfully and\r
                           contents are in Buffer\r
 \r
 --*/\r
@@ -872,7 +872,7 @@ Arguments:
     This                - Calling context\r
     Attributes          - output buffer which contains attributes\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
 \r
 --*/\r
@@ -899,7 +899,7 @@ Arguments:
   This                  - Calling context\r
   Attributes            - output buffer which contains attributes\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - Successfully returns\r
 \r
 --*/\r
@@ -915,28 +915,28 @@ EFI_STATUS
 EFIAPI\r
 FvbProtocolEraseBlocks (\r
   IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL    *This,\r
-  ...  \r
+  ...\r
   )\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  The EraseBlock() function erases one or more blocks as denoted by the \r
+  The EraseBlock() function erases one or more blocks as denoted by the\r
   variable argument list. The entire parameter list of blocks must be verified\r
-  prior to erasing any blocks.  If a block is requested that does not exist \r
-  within the associated firmware volume (it has a larger index than the last \r
+  prior to erasing any blocks.  If a block is requested that does not exist\r
+  within the associated firmware volume (it has a larger index than the last\r
   block of the firmware volume), the EraseBlock() function must return\r
   EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
 \r
 Arguments:\r
   This                  - Calling context\r
-  ...                   - Starting LBA followed by Number of Lba to erase. \r
+  ...                   - Starting LBA followed by Number of Lba to erase.\r
                           a -1 to terminate the list.\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The erase request was successfully completed\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written. Firmware device may have been\r
                           partially erased\r
 \r
@@ -1037,13 +1037,13 @@ Arguments:
                           output, indicates the actual number of bytes written\r
   Buffer                - Buffer containing source data for the write.\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The firmware volume was written successfully\r
   EFI_BAD_BUFFER_SIZE   - Write attempted across a LBA boundary. On output,\r
                           NumBytes contains the total number of bytes\r
                           actually written\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written\r
   EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
 \r
@@ -1085,14 +1085,14 @@ Arguments:
                           output, indicates the actual number of bytes Read\r
   Buffer                - Buffer containing source data for the Read.\r
 \r
-Returns: \r
-  EFI_SUCCESS           - The firmware volume was read successfully and \r
+Returns:\r
+  EFI_SUCCESS           - The firmware volume was read successfully and\r
                           contents are in Buffer\r
   EFI_BAD_BUFFER_SIZE   - Read attempted across a LBA boundary. On output,\r
                           NumBytes contains the total number of bytes returned\r
                           in Buffer\r
   EFI_ACCESS_DENIED     - The firmware volume is in the ReadDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be read\r
   EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL\r
 \r
@@ -1125,15 +1125,15 @@ Routine Description:
 Arguments:\r
   This                  - Calling context\r
   StartLba              - The starting logical block index to be erased\r
-  OffsetStartLba        - Offset into the starting block at which to \r
+  OffsetStartLba        - Offset into the starting block at which to\r
                           begin erasing\r
   LastLba               - The last logical block index to be erased\r
   OffsetStartLba        - Offset into the last block at which to end erasing\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The firmware volume was erased successfully\r
   EFI_ACCESS_DENIED     - The firmware volume is in the WriteDisabled state\r
-  EFI_DEVICE_ERROR      - The block device is not functioning correctly and \r
+  EFI_DEVICE_ERROR      - The block device is not functioning correctly and\r
                           could not be written. Firmware device may have been\r
                           partially erased\r
 \r
@@ -1167,7 +1167,7 @@ Routine Description:
 Arguments:\r
   FwVolHeader           - A pointer to a firmware volume header\r
 \r
-Returns: \r
+Returns:\r
   EFI_SUCCESS           - The firmware volume is consistent\r
   EFI_NOT_FOUND         - The firmware volume has corrupted. So it is not an FV\r
 \r
@@ -1252,12 +1252,8 @@ Returns:
   // Allocate runtime services data for global variable, which contains\r
   // the private data of all firmware volume block instances\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  sizeof (ESAL_FWB_GLOBAL),\r
-                  &mFvbModuleGlobal\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));\r
+  ASSERT (mFvbModuleGlobal != NULL);\r
 \r
   //\r
   // Calculate the total size for all firmware volume block instances\r
@@ -1306,12 +1302,8 @@ Returns:
   // the private data of each FV instance. But in virtual mode or in physical\r
   // mode, the address of the the physical memory may be different.\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  BufferSize,\r
-                  &mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);\r
+  ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);\r
 \r
   //\r
   // Make a virtual copy of the FvInstance pointer.\r
@@ -1392,12 +1384,8 @@ Returns:
     //\r
     // Add a FVB Protocol Instance\r
     //\r
-    Status = gBS->AllocatePool (\r
-                    EfiRuntimeServicesData,\r
-                    sizeof (EFI_FW_VOL_BLOCK_DEVICE),\r
-                    &FvbDevice\r
-                    );\r
-    ASSERT_EFI_ERROR (Status);\r
+    FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
+    ASSERT (FvbDevice != NULL);\r
 \r
     CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));\r
 \r
@@ -1481,12 +1469,8 @@ Returns:
   //\r
   // Allocate for scratch space, an intermediate buffer for FVB extention\r
   //\r
-  Status = gBS->AllocatePool (\r
-                  EfiRuntimeServicesData,\r
-                  MaxLbaSize,\r
-                  &mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]\r
-                  );\r
-  ASSERT_EFI_ERROR (Status);\r
+  mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] = AllocateRuntimePool (MaxLbaSize);\r
+  ASSERT (mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] != NULL);\r
 \r
   mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL];\r
 \r