1. Perfect libraries MSA files

2. Use MemoryAllocationLib to replace gBS memory services in EdkEt32Pkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2517 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff
2007-03-30 06:15:19 +00:00
parent db29f969a9
commit fa332de749
43 changed files with 893 additions and 1042 deletions

View File

@@ -1,19 +1,19 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
MiscSubclassDriverEntryPoint.c MiscSubclassDriverEntryPoint.c
Abstract: Abstract:
This driver parses the mMiscSubclassDataTable structure and reports This driver parses the mMiscSubclassDataTable structure and reports
any generated data to the DataHub. any generated data to the DataHub.
@@ -201,7 +201,7 @@ Returns:
// //
PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings); PackageList = PreparePackages (1, &gEfiMiscSubClassGuid, MiscSubclassStrings);
EfiStatus = Hii->NewPack (Hii, PackageList, &HiiHandle); EfiStatus = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
if (EFI_ERROR (EfiStatus)) { if (EFI_ERROR (EfiStatus)) {
DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus)); DEBUG ((EFI_D_ERROR, "Could not log default strings to Hii. %r\n", EfiStatus));
@@ -351,8 +351,8 @@ Routine Description:
Arguments: Arguments:
String - Unicode string. String - Unicode string.
Returns: Returns:
UINTN of the number represented by String. UINTN of the number represented by String.
--*/ --*/
{ {

View File

@@ -445,7 +445,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED)); TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }
@@ -487,7 +487,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_FAILED)); TmpStr = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL); BdsLibOutputStrings (gST->ConOut, TmpStr, Option->Description, L"\n\r", NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -486,19 +486,19 @@ BdsDeleteAllInvalidLegacyBootOptions (
Index++; Index++;
continue; continue;
} }
// //
// Check if BBS Description String is changed // Check if BBS Description String is changed
// //
DescStringMatch = FALSE; DescStringMatch = FALSE;
BdsBuildLegacyDevNameString ( BdsBuildLegacyDevNameString (
&LocalBbsTable[BbsIndex], &LocalBbsTable[BbsIndex],
BbsIndex, BbsIndex,
sizeof(BootDesc), sizeof(BootDesc),
BootDesc BootDesc
); );
if (StrCmp (BootDesc, (UINT16*)(BootOptionVar + sizeof (UINT32) + sizeof (UINT16))) == 0) { if (StrCmp (BootDesc, (UINT16*)(BootOptionVar + sizeof (UINT32) + sizeof (UINT16))) == 0) {
DescStringMatch = TRUE; DescStringMatch = TRUE;
} }
@@ -634,7 +634,7 @@ BdsCreateOneLegacyBootOption (
); );
BbsItem->BootPriority = 0x00; BbsItem->BootPriority = 0x00;
gBS->FreePool (DevPath); FreePool (DevPath);
return Status; return Status;
} }

View File

@@ -1,18 +1,18 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
BmLib.c BmLib.c
AgBStract: AgBStract:
Boot Maintainence Helper functions Boot Maintainence Helper functions
@@ -30,13 +30,13 @@ EfiLibLocateProtocol (
Routine Description: Routine Description:
Find the first instance of this Protocol Find the first instance of this Protocol
in the system and return it's interface in the system and return it's interface
Arguments: Arguments:
ProtocolGuid - Provides the protocol to search for ProtocolGuid - Provides the protocol to search for
Interface - On return, a pointer to the first interface Interface - On return, a pointer to the first interface
that matches ProtocolGuid that matches ProtocolGuid
Returns: Returns:
@@ -72,7 +72,7 @@ Arguments:
DeviceHandle - A handle for a device DeviceHandle - A handle for a device
Returns: Returns:
A valid file handle or NULL is returned A valid file handle or NULL is returned
--*/ --*/
@@ -118,7 +118,7 @@ EfiGrowBuffer (
Routine Description: Routine Description:
Helper function called as part of the code needed Helper function called as part of the code needed
to allocate the proper sized buffer for various to allocate the proper sized buffer for various
EFI interfaces. EFI interfaces.
Arguments: Arguments:
@@ -128,10 +128,10 @@ Arguments:
Buffer - Current allocated buffer, or NULL Buffer - Current allocated buffer, or NULL
BufferSize - Current buffer size needed BufferSize - Current buffer size needed
Returns: Returns:
TRUE - if the buffer was reallocated and the caller TRUE - if the buffer was reallocated and the caller
should try the API again. should try the API again.
--*/ --*/
@@ -182,7 +182,7 @@ Routine Description:
Function returns the value of the specified variable. Function returns the value of the specified variable.
Arguments: Arguments:
Name - A Null-terminated Unicode string that is Name - A Null-terminated Unicode string that is
the name of the vendor's variable. the name of the vendor's variable.
VendorGuid - A unique identifier for the vendor. VendorGuid - A unique identifier for the vendor.
@@ -209,7 +209,7 @@ Routine Description:
Function deletes the variable specified by VarName and VarGuid. Function deletes the variable specified by VarName and VarGuid.
Arguments: Arguments:
VarName - A Null-terminated Unicode string that is VarName - A Null-terminated Unicode string that is
the name of the vendor's variable. the name of the vendor's variable.
VendorGuid - A unique identifier for the vendor. VendorGuid - A unique identifier for the vendor.
@@ -252,7 +252,7 @@ EfiLibFileSystemVolumeLabelInfo (
Routine Description: Routine Description:
Function gets the file system information from an open file descriptor, Function gets the file system information from an open file descriptor,
and stores it in a buffer allocated from pool. and stores it in a buffer allocated from pool.
Arguments: Arguments:
@@ -260,7 +260,7 @@ Arguments:
Fhand - A file handle Fhand - A file handle
Returns: Returns:
A pointer to a buffer with file information or NULL is returned A pointer to a buffer with file information or NULL is returned
--*/ --*/
@@ -315,7 +315,7 @@ EfiLibFileInfo (
Routine Description: Routine Description:
Function gets the file information from an open file descriptor, and stores it Function gets the file information from an open file descriptor, and stores it
in a buffer allocated from pool. in a buffer allocated from pool.
Arguments: Arguments:
@@ -323,7 +323,7 @@ Arguments:
Fhand - A file handle Fhand - A file handle
Returns: Returns:
A pointer to a buffer with file information or NULL is returned A pointer to a buffer with file information or NULL is returned
--*/ --*/
@@ -360,7 +360,7 @@ EfiDevicePathInstanceCount (
/*++ /*++
Routine Description: Routine Description:
Function is used to determine the number of device path instances Function is used to determine the number of device path instances
that exist in a device path. that exist in a device path.
Arguments: Arguments:
@@ -368,7 +368,7 @@ Arguments:
Returns: Returns:
This function counts and returns the number of device path instances This function counts and returns the number of device path instances
in DevicePath. in DevicePath.
--*/ --*/
@@ -437,15 +437,15 @@ EfiLibGetStringFromToken (
/*++ /*++
Routine Description: Routine Description:
Acquire the string associated with the ProducerGuid and return it. Acquire the string associated with the ProducerGuid and return it.
Arguments: Arguments:
ProducerGuid - The Guid to search the HII database for ProducerGuid - The Guid to search the HII database for
Token - The token value of the string to extract Token - The token value of the string to extract
String - The string that is extracted String - The string that is extracted
Returns: Returns:
EFI_SUCCESS - Buffer filled with the requested forms. BufferLength EFI_SUCCESS - Buffer filled with the requested forms. BufferLength
@@ -469,7 +469,7 @@ Returns:
// //
HandleBufferLength = 0; HandleBufferLength = 0;
HiiHandleBuffer = NULL; HiiHandleBuffer = NULL;
Status = gBS->LocateProtocol ( Status = gBS->LocateProtocol (
&gEfiHiiProtocolGuid, &gEfiHiiProtocolGuid,
NULL, NULL,
@@ -484,7 +484,7 @@ Returns:
// //
Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandleBuffer); Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandleBuffer);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
// //
// Get the Hii Handle that matches the StructureNode->ProducerName // Get the Hii Handle that matches the StructureNode->ProducerName
// //
@@ -518,7 +518,7 @@ Returns:
*String *String
); );
gBS->FreePool (HiiHandleBuffer); FreePool (HiiHandleBuffer);
return Status; return Status;
} }
@@ -541,7 +541,7 @@ Arguments:
Returns: Returns:
TRUE The FirstTime is not later than the SecondTime. TRUE The FirstTime is not later than the SecondTime.
FALSE The FirstTime is later than the SecondTime. FALSE The FirstTime is later than the SecondTime.
--*/ --*/
{ {
if (FirstTime->Year != SecondTime->Year) { if (FirstTime->Year != SecondTime->Year) {

View File

@@ -1,18 +1,18 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
BootMaint.c BootMaint.c
Abstract: Abstract:
Boot Maintainence Main File Boot Maintainence Main File
@@ -58,15 +58,15 @@ Routine Description:
Arguments: Arguments:
HiiHandle - Hii Handle of the package to be updated. HiiHandle - Hii Handle of the package to be updated.
MenuOption - The Menu whose string tokens need to be created MenuOption - The Menu whose string tokens need to be created
Returns: Returns:
EFI_SUCCESS - string tokens created successfully EFI_SUCCESS - string tokens created successfully
others - contain some errors others - contain some errors
--*/ --*/
{ {
BM_MENU_ENTRY *NewMenuEntry; BM_MENU_ENTRY *NewMenuEntry;
@@ -113,7 +113,7 @@ Routine Description:
Arguments: Arguments:
This - File explorer callback protocol pointer. This - File explorer callback protocol pointer.
KeyValue - Key value to identify the type of data to expect. KeyValue - Key value to identify the type of data to expect.
Data - A pointer to the data being sent to the original exporting driver. Data - A pointer to the data being sent to the original exporting driver.
Packet - A pointer to a packet of information which a driver passes back to the browser. Packet - A pointer to a packet of information which a driver passes back to the browser.
@@ -122,7 +122,7 @@ Returns:
EFI_SUCCESS - Callback ended successfully. EFI_SUCCESS - Callback ended successfully.
Others - Contain some errors. Others - Contain some errors.
--*/ --*/
{ {
BMM_CALLBACK_DATA *Private; BMM_CALLBACK_DATA *Private;
@@ -729,15 +729,15 @@ Routine Description:
Arguments: Arguments:
ImageHandle - caller provided handle ImageHandle - caller provided handle
SystemTable - caller provided system tables SystemTable - caller provided system tables
Returns: Returns:
EFI_SUCCESS - utility ended successfully EFI_SUCCESS - utility ended successfully
others - contain some errors others - contain some errors
--*/ --*/
{ {
EFI_LEGACY_BIOS_PROTOCOL *LegacyBios; EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;
@@ -849,13 +849,13 @@ Returns:
// //
PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
BmmCallbackInfo->BmmHiiHandle = HiiHandle; BmmCallbackInfo->BmmHiiHandle = HiiHandle;
PackageList = PreparePackages (1, &gBdsStringPackGuid, FEBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, FEBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
BmmCallbackInfo->FeHiiHandle = HiiHandle; BmmCallbackInfo->FeHiiHandle = HiiHandle;
@@ -1036,7 +1036,7 @@ Arguments:
None. None.
Returns: Returns:
None. None.
--*/ --*/
{ {
STRING_DEPOSITORY *StringDepository; STRING_DEPOSITORY *StringDepository;

View File

@@ -1,17 +1,17 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
BootOption.c BootOption.c
Abstract: Abstract:
Provide boot option support for Application "BootMaint" Provide boot option support for Application "BootMaint"
@@ -19,7 +19,7 @@ Abstract:
Include file system navigation, system handle selection Include file system navigation, system handle selection
Boot option manipulation Boot option manipulation
Revision History Revision History
--*/ --*/
@@ -42,7 +42,7 @@ Arguments:
Menu type Menu type
Returns: Returns:
NULL Cannot allocate memory for current menu NULL Cannot allocate memory for current menu
entry entry
Others A valid pointer pointing to the allocated Others A valid pointer pointing to the allocated
memory pool for current menu entry memory pool for current menu entry
@@ -195,11 +195,11 @@ BOpt_GetMenuEntry (
) )
/*++ /*++
Rountine Description : Rountine Description :
Use this routine to get one particular menu entry in specified Use this routine to get one particular menu entry in specified
menu menu
Arguments : Arguments :
MenuOption The menu that we will search MenuOption The menu that we will search
MenuNumber The menunubmer that we want MenuNumber The menunubmer that we want
@@ -238,7 +238,7 @@ Routine Description
protocol, Load File protocol. protocol, Load File protocol.
Building up the FileSystem Menu for user selection Building up the FileSystem Menu for user selection
All file system will be stored in FsOptionMenu All file system will be stored in FsOptionMenu
for future use. for future use.
Arguments: Arguments:
@@ -303,7 +303,7 @@ Returns:
// //
// If block IO exists check to see if it's remobable media // If block IO exists check to see if it's remobable media
// //
RemovableMedia = BlkIo->Media->RemovableMedia; RemovableMedia = BlkIo->Media->RemovableMedia;
} }
// //
@@ -311,12 +311,12 @@ Returns:
// //
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
if (NULL == MenuEntry) { if (NULL == MenuEntry) {
SafeFreePool (SimpleFsHandle); SafeFreePool (SimpleFsHandle);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext; FileContext = (BM_FILE_CONTEXT *) MenuEntry->VariableContext;
FileContext->Handle = SimpleFsHandle[Index]; FileContext->Handle = SimpleFsHandle[Index];
MenuEntry->OptionNumber = Index; MenuEntry->OptionNumber = Index;
FileContext->FHandle = EfiLibOpenRoot (FileContext->Handle); FileContext->FHandle = EfiLibOpenRoot (FileContext->Handle);
@@ -364,7 +364,7 @@ Returns:
TempStr TempStr
); );
OptionNumber++; OptionNumber++;
InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link); InsertTailList (&FsOptionMenu.Head, &MenuEntry->Link);
} }
} }
@@ -386,7 +386,7 @@ Returns:
for (Index = 0; Index < NoLoadFileHandles; Index++) { for (Index = 0; Index < NoLoadFileHandles; Index++) {
MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT); MenuEntry = BOpt_CreateMenuEntry (BM_FILE_CONTEXT_SELECT);
if (NULL == MenuEntry) { if (NULL == MenuEntry) {
SafeFreePool (LoadFileHandle); SafeFreePool (LoadFileHandle);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@@ -494,7 +494,7 @@ Arguments:
Returns: Returns:
VOID VOID
--*/ --*/
{ {
BM_MENU_ENTRY *MenuEntry; BM_MENU_ENTRY *MenuEntry;
@@ -675,15 +675,15 @@ BOpt_GetLegacyOptions (
) )
/*++ /*++
Routine Description: Routine Description:
Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo(). Build the LegacyFDMenu LegacyHDMenu LegacyCDMenu according to LegacyBios.GetBbsInfo().
Arguments: Arguments:
None None
Returns: Returns:
The device info of legacy device. The device info of legacy device.
--*/ --*/
{ {
BM_MENU_ENTRY *NewMenuEntry; BM_MENU_ENTRY *NewMenuEntry;
@@ -832,16 +832,16 @@ BOpt_GetBootOptions (
/*++ /*++
Routine Description: Routine Description:
Build the BootOptionMenu according to BootOrder Variable. Build the BootOptionMenu according to BootOrder Variable.
This Routine will access the Boot#### to get EFI_LOAD_OPTION This Routine will access the Boot#### to get EFI_LOAD_OPTION
Arguments: Arguments:
None None
Returns: Returns:
The number of the Var Boot#### The number of the Var Boot####
--*/ --*/
{ {
UINTN Index; UINTN Index;
@@ -1148,7 +1148,7 @@ BOpt_IsEfiImageName (
/*++ /*++
Routine Description Routine Description
Check whether current FileName point to a valid Check whether current FileName point to a valid
Efi Image File. Efi Image File.
Arguments: Arguments:
@@ -1157,7 +1157,7 @@ Arguments:
Returns: Returns:
TRUE - Is Efi Image TRUE - Is Efi Image
FALSE - Not a valid Efi Image FALSE - Not a valid Efi Image
--*/ --*/
{ {
// //
@@ -1198,7 +1198,7 @@ IsEfiAppReadFromFile (
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_FILE_HANDLE File; EFI_FILE_HANDLE File;
File = (EFI_FILE_HANDLE)FileHandle; File = (EFI_FILE_HANDLE)FileHandle;
Status = File->SetPosition (File, FileOffset); Status = File->SetPosition (File, FileOffset);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@@ -1219,15 +1219,15 @@ BOpt_IsEfiApp (
Routine Description: Routine Description:
Check whether current FileName point to a valid Efi Application Check whether current FileName point to a valid Efi Application
Arguments: Arguments:
Dir - Pointer to current Directory Dir - Pointer to current Directory
FileName - Pointer to current File name. FileName - Pointer to current File name.
Returns: Returns:
TRUE - Is a valid Efi Application TRUE - Is a valid Efi Application
FALSE - not a valid Efi Application FALSE - not a valid Efi Application
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
@@ -1268,7 +1268,7 @@ Routine Description
in current system environment in current system environment
All valid handles in the system except those consume SimpleFs, LoadFile All valid handles in the system except those consume SimpleFs, LoadFile
are stored in DriverMenu for future use. are stored in DriverMenu for future use.
Arguments: Arguments:
None None
@@ -1363,13 +1363,13 @@ BOpt_GetBootOptionNumber (
/*++ /*++
Routine Description: Routine Description:
Get the Option Number that does not used Get the Option Number that does not used
Arguments: Arguments:
Returns: Returns:
The Option Number The Option Number
--*/ --*/
{ {
BM_MENU_ENTRY *NewMenuEntry; BM_MENU_ENTRY *NewMenuEntry;
@@ -1415,7 +1415,7 @@ Returns:
&gEfiGlobalVariableGuid, &gEfiGlobalVariableGuid,
&OptionSize &OptionSize
); );
if (NULL == OptionBuffer) if (NULL == OptionBuffer)
break; break;
} }
} }
@@ -1440,13 +1440,13 @@ BOpt_GetDriverOptionNumber (
/*++ /*++
Routine Description: Routine Description:
Get the Option Number that does not used Get the Option Number that does not used
Arguments: Arguments:
Returns: Returns:
The Option Number The Option Number
--*/ --*/
{ {
BM_MENU_ENTRY *NewMenuEntry; BM_MENU_ENTRY *NewMenuEntry;
@@ -1507,12 +1507,12 @@ BOpt_GetDriverOptions (
Routine Description: Routine Description:
Build up all DriverOptionMenu Build up all DriverOptionMenu
Arguments: Arguments:
Returns: Returns:
The Option Number The Option Number
--*/ --*/
{ {
UINTN Index; UINTN Index;
@@ -1671,7 +1671,7 @@ SafeFreePool (
Routine Description: Routine Description:
Wrap original FreePool gBS call Wrap original FreePool gBS call
in order to decrease code length in order to decrease code length
Arguments: Arguments:
Returns: Returns:
@@ -1679,7 +1679,7 @@ Returns:
--*/ --*/
{ {
if (Buffer != NULL) { if (Buffer != NULL) {
gBS->FreePool (Buffer); FreePool (Buffer);
Buffer = NULL; Buffer = NULL;
} }
} }

View File

@@ -1,18 +1,18 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
UpdatePage.c UpdatePage.c
AgBStract: AgBStract:
Dynamically Update the pages Dynamically Update the pages
@@ -179,7 +179,8 @@ BootThisFile (
CHAR16 *ExitData; CHAR16 *ExitData;
BDS_COMMON_OPTION *Option; BDS_COMMON_OPTION *Option;
Status = gBS->AllocatePool (EfiBootServicesData, sizeof (BDS_COMMON_OPTION), &Option); Option = AllocatePool (sizeof (BDS_COMMON_OPTION));
Option->Description = FileContext->FileName; Option->Description = FileContext->FileName;
Option->DevicePath = FileContext->DevicePath; Option->DevicePath = FileContext->DevicePath;
Option->LoadOptionsSize = 0; Option->LoadOptionsSize = 0;
@@ -218,7 +219,7 @@ UpdateConCOMPage (
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) { for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index); NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
CreateGotoOpCode ( CreateGotoOpCode (
FORM_CON_COM_SETUP_ID, FORM_CON_COM_SETUP_ID,
NewMenuEntry->DisplayStringToken, NewMenuEntry->DisplayStringToken,

View File

@@ -1,15 +1,15 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
BootManager.c BootManager.c
@@ -47,7 +47,7 @@ Routine Description:
This is the function that is called to provide results data to the driver. This data This is the function that is called to provide results data to the driver. This data
consists of a unique key which is used to identify what data is either being passed back consists of a unique key which is used to identify what data is either being passed back
or being asked for. or being asked for.
Arguments: Arguments:
@@ -57,7 +57,7 @@ Arguments:
Data - A pointer to the data being sent to the original exporting driver. Data - A pointer to the data being sent to the original exporting driver.
Returns: Returns:
--*/ --*/
{ {
@@ -170,7 +170,7 @@ Returns:
// //
PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, BdsStrings); PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, BdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gBootManagerHandle); Status = Hii->NewPack (Hii, PackageList, &gBootManagerHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// This example does not implement worker functions // This example does not implement worker functions
@@ -296,20 +296,20 @@ Returns:
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
ASSERT (gBrowser); ASSERT (gBrowser);
BootMngrMenuResetRequired = FALSE; BootMngrMenuResetRequired = FALSE;
gBrowser->SendForm ( gBrowser->SendForm (
gBrowser, gBrowser,
TRUE, TRUE,
&gBootManagerHandle, &gBootManagerHandle,
1, 1,
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL, NULL,
&BootMngrMenuResetRequired &BootMngrMenuResetRequired
); );
@@ -322,12 +322,12 @@ Returns:
if (gOption == NULL) { if (gOption == NULL) {
return ; return ;
} }
// //
//Will leave browser, check any reset required change is applied? if yes, reset system //Will leave browser, check any reset required change is applied? if yes, reset system
// //
SetupResetReminder (); SetupResetReminder ();
// //
// BugBug: This code looks repeated from the BDS. Need to save code space. // BugBug: This code looks repeated from the BDS. Need to save code space.
// //

View File

@@ -1,15 +1,15 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DeviceManager.c DeviceManager.c
@@ -51,7 +51,7 @@ Routine Description:
This is the function that is called to provide results data to the driver. This data This is the function that is called to provide results data to the driver. This data
consists of a unique key which is used to identify what data is either being passed back consists of a unique key which is used to identify what data is either being passed back
or being asked for. or being asked for.
Arguments: Arguments:
@@ -61,7 +61,7 @@ Arguments:
Data - A pointer to the data being sent to the original exporting driver. Data - A pointer to the data being sent to the original exporting driver.
Returns: Returns:
--*/ --*/
{ {
@@ -103,7 +103,7 @@ Routine Description:
Arguments: Arguments:
None None
Returns: Returns:
--*/ --*/
@@ -120,7 +120,7 @@ Returns:
PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin); PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin);
Status = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle); Status = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// This example does not implement worker functions for the NV accessor functions. Only a callback evaluator // This example does not implement worker functions for the NV accessor functions. Only a callback evaluator
@@ -157,7 +157,7 @@ Returns:
// //
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData); Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
return Status; return Status;
} }
@@ -168,17 +168,17 @@ CallDeviceManager (
/*++ /*++
Routine Description: Routine Description:
Call the browser and display the device manager Call the browser and display the device manager
Arguments: Arguments:
None None
Returns: Returns:
EFI_SUCCESS - Operation is successful. EFI_SUCCESS - Operation is successful.
EFI_INVALID_PARAMETER - If the inputs to SendForm function is not valid. EFI_INVALID_PARAMETER - If the inputs to SendForm function is not valid.
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
@@ -337,7 +337,7 @@ Returns:
} }
} }
gBS->FreePool (String); FreePool (String);
CreateGotoOpCode ( CreateGotoOpCode (
0x1000, // Device Manager Page 0x1000, // Device Manager Page
@@ -391,7 +391,7 @@ Returns:
// //
// Reset Buffer pointer to original location // Reset Buffer pointer to original location
// //
gBS->FreePool (Buffer); FreePool (Buffer);
} }
} }
// //
@@ -406,12 +406,12 @@ Returns:
FPCallbackInfo.Data.VideoBIOS = 0; FPCallbackInfo.Data.VideoBIOS = 0;
} else { } else {
FPCallbackInfo.Data.VideoBIOS = VideoOption[0]; FPCallbackInfo.Data.VideoBIOS = VideoOption[0];
gBS->FreePool (VideoOption); FreePool (VideoOption);
} }
ASSERT (FPCallbackInfo.Data.VideoBIOS <= 1); ASSERT (FPCallbackInfo.Data.VideoBIOS <= 1);
Status = gBS->AllocatePool (EfiBootServicesData, 2 * sizeof (IFR_OPTION), &IfrOptionList); IfrOptionList = AllocatePool (2 * sizeof (IFR_OPTION));
if (IfrOptionList != NULL) { if (IfrOptionList != NULL) {
IfrOptionList[0].Flags = EFI_IFR_FLAG_INTERACTIVE; IfrOptionList[0].Flags = EFI_IFR_FLAG_INTERACTIVE;
IfrOptionList[0].Key = SET_VIDEO_BIOS_TYPE_QUESTION_ID + 0x2000; IfrOptionList[0].Key = SET_VIDEO_BIOS_TYPE_QUESTION_ID + 0x2000;
@@ -437,7 +437,7 @@ Returns:
UpdateData->DataCount = 4; UpdateData->DataCount = 4;
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData); Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData);
gBS->FreePool (IfrOptionList); FreePool (IfrOptionList);
} }
BootDeviceMngrMenuResetRequired = FALSE; BootDeviceMngrMenuResetRequired = FALSE;
@@ -490,8 +490,8 @@ Returns:
gCallbackKey = 4; gCallbackKey = 4;
} }
gBS->FreePool (UpdateData); FreePool (UpdateData);
gBS->FreePool (HiiHandles); FreePool (HiiHandles);
return Status; return Status;
} }

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -16,7 +16,7 @@ Module Name:
Abstract: Abstract:
FrontPage routines to handle the callbacks and browser calls FrontPage routines to handle the callbacks and browser calls
--*/ --*/
#include "Bds.h" #include "Bds.h"
@@ -53,7 +53,7 @@ Routine Description:
This is the function that is called to provide results data to the driver. This data This is the function that is called to provide results data to the driver. This data
consists of a unique key which is used to identify what data is either being passed back consists of a unique key which is used to identify what data is either being passed back
or being asked for. or being asked for.
Arguments: Arguments:
@@ -63,7 +63,7 @@ Arguments:
Data - A pointer to the data being sent to the original exporting driver. Data - A pointer to the data being sent to the original exporting driver.
Returns: Returns:
--*/ --*/
{ {
@@ -136,7 +136,7 @@ Returns:
Lang Lang
); );
gBS->FreePool (LanguageString); FreePool (LanguageString);
gCallbackKey = 2; gCallbackKey = 2;
break; break;
@@ -179,7 +179,7 @@ Returns:
(UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data), (UINTN) (((EFI_IFR_DATA_ENTRY *) (DataArray+1))->Data),
0 0
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
break; break;
@@ -198,12 +198,12 @@ InitializeFrontPage (
/*++ /*++
Routine Description: Routine Description:
Initialize HII information for the FrontPage Initialize HII information for the FrontPage
Arguments: Arguments:
None None
Returns: Returns:
EFI_SUCCESS - The operation is successful. EFI_SUCCESS - The operation is successful.
EFI_DEVICE_ERROR - If the dynamic opcode creation failed. EFI_DEVICE_ERROR - If the dynamic opcode creation failed.
@@ -254,7 +254,7 @@ Returns:
Status = Hii->NewPack (Hii, PackageList, &gFrontPageHandle); Status = Hii->NewPack (Hii, PackageList, &gFrontPageHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// There will be only one FormConfig in the system // There will be only one FormConfig in the system
@@ -364,11 +364,11 @@ ReInitStrings:
OptionCount++; OptionCount++;
} }
gBS->FreePool (LanguageString); FreePool (LanguageString);
if (ReInitializeStrings) { if (ReInitializeStrings) {
gBS->FreePool (StringBuffer); FreePool (StringBuffer);
gBS->FreePool (OptionList); FreePool (OptionList);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -389,11 +389,11 @@ ReInitStrings:
Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
gBS->FreePool (UpdateData); FreePool (UpdateData);
// //
// gBS->FreePool (OptionList); // FreePool (OptionList);
// //
gBS->FreePool (StringBuffer); FreePool (StringBuffer);
return Status; return Status;
} }
@@ -404,13 +404,13 @@ CallFrontPage (
/*++ /*++
Routine Description: Routine Description:
Call the browser and display the front page Call the browser and display the front page
Arguments: Arguments:
None None
Returns: Returns:
--*/ --*/
@@ -442,7 +442,7 @@ Returns:
); );
// //
// Check whether user change any option setting which needs a reset to be effective // Check whether user change any option setting which needs a reset to be effective
// //
if (FrontPageMenuResetRequired) { if (FrontPageMenuResetRequired) {
EnableResetRequired (); EnableResetRequired ();
} }
@@ -461,15 +461,15 @@ GetStringFromToken (
/*++ /*++
Routine Description: Routine Description:
Acquire the string associated with the ProducerGuid and return it. Acquire the string associated with the ProducerGuid and return it.
Arguments: Arguments:
ProducerGuid - The Guid to search the HII database for ProducerGuid - The Guid to search the HII database for
Token - The token value of the string to extract Token - The token value of the string to extract
String - The string that is extracted String - The string that is extracted
Returns: Returns:
EFI_SUCCESS - The function returns EFI_SUCCESS always. EFI_SUCCESS - The function returns EFI_SUCCESS always.
@@ -529,11 +529,11 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (*String); FreePool (*String);
*String = GetStringById (STRING_TOKEN (STR_MISSING_STRING)); *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));
} }
gBS->FreePool (HiiHandleBuffer); FreePool (HiiHandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -545,14 +545,14 @@ ConvertProcessorToString (
/*++ /*++
Routine Description: Routine Description:
Convert Processor Frequency Data to a string Convert Processor Frequency Data to a string
Arguments: Arguments:
ProcessorFrequency - The frequency data to process ProcessorFrequency - The frequency data to process
String - The string that is created String - The string that is created
Returns: Returns:
--*/ --*/
@@ -590,14 +590,14 @@ ConvertMemorySizeToString (
/*++ /*++
Routine Description: Routine Description:
Convert Memory Size to a string Convert Memory Size to a string
Arguments: Arguments:
MemorySize - The size of the memory to process MemorySize - The size of the memory to process
String - The string that is created String - The string that is created
Returns: Returns:
--*/ --*/
@@ -621,13 +621,13 @@ UpdateFrontPageStrings (
/*++ /*++
Routine Description: Routine Description:
Update the banner information for the Front Page based on DataHub information Update the banner information for the Front Page based on DataHub information
Arguments: Arguments:
None None
Returns: Returns:
--*/ --*/
@@ -689,7 +689,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString); GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[0] = TRUE; Find[0] = TRUE;
} }
@@ -700,7 +700,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString); GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[1] = TRUE; Find[1] = TRUE;
} }
@@ -711,7 +711,7 @@ Returns:
GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString); GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[2] = TRUE; Find[2] = TRUE;
} }
@@ -722,7 +722,7 @@ Returns:
ConvertProcessorToString (ProcessorFrequency, &NewString); ConvertProcessorToString (ProcessorFrequency, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[3] = TRUE; Find[3] = TRUE;
} }
@@ -730,12 +730,12 @@ Returns:
(DataHeader->RecordType == EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER) (DataHeader->RecordType == EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER)
) { ) {
MemoryArray = (EFI_MEMORY_ARRAY_START_ADDRESS_DATA *) (DataHeader + 1); MemoryArray = (EFI_MEMORY_ARRAY_START_ADDRESS_DATA *) (DataHeader + 1);
ConvertMemorySizeToString((UINT32)(RShiftU64((MemoryArray->MemoryArrayEndAddress - ConvertMemorySizeToString((UINT32)(RShiftU64((MemoryArray->MemoryArrayEndAddress -
MemoryArray->MemoryArrayStartAddress + 1), 20)), MemoryArray->MemoryArrayStartAddress + 1), 20)),
&NewString); &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
gBS->FreePool (NewString); FreePool (NewString);
Find[4] = TRUE; Find[4] = TRUE;
} }
} }
@@ -753,15 +753,15 @@ PlatformBdsEnterFrontPage (
Routine Description: Routine Description:
This function is the main entry of the platform setup entry. This function is the main entry of the platform setup entry.
The function will present the main menu of the system setup, The function will present the main menu of the system setup,
this is the platform reference part and can be customize. this is the platform reference part and can be customize.
Arguments: Arguments:
TimeoutDefault - The fault time out value before the system TimeoutDefault - The fault time out value before the system
continue to boot. continue to boot.
ConnectAllHappened - The indicater to check if the connect all have ConnectAllHappened - The indicater to check if the connect all have
already happended. already happended.
Returns: Returns:
None None
@@ -890,7 +890,7 @@ Returns:
//Will leave browser, check any reset required change is applied? if yes, reset system //Will leave browser, check any reset required change is applied? if yes, reset system
// //
SetupResetReminder (); SetupResetReminder ();
// //
// Automatically load current entry // Automatically load current entry
// Note: The following lines of code only execute when Auto boot // Note: The following lines of code only execute when Auto boot

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -16,7 +16,7 @@ Module Name:
Abstract: Abstract:
Language settings Language settings
Revision History Revision History
--*/ --*/
@@ -311,7 +311,7 @@ Routine Description:
Arguments: Arguments:
None None
Returns: Returns:
--*/ --*/
@@ -326,7 +326,7 @@ Returns:
HiiHandle = 0; HiiHandle = 0;
Hii->NewPack (Hii, PackageList, &HiiHandle); Hii->NewPack (Hii, PackageList, &HiiHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
} }
VOID VOID
@@ -336,12 +336,12 @@ InitializeLanguage (
/*++ /*++
Routine Description: Routine Description:
Determine the current language that will be used Determine the current language that will be used
based on language related EFI Variables based on language related EFI Variables
Arguments: Arguments:
LangCodesSettingRequired - If required to set LangCode variable LangCodesSettingRequired - If required to set LangCode variable
Returns: Returns:
--*/ --*/
@@ -421,11 +421,11 @@ Returns:
} }
if (LangCodes) { if (LangCodes) {
gBS->FreePool (LangCodes); FreePool (LangCodes);
} }
if (LanguageString != NULL) { if (LanguageString != NULL) {
gBS->FreePool (LanguageString); FreePool (LanguageString);
} }
} }

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -38,19 +38,19 @@ PlatformBdsShowProgress (
/*++ /*++
Routine Description: Routine Description:
Show progress bar with title above it. It only works in UGA mode. Show progress bar with title above it. It only works in UGA mode.
Arguments: Arguments:
TitleForeground - Foreground color for Title. TitleForeground - Foreground color for Title.
TitleBackground - Background color for Title. TitleBackground - Background color for Title.
Title - Title above progress bar. Title - Title above progress bar.
ProgressColor - Progress bar color. ProgressColor - Progress bar color.
Progress - Progress (0-100) Progress - Progress (0-100)
Returns: Returns:
EFI_STATUS - Success update the progress bar EFI_STATUS - Success update the progress bar
--*/ --*/
@@ -203,19 +203,19 @@ BdsMemoryTest (
/*++ /*++
Routine Description: Routine Description:
Perform the memory test base on the memory test intensive level, Perform the memory test base on the memory test intensive level,
and update the memory resource. and update the memory resource.
Arguments: Arguments:
Level - The memory test intensive level. Level - The memory test intensive level.
Returns: Returns:
EFI_STATUS - Success test all the system memory and update EFI_STATUS - Success test all the system memory and update
the memory resource the memory resource
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
@@ -274,7 +274,7 @@ Returns:
&GenMemoryTest &GenMemoryTest
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (Pos); FreePool (Pos);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -291,7 +291,7 @@ Returns:
// do the test, and then the status of EFI_NO_MEDIA will be returned by // do the test, and then the status of EFI_NO_MEDIA will be returned by
// "MemoryTestInit". So it does not need to test memory again, just return. // "MemoryTestInit". So it does not need to test memory again, just return.
// //
gBS->FreePool (Pos); FreePool (Pos);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -300,7 +300,7 @@ Returns:
if (TmpStr != NULL) { if (TmpStr != NULL) {
gST->ConOut->OutputString (gST->ConOut, TmpStr); gST->ConOut->OutputString (gST->ConOut, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
do { do {
@@ -317,7 +317,7 @@ Returns:
PrintXY (10, 10, NULL, NULL, TmpStr); PrintXY (10, 10, NULL, NULL, TmpStr);
gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4); gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4);
gST->ConOut->OutputString (gST->ConOut, TmpStr); gST->ConOut->OutputString (gST->ConOut, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
ASSERT (0); ASSERT (0);
@@ -333,7 +333,7 @@ Returns:
TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT)); TmpStr = GetStringById (STRING_TOKEN (STR_MEMORY_TEST_PERCENT));
if (TmpStr != NULL) { if (TmpStr != NULL) {
BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL); BdsLibOutputStrings (gST->ConOut, StrPercent, TmpStr, NULL);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST)); TmpStr = GetStringById (STRING_TOKEN (STR_PERFORM_MEM_TEST));
@@ -346,7 +346,7 @@ Returns:
TestPercent, TestPercent,
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
} }
@@ -365,7 +365,7 @@ Returns:
100, 100,
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0); gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);
@@ -389,7 +389,7 @@ Done:
TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED)); TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));
if (TmpStr != NULL) { if (TmpStr != NULL) {
StrCat (StrTotalMemory, TmpStr); StrCat (StrTotalMemory, TmpStr);
gBS->FreePool (TmpStr); FreePool (TmpStr);
} }
gST->ConOut->ClearScreen (gST->ConOut); gST->ConOut->ClearScreen (gST->ConOut);
@@ -405,7 +405,7 @@ Done:
(UINTN) PreviousValue (UINTN) PreviousValue
); );
gBS->FreePool (Pos); FreePool (Pos);
DataSize = sizeof (Value); DataSize = sizeof (Value);
Status = gRT->GetVariable ( Status = gRT->GetVariable (

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -36,7 +36,7 @@ InitializeStringSupport (
/*++ /*++
Routine Description: Routine Description:
Initialize HII global accessor for string support Initialize HII global accessor for string support
Arguments: Arguments:
@@ -60,7 +60,7 @@ Returns:
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
PackageList = PreparePackages (1, &gBdsStringPackGuid, BdsStrings); PackageList = PreparePackages (1, &gBdsStringPackGuid, BdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gStringPackHandle); Status = Hii->NewPack (Hii, PackageList, &gStringPackHandle);
gBS->FreePool (PackageList); FreePool (PackageList);
} }
return Status; return Status;
@@ -79,7 +79,7 @@ Routine Description:
Arguments: Arguments:
Id - String ID. Id - String ID.
Returns: Returns:
CHAR16 * - String from ID. CHAR16 * - String from ID.
@@ -112,7 +112,7 @@ Returns:
// //
// Free the old pool // Free the old pool
// //
gBS->FreePool (String); FreePool (String);
// //
// Allocate new pool with correct value // Allocate new pool with correct value

View File

@@ -1,6 +1,6 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -148,7 +148,7 @@ WinNtBlockIoDriverDiagnosticsRunDiagnostics (
if (DiagnosticType != EfiDriverDiagnosticTypeStandard) { if (DiagnosticType != EfiDriverDiagnosticTypeStandard) {
*ErrorType = &gEfiBlockIoProtocolGuid; *ErrorType = &gEfiBlockIoProtocolGuid;
*BufferSize = 0x60; *BufferSize = 0x60;
gBS->AllocatePool (EfiBootServicesData, (UINTN) (*BufferSize), Buffer); Buffer = AllocatePool ((UINTN) (*BufferSize));
CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize); CopyMem (*Buffer, L"Windows Block I/O Driver Diagnostics Failed\n", *BufferSize);
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }

View File

@@ -346,7 +346,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@@ -430,12 +430,8 @@ Returns:
WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS); WinNtIo->WinNtThunk->SetErrorMode (SEM_FAILCRITICALERRORS);
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_BLOCK_IO_PRIVATE));
EfiBootServicesData, ASSERT (Private != NULL);
sizeof (WIN_NT_BLOCK_IO_PRIVATE),
&Private
);
ASSERT_EFI_ERROR (Status);
EfiInitializeLock (&Private->Lock, EFI_TPL_NOTIFY); EfiInitializeLock (&Private->Lock, EFI_TPL_NOTIFY);
@@ -518,7 +514,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename)); DEBUG ((EFI_D_INIT, "BlockDevice added: %s\n", Filename));

View File

@@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtBlockIo.h</Filename> <Filename>WinNtBlockIo.h</Filename>

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -15,7 +15,7 @@ Module Name:
Abstract: Abstract:
Console based on Win32 APIs. Console based on Win32 APIs.
--*/ --*/
@@ -164,12 +164,8 @@ Returns:
return Status; return Status;
} }
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SIMPLE_TEXT_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -214,7 +210,7 @@ Done:
gBS->CloseEvent (Private->SimpleTextIn.WaitForKey); gBS->CloseEvent (Private->SimpleTextIn.WaitForKey);
} }
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@@ -300,7 +296,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -15,15 +15,15 @@ Module Name:
Abstract: Abstract:
Console based on Win32 APIs. Console based on Win32 APIs.
This file attaches a SimpleTextIn protocol to a previously open window. This file attaches a SimpleTextIn protocol to a previously open window.
The constructor for this protocol depends on an open window. Currently The constructor for this protocol depends on an open window. Currently
the SimpleTextOut protocol creates a window when it's constructor is called. the SimpleTextOut protocol creates a window when it's constructor is called.
Thus this code must run after the constructor for the SimpleTextOut Thus this code must run after the constructor for the SimpleTextOut
protocol protocol
--*/ --*/
#include "Console.h" #include "Console.h"
@@ -102,7 +102,7 @@ Returns:
} else { } else {
return EFI_NOT_READY; return EFI_NOT_READY;
} }
// //
// Check to see if we should return a scan code in place of Unicode character. // Check to see if we should return a scan code in place of Unicode character.
// //
@@ -280,12 +280,8 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( InputRecord = AllocatePool (sizeof (INPUT_RECORD) * NtEventCount);
EfiBootServicesData, if (InputRecord == NULL) {
sizeof (INPUT_RECORD) * NtEventCount,
&InputRecord
);
if (EFI_ERROR (Status)) {
Status = EFI_NOT_READY; Status = EFI_NOT_READY;
goto Done; goto Done;
} }
@@ -315,7 +311,7 @@ Returns:
Done: Done:
if (InputRecord != NULL) { if (InputRecord != NULL) {
gBS->FreePool (InputRecord); FreePool (InputRecord);
} }
return Status; return Status;

View File

@@ -43,6 +43,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>Console.h</Filename> <Filename>Console.h</Filename>

View File

@@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtGopScreen.c</Filename> <Filename>WinNtGopScreen.c</Filename>

View File

@@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@@ -125,12 +125,8 @@ WinNtGopDriverBindingStart (
// Allocate Private context data for SGO inteface. // Allocate Private context data for SGO inteface.
// //
Private = NULL; Private = NULL;
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (GOP_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (GOP_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
// //
@@ -185,7 +181,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
} }
gBS->FreePool (Private); FreePool (Private);
} }
} }
@@ -270,7 +266,7 @@ WinNtGopDriverBindingStop (
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }

View File

@@ -85,7 +85,6 @@ WinNtGopQuerytMode (
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
) )
{ {
EFI_STATUS Status;
GOP_PRIVATE_DATA *Private; GOP_PRIVATE_DATA *Private;
Private = GOP_PRIVATE_DATA_FROM_THIS (This); Private = GOP_PRIVATE_DATA_FROM_THIS (This);
@@ -94,13 +93,9 @@ WinNtGopQuerytMode (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
Status = gBS->AllocatePool ( *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
EfiBootServicesData, if (*Info == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), return EFI_OUT_OF_RESOURCES;
Info
);
if (EFI_ERROR (Status)) {
return Status;
} }
*SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
@@ -242,17 +237,13 @@ WinNtGopSetMode (
} }
Status = gBS->AllocatePool ( NewFillLine = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution);
EfiBootServicesData, if (NewFillLine == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->HorizontalResolution,
&NewFillLine
);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (Private->FillLine != NULL) { if (Private->FillLine != NULL) {
gBS->FreePool (Private->FillLine); FreePool (Private->FillLine);
} }
Private->FillLine = NewFillLine; Private->FillLine = NewFillLine;
@@ -637,7 +628,7 @@ WinNtGopThreadWindowProc (
case VK_F8: Key.ScanCode = SCAN_F8; break; case VK_F8: Key.ScanCode = SCAN_F8; break;
case VK_F9: Key.ScanCode = SCAN_F9; break; case VK_F9: Key.ScanCode = SCAN_F9; break;
case VK_F11: Key.ScanCode = SCAN_F11; 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) { if (Key.ScanCode != 0) {
@@ -885,8 +876,6 @@ WinNtGopConstructor (
GOP_PRIVATE_DATA *Private GOP_PRIVATE_DATA *Private
) )
{ {
EFI_STATUS Status;
Private->ModeData = mGopModeData; Private->ModeData = mGopModeData;
Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode; Private->GraphicsOutput.QueryMode = WinNtGopQuerytMode;
@@ -896,22 +885,15 @@ WinNtGopConstructor (
// //
// Allocate buffer for Graphics Output Protocol mode information // Allocate buffer for Graphics Output Protocol mode information
// //
Status = gBS->AllocatePool ( Private->GraphicsOutput.Mode = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
EfiBootServicesData, if (Private->GraphicsOutput.Mode == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE), return EFI_OUT_OF_RESOURCES;
(VOID **) &Private->GraphicsOutput.Mode
);
if (EFI_ERROR (Status)) {
return Status;
} }
Status = gBS->AllocatePool ( Private->GraphicsOutput.Mode->Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
EfiBootServicesData, if (Private->GraphicsOutput.Mode->Info == NULL) {
sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), return EFI_OUT_OF_RESOURCES;
(VOID **) &Private->GraphicsOutput.Mode->Info
);
if (EFI_ERROR (Status)) {
return Status;
} }
Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA); Private->GraphicsOutput.Mode->MaxMode = sizeof(mGopModeData) / sizeof(GOP_MODE_DATA);
// //
// Till now, we have no idea about the window size. // Till now, we have no idea about the window size.
@@ -982,9 +964,9 @@ WinNtGopDestructor (
// //
if (Private->GraphicsOutput.Mode != NULL) { if (Private->GraphicsOutput.Mode != NULL) {
if (Private->GraphicsOutput.Mode->Info != 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; return EFI_SUCCESS;

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -20,7 +20,7 @@ Abstract:
Handle(1) - WinNtIo - DevicePath(1) Handle(1) - WinNtIo - DevicePath(1)
If a serial port is added to the system this driver creates a new handle. If a serial port is added to the system this driver creates a new handle.
The new handle is required, since the serial device must add an UART device The new handle is required, since the serial device must add an UART device
pathnode. pathnode.
@@ -32,15 +32,15 @@ Abstract:
Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort Handle(1) - WinNtIo - DevicePath(1) - WinNtSerialPort
If the driver is unloaded Handle(2) is removed from the system and If the driver is unloaded Handle(2) is removed from the system and
gEfiWinNtSerialPortGuid is removed from Handle(1). gEfiWinNtSerialPortGuid is removed from Handle(1).
Note: Handle(1) is any handle created by the Win NT Bus driver that is passed Note: Handle(1) is any handle created by the Win NT Bus driver that is passed
into the DriverBinding member functions of this driver. This driver requires into the DriverBinding member functions of this driver. This driver requires
a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and a Handle(1) to contain a WinNtIo protocol, a DevicePath protocol, and
the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid. the TypeGuid in the WinNtIo must be gEfiWinNtSerialPortGuid.
If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is If Handle(1) contains a gEfiWinNtSerialPortGuid protocol then the driver is
loaded on the device. loaded on the device.
--*/ --*/
@@ -135,7 +135,7 @@ Returns:
Status = EFI_UNSUPPORTED; Status = EFI_UNSUPPORTED;
goto Error; goto Error;
} }
// //
// Check the GUID to see if this is a handle type the driver supports // Check the GUID to see if this is a handle type the driver supports
// //
@@ -309,7 +309,7 @@ Returns:
} }
} }
gBS->FreePool (OpenInfoBuffer); FreePool (OpenInfoBuffer);
return Status; return Status;
} }
@@ -334,12 +334,8 @@ Returns:
// //
// Construct Private data // Construct Private data
// //
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SERIAL_IO_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Error; goto Error;
} }
@@ -474,12 +470,12 @@ Error:
} }
if (Private->DevicePath != NULL) { if (Private->DevicePath != NULL) {
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
} }
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
} }
@@ -592,11 +588,11 @@ Returns:
} else { } else {
Private->WinNtThunk->CloseHandle (Private->NtHandle); Private->WinNtThunk->CloseHandle (Private->NtHandle);
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
} }
@@ -683,7 +679,7 @@ Routine Description:
Arguments: Arguments:
This - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue. This - A pointer to the EFI_SERIAL_IO_PROTOCOL structrue.
BaudRate - The Baud rate of the serial device. BaudRate - The Baud rate of the serial device.
ReceiveFifoDepth - The request depth of fifo on receive side. ReceiveFifoDepth - The request depth of fifo on receive side.
Timeout - the request timeout for a single charact. Timeout - the request timeout for a single charact.
@@ -869,7 +865,7 @@ Returns:
} }
if (Private->DevicePath != NULL) { if (Private->DevicePath != NULL) {
gBS->FreePool (Private->DevicePath); FreePool (Private->DevicePath);
} }
Private->DevicePath = NewDevicePath; Private->DevicePath = NewDevicePath;
@@ -1029,7 +1025,7 @@ Returns:
if (ModemStatus & MS_RLSD_ON) { if (ModemStatus & MS_RLSD_ON) {
Bits |= EFI_SERIAL_CARRIER_DETECT; Bits |= EFI_SERIAL_CARRIER_DETECT;
} }
// //
// Get ctrl status // Get ctrl status
// //
@@ -1059,7 +1055,7 @@ Returns:
if (Private->HardwareLoopbackEnable) { if (Private->HardwareLoopbackEnable) {
Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE; Bits |= EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE;
} }
// //
// Get input buffer status // Get input buffer status
// //
@@ -1145,7 +1141,7 @@ Returns:
Control |= EFI_SERIAL_REQUEST_TO_SEND; Control |= EFI_SERIAL_REQUEST_TO_SEND;
WinNtSerialIoSetControl (&Private->SerialIo, Control); WinNtSerialIoSetControl (&Private->SerialIo, Control);
} }
// //
// Do the write // Do the write
// //
@@ -1285,10 +1281,10 @@ IsaSerialFifoFull (
Routine Description: Routine Description:
Detect whether specific FIFO is full or not Detect whether specific FIFO is full or not
Arguments: Arguments:
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO
Returns: Returns:
TRUE: the FIFO is full TRUE: the FIFO is full
FALSE: the FIFO is not full FALSE: the FIFO is not full
@@ -1310,10 +1306,10 @@ IsaSerialFifoEmpty (
Routine Description: Routine Description:
Detect whether specific FIFO is empty or not Detect whether specific FIFO is empty or not
Arguments: Arguments:
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO
Returns: Returns:
TRUE: the FIFO is empty TRUE: the FIFO is empty
FALSE: the FIFO is not empty FALSE: the FIFO is not empty
@@ -1336,14 +1332,14 @@ IsaSerialFifoAdd (
Routine Description: Routine Description:
Add data to specific FIFO Add data to specific FIFO
Arguments: Arguments:
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO
Data UINT8: the data added to FIFO Data UINT8: the data added to FIFO
Returns: Returns:
EFI_SUCCESS: Add data to specific FIFO successfully EFI_SUCCESS: Add data to specific FIFO successfully
EFI_OUT_RESOURCE: Failed to add data because FIFO is already full EFI_OUT_RESOURCE: Failed to add data because FIFO is already full
--*/ --*/
// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment // TODO: EFI_OUT_OF_RESOURCES - add return value to function comment
@@ -1354,7 +1350,7 @@ IsaSerialFifoAdd (
if (IsaSerialFifoFull (Fifo)) { if (IsaSerialFifoFull (Fifo)) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
// //
// FIFO is not full can add data // FIFO is not full can add data
// //
@@ -1377,11 +1373,11 @@ IsaSerialFifoRemove (
Routine Description: Routine Description:
Remove data from specific FIFO Remove data from specific FIFO
Arguments: Arguments:
Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO Fifo SERIAL_DEV_FIFO *: A pointer to the Data Structure SERIAL_DEV_FIFO
Data UINT8*: the data removed from FIFO Data UINT8*: the data removed from FIFO
Returns: Returns:
EFI_SUCCESS: Remove data from specific FIFO successfully EFI_SUCCESS: Remove data from specific FIFO successfully
EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty EFI_OUT_RESOURCE: Failed to remove data because FIFO is empty
@@ -1395,7 +1391,7 @@ IsaSerialFifoRemove (
if (IsaSerialFifoEmpty (Fifo)) { if (IsaSerialFifoEmpty (Fifo)) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
// //
// FIFO is not empty, can remove data // FIFO is not empty, can remove data
// //

View File

@@ -47,6 +47,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword> <Keyword>DevicePathLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtSerialIo.h</Filename> <Filename>WinNtSerialIo.h</Filename>

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -16,8 +16,8 @@ Module Name:
Abstract: Abstract:
Produce Simple File System abstractions for directories on your PC using Win32 APIs. Produce Simple File System abstractions for directories on your PC using Win32 APIs.
The configuration of what devices to mount or emulate comes from NT The configuration of what devices to mount or emulate comes from NT
environment variables. The variables must be visible to the Microsoft* environment variables. The variables must be visible to the Microsoft*
Developer Studio for them to work. Developer Studio for them to work.
* Other names and brands may be claimed as the property of others. * Other names and brands may be claimed as the property of others.
@@ -142,7 +142,7 @@ Returns:
for (Pointer = Str; *(Pointer + Count); Pointer++) { for (Pointer = Str; *(Pointer + Count); Pointer++) {
*Pointer = *(Pointer + Count); *Pointer = *(Pointer + Count);
} }
*Pointer = *(Pointer + Count); *Pointer = *(Pointer + Count);
} }
} }
@@ -284,12 +284,10 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE));
EfiBootServicesData, if (Private == NULL) {
sizeof (WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE), Status = EFI_OUT_OF_RESOURCES;
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -298,14 +296,9 @@ Returns:
Private->FilePath = WinNtIo->EnvString; Private->FilePath = WinNtIo->EnvString;
Private->VolumeLabel = NULL; Private->VolumeLabel = AllocatePool (StrSize (L"EFI_EMULATED"));
Status = gBS->AllocatePool ( if (Private->VolumeLabel == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (L"EFI_EMULATED"),
&Private->VolumeLabel
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -339,7 +332,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
gBS->CloseProtocol ( gBS->CloseProtocol (
@@ -431,7 +424,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
return Status; return Status;
@@ -489,33 +482,21 @@ Returns:
Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This); Private = WIN_NT_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (This);
PrivateFile = NULL; PrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));
Status = gBS->AllocatePool ( if (PrivateFile == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
sizeof (WIN_NT_EFI_FILE_PRIVATE),
&PrivateFile
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
PrivateFile->FileName = NULL; PrivateFile->FileName = AllocatePool (StrSize (Private->FilePath));
Status = gBS->AllocatePool ( if (PrivateFile->FileName == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (Private->FilePath),
&PrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
PrivateFile->FilePath = NULL; PrivateFile->FilePath = AllocatePool (StrSize (Private->FilePath));
Status = gBS->AllocatePool ( if (PrivateFile->FilePath == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (Private->FilePath),
&PrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -541,7 +522,7 @@ Returns:
PrivateFile->LHandle = INVALID_HANDLE_VALUE; PrivateFile->LHandle = INVALID_HANDLE_VALUE;
PrivateFile->DirHandle = INVALID_HANDLE_VALUE; PrivateFile->DirHandle = INVALID_HANDLE_VALUE;
PrivateFile->IsValidFindBuf = FALSE; PrivateFile->IsValidFindBuf = FALSE;
*Root = &PrivateFile->EfiFile; *Root = &PrivateFile->EfiFile;
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
@@ -550,14 +531,14 @@ Done:
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (PrivateFile) { if (PrivateFile) {
if (PrivateFile->FileName) { if (PrivateFile->FileName) {
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
} }
if (PrivateFile->FilePath) { if (PrivateFile->FilePath) {
gBS->FreePool (PrivateFile->FilePath); FreePool (PrivateFile->FilePath);
} }
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
} }
} }
@@ -675,13 +656,9 @@ Returns:
// //
// Allocate buffer for FileName as the passed in FileName may be read only // Allocate buffer for FileName as the passed in FileName may be read only
// //
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (FileName));
EfiBootServicesData, if (TempFileName == NULL) {
StrSize (FileName), return EFI_OUT_OF_RESOURCES;
&TempFileName
);
if (EFI_ERROR (Status)) {
return Status;
} }
StrCpy (TempFileName, FileName); StrCpy (TempFileName, FileName);
FileName = TempFileName; FileName = TempFileName;
@@ -705,7 +682,7 @@ OpenRoot:
} }
// //
// If file name does not equal to "." or "..", // If file name does not equal to "." or "..",
// then we trim the leading/trailing blanks and trailing dots // then we trim the leading/trailing blanks and trailing dots
// //
if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0) { if (StrCmp (FileName, L".") != 0 && StrCmp (FileName, L"..") != 0) {
@@ -722,7 +699,7 @@ OpenRoot:
// //
// Trim trailing dots and blanks // Trim trailing dots and blanks
// //
for (TempFileName = FileName + StrLen (FileName) - 1; for (TempFileName = FileName + StrLen (FileName) - 1;
TempFileName >= FileName && (*TempFileName == L' ' || *TempFileName == L'.'); TempFileName >= FileName && (*TempFileName == L' ' || *TempFileName == L'.');
TempFileName--) { TempFileName--) {
; ;
@@ -733,27 +710,17 @@ OpenRoot:
// //
// Attempt to open the file // Attempt to open the file
// //
Status = gBS->AllocatePool ( NewPrivateFile = AllocatePool (sizeof (WIN_NT_EFI_FILE_PRIVATE));
EfiBootServicesData, if (NewPrivateFile == NULL) {
sizeof (WIN_NT_EFI_FILE_PRIVATE), Status = EFI_OUT_OF_RESOURCES;
&NewPrivateFile
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE)); CopyMem (NewPrivateFile, PrivateFile, sizeof (WIN_NT_EFI_FILE_PRIVATE));
NewPrivateFile->FilePath = NULL; NewPrivateFile->FilePath = AllocatePool (StrSize (PrivateFile->FileName));
if (NewPrivateFile->FilePath == NULL) {
Status = gBS->AllocatePool ( Status = EFI_OUT_OF_RESOURCES;
EfiBootServicesData,
StrSize (PrivateFile->FileName),
&NewPrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -763,14 +730,9 @@ OpenRoot:
StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath); StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath);
} }
NewPrivateFile->FileName = NULL; NewPrivateFile->FileName = AllocatePool (StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName));
Status = gBS->AllocatePool ( if (NewPrivateFile->FileName == NULL) {
EfiBootServicesData, Status = EFI_OUT_OF_RESOURCES;
StrSize (NewPrivateFile->FilePath) + StrSize (L"\\") + StrSize (FileName),
&NewPrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -783,7 +745,7 @@ OpenRoot:
if (StrCmp (FileName, L"") != 0) { if (StrCmp (FileName, L"") != 0) {
// //
// In case the filename becomes empty, especially after trimming dots and blanks // In case the filename becomes empty, especially after trimming dots and blanks
// //
StrCat (NewPrivateFile->FileName, L"\\"); StrCat (NewPrivateFile->FileName, L"\\");
StrCat (NewPrivateFile->FileName, FileName); StrCat (NewPrivateFile->FileName, FileName);
} }
@@ -847,9 +809,9 @@ OpenRoot:
if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) { if (StrCmp (NewPrivateFile->FileName, PrivateRoot->FilePath) == 0) {
NewPrivateFile->IsRootDirectory = TRUE; NewPrivateFile->IsRootDirectory = TRUE;
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
gBS->FreePool (NewPrivateFile->FileName); FreePool (NewPrivateFile->FileName);
gBS->FreePool (NewPrivateFile); FreePool (NewPrivateFile);
goto OpenRoot; goto OpenRoot;
} }
@@ -861,15 +823,11 @@ OpenRoot:
TempChar = *(RealFileName - 1); TempChar = *(RealFileName - 1);
*(RealFileName - 1) = 0; *(RealFileName - 1) = 0;
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
NewPrivateFile->FilePath = NULL; NewPrivateFile->FilePath = NULL;
Status = gBS->AllocatePool ( NewPrivateFile->FilePath = AllocatePool (StrSize (NewPrivateFile->FileName));
EfiBootServicesData, if (NewPrivateFile->FilePath == NULL) {
StrSize (NewPrivateFile->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewPrivateFile->FilePath
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -923,13 +881,9 @@ OpenRoot:
// //
if (NewPrivateFile->IsDirectoryPath) { if (NewPrivateFile->IsDirectoryPath) {
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"));
EfiBootServicesData, if (TempFileName == NULL) {
StrSize (NewPrivateFile->FileName) + StrSize (L"\\*"), Status = EFI_OUT_OF_RESOURCES;
&TempFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -943,7 +897,7 @@ OpenRoot:
LastError = PrivateFile->WinNtThunk->GetLastError (); LastError = PrivateFile->WinNtThunk->GetLastError ();
if (LastError != ERROR_ALREADY_EXISTS) { if (LastError != ERROR_ALREADY_EXISTS) {
gBS->FreePool (TempFileName); FreePool (TempFileName);
Status = EFI_ACCESS_DENIED; Status = EFI_ACCESS_DENIED;
goto Done; goto Done;
} }
@@ -1059,13 +1013,9 @@ OpenRoot:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( Info = AllocatePool (InfoSize);
EfiBootServicesData, if (Info == NULL) {
InfoSize, Status = EFI_OUT_OF_RESOURCES;
&Info
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -1081,19 +1031,19 @@ OpenRoot:
} }
Done: ; Done: ;
gBS->FreePool (FileName); FreePool (FileName);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (NewPrivateFile) { if (NewPrivateFile) {
if (NewPrivateFile->FileName) { if (NewPrivateFile->FileName) {
gBS->FreePool (NewPrivateFile->FileName); FreePool (NewPrivateFile->FileName);
} }
if (NewPrivateFile->FilePath) { if (NewPrivateFile->FilePath) {
gBS->FreePool (NewPrivateFile->FilePath); FreePool (NewPrivateFile->FilePath);
} }
gBS->FreePool (NewPrivateFile); FreePool (NewPrivateFile);
} }
} else { } else {
*NewHandle = &NewPrivateFile->EfiFile; *NewHandle = &NewPrivateFile->EfiFile;
@@ -1132,7 +1082,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) { if (PrivateFile->LHandle != INVALID_HANDLE_VALUE) {
@@ -1151,13 +1101,13 @@ Returns:
} }
if (PrivateFile->FileName) { if (PrivateFile->FileName) {
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
} }
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -1194,7 +1144,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
Status = EFI_WARN_DELETE_FAILURE; Status = EFI_WARN_DELETE_FAILURE;
@@ -1223,8 +1173,8 @@ Returns:
} }
} }
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
gBS->FreePool (PrivateFile); FreePool (PrivateFile);
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@@ -1328,7 +1278,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) { if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {
@@ -1344,11 +1294,7 @@ Returns:
} }
FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO; FileInfoSize = SIZE_OF_EFI_FILE_SYSTEM_INFO;
gBS->AllocatePool ( FileInfo = AllocatePool (FileInfoSize);
EfiBootServicesData,
FileInfoSize,
&FileInfo
);
Status = This->GetInfo ( Status = This->GetInfo (
This, This,
@@ -1358,12 +1304,8 @@ Returns:
); );
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
gBS->FreePool (FileInfo); FreePool (FileInfo);
gBS->AllocatePool ( FileInfo = AllocatePool (FileInfoSize);
EfiBootServicesData,
FileInfoSize,
&FileInfo
);
Status = This->GetInfo ( Status = This->GetInfo (
This, This,
&gEfiFileInfoGuid, &gEfiFileInfoGuid,
@@ -1379,7 +1321,7 @@ Returns:
FileSize = FileInfo->FileSize; FileSize = FileInfo->FileSize;
gBS->FreePool (FileInfo); FreePool (FileInfo);
if (Pos >= FileSize) { if (Pos >= FileSize) {
*BufferSize = 0; *BufferSize = 0;
@@ -1545,7 +1487,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) { if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {
@@ -1619,7 +1561,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->IsDirectoryPath) { if (PrivateFile->IsDirectoryPath) {
@@ -1628,13 +1570,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( FileName = AllocatePool (StrSize (PrivateFile->FileName) + StrSize (L"\\*"));
EfiBootServicesData, if (FileName == NULL) {
StrSize (PrivateFile->FileName) + StrSize (L"\\*"), Status = EFI_OUT_OF_RESOURCES;
&FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -1653,7 +1591,7 @@ Returns:
PrivateFile->IsValidFindBuf = TRUE; PrivateFile->IsValidFindBuf = TRUE;
} }
gBS->FreePool (FileName); FreePool (FileName);
Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS; Status = (PrivateFile->LHandle == INVALID_HANDLE_VALUE) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
} else { } else {
@@ -1956,14 +1894,10 @@ Returns:
// //
// Try to get the drive name // Try to get the drive name
// //
DriveName = NULL;
DriveNameFound = FALSE; DriveNameFound = FALSE;
Status = gBS->AllocatePool ( DriveName = AllocatePool (StrSize (PrivateFile->FilePath) + 1);
EfiBootServicesData, if (DriveName == NULL) {
StrSize (PrivateFile->FilePath) + 1, Status = EFI_OUT_OF_RESOURCES;
&DriveName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -2003,7 +1937,7 @@ Returns:
&TotalClusters &TotalClusters
); );
if (DriveName) { if (DriveName) {
gBS->FreePool (DriveName); FreePool (DriveName);
} }
if (NtStatus) { if (NtStatus) {
@@ -2161,16 +2095,10 @@ Returns:
NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer; NewFileSystemInfo = (EFI_FILE_SYSTEM_INFO *) Buffer;
gBS->FreePool (PrivateRoot->VolumeLabel); FreePool (PrivateRoot->VolumeLabel);
PrivateRoot->VolumeLabel = AllocatePool (StrSize (NewFileSystemInfo->VolumeLabel));
PrivateRoot->VolumeLabel = NULL; if (PrivateRoot->VolumeLabel == NULL) {
Status = gBS->AllocatePool ( Status = EFI_OUT_OF_RESOURCES;
EfiBootServicesData,
StrSize (NewFileSystemInfo->VolumeLabel),
&PrivateRoot->VolumeLabel
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -2240,9 +2168,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool (EfiBootServicesData, OldInfoSize, &OldFileInfo); OldFileInfo = AllocatePool (OldInfoSize);
if (OldFileInfo == NULL) {
if (EFI_ERROR (Status)) { Status = EFI_OUT_OF_RESOURCES;
goto Done; goto Done;
} }
@@ -2252,13 +2180,9 @@ Returns:
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( OldFileName = AllocatePool (StrSize (PrivateFile->FileName));
EfiBootServicesData, if (OldFileName == NULL) {
StrSize (PrivateFile->FileName), Status = EFI_OUT_OF_RESOURCES;
&OldFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -2268,13 +2192,9 @@ Returns:
// Make full pathname from new filename and rootpath. // Make full pathname from new filename and rootpath.
// //
if (NewFileInfo->FileName[0] == '\\') { if (NewFileInfo->FileName[0] == '\\') {
Status = gBS->AllocatePool ( NewFileName = AllocatePool (StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));
EfiBootServicesData, if (NewFileName == NULL) {
StrSize (PrivateRoot->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -2282,13 +2202,9 @@ Returns:
StrCat (NewFileName, L"\\"); StrCat (NewFileName, L"\\");
StrCat (NewFileName, NewFileInfo->FileName + 1); StrCat (NewFileName, NewFileInfo->FileName + 1);
} else { } else {
Status = gBS->AllocatePool ( NewFileName = AllocatePool (StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName));
EfiBootServicesData, if (NewFileName == NULL) {
StrSize (PrivateFile->FilePath) + StrSize (L"\\") + StrSize (NewFileInfo->FileName), Status = EFI_OUT_OF_RESOURCES;
&NewFileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
@@ -2394,30 +2310,22 @@ Returns:
// //
// modify file name // modify file name
// //
gBS->FreePool (PrivateFile->FileName); FreePool (PrivateFile->FileName);
Status = gBS->AllocatePool ( PrivateFile->FileName = AllocatePool (StrSize (NewFileName));
EfiBootServicesData, if (PrivateFile->FileName == NULL) {
StrSize (NewFileName), Status = EFI_OUT_OF_RESOURCES;
&PrivateFile->FileName
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
StrCpy (PrivateFile->FileName, NewFileName); StrCpy (PrivateFile->FileName, NewFileName);
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (NewFileName) + StrSize (L"\\*"));
EfiBootServicesData,
StrSize (NewFileName) + StrSize (L"\\*"),
&TempFileName
);
StrCpy (TempFileName, NewFileName); StrCpy (TempFileName, NewFileName);
if (!PrivateFile->IsDirectoryPath) { if (!PrivateFile->IsDirectoryPath) {
PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile ( PrivateFile->LHandle = PrivateFile->WinNtThunk->CreateFile (
TempFileName, TempFileName,
PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, PrivateFile->IsOpenedByRead ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -2427,7 +2335,7 @@ Returns:
NULL NULL
); );
gBS->FreePool (TempFileName); FreePool (TempFileName);
// //
// Flush buffers just in case // Flush buffers just in case
@@ -2450,7 +2358,7 @@ Returns:
StrCat (TempFileName, L"\\*"); StrCat (TempFileName, L"\\*");
PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf); PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);
gBS->FreePool (TempFileName); FreePool (TempFileName);
} }
} else { } else {
Reopen: ; Reopen: ;
@@ -2462,11 +2370,7 @@ Reopen: ;
goto Done; goto Done;
} }
Status = gBS->AllocatePool ( TempFileName = AllocatePool (StrSize (OldFileName) + StrSize (L"\\*"));
EfiBootServicesData,
StrSize (OldFileName) + StrSize (L"\\*"),
&TempFileName
);
StrCpy (TempFileName, OldFileName); StrCpy (TempFileName, OldFileName);
@@ -2495,7 +2399,7 @@ Reopen: ;
PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf); PrivateFile->LHandle = PrivateFile->WinNtThunk->FindFirstFile (TempFileName, &FindBuf);
} }
gBS->FreePool (TempFileName); FreePool (TempFileName);
goto Done; goto Done;
@@ -2637,15 +2541,15 @@ Reopen: ;
Done: Done:
if (OldFileInfo != NULL) { if (OldFileInfo != NULL) {
gBS->FreePool (OldFileInfo); FreePool (OldFileInfo);
} }
if (OldFileName != NULL) { if (OldFileName != NULL) {
gBS->FreePool (OldFileName); FreePool (OldFileName);
} }
if (NewFileName != NULL) { if (NewFileName != NULL) {
gBS->FreePool (NewFileName); FreePool (NewFileName);
} }
gBS->RestoreTPL (OldTpl); gBS->RestoreTPL (OldTpl);
@@ -2696,7 +2600,7 @@ Returns:
} }
OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK); OldTpl = gBS->RaiseTPL (EFI_TPL_CALLBACK);
PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateFile = WIN_NT_EFI_FILE_PRIVATE_DATA_FROM_THIS (This);
if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) { if (PrivateFile->LHandle == INVALID_HANDLE_VALUE) {

View File

@@ -46,6 +46,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtSimpleFileSystem.h</Filename> <Filename>WinNtSimpleFileSystem.h</Filename>

View File

@@ -43,6 +43,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword> <Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtUga.h</Filename> <Filename>WinNtUga.h</Filename>

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -19,9 +19,9 @@ Abstract:
UGA is short hand for Universal Graphics Abstraction protocol. UGA is short hand for Universal Graphics Abstraction protocol.
This file is a verision of UgaIo the uses WinNtThunk system calls as an IO This file is a verision of UgaIo the uses WinNtThunk system calls as an IO
abstraction. For a PCI device WinNtIo would be replaced with abstraction. For a PCI device WinNtIo would be replaced with
a PCI IO abstraction that abstracted a specific PCI device. a PCI IO abstraction that abstracted a specific PCI device.
--*/ --*/
@@ -137,13 +137,8 @@ Returns:
// //
// Allocate Private context data for SGO inteface. // Allocate Private context data for SGO inteface.
// //
Private = NULL; Private = AllocatePool (sizeof (UGA_PRIVATE_DATA));
Status = gBS->AllocatePool ( if (Private == NULL) {
EfiBootServicesData,
sizeof (UGA_PRIVATE_DATA),
&Private
);
if (EFI_ERROR (Status)) {
goto Done; goto Done;
} }
// //
@@ -198,7 +193,7 @@ Done:
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
} }
gBS->FreePool (Private); FreePool (Private);
} }
} }
@@ -287,7 +282,7 @@ Returns:
// //
FreeUnicodeStringTable (Private->ControllerNameTable); FreeUnicodeStringTable (Private->ControllerNameTable);
gBS->FreePool (Private); FreePool (Private);
} }
@@ -308,9 +303,9 @@ Arguments:
String - Unicode string. String - Unicode string.
Returns: Returns:
UINTN of the number represented by String. UINTN of the number represented by String.
--*/ --*/
{ {

View File

@@ -1,22 +1,22 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
WinNtUgaScreen.c WinNtUgaScreen.c
Abstract: Abstract:
This file produces the graphics abstration of UGA. It is called by This file produces the graphics abstration of UGA. It is called by
WinNtUgaDriver.c file which deals with the EFI 1.1 driver model. WinNtUgaDriver.c file which deals with the EFI 1.1 driver model.
This file just does graphics. This file just does graphics.
--*/ --*/
@@ -72,7 +72,7 @@ WinNtUgaGetMode (
Returns: Returns:
EFI_SUCCESS - Mode information returned. EFI_SUCCESS - Mode information returned.
EFI_NOT_STARTED - Video display is not initialized. Call SetMode () EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
EFI_INVALID_PARAMETER - One of the input args was NULL. EFI_INVALID_PARAMETER - One of the input args was NULL.
--*/ --*/
@@ -123,7 +123,7 @@ WinNtUgaSetMode (
Returns: Returns:
EFI_SUCCESS - Mode information returned. EFI_SUCCESS - Mode information returned.
EFI_NOT_STARTED - Video display is not initialized. Call SetMode () EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
EFI_INVALID_PARAMETER - One of the input args was NULL. EFI_INVALID_PARAMETER - One of the input args was NULL.
--*/ --*/
@@ -224,17 +224,13 @@ WinNtUgaSetMode (
} }
Status = gBS->AllocatePool ( NewFillLine = AllocatePool (sizeof (EFI_UGA_PIXEL) * HorizontalResolution);
EfiBootServicesData, if (NewFillLine == NULL) {
sizeof (EFI_UGA_PIXEL) * HorizontalResolution,
&NewFillLine
);
if (EFI_ERROR (Status)) {
return EFI_DEVICE_ERROR; return EFI_DEVICE_ERROR;
} }
if (Private->FillLine != NULL) { if (Private->FillLine != NULL) {
gBS->FreePool (Private->FillLine); FreePool (Private->FillLine);
} }
Private->FillLine = NewFillLine; Private->FillLine = NewFillLine;
@@ -281,19 +277,19 @@ WinNtUgaBlt (
Routine Description: Routine Description:
Blt pixels from the rectangle (Width X Height) formed by the BltBuffer Blt pixels from the rectangle (Width X Height) formed by the BltBuffer
onto the graphics screen starting a location (X, Y). (0, 0) is defined as onto the graphics screen starting a location (X, Y). (0, 0) is defined as
the upper left hand side of the screen. (X, Y) can be outside of the the upper left hand side of the screen. (X, Y) can be outside of the
current screen geometry and the BltBuffer will be cliped when it is current screen geometry and the BltBuffer will be cliped when it is
displayed. X and Y can be negative or positive. If Width or Height is displayed. X and Y can be negative or positive. If Width or Height is
bigger than the current video screen the image will be clipped. bigger than the current video screen the image will be clipped.
Arguments: Arguments:
This - Protocol instance pointer. This - Protocol instance pointer.
X - X location on graphics screen. X - X location on graphics screen.
Y - Y location on the graphics screen. Y - Y location on the graphics screen.
Width - Width of BltBuffer. Width - Width of BltBuffer.
Height - Hight of BltBuffer Height - Hight of BltBuffer
BltOperation - Operation to perform on BltBuffer and video memory BltOperation - Operation to perform on BltBuffer and video memory
BltBuffer - Buffer containing data to blt into video buffer. This BltBuffer - Buffer containing data to blt into video buffer. This
buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL) buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
SourceX - If the BltOperation is a EfiCopyBlt this is the source SourceX - If the BltOperation is a EfiCopyBlt this is the source
of the copy. For other BLT operations this argument is not of the copy. For other BLT operations this argument is not
@@ -301,11 +297,11 @@ WinNtUgaBlt (
SourceX - If the BltOperation is a EfiCopyBlt this is the source SourceX - If the BltOperation is a EfiCopyBlt this is the source
of the copy. For other BLT operations this argument is not of the copy. For other BLT operations this argument is not
used. used.
Returns: Returns:
EFI_SUCCESS - The palette is updated with PaletteArray. EFI_SUCCESS - The palette is updated with PaletteArray.
EFI_INVALID_PARAMETER - BltOperation is not valid. EFI_INVALID_PARAMETER - BltOperation is not valid.
EFI_DEVICE_ERROR - A hardware error occured writting to the video EFI_DEVICE_ERROR - A hardware error occured writting to the video
buffer. buffer.
--*/ --*/
@@ -445,7 +441,7 @@ WinNtUgaBlt (
// we may miss some data for a short period of time this is no different than // we may miss some data for a short period of time this is no different than
// a write combining on writes to a frame buffer. // a write combining on writes to a frame buffer.
// //
Private->WinNtThunk->UpdateWindow (Private->WindowHandle); Private->WinNtThunk->UpdateWindow (Private->WindowHandle);
} }
@@ -501,7 +497,7 @@ WinNtUgaThreadWindowProc (
/*++ /*++
Routine Description: Routine Description:
Win32 Windows event handler. Win32 Windows event handler.
Arguments: Arguments:
See Win32 Book See Win32 Book
@@ -631,7 +627,7 @@ Returns:
case VK_F8: Key.ScanCode = SCAN_F8; break; case VK_F8: Key.ScanCode = SCAN_F8; break;
case VK_F9: Key.ScanCode = SCAN_F9; break; case VK_F9: Key.ScanCode = SCAN_F9; break;
case VK_F11: Key.ScanCode = SCAN_F11; 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) { if (Key.ScanCode != 0) {
@@ -693,7 +689,7 @@ WinNtUgaThreadWinMain (
Routine Description: Routine Description:
This thread simulates the end of WinMain () aplication. Each Winow nededs This thread simulates the end of WinMain () aplication. Each Winow nededs
to process it's events. The messages are dispatched to to process it's events. The messages are dispatched to
WinNtUgaThreadWindowProc (). WinNtUgaThreadWindowProc ().
Be very careful sine WinNtUgaThreadWinMain () and WinNtUgaThreadWindowProc () Be very careful sine WinNtUgaThreadWinMain () and WinNtUgaThreadWindowProc ()
@@ -974,8 +970,8 @@ KillNtUgaThread (
/*++ /*++
Routine Description: Routine Description:
This is the UGA screen's callback notification function for exit-boot-services. This is the UGA screen's callback notification function for exit-boot-services.
All we do here is call WinNtUgaDestructor(). All we do here is call WinNtUgaDestructor().
Arguments: Arguments:

View File

@@ -136,18 +136,11 @@ AllocateMemory (
IN UINTN Size IN UINTN Size
) )
{ {
EFI_STATUS Status;
VOID *Buffer; VOID *Buffer;
Status = gBS->AllocatePool ( Buffer = AllocatePool (Size);
EfiBootServicesData, ASSERT (Buffer != NULL);
Size,
(VOID *)&Buffer
);
if (EFI_ERROR (Status)) {
ASSERT (FALSE);
return NULL;
}
return Buffer; return Buffer;
} }
@@ -341,13 +334,9 @@ Returns:
} }
if (Status != EFI_ALREADY_STARTED) { if (Status != EFI_ALREADY_STARTED) {
Status = gBS->AllocatePool ( WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));
EfiBootServicesData, if (WinNtBusDevice == NULL) {
sizeof (WIN_NT_BUS_DEVICE), return EFI_OUT_OF_RESOURCES;
(VOID *) &WinNtBusDevice
);
if (EFI_ERROR (Status)) {
return Status;
} }
WinNtBusDevice->Signature = WIN_NT_BUS_DEVICE_SIGNATURE; WinNtBusDevice->Signature = WIN_NT_BUS_DEVICE_SIGNATURE;
@@ -368,7 +357,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
gBS->FreePool (WinNtBusDevice); FreePool (WinNtBusDevice);
return Status; return Status;
} }
} }
@@ -464,7 +453,7 @@ Returns:
Count Count
); );
if (WinNtDevice->DevicePath == NULL) { if (WinNtDevice->DevicePath == NULL) {
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@@ -490,7 +479,7 @@ Returns:
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
} else { } else {
// //
// Open For Child Device // Open For Child Device
@@ -516,7 +505,7 @@ Returns:
StartString = SubString; StartString = SubString;
} }
gBS->FreePool (TempStr); FreePool (TempStr);
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@@ -588,7 +577,7 @@ Returns:
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
gBS->FreePool (WinNtBusDevice); FreePool (WinNtBusDevice);
gBS->CloseProtocol ( gBS->CloseProtocol (
ControllerHandle, ControllerHandle,
@@ -652,7 +641,7 @@ Returns:
// Close the child handle // Close the child handle
// //
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable); FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
gBS->FreePool (WinNtDevice); FreePool (WinNtDevice);
} }
} }

View File

@@ -51,6 +51,9 @@
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword> <Keyword>DevicePathLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>
<SourceFiles> <SourceFiles>
<Filename>WinNtBusDriver.h</Filename> <Filename>WinNtBusDriver.h</Filename>

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -114,7 +114,7 @@ WinNtEnableInterrupt (
Routine Description: Routine Description:
This routine provides support for emulation of the interrupt enable of the This routine provides support for emulation of the interrupt enable of the
the system. For our purposes, CPU enable is just a BOOLEAN that the Timer the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
Architectural Protocol observes in order to defer behaviour while in its Architectural Protocol observes in order to defer behaviour while in its
emulated interrupt, or timer tick. emulated interrupt, or timer tick.
@@ -148,7 +148,7 @@ WinNtDisableInterrupt (
Routine Description: Routine Description:
This routine provides support for emulation of the interrupt disable of the This routine provides support for emulation of the interrupt disable of the
the system. For our purposes, CPU enable is just a BOOLEAN that the Timer the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
Architectural Protocol observes in order to defer behaviour while in its Architectural Protocol observes in order to defer behaviour while in its
emulated interrupt, or timer tick. emulated interrupt, or timer tick.
@@ -183,7 +183,7 @@ WinNtGetInterruptState (
Routine Description: Routine Description:
This routine provides support for emulation of the interrupt disable of the This routine provides support for emulation of the interrupt disable of the
the system. For our purposes, CPU enable is just a BOOLEAN that the Timer the system. For our purposes, CPU enable is just a BOOLEAN that the Timer
Architectural Protocol observes in order to defer behaviour while in its Architectural Protocol observes in order to defer behaviour while in its
emulated interrupt, or timer tick. emulated interrupt, or timer tick.
@@ -223,8 +223,8 @@ WinNtInit (
Routine Description: Routine Description:
This routine would support generation of a CPU INIT. At This routine would support generation of a CPU INIT. At
present, this code does not provide emulation. present, this code does not provide emulation.
Arguments: Arguments:
@@ -258,8 +258,8 @@ WinNtRegisterInterruptHandler (
Routine Description: Routine Description:
This routine would support registration of an interrupt handler. At This routine would support registration of an interrupt handler. At
present, this code does not provide emulation. present, this code does not provide emulation.
Arguments: Arguments:
@@ -305,8 +305,8 @@ WinNtGetTimerValue (
Routine Description: Routine Description:
This routine would support querying of an on-CPU timer. At present, This routine would support querying of an on-CPU timer. At present,
this code does not provide timer emulation. this code does not provide timer emulation.
Arguments: Arguments:
@@ -325,7 +325,7 @@ Returns:
if (TimerValue == NULL) { if (TimerValue == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
// //
// No timer supported // No timer supported
// //
@@ -345,8 +345,8 @@ WinNtSetMemoryAttributes (
Routine Description: Routine Description:
This routine would support querying of an on-CPU timer. At present, This routine would support querying of an on-CPU timer. At present,
this code does not provide timer emulation. this code does not provide timer emulation.
Arguments: Arguments:
@@ -405,7 +405,7 @@ Returns:
Status Status
EFI_SUCCESS - protocol instance can be published EFI_SUCCESS - protocol instance can be published
EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure
EFI_DEVICE_ERROR - cannot create the thread EFI_DEVICE_ERROR - cannot create the thread
@@ -417,12 +417,8 @@ Returns:
CPU_ARCH_PROTOCOL_PRIVATE *Private; CPU_ARCH_PROTOCOL_PRIVATE *Private;
VOID *Registration; VOID *Registration;
Status = gBS->AllocatePool ( Private = AllocatePool (sizeof (CPU_ARCH_PROTOCOL_PRIVATE));
EfiBootServicesData, ASSERT (Private != NULL);
sizeof (CPU_ARCH_PROTOCOL_PRIVATE),
&Private
);
ASSERT_EFI_ERROR (Status);
Private->Signature = CPU_ARCH_PROT_PRIVATE_SIGNATURE; Private->Signature = CPU_ARCH_PROT_PRIVATE_SIGNATURE;
Private->Cpu.FlushDataCache = WinNtFlushCpuDataCache; Private->Cpu.FlushDataCache = WinNtFlushCpuDataCache;
@@ -479,7 +475,7 @@ Returns:
DEBUG ((EFI_D_ERROR, "CPU Architectural Protocol Loaded\n")); DEBUG ((EFI_D_ERROR, "CPU Architectural Protocol Loaded\n"));
return Status; return Status;
} }
@@ -495,8 +491,8 @@ Routine Description:
Arguments: Arguments:
String - Unicode string. String - Unicode string.
Returns: Returns:
UINTN of the number represented by String. UINTN of the number represented by String.
--*/ --*/
{ {
@@ -656,7 +652,7 @@ Returns:
Status = Hii->NewPack (Hii, PackageList, &StringHandle); Status = Hii->NewPack (Hii, PackageList, &StringHandle);
ASSERT (!EFI_ERROR (Status)); ASSERT (!EFI_ERROR (Status));
gBS->FreePool (PackageList); FreePool (PackageList);
// //
// Store processor version data record to data hub // Store processor version data record to data hub
@@ -717,7 +713,7 @@ Returns:
TotalSize TotalSize
); );
gBS->FreePool (RecordBuffer.Raw); FreePool (RecordBuffer.Raw);
} }
gBS->CloseProtocol ( gBS->CloseProtocol (

View File

@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>DxeWinNtLib</OutputFileBasename> <OutputFileBasename>DxeWinNtLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">
<Keyword>WinNtLib</Keyword> <Keyword>WinNtLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -30,7 +30,7 @@ BdsLibDoLegacyBoot (
/*++ /*++
Routine Description: Routine Description:
Boot the legacy system with the boot option Boot the legacy system with the boot option
Arguments: Arguments:
@@ -41,7 +41,7 @@ Returns:
EFI_UNSUPPORTED - There is no legacybios protocol, do not support EFI_UNSUPPORTED - There is no legacybios protocol, do not support
legacy boot. legacy boot.
EFI_STATUS - Return the status of LegacyBios->LegacyBoot (). EFI_STATUS - Return the status of LegacyBios->LegacyBoot ().
--*/ --*/
@@ -89,15 +89,15 @@ BdsLibBootViaBootOption (
Routine Description: Routine Description:
Process the boot option follow the EFI 1.1 specification and Process the boot option follow the EFI 1.1 specification and
special treat the legacy boot option with BBS_DEVICE_PATH. special treat the legacy boot option with BBS_DEVICE_PATH.
Arguments: Arguments:
Option - The boot option need to be processed Option - The boot option need to be processed
DevicePath - The device path which describe where to load DevicePath - The device path which describe where to load
the boot image or the legcy BBS device path the boot image or the legcy BBS device path
to boot the legacy OS to boot the legacy OS
ExitDataSize - Returned directly from gBS->StartImage () ExitDataSize - Returned directly from gBS->StartImage ()
@@ -167,7 +167,7 @@ Returns:
// Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event // Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event
// //
EfiSignalEventReadyToBoot (); EfiSignalEventReadyToBoot ();
// //
// Set Boot Current // Set Boot Current
// //
@@ -240,7 +240,7 @@ Returns:
BlkIo->Media->BlockSize, BlkIo->Media->BlockSize,
Buffer Buffer
); );
gBS->FreePool (Buffer); FreePool (Buffer);
} }
} }
@@ -324,8 +324,8 @@ BdsBootByDiskSignatureAndPartition (
Routine Description: Routine Description:
Check to see if a hard ware device path was passed in. If it was then search Check to see if a hard ware device path was passed in. If it was then search
all the block IO devices for the passed in hard drive device path. all the block IO devices for the passed in hard drive device path.
Arguments: Arguments:
Option - The current processing boot option. Option - The current processing boot option.
@@ -347,7 +347,7 @@ Returns:
EFI_SUCCESS - Status from gBS->StartImage (), EFI_SUCCESS - Status from gBS->StartImage (),
or BootByDiskSignatureAndPartition () or BootByDiskSignatureAndPartition ()
EFI_NOT_FOUND - If the Device Path is not found in the system EFI_NOT_FOUND - If the Device Path is not found in the system
--*/ --*/
@@ -406,7 +406,7 @@ Returns:
// find HardDriver device path node // find HardDriver device path node
// //
while (!IsDevicePathEnd (DevicePath)) { while (!IsDevicePathEnd (DevicePath)) {
if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) && if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP) (DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)
) { ) {
BlockIoHdDevicePath = DevicePath; BlockIoHdDevicePath = DevicePath;
@@ -460,7 +460,7 @@ Returns:
} }
} }
gBS->FreePool (BlockIoBuffer); FreePool (BlockIoBuffer);
return Status; return Status;
} }
@@ -532,7 +532,7 @@ Returns:
&BootOptionSize &BootOptionSize
); );
if (NULL == BootOptionVar) { if (NULL == BootOptionVar) {
gBS->FreePool (BootOrder); FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@@ -549,11 +549,11 @@ Returns:
if ((OptionDevicePathSize == DevicePathSize) && if ((OptionDevicePathSize == DevicePathSize) &&
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) { (CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize); BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
break; break;
} }
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
} }
@@ -565,7 +565,7 @@ Returns:
BootOrder BootOrder
); );
gBS->FreePool (BootOrder); FreePool (BootOrder);
return Status; return Status;
} }
@@ -636,7 +636,7 @@ Returns:
&BootOptionSize &BootOptionSize
); );
if (NULL == BootOptionVar) { if (NULL == BootOptionVar) {
gBS->FreePool (BootOrder); FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@@ -652,7 +652,7 @@ Returns:
// //
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) && if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) { (DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
continue; continue;
} }
@@ -664,7 +664,7 @@ Returns:
TempDevicePath = EfiNextDevicePathNode (TempDevicePath); TempDevicePath = EfiNextDevicePathNode (TempDevicePath);
} }
// //
// Skip the boot option that point to a file, since the device path in // Skip the boot option that point to a file, since the device path in
// removable media boot option doesn't contains a file name. // removable media boot option doesn't contains a file name.
// //
if (((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) && if (((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&
@@ -673,7 +673,7 @@ Returns:
// Skip boot option for internal Shell, it's always valid // Skip boot option for internal Shell, it's always valid
// //
(EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) { (EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) {
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
continue; continue;
} }
@@ -721,7 +721,7 @@ Returns:
BootOrder[Index] = 0xffff; BootOrder[Index] = 0xffff;
} }
gBS->FreePool (BootOptionVar); FreePool (BootOptionVar);
Index++; Index++;
} }
@@ -743,7 +743,7 @@ Returns:
BootOrder BootOrder
); );
gBS->FreePool (BootOrder); FreePool (BootOrder);
return Status; return Status;
} }
@@ -877,7 +877,7 @@ Returns:
} }
if (NumberFileSystemHandles) { if (NumberFileSystemHandles) {
gBS->FreePool (FileSystemHandles); FreePool (FileSystemHandles);
} }
// //
// Parse Network Boot Device // Parse Network Boot Device
@@ -904,7 +904,7 @@ Returns:
} }
if (NumberLoadFileHandles) { if (NumberLoadFileHandles) {
gBS->FreePool (LoadFileHandles); FreePool (LoadFileHandles);
} }
// //
// Check if we have on flash shell // Check if we have on flash shell
@@ -946,7 +946,7 @@ Returns:
} }
if (FvHandleCount) { if (FvHandleCount) {
gBS->FreePool (FvHandleBuffer); FreePool (FvHandleBuffer);
} }
// //
// Make sure every boot only have one time // Make sure every boot only have one time
@@ -966,13 +966,13 @@ BdsLibBuildOptionFromHandle (
/*++ /*++
Routine Description: Routine Description:
Build the boot option with the handle parsed in Build the boot option with the handle parsed in
Arguments: Arguments:
Handle - The handle which present the device path to create boot option Handle - The handle which present the device path to create boot option
BdsBootOptionList - The header of the link list which indexed all current BdsBootOptionList - The header of the link list which indexed all current
boot options boot options
@@ -1002,14 +1002,14 @@ BdsLibBuildOptionFromShell (
/*++ /*++
Routine Description: Routine Description:
Build the on flash shell boot option with the handle parsed in Build the on flash shell boot option with the handle parsed in
Arguments: Arguments:
Handle - The handle which present the device path to create on flash shell Handle - The handle which present the device path to create on flash shell
boot option boot option
BdsBootOptionList - The header of the link list which indexed all current BdsBootOptionList - The header of the link list which indexed all current
boot options boot options
@@ -1044,13 +1044,13 @@ BdsLibBootNext (
/*++ /*++
Routine Description: Routine Description:
Boot from the EFI1.1 spec defined "BootNext" variable Boot from the EFI1.1 spec defined "BootNext" variable
Arguments: Arguments:
None None
Returns: Returns:
None None

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -26,12 +26,12 @@ BdsLibConnectAll (
/*++ /*++
Routine Description: Routine Description:
This function will connect all the system driver to controller This function will connect all the system driver to controller
first, and then special connect the default console, this make first, and then special connect the default console, this make
sure all the system controller avialbe and the platform default sure all the system controller avialbe and the platform default
console connected. console connected.
Arguments: Arguments:
None None
@@ -66,12 +66,12 @@ BdsLibGenericConnectAll (
/*++ /*++
Routine Description: Routine Description:
This function will connect all the system drivers to all controllers This function will connect all the system drivers to all controllers
first, and then connect all the console devices the system current first, and then connect all the console devices the system current
have. After this we should get all the device work and console avariable have. After this we should get all the device work and console avariable
if the system have console device. if the system have console device.
Arguments: Arguments:
None None
@@ -100,7 +100,7 @@ Routine Description:
path node. If the handle associate with one device path node can not path node. If the handle associate with one device path node can not
be created success, then still give one chance to do the dispatch, be created success, then still give one chance to do the dispatch,
which load the missing drivers if possible. which load the missing drivers if possible.
Arguments: Arguments:
DevicePathToConnect - The device path which will be connected, it can DevicePathToConnect - The device path which will be connected, it can
@@ -108,12 +108,12 @@ Arguments:
Returns: Returns:
EFI_SUCCESS - All handles associate with every device path EFI_SUCCESS - All handles associate with every device path
node have been created node have been created
EFI_OUT_OF_RESOURCES - There is no resource to create new handles EFI_OUT_OF_RESOURCES - There is no resource to create new handles
EFI_NOT_FOUND - Create the handle associate with one device EFI_NOT_FOUND - Create the handle associate with one device
path node failed path node failed
--*/ --*/
@@ -206,7 +206,7 @@ Returns:
} while (DevicePath != NULL); } while (DevicePath != NULL);
if (CopyOfDevicePath != NULL) { if (CopyOfDevicePath != NULL) {
gBS->FreePool (CopyOfDevicePath); FreePool (CopyOfDevicePath);
} }
// //
// All handle with DevicePath exists in the handle database // All handle with DevicePath exists in the handle database
@@ -224,7 +224,7 @@ Routine Description:
This function will connect all current system handles recursively. The This function will connect all current system handles recursively. The
connection will finish until every handle's child handle created if it have. connection will finish until every handle's child handle created if it have.
Arguments: Arguments:
None None
@@ -232,8 +232,8 @@ Arguments:
Returns: Returns:
EFI_SUCCESS - All handles and it's child handle have been connected EFI_SUCCESS - All handles and it's child handle have been connected
EFI_STATUS - Return the status of gBS->LocateHandleBuffer(). EFI_STATUS - Return the status of gBS->LocateHandleBuffer().
--*/ --*/
{ {
@@ -257,7 +257,7 @@ Returns:
Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); Status = gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
} }
gBS->FreePool (HandleBuffer); FreePool (HandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -272,7 +272,7 @@ Routine Description:
This function will disconnect all current system handles. The disconnection This function will disconnect all current system handles. The disconnection
will finish until every handle have been disconnected. will finish until every handle have been disconnected.
Arguments: Arguments:
None None
@@ -280,8 +280,8 @@ Arguments:
Returns: Returns:
EFI_SUCCESS - All handles have been disconnected EFI_SUCCESS - All handles have been disconnected
EFI_STATUS - Return the status of gBS->LocateHandleBuffer(). EFI_STATUS - Return the status of gBS->LocateHandleBuffer().
--*/ --*/
{ {
@@ -308,7 +308,7 @@ Returns:
Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL); Status = gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
} }
gBS->FreePool (HandleBuffer); FreePool (HandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -321,19 +321,19 @@ BdsLibConnectAllDriversToAllControllers (
Routine Description: Routine Description:
Connects all drivers to all controllers. Connects all drivers to all controllers.
This function make sure all the current system driver will manage This function make sure all the current system driver will manage
the correspoinding controllers if have. And at the same time, make the correspoinding controllers if have. And at the same time, make
sure all the system controllers have driver to manage it if have. sure all the system controllers have driver to manage it if have.
Arguments: Arguments:
None None
Returns: Returns:
None None
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -25,9 +25,9 @@ IsNvNeed (
) )
{ {
CHAR16 *Ptr; CHAR16 *Ptr;
Ptr = ConVarName; Ptr = ConVarName;
// //
// If the variable includes "Dev" at last, we consider // If the variable includes "Dev" at last, we consider
// it does not support NV attribute. // it does not support NV attribute.
@@ -35,7 +35,7 @@ IsNvNeed (
while (*Ptr) { while (*Ptr) {
Ptr++; Ptr++;
} }
if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) { if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {
return FALSE; return FALSE;
} else { } else {
@@ -53,7 +53,7 @@ BdsLibUpdateConsoleVariable (
Routine Description: Routine Description:
This function update console variable based on ConVarName, it can This function update console variable based on ConVarName, it can
add or remove one specific console device path from the variable add or remove one specific console device path from the variable
Arguments: Arguments:
@@ -71,8 +71,8 @@ Arguments:
Returns: Returns:
EFI_UNSUPPORTED - Add or remove the same device path. EFI_UNSUPPORTED - Add or remove the same device path.
EFI_SUCCESS - Success add or remove the device path from EFI_SUCCESS - Success add or remove the device path from
the console variable. the console variable.
--*/ --*/
@@ -103,12 +103,12 @@ Returns:
&gEfiGlobalVariableGuid, &gEfiGlobalVariableGuid,
&DevicePathSize &DevicePathSize
); );
// //
// Initialize NewDevicePath // Initialize NewDevicePath
// //
NewDevicePath = VarConsole; NewDevicePath = VarConsole;
// //
// If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it. // If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
// In the end, NewDevicePath is the final device path. // In the end, NewDevicePath is the final device path.
@@ -134,7 +134,7 @@ Returns:
BdsLibSafeFreePool(TempNewDevicePath); BdsLibSafeFreePool(TempNewDevicePath);
} }
} }
// //
// The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV. // The attribute for ConInDev, ConOutDev and ErrOutDev does not include NV.
// //
@@ -149,7 +149,7 @@ Returns:
// //
Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; Attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
} }
// //
// Finally, Update the variable of the default console by NewDevicePath // Finally, Update the variable of the default console by NewDevicePath
// //
@@ -192,7 +192,7 @@ Arguments:
Returns: Returns:
EFI_NOT_FOUND - There is not any console devices connected success EFI_NOT_FOUND - There is not any console devices connected success
EFI_SUCCESS - Success connect any one instance of the console EFI_SUCCESS - Success connect any one instance of the console
device path base on the variable ConVarName. device path base on the variable ConVarName.
@@ -250,7 +250,7 @@ Returns:
BdsLibSafeFreePool(Instance); BdsLibSafeFreePool(Instance);
} while (CopyOfDevicePath != NULL); } while (CopyOfDevicePath != NULL);
gBS->FreePool (StartDevicePath); FreePool (StartDevicePath);
if (DeviceExist == FALSE) { if (DeviceExist == FALSE) {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@@ -346,7 +346,7 @@ BdsLibConnectAllDefaultConsoles (
Routine Description: Routine Description:
This function will connect console device base on the console This function will connect console device base on the console
device variable ConIn, ConOut and ErrOut. device variable ConIn, ConOut and ErrOut.
Arguments: Arguments:
@@ -357,7 +357,7 @@ Returns:
EFI_SUCCESS - At least one of the ConIn and ConOut device have EFI_SUCCESS - At least one of the ConIn and ConOut device have
been connected success. been connected success.
EFI_STATUS - Return the status of BdsLibConnectConsoleVariable (). EFI_STATUS - Return the status of BdsLibConnectConsoleVariable ().
--*/ --*/
@@ -370,12 +370,12 @@ Returns:
// //
// Because possibly the platform is legacy free, in such case, // Because possibly the platform is legacy free, in such case,
// ConIn devices (Serial Port and PS2 Keyboard ) does not exist, // ConIn devices (Serial Port and PS2 Keyboard ) does not exist,
// so we need not check the status. // so we need not check the status.
// //
BdsLibConnectConsoleVariable (L"ConIn"); BdsLibConnectConsoleVariable (L"ConIn");
// //
// It seems impossible not to have any ConOut device on platform, // It seems impossible not to have any ConOut device on platform,
// so we check the status here. // so we check the status here.
// //

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006 - 2007, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -31,7 +31,7 @@ BdsLibGetTimeout (
/*++ /*++
Routine Description: Routine Description:
Return the default value for system Timeout variable. Return the default value for system Timeout variable.
Arguments: Arguments:
@@ -39,7 +39,7 @@ Arguments:
None None
Returns: Returns:
Timeout value. Timeout value.
--*/ --*/
@@ -85,7 +85,7 @@ BdsLibLoadDrivers (
/*++ /*++
Routine Description: Routine Description:
The function will go through the driver optoin link list, load and start The function will go through the driver optoin link list, load and start
every driver the driver optoin device path point to. every driver the driver optoin device path point to.
@@ -94,7 +94,7 @@ Arguments:
BdsDriverLists - The header of the current driver option link list BdsDriverLists - The header of the current driver option link list
Returns: Returns:
None None
--*/ --*/
@@ -198,7 +198,7 @@ BdsLibRegisterNewOption (
/*++ /*++
Routine Description: Routine Description:
This function will register the new boot#### or driver#### option base on This function will register the new boot#### or driver#### option base on
the VariableName. The new registered boot#### or driver#### will be linked the VariableName. The new registered boot#### or driver#### will be linked
to BdsOptionList and also update to the VariableName. After the boot#### or to BdsOptionList and also update to the VariableName. After the boot#### or
@@ -207,18 +207,18 @@ Routine Description:
Arguments: Arguments:
BdsOptionList - The header of the boot#### or driver#### link list BdsOptionList - The header of the boot#### or driver#### link list
DevicePath - The device path which the boot#### DevicePath - The device path which the boot####
or driver#### option present or driver#### option present
String - The description of the boot#### or driver#### String - The description of the boot#### or driver####
VariableName - Indicate if the boot#### or driver#### option VariableName - Indicate if the boot#### or driver#### option
Returns: Returns:
EFI_SUCCESS - The boot#### or driver#### have been success registered EFI_SUCCESS - The boot#### or driver#### have been success registered
EFI_STATUS - Return the status of gRT->SetVariable (). EFI_STATUS - Return the status of gRT->SetVariable ().
--*/ --*/
@@ -249,11 +249,13 @@ Returns:
ZeroMem (OptionName, sizeof (OptionName)); ZeroMem (OptionName, sizeof (OptionName));
TempOptionSize = 0; TempOptionSize = 0;
TempOptionPtr = BdsLibGetVariableAndSize ( TempOptionPtr = BdsLibGetVariableAndSize (
VariableName, VariableName,
&gEfiGlobalVariableGuid, &gEfiGlobalVariableGuid,
&TempOptionSize &TempOptionSize
); );
// //
// Compare with current option variable // Compare with current option variable
// //
@@ -290,8 +292,8 @@ Returns:
// //
// Got the option, so just return // Got the option, so just return
// //
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
return EFI_SUCCESS; return EFI_SUCCESS;
} else { } else {
// //
@@ -302,7 +304,7 @@ Returns:
} }
} }
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
} }
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath); OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath);
@@ -342,12 +344,12 @@ Returns:
OptionPtr OptionPtr
); );
if (EFI_ERROR (Status) || UpdateBootDevicePath) { if (EFI_ERROR (Status) || UpdateBootDevicePath) {
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
return Status; return Status;
} }
gBS->FreePool (OptionPtr); FreePool (OptionPtr);
// //
// Update the option order variable // Update the option order variable
@@ -363,13 +365,15 @@ Returns:
OptionOrderPtr OptionOrderPtr
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
gBS->FreePool (TempOptionPtr); FreePool (TempOptionPtr);
gBS->FreePool (OptionOrderPtr); FreePool (OptionOrderPtr);
return Status; return Status;
} }
gBS->FreePool (TempOptionPtr); if (TempOptionPtr != NULL) {
gBS->FreePool (OptionOrderPtr); FreePool (TempOptionPtr);
}
FreePool (OptionOrderPtr);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -383,9 +387,9 @@ BdsLibVariableToOption (
Routine Description: Routine Description:
Build the boot#### or driver#### option from the VariableName, the Build the boot#### or driver#### option from the VariableName, the
build boot#### or driver#### will also be linked to BdsCommonOptionList build boot#### or driver#### will also be linked to BdsCommonOptionList
Arguments: Arguments:
BdsCommonOptionList - The header of the boot#### or driver#### option link list BdsCommonOptionList - The header of the boot#### or driver#### option link list
@@ -482,12 +486,12 @@ Returns:
// //
if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) { if ((Option->Attribute & LOAD_OPTION_ACTIVE) == LOAD_OPTION_ACTIVE) {
InsertTailList (BdsCommonOptionList, &Option->Link); InsertTailList (BdsCommonOptionList, &Option->Link);
gBS->FreePool (Variable); FreePool (Variable);
return Option; return Option;
} }
gBS->FreePool (Variable); FreePool (Variable);
gBS->FreePool (Option); FreePool (Option);
return NULL; return NULL;
} }
@@ -553,7 +557,7 @@ Returns:
} }
gBS->FreePool (OptionOrder); FreePool (OptionOrder);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@@ -631,7 +635,7 @@ Routine Description:
Free pool safely. Free pool safely.
Arguments: Arguments:
Buffer - The allocated pool entry to free Buffer - The allocated pool entry to free
Returns: Returns:
@@ -641,7 +645,7 @@ Returns:
--*/ --*/
{ {
if (Buffer != NULL) { if (Buffer != NULL) {
gBS->FreePool (Buffer); FreePool (Buffer);
Buffer = NULL; Buffer = NULL;
} }
} }
@@ -665,7 +669,7 @@ Arguments:
Returns: Returns:
This function will remove the device path instances in Multi which partly This function will remove the device path instances in Multi which partly
match with the Single, and return the result device path. If there is no match with the Single, and return the result device path. If there is no
remaining device path as a result, this function will return NULL. remaining device path as a result, this function will return NULL.
@@ -675,24 +679,24 @@ Returns:
EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
EFI_DEVICE_PATH_PROTOCOL *TempNewDevicePath; EFI_DEVICE_PATH_PROTOCOL *TempNewDevicePath;
UINTN InstanceSize; UINTN InstanceSize;
UINTN SingleDpSize; UINTN SingleDpSize;
UINTN Size; UINTN Size;
NewDevicePath = NULL; NewDevicePath = NULL;
TempNewDevicePath = NULL; TempNewDevicePath = NULL;
if (Multi == NULL || Single == NULL) { if (Multi == NULL || Single == NULL) {
return Multi; return Multi;
} }
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize); Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
SingleDpSize = GetDevicePathSize (Single) - END_DEVICE_PATH_LENGTH; SingleDpSize = GetDevicePathSize (Single) - END_DEVICE_PATH_LENGTH;
InstanceSize -= END_DEVICE_PATH_LENGTH; InstanceSize -= END_DEVICE_PATH_LENGTH;
while (Instance != NULL) { while (Instance != NULL) {
Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize; Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize;
if ((CompareMem (Instance, Single, Size) != 0)) { if ((CompareMem (Instance, Single, Size) != 0)) {
// //
// Append the device path instance which does not match with Single // Append the device path instance which does not match with Single
@@ -705,7 +709,7 @@ Returns:
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize); Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
InstanceSize -= END_DEVICE_PATH_LENGTH; InstanceSize -= END_DEVICE_PATH_LENGTH;
} }
return NewDevicePath; return NewDevicePath;
} }
@@ -730,9 +734,9 @@ Arguments:
Returns: Returns:
TRUE - If the Single is contained within Multi TRUE - If the Single is contained within Multi
FALSE - The Single is not match within Multi FALSE - The Single is not match within Multi
--*/ --*/
{ {
@@ -756,11 +760,11 @@ Returns:
// return success // return success
// //
if (CompareMem (Single, DevicePathInst, Size) == 0) { if (CompareMem (Single, DevicePathInst, Size) == 0) {
gBS->FreePool (DevicePathInst); FreePool (DevicePathInst);
return TRUE; return TRUE;
} }
gBS->FreePool (DevicePathInst); FreePool (DevicePathInst);
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size); DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
} }
@@ -788,7 +792,7 @@ Arguments:
Returns: Returns:
EFI_SUCCESS - Success print out the string using ConOut. EFI_SUCCESS - Success print out the string using ConOut.
EFI_STATUS - Return the status of the ConOut->OutputString (). EFI_STATUS - Return the status of the ConOut->OutputString ().
--*/ --*/
@@ -821,7 +825,7 @@ Returns:
// //
// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature. // Following are BDS Lib functions which contain all the code about setup browser reset reminder feature.
// Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser if // Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser if
// user change any option setting which needs a reset to be effective, and the reset will be applied according to the user selection. // user change any option setting which needs a reset to be effective, and the reset will be applied according to the user selection.
// //
@@ -832,7 +836,7 @@ EnableResetReminderFeature (
/*++ /*++
Routine Description: Routine Description:
Enable the setup browser reset reminder feature. Enable the setup browser reset reminder feature.
This routine is used in platform tip. If the platform policy need the feature, use the routine to enable it. This routine is used in platform tip. If the platform policy need the feature, use the routine to enable it.
@@ -847,7 +851,7 @@ Returns:
--*/ --*/
{ {
mFeaturerSwitch = TRUE; mFeaturerSwitch = TRUE;
} }
VOID VOID
DisableResetReminderFeature ( DisableResetReminderFeature (
@@ -856,10 +860,10 @@ DisableResetReminderFeature (
/*++ /*++
Routine Description: Routine Description:
Disable the setup browser reset reminder feature. Disable the setup browser reset reminder feature.
This routine is used in platform tip. If the platform policy do not want the feature, use the routine to disable it. This routine is used in platform tip. If the platform policy do not want the feature, use the routine to disable it.
Arguments: Arguments:
VOID VOID
@@ -871,7 +875,7 @@ Returns:
--*/ --*/
{ {
mFeaturerSwitch = FALSE; mFeaturerSwitch = FALSE;
} }
VOID VOID
EnableResetRequired ( EnableResetRequired (
@@ -880,10 +884,10 @@ EnableResetRequired (
/*++ /*++
Routine Description: Routine Description:
Record the info that a reset is required. Record the info that a reset is required.
A module boolean variable is used to record whether a reset is required. A module boolean variable is used to record whether a reset is required.
Arguments: Arguments:
VOID VOID
@@ -895,7 +899,7 @@ Returns:
--*/ --*/
{ {
mResetRequired = TRUE; mResetRequired = TRUE;
} }
VOID VOID
DisableResetRequired ( DisableResetRequired (
@@ -906,7 +910,7 @@ DisableResetRequired (
Routine Description: Routine Description:
Record the info that no reset is required. Record the info that no reset is required.
A module boolean variable is used to record whether a reset is required. A module boolean variable is used to record whether a reset is required.
Arguments: Arguments:
@@ -919,7 +923,7 @@ Returns:
--*/ --*/
{ {
mResetRequired = FALSE; mResetRequired = FALSE;
} }
BOOLEAN BOOLEAN
IsResetReminderFeatureEnable ( IsResetReminderFeatureEnable (
@@ -928,7 +932,7 @@ IsResetReminderFeatureEnable (
/*++ /*++
Routine Description: Routine Description:
Check whether platform policy enable the reset reminder feature. The default is enabled. Check whether platform policy enable the reset reminder feature. The default is enabled.
Arguments: Arguments:
@@ -951,9 +955,9 @@ IsResetRequired (
/*++ /*++
Routine Description: Routine Description:
Check if user changed any option setting which needs a system reset to be effective. Check if user changed any option setting which needs a system reset to be effective.
Arguments: Arguments:
VOID VOID
@@ -974,9 +978,9 @@ SetupResetReminder (
/*++ /*++
Routine Description: Routine Description:
Check whether a reset is needed, and finish the reset reminder feature. Check whether a reset is needed, and finish the reset reminder feature.
If a reset is needed, Popup a menu to notice user, and finish the feature If a reset is needed, Popup a menu to notice user, and finish the feature
according to the user selection. according to the user selection.
Arguments: Arguments:
@@ -991,9 +995,9 @@ Returns:
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_FORM_BROWSER_PROTOCOL *Browser; EFI_FORM_BROWSER_PROTOCOL *Browser;
EFI_INPUT_KEY Key; EFI_INPUT_KEY Key;
CHAR16 *StringBuffer1; CHAR16 *StringBuffer1;
CHAR16 *StringBuffer2; CHAR16 *StringBuffer2;
// //
@@ -1001,28 +1005,28 @@ Returns:
// //
if (IsResetReminderFeatureEnable ()) { if (IsResetReminderFeatureEnable ()) {
if (IsResetRequired ()) { if (IsResetRequired ()) {
Status = gBS->LocateProtocol ( Status = gBS->LocateProtocol (
&gEfiFormBrowserProtocolGuid, &gEfiFormBrowserProtocolGuid,
NULL, NULL,
&Browser &Browser
); );
StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
ASSERT (StringBuffer1 != NULL); ASSERT (StringBuffer1 != NULL);
StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16)); StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
ASSERT (StringBuffer2 != NULL); ASSERT (StringBuffer2 != NULL);
StrCpy (StringBuffer1, L"Configuration changed. Reset to apply it Now ? "); StrCpy (StringBuffer1, L"Configuration changed. Reset to apply it Now ? ");
StrCpy (StringBuffer2, L"Enter (YES) / Esc (NO)"); StrCpy (StringBuffer2, L"Enter (YES) / Esc (NO)");
// //
// Popup a menu to notice user // Popup a menu to notice user
// //
do { do {
Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2); Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2);
} while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN)); } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
gBS->FreePool (StringBuffer1); FreePool (StringBuffer1);
gBS->FreePool (StringBuffer2); FreePool (StringBuffer2);
// //
// If the user hits the YES Response key, reset // If the user hits the YES Response key, reset
// //
@@ -1030,9 +1034,9 @@ Returns:
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
} }
gST->ConOut->ClearScreen (gST->ConOut); gST->ConOut->ClearScreen (gST->ConOut);
} }
} }
} }
EFI_STATUS EFI_STATUS
BdsLibGetHiiHandles ( BdsLibGetHiiHandles (
@@ -1050,7 +1054,7 @@ Routine Description:
Arguments: Arguments:
This - A pointer to the EFI_HII_PROTOCOL instance. This - A pointer to the EFI_HII_PROTOCOL instance.
HandleBufferLength - On input, a pointer to the length of the handle buffer. On output, HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
the length of the handle buffer that is required for the handles found. the length of the handle buffer that is required for the handles found.
HiiHandleBuffer - Pointer to an array of EFI_HII_PROTOCOL instances returned. HiiHandleBuffer - Pointer to an array of EFI_HII_PROTOCOL instances returned.
@@ -1059,19 +1063,19 @@ Returns:
EFI_SUCCESS - Get an array of EFI_HII_PROTOCOL instances successfully. EFI_SUCCESS - Get an array of EFI_HII_PROTOCOL instances successfully.
EFI_INVALID_PARAMETER - Hii is NULL. EFI_INVALID_PARAMETER - Hii is NULL.
EFI_NOT_FOUND - Database not found. EFI_NOT_FOUND - Database not found.
--*/ --*/
{ {
UINT16 TempBufferLength; UINT16 TempBufferLength;
EFI_STATUS Status; EFI_STATUS Status;
TempBufferLength = 0; TempBufferLength = 0;
// //
// Try to find the actual buffer size for HiiHandle Buffer. // Try to find the actual buffer size for HiiHandle Buffer.
// //
Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer); Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
*HiiHandleBuffer = AllocateZeroPool (TempBufferLength); *HiiHandleBuffer = AllocateZeroPool (TempBufferLength);
Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer); Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);
@@ -1080,9 +1084,9 @@ Returns:
// //
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
} }
*HandleBufferLength = TempBufferLength; *HandleBufferLength = TempBufferLength;
return Status; return Status;
} }

View File

@@ -71,7 +71,7 @@ Returns:
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize); CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
} }
gBS->FreePool (OldPool); FreePool (OldPool);
} }
return NewPool; return NewPool;
@@ -137,7 +137,7 @@ Returns:
Str->len = strsize - sizeof (UINT16); Str->len = strsize - sizeof (UINT16);
} }
gBS->FreePool (AppendStr); FreePool (AppendStr);
return Str->str; return Str->str;
} }
@@ -1059,7 +1059,7 @@ DevicePathToStr (
// //
// Shrink pool used for string allocation // Shrink pool used for string allocation
// //
gBS->FreePool (DevPath); FreePool (DevPath);
Done: Done:
NewSize = (Str.len + 1) * sizeof (CHAR16); NewSize = (Str.len + 1) * sizeof (CHAR16);

View File

@@ -6,7 +6,7 @@
<GuidValue>1ec995b2-d15b-44f6-abd2-050ea7dd37d2</GuidValue> <GuidValue>1ec995b2-d15b-44f6-abd2-050ea7dd37d2</GuidValue>
<Version>1.0</Version> <Version>1.0</Version>
<Abstract>EDK Generic BDS Common APIs Library Instance.</Abstract> <Abstract>EDK Generic BDS Common APIs Library Instance.</Abstract>
<Description>The library instance provides common library routines help in <Description>The library instance provides common library routines help in
performance measurement, device path debug print, boot device selections, performance measurement, device path debug print, boot device selections,
boot device connection, console supports in BDS phase and boot from boot boot device connection, console supports in BDS phase and boot from boot
device.</Description> device.</Description>
@@ -20,12 +20,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkGenericBdsLib</OutputFileBasename> <OutputFileBasename>EdkGenericBdsLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER">
<Keyword>EdkGenericBdsLib</Keyword> <Keyword>EdkGenericBdsLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">
@@ -76,7 +76,6 @@
<Filename>Performance.h</Filename> <Filename>Performance.h</Filename>
<Filename>Performance.c</Filename> <Filename>Performance.c</Filename>
<Filename>BdsMisc.c</Filename> <Filename>BdsMisc.c</Filename>
<Filename SupArchList="IPF">Ipf/ShadowRom.c</Filename>
</SourceFiles> </SourceFiles>
<PackageDependencies> <PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/> <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>

View File

@@ -1,13 +1,13 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
@@ -33,7 +33,7 @@ GetShortPdbFileName (
/*++ /*++
Routine Description: Routine Description:
Arguments: Arguments:
Returns: Returns:
@@ -176,13 +176,13 @@ WriteBootToOsPerformanceData (
/*++ /*++
Routine Description: Routine Description:
Allocates a block of memory and writes performance data of booting to OS into it. Allocates a block of memory and writes performance data of booting to OS into it.
Arguments: Arguments:
None None
Returns: Returns:
None None
@@ -328,7 +328,7 @@ Returns:
} }
} }
gBS->FreePool (Handles); FreePool (Handles);
// //
// Get inserted performance data // Get inserted performance data

View File

@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename> <OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="PEI_CORE PEIM">
<Keyword>PeCoffGetEntryPointLib</Keyword> <Keyword>PeCoffGetEntryPointLib</Keyword>
</LibraryClass> </LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED"> <LibraryClass Usage="ALWAYS_CONSUMED">

View File

@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification> <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader> </MsaHeader>
<ModuleDefinitions> <ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures> <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule> <BinaryModule>false</BinaryModule>
<OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename> <OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename>
</ModuleDefinitions> </ModuleDefinitions>
<LibraryClassDefinitions> <LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_PRODUCED"> <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE PEIM">
<Keyword>EdkPeCoffLoaderLib</Keyword> <Keyword>EdkPeCoffLoaderLib</Keyword>
</LibraryClass> </LibraryClass>
</LibraryClassDefinitions> </LibraryClassDefinitions>

View File

@@ -1,18 +1,18 @@
/*++ /*++
Copyright (c) 2006, Intel Corporation Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Module Name:
FWBlockService.c FWBlockService.c
Abstract: Abstract:
Revision History Revision History
@@ -81,14 +81,14 @@ Routine Description:
date items to there virtual address. date items to there virtual address.
mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] - Physical copy of instance data mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] - Physical copy of instance data
mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] - Virtual pointer to common mFvbModuleGlobal->FvInstance[FVB_VIRTUAL] - Virtual pointer to common
instance data. instance data.
Arguments: Arguments:
(Standard EFI notify event - EFI_EVENT_NOTIFY) (Standard EFI notify event - EFI_EVENT_NOTIFY)
Returns: Returns:
None None
@@ -138,7 +138,7 @@ Arguments:
FwhInstance - The EFI_FW_VOL_INSTANCE fimrware instance structure FwhInstance - The EFI_FW_VOL_INSTANCE fimrware instance structure
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -182,14 +182,14 @@ Routine Description:
Arguments: Arguments:
Instance - The FV instance whose base address is going to be Instance - The FV instance whose base address is going to be
returned returned
Address - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS Address - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
that on successful return, contains the base address that on successful return, contains the base address
of the firmware volume. of the firmware volume.
Global - Pointer to ESAL_FWB_GLOBAL that contains all Global - Pointer to ESAL_FWB_GLOBAL that contains all
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -222,14 +222,14 @@ Routine Description:
resulting attributes in output parameter resulting attributes in output parameter
Arguments: Arguments:
Instance - The FV instance whose attributes is going to be Instance - The FV instance whose attributes is going to be
returned returned
Attributes - Output buffer which contains attributes Attributes - Output buffer which contains attributes
Global - Pointer to ESAL_FWB_GLOBAL that contains all Global - Pointer to ESAL_FWB_GLOBAL that contains all
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -266,7 +266,7 @@ Routine Description:
Arguments: Arguments:
Instance - The FV instance which the Lba belongs to Instance - The FV instance which the Lba belongs to
Lba - The logical block address Lba - The logical block address
LbaAddress - On output, contains the physical starting address LbaAddress - On output, contains the physical starting address
of the Lba of the Lba
LbaLength - On output, contains the length of the block LbaLength - On output, contains the length of the block
NumOfBlocks - A pointer to a caller allocated UINTN in which the NumOfBlocks - A pointer to a caller allocated UINTN in which the
@@ -277,7 +277,7 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -369,14 +369,14 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - The firmware volume was read successfully and EFI_SUCCESS - The firmware volume was read successfully and
contents are in Buffer contents are in Buffer
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output, EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,
NumBytes contains the total number of bytes returned NumBytes contains the total number of bytes returned
in Buffer in Buffer
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be read could not be read
EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL
@@ -455,13 +455,13 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - The firmware volume was written successfully EFI_SUCCESS - The firmware volume was written successfully
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output, EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,
NumBytes contains the total number of bytes NumBytes contains the total number of bytes
actually written actually written
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written could not be written
EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL EFI_INVALID_PARAMETER - Instance not found, or NumBytes, Buffer are NULL
@@ -533,10 +533,10 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - The erase request was successfully completed EFI_SUCCESS - The erase request was successfully completed
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written. Firmware device may have been could not be written. Firmware device may have been
partially erased partially erased
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -596,7 +596,7 @@ Routine Description:
Arguments: Arguments:
Instance - The FV instance to be erased Instance - The FV instance to be erased
StartLba - The starting logical block index to be erased StartLba - The starting logical block index to be erased
OffsetStartLba - Offset into the starting block at which to OffsetStartLba - Offset into the starting block at which to
begin erasing begin erasing
LastLba - The last logical block index to be erased LastLba - The last logical block index to be erased
OffsetStartLba - Offset into the last block at which to end erasing OffsetStartLba - Offset into the last block at which to end erasing
@@ -604,10 +604,10 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - The firmware volume was erased successfully EFI_SUCCESS - The firmware volume was erased successfully
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written. Firmware device may have been could not be written. Firmware device may have been
partially erased partially erased
EFI_INVALID_PARAMETER - Instance not found EFI_INVALID_PARAMETER - Instance not found
@@ -681,13 +681,13 @@ FvbSetVolumeAttributes (
/*++ /*++
Routine Description: Routine Description:
Modifies the current settings of the firmware volume according to the Modifies the current settings of the firmware volume according to the
input parameter, and returns the new setting of the volume input parameter, and returns the new setting of the volume
Arguments: Arguments:
Instance - The FV instance whose attributes is going to be Instance - The FV instance whose attributes is going to be
modified modified
Attributes - On input, it is a pointer to EFI_FVB_ATTRIBUTES Attributes - On input, it is a pointer to EFI_FVB_ATTRIBUTES
containing the desired firmware volume settings. containing the desired firmware volume settings.
On successful return, it contains the new settings On successful return, it contains the new settings
of the firmware volume of the firmware volume
@@ -695,7 +695,7 @@ Arguments:
instance data instance data
Virtual - Whether CPU is in virtual or physical mode Virtual - Whether CPU is in virtual or physical mode
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
EFI_ACCESS_DENIED - The volume setting is locked and cannot be modified EFI_ACCESS_DENIED - The volume setting is locked and cannot be modified
EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are EFI_INVALID_PARAMETER - Instance not found, or The attributes requested are
@@ -801,7 +801,7 @@ Arguments:
Returns: Returns:
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
--*/ --*/
@@ -836,8 +836,8 @@ Arguments:
returned. All blocks in this range have a size of returned. All blocks in this range have a size of
BlockSize BlockSize
Returns: Returns:
EFI_SUCCESS - The firmware volume was read successfully and EFI_SUCCESS - The firmware volume was read successfully and
contents are in Buffer contents are in Buffer
--*/ --*/
@@ -872,7 +872,7 @@ Arguments:
This - Calling context This - Calling context
Attributes - output buffer which contains attributes Attributes - output buffer which contains attributes
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
--*/ --*/
@@ -899,7 +899,7 @@ Arguments:
This - Calling context This - Calling context
Attributes - output buffer which contains attributes Attributes - output buffer which contains attributes
Returns: Returns:
EFI_SUCCESS - Successfully returns EFI_SUCCESS - Successfully returns
--*/ --*/
@@ -915,28 +915,28 @@ EFI_STATUS
EFIAPI EFIAPI
FvbProtocolEraseBlocks ( FvbProtocolEraseBlocks (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This, IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
... ...
) )
/*++ /*++
Routine Description: Routine Description:
The EraseBlock() function erases one or more blocks as denoted by the The EraseBlock() function erases one or more blocks as denoted by the
variable argument list. The entire parameter list of blocks must be verified variable argument list. The entire parameter list of blocks must be verified
prior to erasing any blocks. If a block is requested that does not exist prior to erasing any blocks. If a block is requested that does not exist
within the associated firmware volume (it has a larger index than the last within the associated firmware volume (it has a larger index than the last
block of the firmware volume), the EraseBlock() function must return block of the firmware volume), the EraseBlock() function must return
EFI_INVALID_PARAMETER without modifying the contents of the firmware volume. EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
Arguments: Arguments:
This - Calling context This - Calling context
... - Starting LBA followed by Number of Lba to erase. ... - Starting LBA followed by Number of Lba to erase.
a -1 to terminate the list. a -1 to terminate the list.
Returns: Returns:
EFI_SUCCESS - The erase request was successfully completed EFI_SUCCESS - The erase request was successfully completed
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written. Firmware device may have been could not be written. Firmware device may have been
partially erased partially erased
@@ -1037,13 +1037,13 @@ Arguments:
output, indicates the actual number of bytes written output, indicates the actual number of bytes written
Buffer - Buffer containing source data for the write. Buffer - Buffer containing source data for the write.
Returns: Returns:
EFI_SUCCESS - The firmware volume was written successfully EFI_SUCCESS - The firmware volume was written successfully
EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output, EFI_BAD_BUFFER_SIZE - Write attempted across a LBA boundary. On output,
NumBytes contains the total number of bytes NumBytes contains the total number of bytes
actually written actually written
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written could not be written
EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL
@@ -1085,14 +1085,14 @@ Arguments:
output, indicates the actual number of bytes Read output, indicates the actual number of bytes Read
Buffer - Buffer containing source data for the Read. Buffer - Buffer containing source data for the Read.
Returns: Returns:
EFI_SUCCESS - The firmware volume was read successfully and EFI_SUCCESS - The firmware volume was read successfully and
contents are in Buffer contents are in Buffer
EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output, EFI_BAD_BUFFER_SIZE - Read attempted across a LBA boundary. On output,
NumBytes contains the total number of bytes returned NumBytes contains the total number of bytes returned
in Buffer in Buffer
EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state EFI_ACCESS_DENIED - The firmware volume is in the ReadDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be read could not be read
EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL EFI_INVALID_PARAMETER - NumBytes or Buffer are NULL
@@ -1125,15 +1125,15 @@ Routine Description:
Arguments: Arguments:
This - Calling context This - Calling context
StartLba - The starting logical block index to be erased StartLba - The starting logical block index to be erased
OffsetStartLba - Offset into the starting block at which to OffsetStartLba - Offset into the starting block at which to
begin erasing begin erasing
LastLba - The last logical block index to be erased LastLba - The last logical block index to be erased
OffsetStartLba - Offset into the last block at which to end erasing OffsetStartLba - Offset into the last block at which to end erasing
Returns: Returns:
EFI_SUCCESS - The firmware volume was erased successfully EFI_SUCCESS - The firmware volume was erased successfully
EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state EFI_ACCESS_DENIED - The firmware volume is in the WriteDisabled state
EFI_DEVICE_ERROR - The block device is not functioning correctly and EFI_DEVICE_ERROR - The block device is not functioning correctly and
could not be written. Firmware device may have been could not be written. Firmware device may have been
partially erased partially erased
@@ -1167,7 +1167,7 @@ Routine Description:
Arguments: Arguments:
FwVolHeader - A pointer to a firmware volume header FwVolHeader - A pointer to a firmware volume header
Returns: Returns:
EFI_SUCCESS - The firmware volume is consistent EFI_SUCCESS - The firmware volume is consistent
EFI_NOT_FOUND - The firmware volume has corrupted. So it is not an FV EFI_NOT_FOUND - The firmware volume has corrupted. So it is not an FV
@@ -1252,12 +1252,8 @@ Returns:
// Allocate runtime services data for global variable, which contains // Allocate runtime services data for global variable, which contains
// the private data of all firmware volume block instances // the private data of all firmware volume block instances
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal = AllocateRuntimePool (sizeof (ESAL_FWB_GLOBAL));
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal != NULL);
sizeof (ESAL_FWB_GLOBAL),
&mFvbModuleGlobal
);
ASSERT_EFI_ERROR (Status);
// //
// Calculate the total size for all firmware volume block instances // Calculate the total size for all firmware volume block instances
@@ -1306,12 +1302,8 @@ Returns:
// the private data of each FV instance. But in virtual mode or in physical // the private data of each FV instance. But in virtual mode or in physical
// mode, the address of the the physical memory may be different. // mode, the address of the the physical memory may be different.
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] = AllocateRuntimePool (BufferSize);
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal->FvInstance[FVB_PHYSICAL] != NULL);
BufferSize,
&mFvbModuleGlobal->FvInstance[FVB_PHYSICAL]
);
ASSERT_EFI_ERROR (Status);
// //
// Make a virtual copy of the FvInstance pointer. // Make a virtual copy of the FvInstance pointer.
@@ -1392,12 +1384,8 @@ Returns:
// //
// Add a FVB Protocol Instance // Add a FVB Protocol Instance
// //
Status = gBS->AllocatePool ( FvbDevice = AllocateRuntimePool (sizeof (EFI_FW_VOL_BLOCK_DEVICE));
EfiRuntimeServicesData, ASSERT (FvbDevice != NULL);
sizeof (EFI_FW_VOL_BLOCK_DEVICE),
&FvbDevice
);
ASSERT_EFI_ERROR (Status);
CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE)); CopyMem (FvbDevice, &mFvbDeviceTemplate, sizeof (EFI_FW_VOL_BLOCK_DEVICE));
@@ -1481,12 +1469,8 @@ Returns:
// //
// Allocate for scratch space, an intermediate buffer for FVB extention // Allocate for scratch space, an intermediate buffer for FVB extention
// //
Status = gBS->AllocatePool ( mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] = AllocateRuntimePool (MaxLbaSize);
EfiRuntimeServicesData, ASSERT (mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL] != NULL);
MaxLbaSize,
&mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]
);
ASSERT_EFI_ERROR (Status);
mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL]; mFvbModuleGlobal->FvbScratchSpace[FVB_VIRTUAL] = mFvbModuleGlobal->FvbScratchSpace[FVB_PHYSICAL];