mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg/Bds: Use unaligned read to access OptionalData in EFI_LOAD_OPTION
EFI_LOAD_OPTION is a packed structure. Accessing to the non aligned double word requires to use ReadUnaligned32() function. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11916 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
aa95e2f79c
commit
c60ea9a873
|
@ -436,7 +436,7 @@ BootMenuMain (
|
|||
|
||||
Print(L"\t- %s\n",DevicePathTxt);
|
||||
if (BootOption->OptionalData != NULL) {
|
||||
Print(L"\t- LoaderType: %d\n",BootOption->OptionalData->LoaderType);
|
||||
Print(L"\t- LoaderType: %d\n", ReadUnaligned32 (&BootOption->OptionalData->LoaderType));
|
||||
if (BootOption->OptionalData->Arguments != NULL) {
|
||||
Print(L"\t- Arguments: %a\n",BootOption->OptionalData->Arguments);
|
||||
}
|
||||
|
|
|
@ -23,18 +23,20 @@ BootOptionStart (
|
|||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH* FdtDevicePath;
|
||||
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;
|
||||
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol;
|
||||
UINT32 LoaderType;
|
||||
|
||||
Status = EFI_UNSUPPORTED;
|
||||
LoaderType = ReadUnaligned32 (&BootOption->OptionalData->LoaderType);
|
||||
|
||||
if (BootOption->OptionalData->LoaderType == BDS_LOADER_EFI_APPLICATION) {
|
||||
if (LoaderType == BDS_LOADER_EFI_APPLICATION) {
|
||||
// Need to connect every drivers to ensure no dependencies are missing for the application
|
||||
BdsConnectAllDrivers();
|
||||
|
||||
Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList);
|
||||
} else if (BootOption->OptionalData->LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {
|
||||
} else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {
|
||||
Status = BdsBootLinux (BootOption->FilePathList, BootOption->OptionalData->Arguments, NULL);
|
||||
} else if (BootOption->OptionalData->LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) {
|
||||
} else if (LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) {
|
||||
// Convert the FDT path into a Device Path
|
||||
Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
@ -178,7 +180,7 @@ BootOptionAllocateBootIndex (
|
|||
STATIC
|
||||
EFI_STATUS
|
||||
BootOptionSetFields (
|
||||
IN BDS_LOAD_OPTION *BootOption,
|
||||
IN BDS_LOAD_OPTION* BootOption,
|
||||
IN UINT32 Attributes,
|
||||
IN CHAR16* BootDescription,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL* DevicePath,
|
||||
|
|
Loading…
Reference in New Issue