summaryrefslogtreecommitdiff
path: root/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib
diff options
context:
space:
mode:
Diffstat (limited to 'Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib')
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeBoardAcpiTableLib.c41
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.c39
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf42
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmBoardAcpiEnableLib.c63
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.c39
-rw-r--r--Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf42
6 files changed, 266 insertions, 0 deletions
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeBoardAcpiTableLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeBoardAcpiTableLib.c
new file mode 100644
index 0000000000..700d5e0773
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeBoardAcpiTableLib.c
@@ -0,0 +1,41 @@
+/** @file
+
+Copyright (c) 2017, 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 that 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/BoardAcpiEnableLib.h>
+#include <Library/MultiBoardAcpiSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+EFI_STATUS
+EFIAPI
+BoardUpdateAcpiTable (
+ IN OUT EFI_ACPI_COMMON_HEADER *Table,
+ IN OUT EFI_ACPI_TABLE_VERSION *Version
+ )
+{
+ BOARD_ACPI_TABLE_FUNC *BoardAcpiTableFunc;
+ EFI_STATUS Status;
+
+ Status = gBS->LocateProtocol (
+ &gBoardAcpiTableGuid,
+ NULL,
+ (VOID **)&BoardAcpiTableFunc
+ );
+ if (!EFI_ERROR(Status)) {
+ if (BoardAcpiTableFunc->BoardUpdateAcpiTable != NULL) {
+ return BoardAcpiTableFunc->BoardUpdateAcpiTable (Table, Version);
+ }
+ }
+ return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.c
new file mode 100644
index 0000000000..d054d724d6
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.c
@@ -0,0 +1,39 @@
+/** @file
+
+Copyright (c) 2017, 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 that 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/BoardAcpiTableLib.h>
+#include <Library/MultiBoardAcpiSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+EFI_STATUS
+EFIAPI
+RegisterBoardAcpiTableFunc (
+ IN BOARD_ACPI_TABLE_FUNC *BoardAcpiTableFunc
+ )
+{
+ EFI_HANDLE Handle;
+ EFI_STATUS Status;
+
+ Handle = NULL;
+ Status = gBS->InstallProtocolInterface (
+ &Handle,
+ &gBoardAcpiTableGuid,
+ EFI_NATIVE_INTERFACE,
+ BoardAcpiTableFunc
+ );
+ ASSERT_EFI_ERROR(Status);
+
+ return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
new file mode 100644
index 0000000000..8422faf62a
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
@@ -0,0 +1,42 @@
+## @file
+# Component information file for Board Init Library
+#
+# Copyright (c) 2017, 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.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeMultiBoardAcpiSupportLib
+ FILE_GUID = 80C96C2A-327A-447B-932D-610DDD449E03
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = MultiBoardAcpiSupportLib
+ LIBRARY_CLASS = BoardAcpiTableLib
+
+[LibraryClasses]
+ BaseLib
+ PcdLib
+ DebugLib
+ UefiBootServicesTableLib
+
+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+ MdePkg/MdePkg.dec
+
+[Sources]
+ DxeMultiBoardAcpiSupportLib.c
+ DxeBoardAcpiTableLib.c
+
+[Guids]
+ gBoardAcpiTableGuid
+
+[Pcd]
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmBoardAcpiEnableLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmBoardAcpiEnableLib.c
new file mode 100644
index 0000000000..a0c6b20e13
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmBoardAcpiEnableLib.c
@@ -0,0 +1,63 @@
+/** @file
+
+Copyright (c) 2017, 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 that 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/BoardAcpiTableLib.h>
+#include <Library/MultiBoardAcpiSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/SmmServicesTableLib.h>
+
+EFI_STATUS
+EFIAPI
+BoardEnableAcpi (
+ IN BOOLEAN EnableSci
+ )
+{
+ BOARD_ACPI_ENABLE_FUNC *BoardAcpiEnableFunc;
+ EFI_STATUS Status;
+
+ Status = gSmst->SmmLocateProtocol (
+ &gBoardAcpiEnableGuid,
+ NULL,
+ (VOID **)&BoardAcpiEnableFunc
+ );
+ if (!EFI_ERROR(Status)) {
+ if (BoardAcpiEnableFunc->BoardEnableAcpi != NULL) {
+ return BoardAcpiEnableFunc->BoardEnableAcpi (EnableSci);
+ }
+ }
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+BoardDisableAcpi (
+ IN BOOLEAN DisableSci
+ )
+{
+ BOARD_ACPI_ENABLE_FUNC *BoardAcpiEnableFunc;
+ EFI_STATUS Status;
+
+ Status = gSmst->SmmLocateProtocol (
+ &gBoardAcpiEnableGuid,
+ NULL,
+ (VOID **)&BoardAcpiEnableFunc
+ );
+ if (!EFI_ERROR(Status)) {
+ if (BoardAcpiEnableFunc->BoardDisableAcpi != NULL) {
+ return BoardAcpiEnableFunc->BoardDisableAcpi (DisableSci);
+ }
+ }
+ return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.c b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.c
new file mode 100644
index 0000000000..d858e8ae27
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.c
@@ -0,0 +1,39 @@
+/** @file
+
+Copyright (c) 2017, 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 that 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/BoardAcpiEnableLib.h>
+#include <Library/MultiBoardAcpiSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/SmmServicesTableLib.h>
+
+EFI_STATUS
+EFIAPI
+RegisterBoardAcpiEnableFunc (
+ IN BOARD_ACPI_ENABLE_FUNC *BoardAcpiEnableFunc
+ )
+{
+ EFI_HANDLE Handle;
+ EFI_STATUS Status;
+
+ Handle = NULL;
+ Status = gSmst->SmmInstallProtocolInterface (
+ &Handle,
+ &gBoardAcpiEnableGuid,
+ EFI_NATIVE_INTERFACE,
+ BoardAcpiEnableFunc
+ );
+ ASSERT_EFI_ERROR(Status);
+
+ return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf
new file mode 100644
index 0000000000..0ce45b25cb
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf
@@ -0,0 +1,42 @@
+## @file
+# Component information file for Board Init Library
+#
+# Copyright (c) 2017, 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.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = SmmMultiBoardAcpiSupportLib
+ FILE_GUID = E0238683-D3FD-4D97-8874-37C6157E2906
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = MultiBoardAcpiSupportLib
+ LIBRARY_CLASS = BoardAcpiEnableLib
+
+[LibraryClasses]
+ BaseLib
+ PcdLib
+ DebugLib
+ SmmServicesTableLib
+
+[Packages]
+ MinPlatformPkg/MinPlatformPkg.dec
+ MdePkg/MdePkg.dec
+
+[Sources]
+ SmmMultiBoardAcpiSupportLib.c
+ SmmBoardAcpiEnableLib.c
+
+[Guids]
+ gBoardAcpiEnableGuid
+
+[Pcd]