Clean up PERF macro usage. The macros were being used with 0 as the first parameter. This parameter is actually a void*. All of these instances were corrected to use NULL as the first parameter.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8954 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -77,7 +77,7 @@ BdsLibDoLegacyBoot (
|
|||||||
|
|
||||||
@retval TRUE This boot option matches a valid EFI NV Boot####.
|
@retval TRUE This boot option matches a valid EFI NV Boot####.
|
||||||
@retval FALSE If not.
|
@retval FALSE If not.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
IsBootOptionValidNVVarialbe (
|
IsBootOptionValidNVVarialbe (
|
||||||
@ -100,7 +100,7 @@ IsBootOptionValidNVVarialbe (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the Boot Option Number and Device Path matches, OptionToCheck matches a
|
// If the Boot Option Number and Device Path matches, OptionToCheck matches a
|
||||||
// valid EFI NV Boot####.
|
// valid EFI NV Boot####.
|
||||||
//
|
//
|
||||||
if ((OptionToCheck->BootCurrent == BootOption->BootCurrent) &&
|
if ((OptionToCheck->BootCurrent == BootOption->BootCurrent) &&
|
||||||
@ -110,7 +110,7 @@ IsBootOptionValidNVVarialbe (
|
|||||||
}
|
}
|
||||||
|
|
||||||
FreePool (BootOption);
|
FreePool (BootOption);
|
||||||
|
|
||||||
return Valid;
|
return Valid;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -150,7 +150,7 @@ BdsLibBootViaBootOption (
|
|||||||
//
|
//
|
||||||
// Record the performance data for End of BDS
|
// Record the performance data for End of BDS
|
||||||
//
|
//
|
||||||
PERF_END (0, "BDS", NULL, 0);
|
PERF_END(NULL, "BDS", NULL, 0);
|
||||||
|
|
||||||
*ExitDataSize = 0;
|
*ExitDataSize = 0;
|
||||||
*ExitData = NULL;
|
*ExitData = NULL;
|
||||||
@ -187,8 +187,8 @@ BdsLibBootViaBootOption (
|
|||||||
// Signal the EVT_SIGNAL_READY_TO_BOOT event
|
// Signal the EVT_SIGNAL_READY_TO_BOOT event
|
||||||
//
|
//
|
||||||
EfiSignalEventReadyToBoot();
|
EfiSignalEventReadyToBoot();
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set Boot Current
|
// Set Boot Current
|
||||||
//
|
//
|
||||||
@ -233,11 +233,11 @@ BdsLibBootViaBootOption (
|
|||||||
//
|
//
|
||||||
InitializeListHead (&TempBootLists);
|
InitializeListHead (&TempBootLists);
|
||||||
BdsLibRegisterNewOption (&TempBootLists, DevicePath, L"EFI Internal Shell", L"BootOrder");
|
BdsLibRegisterNewOption (&TempBootLists, DevicePath, L"EFI Internal Shell", L"BootOrder");
|
||||||
|
|
||||||
//
|
//
|
||||||
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()
|
// free the temporary device path created by BdsLibUpdateFvFileDevicePath()
|
||||||
//
|
//
|
||||||
FreePool (DevicePath);
|
FreePool (DevicePath);
|
||||||
DevicePath = Option->DevicePath;
|
DevicePath = Option->DevicePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
&mHdBootVariablePrivateGuid,
|
&mHdBootVariablePrivateGuid,
|
||||||
&CachedDevicePathSize
|
&CachedDevicePathSize
|
||||||
);
|
);
|
||||||
|
|
||||||
if (CachedDevicePath != NULL) {
|
if (CachedDevicePath != NULL) {
|
||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
DeviceExist = FALSE;
|
DeviceExist = FALSE;
|
||||||
@ -442,7 +442,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
TempNewDevicePath = CachedDevicePath;
|
TempNewDevicePath = CachedDevicePath;
|
||||||
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );
|
CachedDevicePath = BdsLibDelPartMatchInstance (CachedDevicePath, Instance );
|
||||||
FreePool (TempNewDevicePath);
|
FreePool (TempNewDevicePath);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Second, append the remaining path after the matched instance
|
// Second, append the remaining path after the matched instance
|
||||||
//
|
//
|
||||||
@ -460,7 +460,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
CachedDevicePath
|
CachedDevicePath
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (Instance);
|
FreePool (Instance);
|
||||||
FreePool (CachedDevicePath);
|
FreePool (CachedDevicePath);
|
||||||
return FullDevicePath;
|
return FullDevicePath;
|
||||||
@ -559,7 +559,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (CachedDevicePath);
|
FreePool (CachedDevicePath);
|
||||||
if (BlockIoBuffer != NULL) {
|
if (BlockIoBuffer != NULL) {
|
||||||
FreePool (BlockIoBuffer);
|
FreePool (BlockIoBuffer);
|
||||||
@ -594,7 +594,7 @@ MatchPartitionDevicePathNode (
|
|||||||
if ((BlockIoDevicePath == NULL) || (HardDriveDevicePath == NULL)) {
|
if ((BlockIoDevicePath == NULL) || (HardDriveDevicePath == NULL)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make PreviousDevicePath == the device path node before the end node
|
// Make PreviousDevicePath == the device path node before the end node
|
||||||
//
|
//
|
||||||
@ -623,7 +623,7 @@ MatchPartitionDevicePathNode (
|
|||||||
//
|
//
|
||||||
TmpHdPath = (HARDDRIVE_DEVICE_PATH *) BlockIoHdDevicePathNode;
|
TmpHdPath = (HARDDRIVE_DEVICE_PATH *) BlockIoHdDevicePathNode;
|
||||||
Match = FALSE;
|
Match = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check for the match
|
// Check for the match
|
||||||
//
|
//
|
||||||
@ -711,7 +711,7 @@ BdsLibDeleteOptionFromHandle (
|
|||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
&BootOptionSize
|
&BootOptionSize
|
||||||
);
|
);
|
||||||
|
|
||||||
if (BootOptionVar == NULL) {
|
if (BootOptionVar == NULL) {
|
||||||
FreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
@ -872,40 +872,40 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
For EFI boot option, BDS separate them as six types:
|
For EFI boot option, BDS separate them as six types:
|
||||||
1. Network - The boot option points to the SimpleNetworkProtocol device.
|
1. Network - The boot option points to the SimpleNetworkProtocol device.
|
||||||
Bds will try to automatically create this type boot option when enumerate.
|
Bds will try to automatically create this type boot option when enumerate.
|
||||||
2. Shell - The boot option points to internal flash shell.
|
2. Shell - The boot option points to internal flash shell.
|
||||||
Bds will try to automatically create this type boot option when enumerate.
|
Bds will try to automatically create this type boot option when enumerate.
|
||||||
3. Removable BlockIo - The boot option only points to the removable media
|
3. Removable BlockIo - The boot option only points to the removable media
|
||||||
device, like USB flash disk, DVD, Floppy etc.
|
device, like USB flash disk, DVD, Floppy etc.
|
||||||
These device should contain a *removable* blockIo
|
These device should contain a *removable* blockIo
|
||||||
protocol in their device handle.
|
protocol in their device handle.
|
||||||
Bds will try to automatically create this type boot option
|
Bds will try to automatically create this type boot option
|
||||||
when enumerate.
|
when enumerate.
|
||||||
4. Fixed BlockIo - The boot option only points to a Fixed blockIo device,
|
4. Fixed BlockIo - The boot option only points to a Fixed blockIo device,
|
||||||
like HardDisk.
|
like HardDisk.
|
||||||
These device should contain a *fixed* blockIo
|
These device should contain a *fixed* blockIo
|
||||||
protocol in their device handle.
|
protocol in their device handle.
|
||||||
BDS will skip fixed blockIo devices, and NOT
|
BDS will skip fixed blockIo devices, and NOT
|
||||||
automatically create boot option for them. But BDS
|
automatically create boot option for them. But BDS
|
||||||
will help to delete those fixed blockIo boot option,
|
will help to delete those fixed blockIo boot option,
|
||||||
whose description rule conflict with other auto-created
|
whose description rule conflict with other auto-created
|
||||||
boot options.
|
boot options.
|
||||||
5. Non-BlockIo Simplefile - The boot option points to a device whose handle
|
5. Non-BlockIo Simplefile - The boot option points to a device whose handle
|
||||||
has SimpleFileSystem Protocol, but has no blockio
|
has SimpleFileSystem Protocol, but has no blockio
|
||||||
protocol. These devices do not offer blockIo
|
protocol. These devices do not offer blockIo
|
||||||
protocol, but BDS still can get the
|
protocol, but BDS still can get the
|
||||||
\EFI\BOOT\boot{machinename}.EFI by SimpleFileSystem
|
\EFI\BOOT\boot{machinename}.EFI by SimpleFileSystem
|
||||||
Protocol.
|
Protocol.
|
||||||
6. File - The boot option points to a file. These boot options are usually
|
6. File - The boot option points to a file. These boot options are usually
|
||||||
created by user manually or OS loader. BDS will not delete or modify
|
created by user manually or OS loader. BDS will not delete or modify
|
||||||
these boot options.
|
these boot options.
|
||||||
|
|
||||||
This function will enumerate all possible boot device in the system, and
|
This function will enumerate all possible boot device in the system, and
|
||||||
automatically create boot options for Network, Shell, Removable BlockIo,
|
automatically create boot options for Network, Shell, Removable BlockIo,
|
||||||
and Non-BlockIo Simplefile devices.
|
and Non-BlockIo Simplefile devices.
|
||||||
It will only execute once of every boot.
|
It will only execute once of every boot.
|
||||||
|
|
||||||
@param BdsBootOptionList The header of the link list which indexed all
|
@param BdsBootOptionList The header of the link list which indexed all
|
||||||
current boot options
|
current boot options
|
||||||
|
|
||||||
@ -956,7 +956,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
MiscNumber = 0;
|
MiscNumber = 0;
|
||||||
ScsiNumber = 0;
|
ScsiNumber = 0;
|
||||||
ZeroMem (Buffer, sizeof (Buffer));
|
ZeroMem (Buffer, sizeof (Buffer));
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the boot device enumerate happened, just get the boot
|
// If the boot device enumerate happened, just get the boot
|
||||||
// device from the boot order variable
|
// device from the boot order variable
|
||||||
@ -965,7 +965,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");
|
Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Notes: this dirty code is to get the legacy boot option from the
|
// Notes: this dirty code is to get the legacy boot option from the
|
||||||
// BBS table and create to variable as the EFI boot option, it should
|
// BBS table and create to variable as the EFI boot option, it should
|
||||||
@ -977,7 +977,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
// Delete invalid boot option
|
// Delete invalid boot option
|
||||||
//
|
//
|
||||||
BdsDeleteAllInvalidEfiBootOption ();
|
BdsDeleteAllInvalidEfiBootOption ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Parse removable media
|
// Parse removable media
|
||||||
//
|
//
|
||||||
@ -988,7 +988,7 @@ BdsLibEnumerateAllBootOption (
|
|||||||
&NumberBlockIoHandles,
|
&NumberBlockIoHandles,
|
||||||
&BlockIoHandles
|
&BlockIoHandles
|
||||||
);
|
);
|
||||||
|
|
||||||
for (Index = 0; Index < NumberBlockIoHandles; Index++) {
|
for (Index = 0; Index < NumberBlockIoHandles; Index++) {
|
||||||
Status = gBS->HandleProtocol (
|
Status = gBS->HandleProtocol (
|
||||||
BlockIoHandles[Index],
|
BlockIoHandles[Index],
|
||||||
@ -1008,11 +1008,11 @@ BdsLibEnumerateAllBootOption (
|
|||||||
|
|
||||||
switch (DevicePathType) {
|
switch (DevicePathType) {
|
||||||
case BDS_EFI_ACPI_FLOPPY_BOOT:
|
case BDS_EFI_ACPI_FLOPPY_BOOT:
|
||||||
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", FloppyNumber);
|
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", FloppyNumber);
|
||||||
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
||||||
FloppyNumber++;
|
FloppyNumber++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Assume a removable SATA device should be the DVD/CD device
|
// Assume a removable SATA device should be the DVD/CD device
|
||||||
//
|
//
|
||||||
@ -1031,13 +1031,13 @@ BdsLibEnumerateAllBootOption (
|
|||||||
|
|
||||||
case BDS_EFI_MESSAGE_SCSI_BOOT:
|
case BDS_EFI_MESSAGE_SCSI_BOOT:
|
||||||
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", ScsiNumber);
|
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", ScsiNumber);
|
||||||
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
||||||
ScsiNumber++;
|
ScsiNumber++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BDS_EFI_MESSAGE_MISC_BOOT:
|
case BDS_EFI_MESSAGE_MISC_BOOT:
|
||||||
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", MiscNumber);
|
UnicodeSPrint (Buffer, sizeof (Buffer), L"%d", MiscNumber);
|
||||||
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
BdsLibBuildOptionFromHandle (BlockIoHandles[Index], BdsBootOptionList, Buffer);
|
||||||
MiscNumber++;
|
MiscNumber++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1198,7 +1198,7 @@ BdsLibBuildOptionFromHandle (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||||
|
|
||||||
DevicePath = DevicePathFromHandle (Handle);
|
DevicePath = DevicePathFromHandle (Handle);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1333,7 +1333,7 @@ BdsLibGetBootableHandle (
|
|||||||
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
|
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
|
||||||
|
|
||||||
UpdatedDevicePath = DevicePath;
|
UpdatedDevicePath = DevicePath;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check whether the device is connected
|
// Check whether the device is connected
|
||||||
//
|
//
|
||||||
@ -1386,7 +1386,7 @@ BdsLibGetBootableHandle (
|
|||||||
//
|
//
|
||||||
DupDevicePath = DuplicateDevicePath (DevicePath);
|
DupDevicePath = DuplicateDevicePath (DevicePath);
|
||||||
ASSERT (DupDevicePath != NULL);
|
ASSERT (DupDevicePath != NULL);
|
||||||
|
|
||||||
UpdatedDevicePath = DupDevicePath;
|
UpdatedDevicePath = DupDevicePath;
|
||||||
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);
|
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);
|
||||||
//
|
//
|
||||||
@ -1531,7 +1531,7 @@ BdsLibNetworkBootWithMediaPresent (
|
|||||||
|
|
||||||
@param DevicePath The bootable device Path to check
|
@param DevicePath The bootable device Path to check
|
||||||
|
|
||||||
@retval BDS_EFI_MEDIA_HD_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node
|
@retval BDS_EFI_MEDIA_HD_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node
|
||||||
which subtype is MEDIA_HARDDRIVE_DP
|
which subtype is MEDIA_HARDDRIVE_DP
|
||||||
@retval BDS_EFI_MEDIA_CDROM_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node
|
@retval BDS_EFI_MEDIA_CDROM_BOOT If given device path contains MEDIA_DEVICE_PATH type device path node
|
||||||
which subtype is MEDIA_CDROM_DP
|
which subtype is MEDIA_CDROM_DP
|
||||||
@ -1546,7 +1546,7 @@ BdsLibNetworkBootWithMediaPresent (
|
|||||||
@retval BDS_EFI_MESSAGE_MISC_BOOT If the device path not contains any media device path node, and
|
@retval BDS_EFI_MESSAGE_MISC_BOOT If the device path not contains any media device path node, and
|
||||||
its last device path node point to a message device path node.
|
its last device path node point to a message device path node.
|
||||||
@retval BDS_LEGACY_BBS_BOOT If given device path contains BBS_DEVICE_PATH type device path node.
|
@retval BDS_LEGACY_BBS_BOOT If given device path contains BBS_DEVICE_PATH type device path node.
|
||||||
@retval BDS_EFI_UNSUPPORT An EFI Removable BlockIO device path not point to a media and message device,
|
@retval BDS_EFI_UNSUPPORT An EFI Removable BlockIO device path not point to a media and message device,
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINT32
|
UINT32
|
||||||
@ -1575,7 +1575,7 @@ BdsGetBootTypeFromDevicePath (
|
|||||||
return BDS_EFI_MEDIA_HD_BOOT;
|
return BDS_EFI_MEDIA_HD_BOOT;
|
||||||
} else if (DevicePathSubType (TempDevicePath) == MEDIA_CDROM_DP) {
|
} else if (DevicePathSubType (TempDevicePath) == MEDIA_CDROM_DP) {
|
||||||
return BDS_EFI_MEDIA_CDROM_BOOT;
|
return BDS_EFI_MEDIA_CDROM_BOOT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACPI_DEVICE_PATH:
|
case ACPI_DEVICE_PATH:
|
||||||
Acpi = (ACPI_HID_DEVICE_PATH *) TempDevicePath;
|
Acpi = (ACPI_HID_DEVICE_PATH *) TempDevicePath;
|
||||||
@ -1599,7 +1599,7 @@ BdsGetBootTypeFromDevicePath (
|
|||||||
// if the device path not only point to driver device, it is not a messaging device path,
|
// if the device path not only point to driver device, it is not a messaging device path,
|
||||||
//
|
//
|
||||||
if (!IsDevicePathEndType (LastDeviceNode)) {
|
if (!IsDevicePathEndType (LastDeviceNode)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DevicePathSubType(TempDevicePath) == MSG_ATAPI_DP) {
|
if (DevicePathSubType(TempDevicePath) == MSG_ATAPI_DP) {
|
||||||
@ -1675,7 +1675,7 @@ BdsLibIsValidEFIBootOptDevicePathExt (
|
|||||||
|
|
||||||
TempDevicePath = DevPath;
|
TempDevicePath = DevPath;
|
||||||
LastDeviceNode = DevPath;
|
LastDeviceNode = DevPath;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check if it's a valid boot option for network boot device
|
// Check if it's a valid boot option for network boot device
|
||||||
// Only check if there is SimpleNetworkProtocol installed. If yes, that means
|
// Only check if there is SimpleNetworkProtocol installed. If yes, that means
|
||||||
@ -1698,7 +1698,7 @@ BdsLibIsValidEFIBootOptDevicePathExt (
|
|||||||
&Handle
|
&Handle
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
if (CheckMedia) {
|
if (CheckMedia) {
|
||||||
//
|
//
|
||||||
@ -1732,22 +1732,22 @@ BdsLibIsValidEFIBootOptDevicePathExt (
|
|||||||
//
|
//
|
||||||
// If the boot option point to Internal FV shell, make sure it is valid
|
// If the boot option point to Internal FV shell, make sure it is valid
|
||||||
//
|
//
|
||||||
TempDevicePath = DevPath;
|
TempDevicePath = DevPath;
|
||||||
Status = BdsLibUpdateFvFileDevicePath (&TempDevicePath, PcdGetPtr(PcdShellFile));
|
Status = BdsLibUpdateFvFileDevicePath (&TempDevicePath, PcdGetPtr(PcdShellFile));
|
||||||
if (Status == EFI_ALREADY_STARTED) {
|
if (Status == EFI_ALREADY_STARTED) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
if (Status == EFI_SUCCESS) {
|
if (Status == EFI_SUCCESS) {
|
||||||
FreePool (TempDevicePath);
|
FreePool (TempDevicePath);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the boot option point to a blockIO device:
|
// If the boot option point to a blockIO device:
|
||||||
// if it is a removable blockIo device, it is valid.
|
// if it is a removable blockIo device, it is valid.
|
||||||
// if it is a fixed blockIo device, check its description confliction.
|
// if it is a fixed blockIo device, check its description confliction.
|
||||||
//
|
//
|
||||||
TempDevicePath = DevPath;
|
TempDevicePath = DevPath;
|
||||||
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
|
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
|
||||||
@ -1764,7 +1764,7 @@ BdsLibIsValidEFIBootOptDevicePathExt (
|
|||||||
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
|
Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &TempDevicePath, &Handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);
|
Status = gBS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
@ -1853,7 +1853,7 @@ BdsLibUpdateFvFileDevicePath (
|
|||||||
if (FileGuid == NULL) {
|
if (FileGuid == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check whether the device path point to the default the input Fv file
|
// Check whether the device path point to the default the input Fv file
|
||||||
//
|
//
|
||||||
@ -1987,7 +1987,7 @@ BdsLibUpdateFvFileDevicePath (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FvHandleBuffer != NULL) {
|
if (FvHandleBuffer != NULL) {
|
||||||
FreePool (FvHandleBuffer);
|
FreePool (FvHandleBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This module produce main entry for BDS phase - BdsEntry.
|
This module produce main entry for BDS phase - BdsEntry.
|
||||||
When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed
|
When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed
|
||||||
which contains interface of BdsEntry.
|
which contains interface of BdsEntry.
|
||||||
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
|
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
|
||||||
@ -27,7 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
///
|
///
|
||||||
/// Note: Current BDS not directly get the BootMode, DefaultBoot,
|
/// Note: Current BDS not directly get the BootMode, DefaultBoot,
|
||||||
/// TimeoutDefault, MemoryTestLevel value from the BDS arch protocol.
|
/// TimeoutDefault, MemoryTestLevel value from the BDS arch protocol.
|
||||||
/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout
|
/// Please refer to the library useage of BdsLibGetBootMode, BdsLibGetTimeout
|
||||||
/// and PlatformBdsDiagnostics in BdsPlatform.c
|
/// and PlatformBdsDiagnostics in BdsPlatform.c
|
||||||
///
|
///
|
||||||
EFI_HANDLE gBdsHandle = NULL;
|
EFI_HANDLE gBdsHandle = NULL;
|
||||||
@ -136,14 +136,14 @@ BdsBootDeviceSelect (
|
|||||||
//
|
//
|
||||||
UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *mBootNext);
|
UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *mBootNext);
|
||||||
BootOption = BdsLibVariableToOption (&BootLists, Buffer);
|
BootOption = BdsLibVariableToOption (&BootLists, Buffer);
|
||||||
|
|
||||||
//
|
//
|
||||||
// If fail to get boot option from variable, just return and do nothing.
|
// If fail to get boot option from variable, just return and do nothing.
|
||||||
//
|
//
|
||||||
if (BootOption == NULL) {
|
if (BootOption == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BootOption->BootCurrent = *mBootNext;
|
BootOption->BootCurrent = *mBootNext;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -231,7 +231,7 @@ BdsBootDeviceSelect (
|
|||||||
//
|
//
|
||||||
// Call platform action to indicate the boot success
|
// Call platform action to indicate the boot success
|
||||||
//
|
//
|
||||||
BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
|
BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_SUCCEEDED));
|
||||||
PlatformBdsBootSuccess (BootOption);
|
PlatformBdsBootSuccess (BootOption);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -286,8 +286,8 @@ BdsEntry (
|
|||||||
//
|
//
|
||||||
// Insert the performance probe
|
// Insert the performance probe
|
||||||
//
|
//
|
||||||
PERF_END (0, "DXE", NULL, 0);
|
PERF_END (NULL, "DXE", NULL, 0);
|
||||||
PERF_START (0, "BDS", NULL, 0);
|
PERF_START (NULL, "BDS", NULL, 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the global system boot option and driver option
|
// Initialize the global system boot option and driver option
|
||||||
@ -316,11 +316,11 @@ BdsEntry (
|
|||||||
//
|
//
|
||||||
// Do the platform init, can be customized by OEM/IBV
|
// Do the platform init, can be customized by OEM/IBV
|
||||||
//
|
//
|
||||||
PERF_START (0, "PlatformBds", "BDS", 0);
|
PERF_START (NULL, "PlatformBds", "BDS", 0);
|
||||||
PlatformBdsInit ();
|
PlatformBdsInit ();
|
||||||
|
|
||||||
InitializeHwErrRecSupport();
|
InitializeHwErrRecSupport();
|
||||||
|
|
||||||
//
|
//
|
||||||
// bugbug: platform specific code
|
// bugbug: platform specific code
|
||||||
// Initialize the platform specific string and language
|
// Initialize the platform specific string and language
|
||||||
@ -351,7 +351,7 @@ BdsEntry (
|
|||||||
// Setup some platform policy here
|
// Setup some platform policy here
|
||||||
//
|
//
|
||||||
PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, ProcessCapsules, BdsMemoryTest);
|
PlatformBdsPolicyBehavior (&DriverOptionList, &BootOptionList, ProcessCapsules, BdsMemoryTest);
|
||||||
PERF_END (0, "PlatformBds", "BDS", 0);
|
PERF_END (NULL, "PlatformBds", "BDS", 0);
|
||||||
|
|
||||||
//
|
//
|
||||||
// BDS select the boot device to load OS
|
// BDS select the boot device to load OS
|
||||||
|
@ -56,7 +56,7 @@ HII_VENDOR_DEVICE_PATH mFrontPageHiiVendorDevicePath = {
|
|||||||
{
|
{
|
||||||
END_DEVICE_PATH_TYPE,
|
END_DEVICE_PATH_TYPE,
|
||||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||||
{
|
{
|
||||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||||
}
|
}
|
||||||
@ -205,7 +205,7 @@ FrontPageCallback (
|
|||||||
//
|
//
|
||||||
Lang = AllocatePool (AsciiStrSize (LanguageString));
|
Lang = AllocatePool (AsciiStrSize (LanguageString));
|
||||||
ASSERT (Lang != NULL);
|
ASSERT (Lang != NULL);
|
||||||
|
|
||||||
Index = 0;
|
Index = 0;
|
||||||
LangCode = LanguageString;
|
LangCode = LanguageString;
|
||||||
while (*LangCode != 0) {
|
while (*LangCode != 0) {
|
||||||
@ -226,7 +226,7 @@ FrontPageCallback (
|
|||||||
);
|
);
|
||||||
ASSERT (PlatformSupportedLanguages != NULL);
|
ASSERT (PlatformSupportedLanguages != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Select the best language in platform supported Language.
|
// Select the best language in platform supported Language.
|
||||||
//
|
//
|
||||||
@ -437,7 +437,7 @@ InitializeFrontPage (
|
|||||||
OptionCount = 0;
|
OptionCount = 0;
|
||||||
LangCode = LanguageString;
|
LangCode = LanguageString;
|
||||||
FirstFlag = FALSE;
|
FirstFlag = FALSE;
|
||||||
|
|
||||||
if (gFrontPagePrivate.LanguageToken == NULL) {
|
if (gFrontPagePrivate.LanguageToken == NULL) {
|
||||||
while (*LangCode != 0) {
|
while (*LangCode != 0) {
|
||||||
GetNextLanguage (&LangCode, Lang);
|
GetNextLanguage (&LangCode, Lang);
|
||||||
@ -877,7 +877,7 @@ ShowProgress (
|
|||||||
}
|
}
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));
|
DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));
|
||||||
|
|
||||||
SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
|
SetMem (&Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
|
||||||
SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
|
SetMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
|
||||||
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
|
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0xff);
|
||||||
@ -893,7 +893,7 @@ ShowProgress (
|
|||||||
TimeoutRemain = TimeoutDefault;
|
TimeoutRemain = TimeoutDefault;
|
||||||
while (TimeoutRemain != 0) {
|
while (TimeoutRemain != 0) {
|
||||||
DEBUG ((EFI_D_INFO, "Showing progress bar...Remaining %d second!\n", TimeoutRemain));
|
DEBUG ((EFI_D_INFO, "Showing progress bar...Remaining %d second!\n", TimeoutRemain));
|
||||||
|
|
||||||
Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_SECOND);
|
Status = WaitForSingleEvent (gST->ConIn->WaitForKey, ONE_SECOND);
|
||||||
if (Status != EFI_TIMEOUT) {
|
if (Status != EFI_TIMEOUT) {
|
||||||
break;
|
break;
|
||||||
@ -961,7 +961,7 @@ PlatformBdsEnterFrontPage (
|
|||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
PERF_START (0, "BdsTimeOut", "BDS", 0);
|
PERF_START (NULL, "BdsTimeOut", "BDS", 0);
|
||||||
//
|
//
|
||||||
// Indicate if we need connect all in the platform setup
|
// Indicate if we need connect all in the platform setup
|
||||||
//
|
//
|
||||||
@ -1072,5 +1072,5 @@ Exit:
|
|||||||
// Note: The following lines of code only execute when Auto boot
|
// Note: The following lines of code only execute when Auto boot
|
||||||
// takes affect
|
// takes affect
|
||||||
//
|
//
|
||||||
PERF_END (0, "BdsTimeOut", "BDS", 0);
|
PERF_END (NULL, "BdsTimeOut", "BDS", 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user