/*++\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
//\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
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
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
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
/*++\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
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
);\r
BbsItem->BootPriority = 0x00;\r
\r
- gBS->FreePool (DevPath);\r
+ FreePool (DevPath);\r
\r
return Status;\r
}\r
/*++\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
\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
DeviceHandle - A handle for a device\r
\r
Returns:\r
- \r
+\r
A valid file handle or NULL is returned\r
\r
--*/\r
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
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
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
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
\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
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
\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
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
/*++\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
\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
/*++\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
//\r
HandleBufferLength = 0;\r
HiiHandleBuffer = NULL;\r
- \r
+\r
Status = gBS->LocateProtocol (\r
&gEfiHiiProtocolGuid,\r
NULL,\r
//\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
*String\r
);\r
\r
- gBS->FreePool (HiiHandleBuffer);\r
+ FreePool (HiiHandleBuffer);\r
\r
return Status;\r
}\r
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
-/*++ \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
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
\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
\r
EFI_SUCCESS - Callback ended successfully.\r
Others - Contain some errors.\r
- \r
+\r
--*/\r
{\r
BMM_CALLBACK_DATA *Private;\r
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
//\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
None.\r
\r
Returns:\r
- None. \r
+ None.\r
--*/\r
{\r
STRING_DEPOSITORY *StringDepository;\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
BootOption.c\r
- \r
+\r
Abstract:\r
\r
Provide boot option support for Application "BootMaint"\r
Include file system navigation, system handle selection\r
\r
Boot option manipulation\r
- \r
+\r
Revision History\r
\r
--*/\r
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
)\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
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
//\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
//\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
TempStr\r
);\r
OptionNumber++;\r
- InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link); \r
+ InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);\r
}\r
}\r
\r
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
\r
Returns:\r
VOID\r
- \r
+\r
--*/\r
{\r
BM_MENU_ENTRY *MenuEntry;\r
)\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
/*++\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
/*++\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
Returns:\r
TRUE - Is Efi Image\r
FALSE - Not a valid Efi Image\r
- \r
+\r
--*/\r
{\r
//\r
{\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
\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
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
/*++\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
&gEfiGlobalVariableGuid,\r
&OptionSize\r
);\r
- if (NULL == OptionBuffer) \r
+ if (NULL == OptionBuffer)\r
break;\r
}\r
}\r
/*++\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
\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
Routine Description:\r
Wrap original FreePool gBS call\r
in order to decrease code length\r
- \r
+\r
Arguments:\r
\r
Returns:\r
--*/\r
{\r
if (Buffer != NULL) {\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
}\r
/*++\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
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
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
/*++\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
\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
\r
Data - A pointer to the data being sent to the original exporting driver.\r
\r
-Returns: \r
+Returns:\r
\r
--*/\r
{\r
//\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
\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
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
/*++\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
\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
\r
Data - A pointer to the data being sent to the original exporting driver.\r
\r
-Returns: \r
+Returns:\r
\r
--*/\r
{\r
\r
Arguments:\r
None\r
- \r
+\r
Returns:\r
\r
--*/\r
\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
//\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
/*++\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
}\r
}\r
\r
- gBS->FreePool (String);\r
+ FreePool (String);\r
\r
CreateGotoOpCode (\r
0x1000, // Device Manager Page\r
//\r
// Reset Buffer pointer to original location\r
//\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
}\r
}\r
//\r
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
\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
gCallbackKey = 4;\r
}\r
\r
- gBS->FreePool (UpdateData);\r
- gBS->FreePool (HiiHandles);\r
+ FreePool (UpdateData);\r
+ FreePool (HiiHandles);\r
\r
return Status;\r
}\r
/*++\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
Abstract:\r
\r
FrontPage routines to handle the callbacks and browser calls\r
- \r
+\r
--*/\r
\r
#include "Bds.h"\r
\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
\r
Data - A pointer to the data being sent to the original exporting driver.\r
\r
-Returns: \r
+Returns:\r
\r
--*/\r
{\r
Lang\r
);\r
\r
- gBS->FreePool (LanguageString);\r
+ FreePool (LanguageString);\r
gCallbackKey = 2;\r
break;\r
\r
(UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data),\r
0\r
);\r
- gBS->FreePool (TmpStr);\r
+ FreePool (TmpStr);\r
}\r
break;\r
\r
/*++\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
\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
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
\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
/*++\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
);\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
/*++\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
);\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
/*++\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
/*++\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
/*++\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
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
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
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
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
(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
\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
//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
/*++\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
Abstract:\r
\r
Language settings\r
- \r
+\r
Revision History\r
\r
--*/\r
\r
Arguments:\r
None\r
- \r
+\r
Returns:\r
\r
--*/\r
HiiHandle = 0;\r
Hii->NewPack (Hii, PackageList, &HiiHandle);\r
\r
- gBS->FreePool (PackageList);\r
+ FreePool (PackageList);\r
}\r
\r
VOID\r
/*++\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
}\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
/*++\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
/*++\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
/*++\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
&GenMemoryTest\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (Pos);\r
+ FreePool (Pos);\r
return EFI_SUCCESS;\r
}\r
\r
// 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
\r
if (TmpStr != NULL) {\r
gST->ConOut->OutputString (gST->ConOut, TmpStr);\r
- gBS->FreePool (TmpStr);\r
+ FreePool (TmpStr);\r
}\r
\r
do {\r
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
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
TestPercent,\r
(UINTN) PreviousValue\r
);\r
- gBS->FreePool (TmpStr);\r
+ FreePool (TmpStr);\r
}\r
}\r
\r
100,\r
(UINTN) PreviousValue\r
);\r
- gBS->FreePool (TmpStr);\r
+ FreePool (TmpStr);\r
}\r
\r
gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);\r
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
(UINTN) PreviousValue\r
);\r
\r
- gBS->FreePool (Pos);\r
+ FreePool (Pos);\r
\r
DataSize = sizeof (Value);\r
Status = gRT->GetVariable (\r
/*++\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
/*++\r
\r
Routine Description:\r
- \r
+\r
Initialize HII global accessor for string support\r
\r
Arguments:\r
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
Arguments:\r
\r
Id - String ID.\r
- \r
+\r
Returns:\r
\r
CHAR16 * - String from ID.\r
//\r
// Free the old pool\r
//\r
- gBS->FreePool (String);\r
+ FreePool (String);\r
\r
//\r
// Allocate new pool with correct value\r
/*++\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
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
//\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
\r
return Status;\r
\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
);\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
<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
/*++\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
\r
Abstract:\r
\r
- Console based on Win32 APIs. \r
+ Console based on Win32 APIs.\r
\r
--*/\r
\r
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
gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);\r
}\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
\r
return Status;\r
//\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
\r
return Status;\r
/*++\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
\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
} 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
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
\r
Done:\r
if (InputRecord != NULL) {\r
- gBS->FreePool (InputRecord);\r
+ FreePool (InputRecord);\r
}\r
\r
return Status;\r
<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
<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
/** @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
// 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;
}
//
FreeUnicodeStringTable (Private->ControllerNameTable);
}
- gBS->FreePool (Private);
+ FreePool (Private);
}
}
//
FreeUnicodeStringTable (Private->ControllerNameTable);
- gBS->FreePool (Private);
+ FreePool (Private);
}
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
)
{
- EFI_STATUS Status;
GOP_PRIVATE_DATA *Private;
Private = GOP_PRIVATE_DATA_FROM_THIS (This);
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);
}
- 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;
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) {
GOP_PRIVATE_DATA *Private
)
{
- EFI_STATUS Status;
-
Private->ModeData = mGopModeData;
Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode;
//
// 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.
//
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;
/*++\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
\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
\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
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
}\r
}\r
\r
- gBS->FreePool (OpenInfoBuffer);\r
+ FreePool (OpenInfoBuffer);\r
return Status;\r
}\r
\r
//\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
}\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
} 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
\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
}\r
\r
if (Private->DevicePath != NULL) {\r
- gBS->FreePool (Private->DevicePath);\r
+ FreePool (Private->DevicePath);\r
}\r
\r
Private->DevicePath = NewDevicePath;\r
if (ModemStatus & MS_RLSD_ON) {\r
Bits |= EFI_SERIAL_CARRIER_DETECT;\r
}\r
- \r
+\r
//\r
// Get ctrl status\r
//\r
if (Private->HardwareLoopbackEnable) {\r
Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;\r
}\r
- \r
+\r
//\r
// Get input buffer status\r
//\r
Control |= EFI_SERIAL_REQUEST_TO_SEND;\r
WinNtSerialIoSetControl (&Private->SerialIo, Control);\r
}\r
- \r
+\r
//\r
// Do the write\r
//\r
\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
\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
\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
if (IsaSerialFifoFull (Fifo)) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// FIFO is not full can add data\r
//\r
\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
if (IsaSerialFifoEmpty (Fifo)) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// FIFO is not empty, can remove data\r
//\r
<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
/*++\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
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
for (Pointer = Str; *(Pointer + Count); Pointer++) {\r
*Pointer = *(Pointer + Count);\r
}\r
- *Pointer = *(Pointer + Count); \r
+ *Pointer = *(Pointer + Count);\r
}\r
}\r
\r
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
\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
\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
\r
gBS->CloseProtocol (\r
//\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
\r
return Status;\r
\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
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
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
//\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
}\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
//\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
//\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
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
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
\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
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
//\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
\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
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
}\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
}\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
}\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
}\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
}\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
}\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
}\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
);\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
\r
FileSize = FileInfo->FileSize;\r
\r
- gBS->FreePool (FileInfo);\r
+ FreePool (FileInfo);\r
\r
if (Pos >= FileSize) {\r
*BufferSize = 0;\r
}\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
}\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
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
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
//\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
&TotalClusters\r
);\r
if (DriveName) {\r
- gBS->FreePool (DriveName);\r
+ FreePool (DriveName);\r
}\r
\r
if (NtStatus) {\r
\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
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
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
// 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
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
//\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
NULL\r
);\r
\r
- gBS->FreePool (TempFileName);\r
+ FreePool (TempFileName);\r
\r
//\r
// Flush buffers just in case\r
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
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
PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);\r
}\r
\r
- gBS->FreePool (TempFileName);\r
+ FreePool (TempFileName);\r
\r
goto Done;\r
\r
\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
}\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
<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
<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
/*++\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
\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
//\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
FreeUnicodeStringTable (Private->ControllerNameTable);\r
}\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
}\r
}\r
\r
//\r
FreeUnicodeStringTable (Private->ControllerNameTable);\r
\r
- gBS->FreePool (Private);\r
+ FreePool (Private);\r
\r
}\r
\r
\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
/*++\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
\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
\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
\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
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
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
// 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
/*++\r
\r
Routine Description:\r
- Win32 Windows event handler. \r
+ Win32 Windows event handler.\r
\r
Arguments:\r
See Win32 Book\r
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
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
/*++\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
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
}\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
);\r
if (EFI_ERROR (Status)) {\r
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
- gBS->FreePool (WinNtBusDevice);\r
+ FreePool (WinNtBusDevice);\r
return Status;\r
}\r
}\r
Count\r
);\r
if (WinNtDevice->DevicePath == NULL) {\r
- gBS->FreePool (WinNtDevice);\r
+ FreePool (WinNtDevice);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
);\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
StartString = SubString;\r
}\r
\r
- gBS->FreePool (TempStr);\r
+ FreePool (TempStr);\r
}\r
\r
return EFI_SUCCESS;\r
\r
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);\r
\r
- gBS->FreePool (WinNtBusDevice);\r
+ FreePool (WinNtBusDevice);\r
\r
gBS->CloseProtocol (\r
ControllerHandle,\r
// Close the child handle\r
//\r
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);\r
- gBS->FreePool (WinNtDevice);\r
+ FreePool (WinNtDevice);\r
}\r
}\r
\r
<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
/*++\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
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
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
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
\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
\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
\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
if (TimerValue == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// No timer supported\r
//\r
\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
\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
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
DEBUG ((EFI_D_ERROR, "CPU Architectural Protocol Loaded\n"));\r
\r
\r
- \r
+\r
return Status;\r
}\r
\r
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
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
TotalSize\r
);\r
\r
- gBS->FreePool (RecordBuffer.Raw);\r
+ FreePool (RecordBuffer.Raw);\r
}\r
\r
gBS->CloseProtocol (\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>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
/*++\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
/*++\r
\r
Routine Description:\r
- \r
+\r
Boot the legacy system with the boot option\r
\r
Arguments:\r
\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
\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
// Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event\r
//\r
EfiSignalEventReadyToBoot ();\r
- \r
+\r
//\r
// Set Boot Current\r
//\r
BlkIo->Media->BlockSize,\r
Buffer\r
);\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
}\r
}\r
\r
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
\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
// 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
}\r
}\r
\r
- gBS->FreePool (BlockIoBuffer);\r
+ FreePool (BlockIoBuffer);\r
return Status;\r
}\r
\r
&BootOptionSize\r
);\r
if (NULL == BootOptionVar) {\r
- gBS->FreePool (BootOrder);\r
+ FreePool (BootOrder);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
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
BootOrder\r
);\r
\r
- gBS->FreePool (BootOrder);\r
+ FreePool (BootOrder);\r
\r
return Status;\r
}\r
&BootOptionSize\r
);\r
if (NULL == BootOptionVar) {\r
- gBS->FreePool (BootOrder);\r
+ FreePool (BootOrder);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
//\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
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
// 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
BootOrder[Index] = 0xffff;\r
}\r
\r
- gBS->FreePool (BootOptionVar);\r
+ FreePool (BootOptionVar);\r
Index++;\r
}\r
\r
BootOrder\r
);\r
\r
- gBS->FreePool (BootOrder);\r
+ FreePool (BootOrder);\r
\r
return Status;\r
}\r
}\r
\r
if (NumberFileSystemHandles) {\r
- gBS->FreePool (FileSystemHandles);\r
+ FreePool (FileSystemHandles);\r
}\r
//\r
// Parse Network Boot Device\r
}\r
\r
if (NumberLoadFileHandles) {\r
- gBS->FreePool (LoadFileHandles);\r
+ FreePool (LoadFileHandles);\r
}\r
//\r
// Check if we have on flash shell\r
}\r
\r
if (FvHandleCount) {\r
- gBS->FreePool (FvHandleBuffer);\r
+ FreePool (FvHandleBuffer);\r
}\r
//\r
// Make sure every boot only have one time\r
/*++\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
/*++\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
/*++\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
/*++\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
/*++\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
/*++\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
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
\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
} 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
\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
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
Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);\r
}\r
\r
- gBS->FreePool (HandleBuffer);\r
+ FreePool (HandleBuffer);\r
\r
return EFI_SUCCESS;\r
}\r
\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
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
Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
}\r
\r
- gBS->FreePool (HandleBuffer);\r
+ FreePool (HandleBuffer);\r
\r
return EFI_SUCCESS;\r
}\r
\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
/*++\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
)\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
while (*Ptr) {\r
Ptr++;\r
}\r
- \r
+\r
if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {\r
return FALSE;\r
} else {\r
\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
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
&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
BdsLibSafeFreePool(TempNewDevicePath);\r
}\r
}\r
- \r
+\r
//\r
// The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.\r
//\r
//\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
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
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
\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
\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
\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
/*++\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
\r
Routine Description:\r
- \r
+\r
Return the default value for system Timeout variable.\r
\r
Arguments:\r
None\r
\r
Returns:\r
- \r
+\r
Timeout value.\r
\r
--*/\r
/*++\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
BdsDriverLists - The header of the current driver option link list\r
\r
Returns:\r
- \r
+\r
None\r
\r
--*/\r
/*++\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
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
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
//\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
}\r
}\r
\r
- gBS->FreePool (OptionPtr);\r
+ FreePool (OptionPtr);\r
}\r
\r
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath);\r
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
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
\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
//\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
\r
}\r
\r
- gBS->FreePool (OptionOrder);\r
+ FreePool (OptionOrder);\r
\r
return EFI_SUCCESS;\r
}\r
Free pool safely.\r
\r
Arguments:\r
- \r
+\r
Buffer - The allocated pool entry to free\r
\r
Returns:\r
--*/\r
{\r
if (Buffer != NULL) {\r
- gBS->FreePool (Buffer);\r
+ FreePool (Buffer);\r
Buffer = NULL;\r
}\r
}\r
\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
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
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);\r
InstanceSize -= END_DEVICE_PATH_LENGTH;\r
}\r
- \r
+\r
return NewDevicePath;\r
}\r
\r
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
// 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
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
\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
/*++\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
--*/\r
{\r
mFeaturerSwitch = TRUE;\r
-} \r
+}\r
\r
VOID\r
DisableResetReminderFeature (\r
/*++\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
--*/\r
{\r
mFeaturerSwitch = FALSE;\r
-} \r
+}\r
\r
VOID\r
EnableResetRequired (\r
/*++\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
--*/\r
{\r
mResetRequired = TRUE;\r
-} \r
+}\r
\r
VOID\r
DisableResetRequired (\r
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
--*/\r
{\r
mResetRequired = FALSE;\r
-} \r
+}\r
\r
BOOLEAN\r
IsResetReminderFeatureEnable (\r
/*++\r
\r
Routine Description:\r
- \r
+\r
Check whether platform policy enable the reset reminder feature. The default is enabled.\r
\r
Arguments:\r
/*++\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
/*++\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
{\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
//\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
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
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
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
//\r
ASSERT_EFI_ERROR (Status);\r
}\r
- \r
+\r
*HandleBufferLength = TempBufferLength;\r
- \r
+\r
return Status;\r
- \r
+\r
}\r
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
}\r
\r
- gBS->FreePool (OldPool);\r
+ FreePool (OldPool);\r
}\r
\r
return NewPool;\r
Str->len = strsize - sizeof (UINT16);\r
}\r
\r
- gBS->FreePool (AppendStr);\r
+ FreePool (AppendStr);\r
return Str->str;\r
}\r
\r
//\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
<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
<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
/*++\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
/*++\r
\r
Routine Description:\r
- \r
+\r
Arguments:\r
\r
Returns:\r
/*++\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
}\r
}\r
\r
- gBS->FreePool (Handles);\r
+ FreePool (Handles);\r
\r
//\r
// Get inserted performance data\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>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
<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
/*++\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
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
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
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
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
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
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
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
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
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
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
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
/*++\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
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
\r
Returns:\r
\r
-Returns: \r
+Returns:\r
EFI_SUCCESS - Successfully returns\r
\r
--*/\r
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
This - Calling context\r
Attributes - output buffer which contains attributes\r
\r
-Returns: \r
+Returns:\r
EFI_SUCCESS - Successfully returns\r
\r
--*/\r
This - Calling context\r
Attributes - output buffer which contains attributes\r
\r
-Returns: \r
+Returns:\r
EFI_SUCCESS - Successfully returns\r
\r
--*/\r
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
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
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
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
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
// 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
// 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
//\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
//\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