summaryrefslogtreecommitdiff
path: root/EdkNt32Pkg/Library
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-30 06:15:19 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-30 06:15:19 +0000
commitfa332de7493caee4d3fa22392dc6292cfbb6f224 (patch)
tree3067198e303277699f3879d8d25e66c0254979a8 /EdkNt32Pkg/Library
parentdb29f969a9eb430eb81fd027614d4933c1d450e1 (diff)
downloadedk2-platforms-fa332de7493caee4d3fa22392dc6292cfbb6f224.tar.xz
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
Diffstat (limited to 'EdkNt32Pkg/Library')
-rw-r--r--EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa4
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c86
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c68
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c50
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c182
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c6
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa7
-rw-r--r--EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c26
-rw-r--r--EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa4
-rw-r--r--EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa4
10 files changed, 220 insertions, 217 deletions
diff --git a/EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa b/EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
index 23d7157d8b..4ae0d0c10c 100644
--- a/EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
+++ b/EdkNt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>DxeWinNtLib</OutputFileBasename>
</ModuleDefinitions>
<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>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c
index 0c744db224..05c8e7d1e3 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsBoot.c
@@ -1,13 +1,13 @@
/*++
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-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.
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+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:
@@ -30,7 +30,7 @@ BdsLibDoLegacyBoot (
/*++
Routine Description:
-
+
Boot the legacy system with the boot option
Arguments:
@@ -41,7 +41,7 @@ Returns:
EFI_UNSUPPORTED - There is no legacybios protocol, do not support
legacy boot.
-
+
EFI_STATUS - Return the status of LegacyBios->LegacyBoot ().
--*/
@@ -89,15 +89,15 @@ BdsLibBootViaBootOption (
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.
Arguments:
Option - The boot option need to be processed
-
- DevicePath - The device path which describe where to load
- the boot image or the legcy BBS device path
+
+ DevicePath - The device path which describe where to load
+ the boot image or the legcy BBS device path
to boot the legacy OS
ExitDataSize - Returned directly from gBS->StartImage ()
@@ -167,7 +167,7 @@ Returns:
// Signal the EFI_EVENT_SIGNAL_READY_TO_BOOT event
//
EfiSignalEventReadyToBoot ();
-
+
//
// Set Boot Current
//
@@ -240,7 +240,7 @@ Returns:
BlkIo->Media->BlockSize,
Buffer
);
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
}
}
@@ -324,8 +324,8 @@ BdsBootByDiskSignatureAndPartition (
Routine Description:
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:
Option - The current processing boot option.
@@ -347,7 +347,7 @@ Returns:
EFI_SUCCESS - Status from gBS->StartImage (),
or BootByDiskSignatureAndPartition ()
-
+
EFI_NOT_FOUND - If the Device Path is not found in the system
--*/
@@ -406,7 +406,7 @@ Returns:
// find HardDriver device path node
//
while (!IsDevicePathEnd (DevicePath)) {
- if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) &&
+ if ((DevicePathType (DevicePath) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType (DevicePath) == MEDIA_HARDDRIVE_DP)
) {
BlockIoHdDevicePath = DevicePath;
@@ -460,7 +460,7 @@ Returns:
}
}
- gBS->FreePool (BlockIoBuffer);
+ FreePool (BlockIoBuffer);
return Status;
}
@@ -532,7 +532,7 @@ Returns:
&BootOptionSize
);
if (NULL == BootOptionVar) {
- gBS->FreePool (BootOrder);
+ FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES;
}
@@ -549,11 +549,11 @@ Returns:
if ((OptionDevicePathSize == DevicePathSize) &&
(CompareMem (DevicePath, OptionDevicePath, DevicePathSize) == 0)) {
BdsDeleteBootOption (BootOrder[Index], BootOrder, &BootOrderSize);
- gBS->FreePool (BootOptionVar);
+ FreePool (BootOptionVar);
break;
}
- gBS->FreePool (BootOptionVar);
+ FreePool (BootOptionVar);
Index++;
}
@@ -565,7 +565,7 @@ Returns:
BootOrder
);
- gBS->FreePool (BootOrder);
+ FreePool (BootOrder);
return Status;
}
@@ -636,7 +636,7 @@ Returns:
&BootOptionSize
);
if (NULL == BootOptionVar) {
- gBS->FreePool (BootOrder);
+ FreePool (BootOrder);
return EFI_OUT_OF_RESOURCES;
}
@@ -652,7 +652,7 @@ Returns:
//
if ((DevicePathType (OptionDevicePath) == BBS_DEVICE_PATH) &&
(DevicePathSubType (OptionDevicePath) == BBS_BBS_DP)) {
- gBS->FreePool (BootOptionVar);
+ FreePool (BootOptionVar);
Index++;
continue;
}
@@ -664,7 +664,7 @@ Returns:
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.
//
if (((DevicePathType (LastDeviceNode) == MEDIA_DEVICE_PATH) &&
@@ -673,7 +673,7 @@ Returns:
// Skip boot option for internal Shell, it's always valid
//
(EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode) != NULL)) {
- gBS->FreePool (BootOptionVar);
+ FreePool (BootOptionVar);
Index++;
continue;
}
@@ -721,7 +721,7 @@ Returns:
BootOrder[Index] = 0xffff;
}
- gBS->FreePool (BootOptionVar);
+ FreePool (BootOptionVar);
Index++;
}
@@ -743,7 +743,7 @@ Returns:
BootOrder
);
- gBS->FreePool (BootOrder);
+ FreePool (BootOrder);
return Status;
}
@@ -877,7 +877,7 @@ Returns:
}
if (NumberFileSystemHandles) {
- gBS->FreePool (FileSystemHandles);
+ FreePool (FileSystemHandles);
}
//
// Parse Network Boot Device
@@ -904,7 +904,7 @@ Returns:
}
if (NumberLoadFileHandles) {
- gBS->FreePool (LoadFileHandles);
+ FreePool (LoadFileHandles);
}
//
// Check if we have on flash shell
@@ -946,7 +946,7 @@ Returns:
}
if (FvHandleCount) {
- gBS->FreePool (FvHandleBuffer);
+ FreePool (FvHandleBuffer);
}
//
// Make sure every boot only have one time
@@ -966,13 +966,13 @@ BdsLibBuildOptionFromHandle (
/*++
Routine Description:
-
+
Build the boot option with the handle parsed in
-
+
Arguments:
Handle - The handle which present the device path to create boot option
-
+
BdsBootOptionList - The header of the link list which indexed all current
boot options
@@ -1002,14 +1002,14 @@ BdsLibBuildOptionFromShell (
/*++
Routine Description:
-
+
Build the on flash shell boot option with the handle parsed in
-
+
Arguments:
Handle - The handle which present the device path to create on flash shell
boot option
-
+
BdsBootOptionList - The header of the link list which indexed all current
boot options
@@ -1044,13 +1044,13 @@ BdsLibBootNext (
/*++
Routine Description:
-
+
Boot from the EFI1.1 spec defined "BootNext" variable
-
+
Arguments:
None
-
+
Returns:
None
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c
index 9c649f1f82..772b339f9b 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConnect.c
@@ -1,13 +1,13 @@
/*++
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-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.
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+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:
@@ -26,12 +26,12 @@ BdsLibConnectAll (
/*++
Routine Description:
-
+
This function will connect all the system driver to controller
first, and then special connect the default console, this make
sure all the system controller avialbe and the platform default
console connected.
-
+
Arguments:
None
@@ -66,12 +66,12 @@ BdsLibGenericConnectAll (
/*++
Routine Description:
-
+
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
if the system have console device.
-
+
Arguments:
None
@@ -100,7 +100,7 @@ Routine Description:
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,
which load the missing drivers if possible.
-
+
Arguments:
DevicePathToConnect - The device path which will be connected, it can
@@ -108,12 +108,12 @@ Arguments:
Returns:
- EFI_SUCCESS - All handles associate with every device path
+ EFI_SUCCESS - All handles associate with every device path
node have been created
-
+
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
--*/
@@ -206,7 +206,7 @@ Returns:
} while (DevicePath != NULL);
if (CopyOfDevicePath != NULL) {
- gBS->FreePool (CopyOfDevicePath);
+ FreePool (CopyOfDevicePath);
}
//
// 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
connection will finish until every handle's child handle created if it have.
-
+
Arguments:
None
@@ -232,8 +232,8 @@ Arguments:
Returns:
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);
}
- gBS->FreePool (HandleBuffer);
+ FreePool (HandleBuffer);
return EFI_SUCCESS;
}
@@ -272,7 +272,7 @@ Routine Description:
This function will disconnect all current system handles. The disconnection
will finish until every handle have been disconnected.
-
+
Arguments:
None
@@ -280,8 +280,8 @@ Arguments:
Returns:
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);
}
- gBS->FreePool (HandleBuffer);
+ FreePool (HandleBuffer);
return EFI_SUCCESS;
}
@@ -321,19 +321,19 @@ BdsLibConnectAllDriversToAllControllers (
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
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:
-
+
None
-
+
Returns:
-
+
None
-
+
--*/
{
EFI_STATUS Status;
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c
index 47a79ff34e..96a1f4b9fd 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsConsole.c
@@ -1,13 +1,13 @@
/*++
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-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.
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+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:
@@ -25,9 +25,9 @@ IsNvNeed (
)
{
CHAR16 *Ptr;
-
+
Ptr = ConVarName;
-
+
//
// If the variable includes "Dev" at last, we consider
// it does not support NV attribute.
@@ -35,7 +35,7 @@ IsNvNeed (
while (*Ptr) {
Ptr++;
}
-
+
if ((*(Ptr - 3) == 'D') && (*(Ptr - 2) == 'e') && (*(Ptr - 1) == 'v')) {
return FALSE;
} else {
@@ -53,7 +53,7 @@ BdsLibUpdateConsoleVariable (
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
Arguments:
@@ -71,8 +71,8 @@ Arguments:
Returns:
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.
--*/
@@ -103,12 +103,12 @@ Returns:
&gEfiGlobalVariableGuid,
&DevicePathSize
);
-
+
//
// Initialize NewDevicePath
//
NewDevicePath = VarConsole;
-
+
//
// If ExclusiveDevicePath is even the part of the instance in VarConsole, delete it.
// In the end, NewDevicePath is the final device path.
@@ -134,7 +134,7 @@ Returns:
BdsLibSafeFreePool(TempNewDevicePath);
}
}
-
+
//
// 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;
}
-
+
//
// Finally, Update the variable of the default console by NewDevicePath
//
@@ -192,7 +192,7 @@ Arguments:
Returns:
EFI_NOT_FOUND - There is not any console devices connected success
-
+
EFI_SUCCESS - Success connect any one instance of the console
device path base on the variable ConVarName.
@@ -250,7 +250,7 @@ Returns:
BdsLibSafeFreePool(Instance);
} while (CopyOfDevicePath != NULL);
- gBS->FreePool (StartDevicePath);
+ FreePool (StartDevicePath);
if (DeviceExist == FALSE) {
return EFI_NOT_FOUND;
@@ -346,7 +346,7 @@ BdsLibConnectAllDefaultConsoles (
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.
Arguments:
@@ -357,7 +357,7 @@ Returns:
EFI_SUCCESS - At least one of the ConIn and ConOut device have
been connected success.
-
+
EFI_STATUS - Return the status of BdsLibConnectConsoleVariable ().
--*/
@@ -370,12 +370,12 @@ Returns:
//
// 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.
- //
+ //
BdsLibConnectConsoleVariable (L"ConIn");
- //
+ //
// It seems impossible not to have any ConOut device on platform,
// so we check the status here.
//
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
index 6a3ec058bf..e0b5d08c96 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/BdsMisc.c
@@ -1,13 +1,13 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-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.
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+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:
@@ -31,7 +31,7 @@ BdsLibGetTimeout (
/*++
Routine Description:
-
+
Return the default value for system Timeout variable.
Arguments:
@@ -39,7 +39,7 @@ Arguments:
None
Returns:
-
+
Timeout value.
--*/
@@ -85,7 +85,7 @@ BdsLibLoadDrivers (
/*++
Routine Description:
-
+
The function will go through the driver optoin link list, load and start
every driver the driver optoin device path point to.
@@ -94,7 +94,7 @@ Arguments:
BdsDriverLists - The header of the current driver option link list
Returns:
-
+
None
--*/
@@ -198,7 +198,7 @@ BdsLibRegisterNewOption (
/*++
Routine Description:
-
+
This function will register the new boot#### or driver#### option base on
the VariableName. The new registered boot#### or driver#### will be linked
to BdsOptionList and also update to the VariableName. After the boot#### or
@@ -207,18 +207,18 @@ Routine Description:
Arguments:
BdsOptionList - The header of the boot#### or driver#### link list
-
+
DevicePath - The device path which the boot####
or driver#### option present
-
+
String - The description of the boot#### or driver####
-
+
VariableName - Indicate if the boot#### or driver#### option
Returns:
-
+
EFI_SUCCESS - The boot#### or driver#### have been success registered
-
+
EFI_STATUS - Return the status of gRT->SetVariable ().
--*/
@@ -249,11 +249,13 @@ Returns:
ZeroMem (OptionName, sizeof (OptionName));
TempOptionSize = 0;
+
TempOptionPtr = BdsLibGetVariableAndSize (
VariableName,
&gEfiGlobalVariableGuid,
&TempOptionSize
);
+
//
// Compare with current option variable
//
@@ -290,8 +292,8 @@ Returns:
//
// Got the option, so just return
//
- gBS->FreePool (OptionPtr);
- gBS->FreePool (TempOptionPtr);
+ FreePool (OptionPtr);
+ FreePool (TempOptionPtr);
return EFI_SUCCESS;
} else {
//
@@ -302,7 +304,7 @@ Returns:
}
}
- gBS->FreePool (OptionPtr);
+ FreePool (OptionPtr);
}
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String) + GetDevicePathSize (DevicePath);
@@ -342,12 +344,12 @@ Returns:
OptionPtr
);
if (EFI_ERROR (Status) || UpdateBootDevicePath) {
- gBS->FreePool (OptionPtr);
- gBS->FreePool (TempOptionPtr);
+ FreePool (OptionPtr);
+ FreePool (TempOptionPtr);
return Status;
}
- gBS->FreePool (OptionPtr);
+ FreePool (OptionPtr);
//
// Update the option order variable
@@ -363,13 +365,15 @@ Returns:
OptionOrderPtr
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (TempOptionPtr);
- gBS->FreePool (OptionOrderPtr);
+ FreePool (TempOptionPtr);
+ FreePool (OptionOrderPtr);
return Status;
}
- gBS->FreePool (TempOptionPtr);
- gBS->FreePool (OptionOrderPtr);
+ if (TempOptionPtr != NULL) {
+ FreePool (TempOptionPtr);
+ }
+ FreePool (OptionOrderPtr);
return EFI_SUCCESS;
}
@@ -383,9 +387,9 @@ BdsLibVariableToOption (
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
-
+
Arguments:
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) {
InsertTailList (BdsCommonOptionList, &Option->Link);
- gBS->FreePool (Variable);
+ FreePool (Variable);
return Option;
}
- gBS->FreePool (Variable);
- gBS->FreePool (Option);
+ FreePool (Variable);
+ FreePool (Option);
return NULL;
}
@@ -553,7 +557,7 @@ Returns:
}
- gBS->FreePool (OptionOrder);
+ FreePool (OptionOrder);
return EFI_SUCCESS;
}
@@ -631,7 +635,7 @@ Routine Description:
Free pool safely.
Arguments:
-
+
Buffer - The allocated pool entry to free
Returns:
@@ -641,7 +645,7 @@ Returns:
--*/
{
if (Buffer != NULL) {
- gBS->FreePool (Buffer);
+ FreePool (Buffer);
Buffer = NULL;
}
}
@@ -665,7 +669,7 @@ Arguments:
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
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 *TempNewDevicePath;
UINTN InstanceSize;
- UINTN SingleDpSize;
- UINTN Size;
-
+ UINTN SingleDpSize;
+ UINTN Size;
+
NewDevicePath = NULL;
TempNewDevicePath = NULL;
if (Multi == NULL || Single == NULL) {
return Multi;
}
-
+
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
SingleDpSize = GetDevicePathSize (Single) - END_DEVICE_PATH_LENGTH;
InstanceSize -= END_DEVICE_PATH_LENGTH;
while (Instance != NULL) {
- Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize;
-
+ Size = (SingleDpSize < InstanceSize) ? SingleDpSize : InstanceSize;
+
if ((CompareMem (Instance, Single, Size) != 0)) {
//
// Append the device path instance which does not match with Single
@@ -705,7 +709,7 @@ Returns:
Instance = GetNextDevicePathInstance (&Multi, &InstanceSize);
InstanceSize -= END_DEVICE_PATH_LENGTH;
}
-
+
return NewDevicePath;
}
@@ -730,9 +734,9 @@ Arguments:
Returns:
TRUE - If the Single is contained within Multi
-
+
FALSE - The Single is not match within Multi
-
+
--*/
{
@@ -756,11 +760,11 @@ Returns:
// return success
//
if (CompareMem (Single, DevicePathInst, Size) == 0) {
- gBS->FreePool (DevicePathInst);
+ FreePool (DevicePathInst);
return TRUE;
}
- gBS->FreePool (DevicePathInst);
+ FreePool (DevicePathInst);
DevicePathInst = GetNextDevicePathInstance (&DevicePath, &Size);
}
@@ -788,7 +792,7 @@ Arguments:
Returns:
EFI_SUCCESS - Success print out the string using ConOut.
-
+
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.
-// 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.
//
@@ -832,7 +836,7 @@ EnableResetReminderFeature (
/*++
Routine Description:
-
+
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.
@@ -847,7 +851,7 @@ Returns:
--*/
{
mFeaturerSwitch = TRUE;
-}
+}
VOID
DisableResetReminderFeature (
@@ -856,10 +860,10 @@ DisableResetReminderFeature (
/*++
Routine Description:
-
+
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.
-
+
Arguments:
VOID
@@ -871,7 +875,7 @@ Returns:
--*/
{
mFeaturerSwitch = FALSE;
-}
+}
VOID
EnableResetRequired (
@@ -880,10 +884,10 @@ EnableResetRequired (
/*++
Routine Description:
-
+
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:
VOID
@@ -895,7 +899,7 @@ Returns:
--*/
{
mResetRequired = TRUE;
-}
+}
VOID
DisableResetRequired (
@@ -906,7 +910,7 @@ DisableResetRequired (
Routine Description:
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:
@@ -919,7 +923,7 @@ Returns:
--*/
{
mResetRequired = FALSE;
-}
+}
BOOLEAN
IsResetReminderFeatureEnable (
@@ -928,7 +932,7 @@ IsResetReminderFeatureEnable (
/*++
Routine Description:
-
+
Check whether platform policy enable the reset reminder feature. The default is enabled.
Arguments:
@@ -951,9 +955,9 @@ IsResetRequired (
/*++
Routine Description:
-
+
Check if user changed any option setting which needs a system reset to be effective.
-
+
Arguments:
VOID
@@ -974,9 +978,9 @@ SetupResetReminder (
/*++
Routine Description:
-
+
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.
Arguments:
@@ -991,9 +995,9 @@ Returns:
{
EFI_STATUS Status;
EFI_FORM_BROWSER_PROTOCOL *Browser;
- EFI_INPUT_KEY Key;
+ EFI_INPUT_KEY Key;
CHAR16 *StringBuffer1;
- CHAR16 *StringBuffer2;
+ CHAR16 *StringBuffer2;
//
@@ -1001,28 +1005,28 @@ Returns:
//
if (IsResetReminderFeatureEnable ()) {
if (IsResetRequired ()) {
-
+
Status = gBS->LocateProtocol (
&gEfiFormBrowserProtocolGuid,
NULL,
&Browser
- );
-
+ );
+
StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
ASSERT (StringBuffer1 != NULL);
StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
- ASSERT (StringBuffer2 != NULL);
+ ASSERT (StringBuffer2 != NULL);
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
- //
+ //
do {
Browser->CreatePopUp (2, TRUE, 0, NULL, &Key, StringBuffer1, StringBuffer2);
- } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
-
- gBS->FreePool (StringBuffer1);
- gBS->FreePool (StringBuffer2);
+ } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN));
+
+ FreePool (StringBuffer1);
+ FreePool (StringBuffer2);
//
// If the user hits the YES Response key, reset
//
@@ -1030,9 +1034,9 @@ Returns:
gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
}
gST->ConOut->ClearScreen (gST->ConOut);
- }
- }
-}
+ }
+ }
+}
EFI_STATUS
BdsLibGetHiiHandles (
@@ -1050,7 +1054,7 @@ Routine Description:
Arguments:
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.
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_INVALID_PARAMETER - Hii is NULL.
EFI_NOT_FOUND - Database not found.
-
+
--*/
{
UINT16 TempBufferLength;
EFI_STATUS Status;
-
+
TempBufferLength = 0;
-
+
//
// Try to find the actual buffer size for HiiHandle Buffer.
//
Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);
-
+
if (Status == EFI_BUFFER_TOO_SMALL) {
*HiiHandleBuffer = AllocateZeroPool (TempBufferLength);
Status = Hii->FindHandles (Hii, &TempBufferLength, *HiiHandleBuffer);
@@ -1080,9 +1084,9 @@ Returns:
//
ASSERT_EFI_ERROR (Status);
}
-
+
*HandleBufferLength = TempBufferLength;
-
+
return Status;
-
+
}
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c
index 5a80471927..e893046c4e 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/DevicePath.c
@@ -71,7 +71,7 @@ Returns:
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
}
- gBS->FreePool (OldPool);
+ FreePool (OldPool);
}
return NewPool;
@@ -137,7 +137,7 @@ Returns:
Str->len = strsize - sizeof (UINT16);
}
- gBS->FreePool (AppendStr);
+ FreePool (AppendStr);
return Str->str;
}
@@ -1059,7 +1059,7 @@ DevicePathToStr (
//
// Shrink pool used for string allocation
//
- gBS->FreePool (DevPath);
+ FreePool (DevPath);
Done:
NewSize = (Str.len + 1) * sizeof (CHAR16);
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa b/EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa
index 0357fcb69c..d9420e4385 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/EdkGenericBdsLib.msa
@@ -6,7 +6,7 @@
<GuidValue>1ec995b2-d15b-44f6-abd2-050ea7dd37d2</GuidValue>
<Version>1.0</Version>
<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,
boot device connection, console supports in BDS phase and boot from boot
device.</Description>
@@ -20,12 +20,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkGenericBdsLib</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
- <LibraryClass Usage="ALWAYS_PRODUCED">
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER">
<Keyword>EdkGenericBdsLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
@@ -76,7 +76,6 @@
<Filename>Performance.h</Filename>
<Filename>Performance.c</Filename>
<Filename>BdsMisc.c</Filename>
- <Filename SupArchList="IPF">Ipf/ShadowRom.c</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
diff --git a/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c b/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c
index f0ac12e0d6..2d157aebb3 100644
--- a/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c
+++ b/EdkNt32Pkg/Library/EdkGenericBdsLib/Performance.c
@@ -1,13 +1,13 @@
/*++
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-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.
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+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:
@@ -33,7 +33,7 @@ GetShortPdbFileName (
/*++
Routine Description:
-
+
Arguments:
Returns:
@@ -176,13 +176,13 @@ WriteBootToOsPerformanceData (
/*++
Routine Description:
-
+
Allocates a block of memory and writes performance data of booting to OS into it.
Arguments:
-
+
None
-
+
Returns:
None
@@ -328,7 +328,7 @@ Returns:
}
}
- gBS->FreePool (Handles);
+ FreePool (Handles);
//
// Get inserted performance data
diff --git a/EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa b/EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa
index 624f928e7d..79fc9ec7c7 100644
--- a/EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa
+++ b/EdkNt32Pkg/Library/EdkNt32PeiPeCoffGetEntryPointLib/EdkNt32PeiPeCoffGetEntryPointLib.msa
@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>EdkNt32PeiPeCoffGetEntryPointLib</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
- <LibraryClass Usage="ALWAYS_PRODUCED">
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="PEI_CORE PEIM">
<Keyword>PeCoffGetEntryPointLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
diff --git a/EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa b/EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa
index e57dff1dc8..1a76e04341 100644
--- a/EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa
+++ b/EdkNt32Pkg/Library/Nt32PeCoffLoaderLib/Nt32PeCoffLoaderLib.msa
@@ -17,12 +17,12 @@
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
+ <SupportedArchitectures>IA32</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>Nt32PeCoffLoaderLib</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
- <LibraryClass Usage="ALWAYS_PRODUCED">
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE PEIM">
<Keyword>EdkPeCoffLoaderLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions>