/** @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
*\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
if (BootOrder[Index] == BootOption->LoadOptionIndex) {\r
// If it the last entry we do not need to rearrange the BootOrder list\r
if (Index + 1 != BootOrderCount) {\r
- CopyMem (&BootOrder[Index],&BootOrder[Index+1], BootOrderCount - (Index + 1));\r
+ CopyMem (\r
+ &BootOrder[Index],\r
+ &BootOrder[Index + 1],\r
+ (BootOrderCount - (Index + 1)) * sizeof(UINT16)\r
+ );\r
}\r
break;\r
}\r