/** @file\r
Head file for BDS Architectural Protocol implementation\r
\r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\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
#include <Uefi.h>\r
#include <Guid/GlobalVariable.h>\r
#include <Guid/ConnectConInEvent.h>\r
-#include <Guid/Performance.h>\r
#include <Guid/StatusCodeDataTypeVariable.h>\r
#include <Guid/EventGroup.h>\r
\r
# gEfiBdsArchProtocolGuid. After DxeCore finish dispatching, DxeCore will invoke Entry\r
# interface of protocol gEfiBdsArchProtocolGuid, then BDS phase is entered.\r
# \r
-# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\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
## SOMETIMES_CONSUMES ## Variable:L"ErrOut" (The device path of error out device)\r
gConnectConInEventGuid ## SOMETIMES_CONSUMES ## Event\r
gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES ## GUID\r
- gPerformanceProtocolGuid ## SOMETIMES_PRODUCES ## Variable:L"PerfDataMemAddr" (The ACPI address of performance data)\r
gEfiEventReadyToBootGuid ## CONSUMES ## Event\r
\r
[Protocols]\r
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked\r
to enter BDS phase.\r
\r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
This program and the accompanying materials\r
BdsFormalizeOSIndicationVariable ();\r
}\r
\r
-/**\r
-\r
- Allocate a block of memory that will contain performance data to OS.\r
-\r
-**/\r
-VOID\r
-BdsAllocateMemoryForPerformanceData (\r
- VOID\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_PHYSICAL_ADDRESS AcpiLowMemoryBase;\r
- EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock;\r
-\r
- AcpiLowMemoryBase = 0x0FFFFFFFFULL;\r
-\r
- //\r
- // Allocate a block of memory that will contain performance data to OS.\r
- //\r
- Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
- EfiReservedMemoryType,\r
- EFI_SIZE_TO_PAGES (PERF_DATA_MAX_LENGTH),\r
- &AcpiLowMemoryBase\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- //\r
- // Save the pointer to variable for use in S3 resume.\r
- //\r
- Status = BdsDxeSetVariableAndReportStatusCodeOnError (\r
- L"PerfDataMemAddr",\r
- &gPerformanceProtocolGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- sizeof (EFI_PHYSICAL_ADDRESS),\r
- &AcpiLowMemoryBase\r
- );\r
- if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "[Bds] PerfDataMemAddr (%08x) cannot be saved to NV storage.\n", AcpiLowMemoryBase));\r
- }\r
- //\r
- // Mark L"PerfDataMemAddr" variable to read-only if the Variable Lock protocol exists\r
- // Still lock it even the variable cannot be saved to prevent it's set by 3rd party code.\r
- //\r
- Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);\r
- if (!EFI_ERROR (Status)) {\r
- Status = VariableLock->RequestToLock (VariableLock, L"PerfDataMemAddr", &gPerformanceProtocolGuid);\r
- ASSERT_EFI_ERROR (Status);\r
- }\r
- }\r
-}\r
-\r
/**\r
Enter an infinite loop of calling the Boot Manager Menu.\r
\r
PERF_START (NULL, "BDS", NULL, 0);\r
DEBUG ((EFI_D_INFO, "[Bds] Entry...\n"));\r
\r
- PERF_CODE (\r
- BdsAllocateMemoryForPerformanceData ();\r
- );\r
-\r
//\r
// Fill in FirmwareVendor and FirmwareRevision from PCDs\r
//\r