/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Choice = LINUX_LOADER_NEW;\r
\r
// Scan the OptionalData of every entry for the correct signature\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (!EFI_ERROR(Status)) {\r
BootOrderCount = BootOrderSize / sizeof(UINT16);\r
\r
/** @file\r
*\r
-* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
+* Copyright (c) 2013, ARM Limited. All rights reserved.\r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
VOID\r
);\r
\r
+EFI_STATUS\r
+GetGlobalEnvironmentVariable (\r
+ IN CONST CHAR16* VariableName,\r
+ IN VOID* DefaultValue,\r
+ IN OUT UINTN* Size,\r
+ OUT VOID** Value\r
+ );\r
+\r
EFI_STATUS\r
GetEnvironmentVariable (\r
IN CONST CHAR16* VariableName,\r
+ IN EFI_GUID* VendorGuid,\r
IN VOID* DefaultValue,\r
IN OUT UINTN* Size,\r
OUT VOID** Value\r
/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
SerialPortWrite ((UINT8 *) Buffer, CharCount);\r
}\r
\r
+EFI_STATUS\r
+GetGlobalEnvironmentVariable (\r
+ IN CONST CHAR16* VariableName,\r
+ IN VOID* DefaultValue,\r
+ IN OUT UINTN* Size,\r
+ OUT VOID** Value\r
+ )\r
+{\r
+ return GetEnvironmentVariable (VariableName, &gEfiGlobalVariableGuid,\r
+ DefaultValue, Size, Value);\r
+}\r
+\r
EFI_STATUS\r
GetEnvironmentVariable (\r
IN CONST CHAR16* VariableName,\r
+ IN EFI_GUID* VendorGuid,\r
IN VOID* DefaultValue,\r
IN OUT UINTN* Size,\r
OUT VOID** Value\r
// Try to get the variable size.\r
*Value = NULL;\r
VariableSize = 0;\r
- Status = gRT->GetVariable ((CHAR16 *) VariableName, &gEfiGlobalVariableGuid, NULL, &VariableSize, *Value);\r
+ Status = gRT->GetVariable ((CHAR16 *) VariableName, VendorGuid, NULL, &VariableSize, *Value);\r
if (Status == EFI_NOT_FOUND) {\r
if ((DefaultValue != NULL) && (Size != NULL) && (*Size != 0)) {\r
// If the environment variable does not exist yet then set it with the default value\r
Status = gRT->SetVariable (\r
(CHAR16*)VariableName,\r
- &gEfiGlobalVariableGuid,\r
+ VendorGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
*Size,\r
DefaultValue\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- Status = gRT->GetVariable ((CHAR16 *)VariableName, &gEfiGlobalVariableGuid, NULL, &VariableSize, *Value);\r
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, VendorGuid, NULL, &VariableSize, *Value);\r
if (EFI_ERROR (Status)) {\r
FreePool(*Value);\r
return EFI_INVALID_PARAMETER;\r
[Guids]\r
gEfiFileInfoGuid\r
gArmMpCoreInfoGuid\r
+ gArmGlobalVariableGuid\r
\r
[Protocols]\r
gEfiBdsArchProtocolGuid \r
/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
EFI_LOAD_OPTION EfiLoadOption;\r
UINTN EfiLoadOptionSize;\r
\r
- Status = GetEnvironmentVariable (BootVariableName, NULL, &EfiLoadOptionSize, (VOID**)&EfiLoadOption);\r
+ Status = GetGlobalEnvironmentVariable (BootVariableName, NULL, &EfiLoadOptionSize, (VOID**)&EfiLoadOption);\r
if (!EFI_ERROR(Status)) {\r
*BdsLoadOption = NULL;\r
Status = BootOptionParseLoadOption (EfiLoadOption, EfiLoadOptionSize, BdsLoadOption);\r
// When it is a new entry we must add the entry to the BootOrder\r
if (OldLoadOption == NULL) {\r
// Add the new Boot Index to the list\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (!EFI_ERROR(Status)) {\r
BootOrder = ReallocatePool (BootOrderSize, BootOrderSize + sizeof(UINT16), BootOrder);\r
// Add the new index at the end\r
);\r
DEBUG((EFI_D_ERROR,"Create %s\n",BootVariableName));\r
\r
- // Free memory allocated by GetEnvironmentVariable\r
+ // Free memory allocated by GetGlobalEnvironmentVariable\r
if (!EFI_ERROR(Status)) {\r
FreePool (BootOrder);\r
}\r
BOOLEAN Found;\r
\r
// Get the Boot Option Order from the environment variable\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (!EFI_ERROR(Status)) {\r
for (BootIndex = 0; BootIndex <= 0xFFFF; BootIndex++) {\r
Found = FALSE;\r
/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
CHAR16* NextDevicePathStr;\r
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;\r
\r
- Status = GetEnvironmentVariable (ConsoleVarName, NULL, NULL, (VOID**)&DevicePathInstances);\r
+ Status = GetGlobalEnvironmentVariable (ConsoleVarName, NULL, NULL, (VOID**)&DevicePathInstances);\r
if (EFI_ERROR(Status)) {\r
// In case no default console device path has been defined we assume a driver handles the console (eg: SimpleTextInOutSerial)\r
if ((DefaultConsolePaths == NULL) || (DefaultConsolePaths[0] == L'\0')) {\r
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;\r
CHAR16* DevicePathTxt;\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);\r
if (!EFI_ERROR(Status)) {\r
DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (DevicePath, TRUE, TRUE);\r
Size = sizeof(UINT16);\r
Timeout = (UINT16)PcdGet16 (PcdPlatformBootTimeOut);\r
TimeoutPtr = &Timeout;\r
- GetEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);\r
+ GetGlobalEnvironmentVariable (L"Timeout", &Timeout, &Size, (VOID**)&TimeoutPtr);\r
\r
if (Timeout != 0xFFFF) {\r
if (Timeout > 0) {\r
// In case of Timeout we start the default boot selection\r
if (Timeout == 0) {\r
// Get the Boot Option Order from the environment variable (a default value should have been created)\r
- GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
\r
for (Index = 0; Index < BootOrderSize / sizeof (UINT16); Index++) {\r
UnicodeSPrint (BootVariableName, 9 * sizeof(CHAR16), L"Boot%04X", BootOrder[Index]);\r
}\r
\r
/**\r
- This function uses policy data from the platform to determine what operating \r
- system or system utility should be loaded and invoked. This function call \r
- also optionally make the use of user input to determine the operating system \r
- or system utility to be loaded and invoked. When the DXE Core has dispatched \r
- all the drivers on the dispatch queue, this function is called. This \r
- function will attempt to connect the boot devices required to load and invoke \r
- the selected operating system or system utility. During this process, \r
- additional firmware volumes may be discovered that may contain addition DXE \r
- drivers that can be dispatched by the DXE Core. If a boot device cannot be \r
- fully connected, this function calls the DXE Service Dispatch() to allow the \r
- DXE drivers from any newly discovered firmware volumes to be dispatched. \r
- Then the boot device connection can be attempted again. If the same boot \r
- device connection operation fails twice in a row, then that boot device has \r
+ This function uses policy data from the platform to determine what operating\r
+ system or system utility should be loaded and invoked. This function call\r
+ also optionally make the use of user input to determine the operating system\r
+ or system utility to be loaded and invoked. When the DXE Core has dispatched\r
+ all the drivers on the dispatch queue, this function is called. This\r
+ function will attempt to connect the boot devices required to load and invoke\r
+ the selected operating system or system utility. During this process,\r
+ additional firmware volumes may be discovered that may contain addition DXE\r
+ drivers that can be dispatched by the DXE Core. If a boot device cannot be\r
+ fully connected, this function calls the DXE Service Dispatch() to allow the\r
+ DXE drivers from any newly discovered firmware volumes to be dispatched.\r
+ Then the boot device connection can be attempted again. If the same boot\r
+ device connection operation fails twice in a row, then that boot device has\r
failed, and should be skipped. This function should never return.\r
\r
@param This The EFI_BDS_ARCH_PROTOCOL instance.\r
\r
// If BootNext environment variable is defined then we just load it !\r
BootNextSize = sizeof(UINT16);\r
- Status = GetEnvironmentVariable (L"BootNext", NULL, &BootNextSize, (VOID**)&BootNext);\r
+ Status = GetGlobalEnvironmentVariable (L"BootNext", NULL, &BootNextSize, (VOID**)&BootNext);\r
if (!EFI_ERROR(Status)) {\r
ASSERT(BootNextSize == sizeof(UINT16));\r
\r
/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
typedef struct {\r
UINT16 CmdLineSize;\r
UINT16 InitrdSize;\r
- \r
+\r
// These following fields have variable length and are packed:\r
//CHAR8 *CmdLine;\r
//EFI_DEVICE_PATH_PROTOCOL *InitrdPathList;\r
#define LOAD_OPTION_ENTRY_FROM_LINK(a) BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link)\r
#define LOAD_OPTION_FROM_LINK(a) ((BDS_LOAD_OPTION_ENTRY*)BASE_CR(a, BDS_LOAD_OPTION_ENTRY, Link))->BdsLoadOption\r
\r
-EFI_STATUS\r
-GetEnvironmentVariable (\r
- IN CONST CHAR16* VariableName,\r
- IN VOID* DefaultValue,\r
- IN OUT UINTN* Size,\r
- OUT VOID** Value\r
- );\r
-\r
EFI_STATUS\r
BootDeviceListSupportedInit (\r
IN OUT LIST_ENTRY *SupportedDeviceList\r
*\r
**/\r
\r
+#include <Guid/ArmGlobalVariableHob.h>\r
#include "BdsInternal.h"\r
\r
extern EFI_HANDLE mImageHandle;\r
\r
// Get the FDT device path\r
FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);\r
- Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);\r
+ Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,\r
+ DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);\r
ASSERT_EFI_ERROR(Status);\r
\r
Status = BdsBootLinuxFdt (BootOption->FilePathList,\r
InitializeListHead (BootOptionList);\r
\r
// Get the Boot Option Order from the environment variable\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (EFI_ERROR(Status)) {\r
return Status;\r
}\r
);\r
\r
// Add the new Boot Index to the list\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (!EFI_ERROR(Status)) {\r
BootOrder = ReallocatePool (BootOrderSize, BootOrderSize + sizeof(UINT16), BootOrder);\r
// Add the new index at the end\r
EFI_STATUS Status;\r
\r
// Remove the entry from the BootOrder environment variable\r
- Status = GetEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
+ Status = GetGlobalEnvironmentVariable (L"BootOrder", NULL, &BootOrderSize, (VOID**)&BootOrder);\r
if (!EFI_ERROR(Status)) {\r
BootOrderCount = BootOrderSize / sizeof(UINT16);\r
\r
/** @file\r
*\r
-* Copyright (c) 2011, ARM Limited. All rights reserved.\r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
#ifndef __ARM_GLOBAL_VARIABLE_GUID_H__\r
#define __ARM_GLOBAL_VARIABLE_GUID_H__\r
\r
+#include <Pi/PiBootMode.h>\r
+#include <Pi/PiHob.h>\r
+\r
#define ARM_HOB_GLOBAL_VARIABLE_GUID \\r
{ 0xc3253c90, 0xa24f, 0x4599, { 0xa6, 0x64, 0x1f, 0x88, 0x13, 0x77, 0x8f, 0xc9} };\r
\r
/** @file\r
*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
\r
#include <Protocol/DevicePathFromText.h>\r
\r
-#include <Guid/GlobalVariable.h>\r
+#include <Guid/ArmGlobalVariableHob.h>\r
\r
#include <libfdt.h>\r
\r
\r
// If no FDT file is passed to the argument then get the one from the platform\r
if (Argc < 2) {\r
- Status = GetEnvironmentVariable (L"Fdt",NULL,NULL,(VOID**)&FdtDevicePath);\r
+ Status = GetEnvironmentVariable (L"Fdt", &gArmGlobalVariableGuid, NULL, NULL, (VOID**)&FdtDevicePath);\r
if (Status == EFI_NOT_FOUND) {\r
// No set yet, get the Default Device Path\r
Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r