ArmPlatformPkg/Bds: Got rid of RequestBootType argument

Removed "RequestBootType" argument of the "*CreateDevicePathNode()" and
"*UpdateDevicePathNode()" functions. A boolean field "Request
BootType" has been added to the BDS_LOAD_OPTION_SUPPORT structure and
is used by the "BootMenuAddBootOption()" and "BootMenuUpdateBootOption()"
functions instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15713 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ronald Cron 2014-07-29 14:15:15 +00:00 committed by oliviermartin
parent ef0fa8e16b
commit 889ac6a8b7
3 changed files with 38 additions and 53 deletions

View File

@ -102,8 +102,12 @@ typedef struct _BDS_LOAD_OPTION_SUPPORT {
BDS_SUPPORTED_DEVICE_TYPE Type; BDS_SUPPORTED_DEVICE_TYPE Type;
EFI_STATUS (*ListDevices)(IN OUT LIST_ENTRY* BdsLoadOptionList); EFI_STATUS (*ListDevices)(IN OUT LIST_ENTRY* BdsLoadOptionList);
BOOLEAN (*IsSupported)(IN EFI_DEVICE_PATH *DevicePath); BOOLEAN (*IsSupported)(IN EFI_DEVICE_PATH *DevicePath);
EFI_STATUS (*CreateDevicePathNode)(IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT BOOLEAN *RequestBootType); EFI_STATUS (*CreateDevicePathNode)(IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes);
EFI_STATUS (*UpdateDevicePathNode)(IN EFI_DEVICE_PATH *OldDevicePath, IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath, OUT BOOLEAN *RequestBootType); EFI_STATUS (*UpdateDevicePathNode)(IN EFI_DEVICE_PATH *OldDevicePath, IN CHAR16* FileName, OUT EFI_DEVICE_PATH_PROTOCOL** NewDevicePath);
/// Define if the boot menu should request if the file is a EFI binary or a Linux kernel
/// Example: PXE boot always deliver a UEFI application.
BOOLEAN RequestBootType;
} BDS_LOAD_OPTION_SUPPORT; } BDS_LOAD_OPTION_SUPPORT;
#define LOAD_OPTION_ENTRY_FROM_LINK(a) BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link) #define LOAD_OPTION_ENTRY_FROM_LINK(a) BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link)

View File

@ -134,7 +134,6 @@ BootMenuAddBootOption (
UINTN InitrdSize; UINTN InitrdSize;
UINT8* OptionalData; UINT8* OptionalData;
UINTN OptionalDataSize; UINTN OptionalDataSize;
BOOLEAN RequestBootType;
Attributes = 0; Attributes = 0;
SupportedBootDevice = NULL; SupportedBootDevice = NULL;
@ -147,8 +146,7 @@ BootMenuAddBootOption (
} }
// Create the specific device path node // Create the specific device path node
RequestBootType = TRUE; Status = SupportedBootDevice->Support->CreateDevicePathNode (L"EFI Application or the kernel", &DevicePathNodes);
Status = SupportedBootDevice->Support->CreateDevicePathNode (L"EFI Application or the kernel", &DevicePathNodes, &RequestBootType);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;
@ -160,7 +158,7 @@ BootMenuAddBootOption (
goto EXIT; goto EXIT;
} }
if (RequestBootType) { if (SupportedBootDevice->Support->RequestBootType) {
Status = BootDeviceGetType (DevicePath, &BootType, &Attributes); Status = BootDeviceGetType (DevicePath, &BootType, &Attributes);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = EFI_ABORTED; Status = EFI_ABORTED;
@ -180,7 +178,7 @@ BootMenuAddBootOption (
if (InitrdSupport) { if (InitrdSupport) {
// Create the specific device path node // Create the specific device path node
Status = SupportedBootDevice->Support->CreateDevicePathNode (L"initrd", &InitrdPathNodes, NULL); Status = SupportedBootDevice->Support->CreateDevicePathNode (L"initrd", &InitrdPathNodes);
if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) { // EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) { // EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;
@ -409,7 +407,6 @@ BootMenuUpdateBootOption (
BOOLEAN InitrdSupport; BOOLEAN InitrdSupport;
UINT8* OptionalData; UINT8* OptionalData;
UINTN OptionalDataSize; UINTN OptionalDataSize;
BOOLEAN RequestBootType;
BOOLEAN IsPrintable; BOOLEAN IsPrintable;
BOOLEAN IsUnicode; BOOLEAN IsUnicode;
@ -426,14 +423,13 @@ BootMenuUpdateBootOption (
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
RequestBootType = TRUE; Status = DeviceSupport->UpdateDevicePathNode (BootOption->FilePathList, L"EFI Application or the kernel", &DevicePath);
Status = DeviceSupport->UpdateDevicePathNode (BootOption->FilePathList, L"EFI Application or the kernel", &DevicePath, &RequestBootType);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;
} }
if (RequestBootType) { if (DeviceSupport->RequestBootType) {
Status = BootDeviceGetType (DevicePath, &BootType, &BootOption->Attributes); Status = BootDeviceGetType (DevicePath, &BootType, &BootOption->Attributes);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = EFI_ABORTED; Status = EFI_ABORTED;
@ -468,7 +464,7 @@ BootMenuUpdateBootOption (
if (InitrdSupport) { if (InitrdSupport) {
if (InitrdSize > 0) { if (InitrdSize > 0) {
// Case we update the initrd device path // Case we update the initrd device path
Status = DeviceSupport->UpdateDevicePathNode ((EFI_DEVICE_PATH*)((UINTN)(LinuxArguments + 1) + CmdLineSize), L"initrd", &InitrdPath, NULL); Status = DeviceSupport->UpdateDevicePathNode ((EFI_DEVICE_PATH*)((UINTN)(LinuxArguments + 1) + CmdLineSize), L"initrd", &InitrdPath);
if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {// EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) {// EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;
@ -477,7 +473,7 @@ BootMenuUpdateBootOption (
} else { } else {
// Case we create the initrd device path // Case we create the initrd device path
Status = DeviceSupport->CreateDevicePathNode (L"initrd", &InitrdPathNodes, NULL); Status = DeviceSupport->CreateDevicePathNode (L"initrd", &InitrdPathNodes);
if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) { // EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd if (EFI_ERROR(Status) && Status != EFI_NOT_FOUND) { // EFI_NOT_FOUND is returned on empty input string, but we can boot without an initrd
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;
@ -611,7 +607,7 @@ UpdateFdtPath (
} }
// Create the specific device path node // Create the specific device path node
Status = SupportedBootDevice->Support->CreateDevicePathNode (L"FDT blob", &FdtDevicePathNodes, NULL); Status = SupportedBootDevice->Support->CreateDevicePathNode (L"FDT blob", &FdtDevicePathNodes);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = EFI_ABORTED; Status = EFI_ABORTED;
goto EXIT; goto EXIT;

View File

@ -34,16 +34,14 @@ BdsLoadOptionFileSystemList (
EFI_STATUS EFI_STATUS
BdsLoadOptionFileSystemCreateDevicePath ( BdsLoadOptionFileSystemCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
); );
EFI_STATUS EFI_STATUS
BdsLoadOptionFileSystemUpdateDevicePath ( BdsLoadOptionFileSystemUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
); );
BOOLEAN BOOLEAN
@ -59,16 +57,14 @@ BdsLoadOptionMemMapList (
EFI_STATUS EFI_STATUS
BdsLoadOptionMemMapCreateDevicePath ( BdsLoadOptionMemMapCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
); );
EFI_STATUS EFI_STATUS
BdsLoadOptionMemMapUpdateDevicePath ( BdsLoadOptionMemMapUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
); );
BOOLEAN BOOLEAN
@ -84,16 +80,14 @@ BdsLoadOptionPxeList (
EFI_STATUS EFI_STATUS
BdsLoadOptionPxeCreateDevicePath ( BdsLoadOptionPxeCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
); );
EFI_STATUS EFI_STATUS
BdsLoadOptionPxeUpdateDevicePath ( BdsLoadOptionPxeUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
); );
BOOLEAN BOOLEAN
@ -109,16 +103,14 @@ BdsLoadOptionTftpList (
EFI_STATUS EFI_STATUS
BdsLoadOptionTftpCreateDevicePath ( BdsLoadOptionTftpCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
); );
EFI_STATUS EFI_STATUS
BdsLoadOptionTftpUpdateDevicePath ( BdsLoadOptionTftpUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
); );
BOOLEAN BOOLEAN
@ -132,28 +124,32 @@ BDS_LOAD_OPTION_SUPPORT BdsLoadOptionSupportList[] = {
BdsLoadOptionFileSystemList, BdsLoadOptionFileSystemList,
BdsLoadOptionFileSystemIsSupported, BdsLoadOptionFileSystemIsSupported,
BdsLoadOptionFileSystemCreateDevicePath, BdsLoadOptionFileSystemCreateDevicePath,
BdsLoadOptionFileSystemUpdateDevicePath BdsLoadOptionFileSystemUpdateDevicePath,
TRUE
}, },
{ {
BDS_DEVICE_MEMMAP, BDS_DEVICE_MEMMAP,
BdsLoadOptionMemMapList, BdsLoadOptionMemMapList,
BdsLoadOptionMemMapIsSupported, BdsLoadOptionMemMapIsSupported,
BdsLoadOptionMemMapCreateDevicePath, BdsLoadOptionMemMapCreateDevicePath,
BdsLoadOptionMemMapUpdateDevicePath BdsLoadOptionMemMapUpdateDevicePath,
TRUE
}, },
{ {
BDS_DEVICE_PXE, BDS_DEVICE_PXE,
BdsLoadOptionPxeList, BdsLoadOptionPxeList,
BdsLoadOptionPxeIsSupported, BdsLoadOptionPxeIsSupported,
BdsLoadOptionPxeCreateDevicePath, BdsLoadOptionPxeCreateDevicePath,
BdsLoadOptionPxeUpdateDevicePath BdsLoadOptionPxeUpdateDevicePath,
FALSE
}, },
{ {
BDS_DEVICE_TFTP, BDS_DEVICE_TFTP,
BdsLoadOptionTftpList, BdsLoadOptionTftpList,
BdsLoadOptionTftpIsSupported, BdsLoadOptionTftpIsSupported,
BdsLoadOptionTftpCreateDevicePath, BdsLoadOptionTftpCreateDevicePath,
BdsLoadOptionTftpUpdateDevicePath BdsLoadOptionTftpUpdateDevicePath,
TRUE
} }
}; };
@ -384,8 +380,7 @@ BdsLoadOptionFileSystemList (
EFI_STATUS EFI_STATUS
BdsLoadOptionFileSystemCreateDevicePath ( BdsLoadOptionFileSystemCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -421,8 +416,7 @@ EFI_STATUS
BdsLoadOptionFileSystemUpdateDevicePath ( BdsLoadOptionFileSystemUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -571,8 +565,7 @@ BdsLoadOptionMemMapList (
EFI_STATUS EFI_STATUS
BdsLoadOptionMemMapCreateDevicePath ( BdsLoadOptionMemMapCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -612,8 +605,7 @@ EFI_STATUS
BdsLoadOptionMemMapUpdateDevicePath ( BdsLoadOptionMemMapUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -714,16 +706,12 @@ BdsLoadOptionPxeList (
EFI_STATUS EFI_STATUS
BdsLoadOptionPxeCreateDevicePath ( BdsLoadOptionPxeCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
) )
{ {
*DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); *DevicePathNodes = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH);
SetDevicePathEndNode (*DevicePathNodes); SetDevicePathEndNode (*DevicePathNodes);
if (RequestBootType) {
*RequestBootType = FALSE;
}
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -742,8 +730,7 @@ EFI_STATUS
BdsLoadOptionPxeUpdateDevicePath ( BdsLoadOptionPxeUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
) )
{ {
// //
@ -837,8 +824,7 @@ BdsLoadOptionTftpList (
EFI_STATUS EFI_STATUS
BdsLoadOptionTftpCreateDevicePath ( BdsLoadOptionTftpCreateDevicePath (
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathNodes
OUT BOOLEAN *RequestBootType
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -913,8 +899,7 @@ EFI_STATUS
BdsLoadOptionTftpUpdateDevicePath ( BdsLoadOptionTftpUpdateDevicePath (
IN EFI_DEVICE_PATH *OldDevicePath, IN EFI_DEVICE_PATH *OldDevicePath,
IN CHAR16* FileName, IN CHAR16* FileName,
OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath, OUT EFI_DEVICE_PATH_PROTOCOL **NewDevicePath
OUT BOOLEAN *RequestBootType
) )
{ {
ASSERT (0); ASSERT (0);