summaryrefslogtreecommitdiff
path: root/OvmfPkg/AcpiPlatformDxe
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/AcpiPlatformDxe')
-rw-r--r--OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c18
-rw-r--r--OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h6
-rw-r--r--OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf1
-rw-r--r--OvmfPkg/AcpiPlatformDxe/EntryPoint.c47
-rw-r--r--OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c36
-rw-r--r--OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c39
-rw-r--r--OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf4
7 files changed, 99 insertions, 52 deletions
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
index 8bfb1890b1..61166c65c3 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
@@ -228,7 +228,7 @@ InstallOvmfFvTables (
}
/**
- Entrypoint of Acpi Platform driver.
+ Effective entrypoint of Acpi Platform driver.
@param ImageHandle
@param SystemTable
@@ -240,23 +240,11 @@ InstallOvmfFvTables (
**/
EFI_STATUS
EFIAPI
-AcpiPlatformEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+InstallAcpiTables (
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
)
{
EFI_STATUS Status;
- EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
-
- //
- // Find the AcpiTable protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiAcpiTableProtocolGuid,
- NULL,
- (VOID**)&AcpiTable
- );
- ASSERT_EFI_ERROR (Status);
if (XenDetected ()) {
Status = InstallXenTables (AcpiTable);
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
index ae11e79e11..55b380b285 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
@@ -67,5 +67,11 @@ InstallQemuFwCfgTables (
IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol
);
+EFI_STATUS
+EFIAPI
+InstallAcpiTables (
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
+ );
+
#endif
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index 53292bf150..0ba703dcec 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -31,6 +31,7 @@
Qemu.c
QemuFwCfgAcpi.c
Xen.c
+ EntryPoint.c
[Packages]
MdePkg/MdePkg.dec
diff --git a/OvmfPkg/AcpiPlatformDxe/EntryPoint.c b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
new file mode 100644
index 0000000000..d782b610bd
--- /dev/null
+++ b/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
@@ -0,0 +1,47 @@
+/** @file
+ Entry point of OVMF ACPI Platform Driver
+
+ Copyright (C) 2015, Red Hat, Inc.
+ Copyright (c) 2008 - 2015, 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 "AcpiPlatform.h"
+
+STATIC
+EFI_ACPI_TABLE_PROTOCOL *
+FindAcpiTableProtocol (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
+
+ Status = gBS->LocateProtocol (
+ &gEfiAcpiTableProtocolGuid,
+ NULL,
+ (VOID**)&AcpiTable
+ );
+ ASSERT_EFI_ERROR (Status);
+ return AcpiTable;
+}
+
+EFI_STATUS
+EFIAPI
+AcpiPlatformEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ Status = InstallAcpiTables (FindAcpiTableProtocol ());
+ return Status;
+}
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
index 806446ee7f..81620448a0 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
@@ -683,39 +683,3 @@ FreeLoader:
return Status;
}
-
-
-/**
- Entrypoint of QEMU fw-cfg Acpi Platform driver.
-
- @param ImageHandle
- @param SystemTable
-
- @return EFI_SUCCESS
- @return EFI_LOAD_ERROR
- @return EFI_OUT_OF_RESOURCES
-
-**/
-EFI_STATUS
-EFIAPI
-QemuFwCfgAcpiPlatformEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
-
- //
- // Find the AcpiTable protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiAcpiTableProtocolGuid,
- NULL,
- (VOID**)&AcpiTable
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = InstallQemuFwCfgTables (AcpiTable);
- return Status;
-}
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c
new file mode 100644
index 0000000000..5cb3bac9db
--- /dev/null
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c
@@ -0,0 +1,39 @@
+/** @file
+ OVMF ACPI Platform Driver using QEMU's fw-cfg interface
+
+ Copyright (C) 2015, Red Hat, Inc.
+ Copyright (c) 2008 - 2014, 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 "AcpiPlatform.h"
+
+/**
+ Effective entrypoint of QEMU fw-cfg Acpi Platform driver.
+
+ @param ImageHandle
+ @param SystemTable
+
+ @return EFI_SUCCESS
+ @return EFI_LOAD_ERROR
+ @return EFI_OUT_OF_RESOURCES
+
+**/
+EFI_STATUS
+EFIAPI
+InstallAcpiTables (
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
+ )
+{
+ EFI_STATUS Status;
+
+ Status = InstallQemuFwCfgTables (AcpiTable);
+ return Status;
+}
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
index 5dab3ba2d7..13c8009ed2 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
@@ -18,7 +18,7 @@
FILE_GUID = 17985e6f-e778-4d94-aefa-c5dd2b77e186
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- ENTRY_POINT = QemuFwCfgAcpiPlatformEntryPoint
+ ENTRY_POINT = AcpiPlatformEntryPoint
#
# The following information is for reference only and not required by the build tools.
@@ -27,7 +27,9 @@
#
[Sources]
+ QemuFwCfgAcpiPlatform.c
QemuFwCfgAcpi.c
+ EntryPoint.c
[Packages]
MdePkg/MdePkg.dec