ArmPlatformPkg/Bds/BootMenu.c: Set "Fdt" UEFI variable as local

"Fdt" UEFI variable is not a global variable as defined by UEFI specification.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14104 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin 2013-01-28 11:44:50 +00:00
parent 76aee8f4cf
commit aeaf64d64d
2 changed files with 32 additions and 16 deletions

View File

@ -1,24 +1,24 @@
#/** @file #/** @file
# #
# Component description file for Bds module # Component description file for Bds module
# #
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR> # Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>
# #
# This program and the accompanying materials # 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.
# #
#**/ #**/
[Defines] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
BASE_NAME = ArmPlatformBds BASE_NAME = ArmPlatformBds
FILE_GUID = 5a50aa81-c3ae-4608-a0e3-41a2e69baf94 FILE_GUID = 5a50aa81-c3ae-4608-a0e3-41a2e69baf94
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
@ -47,10 +47,11 @@
DebugLib DebugLib
PrintLib PrintLib
BaseLib BaseLib
[Guids] [Guids]
gEfiFileSystemInfoGuid gEfiFileSystemInfoGuid
gArmGlobalVariableGuid
[Protocols] [Protocols]
gEfiBdsArchProtocolGuid gEfiBdsArchProtocolGuid
gEfiBlockIoProtocolGuid gEfiBlockIoProtocolGuid
@ -70,6 +71,6 @@
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths
[Depex] [Depex]
TRUE TRUE

View File

@ -1,6 +1,6 @@
/** @file /** @file
* *
* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * Copyright (c) 2011-2013, ARM Limited. All rights reserved.
* *
* This program and the accompanying materials * 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
@ -14,9 +14,12 @@
#include "BdsInternal.h" #include "BdsInternal.h"
#include <Guid/ArmGlobalVariableHob.h>
extern EFI_HANDLE mImageHandle; extern EFI_HANDLE mImageHandle;
extern BDS_LOAD_OPTION_SUPPORT *BdsLoadOptionSupportList; extern BDS_LOAD_OPTION_SUPPORT *BdsLoadOptionSupportList;
EFI_STATUS EFI_STATUS
SelectBootDevice ( SelectBootDevice (
OUT BDS_SUPPORTED_DEVICE** SupportedBootDevice OUT BDS_SUPPORTED_DEVICE** SupportedBootDevice
@ -102,7 +105,7 @@ SelectBootDevice (
} }
Index++; Index++;
} }
EXIT: EXIT:
BootDeviceListSupportedFree (&SupportedDeviceList, *SupportedBootDevice); BootDeviceListSupportedFree (&SupportedDeviceList, *SupportedBootDevice);
return Status; return Status;
@ -185,7 +188,7 @@ BootMenuAddBootOption (
InitrdSize = GetDevicePathSize (InitrdPath); InitrdSize = GetDevicePathSize (InitrdPath);
BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)AllocatePool (sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize); BootArguments = (ARM_BDS_LOADER_ARGUMENTS*)AllocatePool (sizeof(ARM_BDS_LOADER_ARGUMENTS) + CmdLineSize + InitrdSize);
BootArguments->LinuxArguments.CmdLineSize = CmdLineSize; BootArguments->LinuxArguments.CmdLineSize = CmdLineSize;
BootArguments->LinuxArguments.InitrdSize = InitrdSize; BootArguments->LinuxArguments.InitrdSize = InitrdSize;
CopyMem ((VOID*)(&BootArguments->LinuxArguments + 1), CmdLine, CmdLineSize); CopyMem ((VOID*)(&BootArguments->LinuxArguments + 1), CmdLine, CmdLineSize);
@ -211,7 +214,7 @@ BootMenuAddBootOption (
FREE_DEVICE_PATH: FREE_DEVICE_PATH:
FreePool (DevicePath); FreePool (DevicePath);
EXIT: EXIT:
if (Status == EFI_ABORTED) { if (Status == EFI_ABORTED) {
Print(L"\n"); Print(L"\n");
@ -439,7 +442,7 @@ BootMenuUpdateBootOption (
InitrdSize = 0; InitrdSize = 0;
} }
Print(L"Arguments to pass to the binary: "); Print(L"Arguments to pass to the binary: ");
if (CmdLineSize > 0) { if (CmdLineSize > 0) {
AsciiStrnCpy(CmdLine, (CONST CHAR8*)(LinuxArguments + 1), CmdLineSize); AsciiStrnCpy(CmdLine, (CONST CHAR8*)(LinuxArguments + 1), CmdLineSize);
} else { } else {
@ -511,10 +514,22 @@ UpdateFdtPath (
// Append the Device Path node to the select device path // Append the Device Path node to the select device path
FdtDevicePath = AppendDevicePathNode (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNode); FdtDevicePath = AppendDevicePathNode (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNode);
FdtDevicePathSize = GetDevicePathSize (FdtDevicePath); FdtDevicePathSize = GetDevicePathSize (FdtDevicePath);
Status = gRT->SetVariable ((CHAR16*)L"Fdt", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), FdtDevicePathSize, FdtDevicePath); Status = gRT->SetVariable (
(CHAR16*)L"Fdt",
&gArmGlobalVariableGuid,
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
FdtDevicePathSize,
FdtDevicePath
);
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);
} else { } else {
gRT->SetVariable ((CHAR16*)L"Fdt", &gEfiGlobalVariableGuid, (EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS ), 0, NULL); gRT->SetVariable (
(CHAR16*)L"Fdt",
&gArmGlobalVariableGuid,
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
0,
NULL
);
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);
} }