summaryrefslogtreecommitdiff
path: root/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c
diff options
context:
space:
mode:
authorGuo Mang <mang.guo@intel.com>2016-12-23 14:29:06 +0800
committerGuo Mang <mang.guo@intel.com>2016-12-26 19:15:23 +0800
commit8ab3a9adc8f2b56e865e6ad4f9900066a159ec00 (patch)
tree311ff90dfcd021480498ea81b6beaf6824f190a0 /Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c
parent275a7851a246bf0a86a66768b3fc0f4497d0425d (diff)
downloadedk2-platforms-8ab3a9adc8f2b56e865e6ad4f9900066a159ec00.tar.xz
BroxtonPlatformPkg: Add PlatformDxe
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c')
-rw-r--r--Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c
new file mode 100644
index 0000000000..ca80487640
--- /dev/null
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformDxe/SiPolicy.c
@@ -0,0 +1,62 @@
+/** @file
+ Initilize Cpu DXE Platform Policy.
+
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ 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
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/BaseLib.h>
+#include <Protocol/FirmwareVolume2.h>
+#include <Guid/StatusCodeDataTypeId.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DebugLib.h>
+#include <Protocol/SiPolicyProtocol.h>
+
+DXE_SI_POLICY_PROTOCOL mSiPolicyData = { 0 };
+
+/**
+ Initilize Intel Cpu DXE Platform Policy.
+
+ @param[in] ImageHandle Image handle of this driver.
+
+ @retval EFI_SUCCESS Initialization complete.
+ @retval EFI_UNSUPPORTED The chipset is unsupported by this driver.
+ @retval EFI_OUT_OF_RESOURCES Do not have enough resources to initialize the driver.
+ @retval EFI_DEVICE_ERROR Device error, driver exits abnormally.
+
+**/
+EFI_STATUS
+EFIAPI
+InitSiPolicy(
+ )
+{
+ EFI_STATUS Status;
+ EFI_HANDLE ImageHandle;
+
+ ImageHandle = NULL;
+ mSiPolicyData.Revision = DXE_SI_POLICY_PROTOCOL_REVISION_1;
+
+ //
+ // Install the DXE_SI_POLICY_PROTOCOL interface
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &ImageHandle,
+ &gDxeSiPolicyProtocolGuid,
+ &mSiPolicyData,
+ NULL
+ );
+
+ ASSERT_EFI_ERROR (Status);
+
+ return Status;
+}
+