Currently the entry point functions of both driver builds
(AcpiPlatformDxe.inf and QemuFwCfgAcpiPlatformDxe.inf) directly contain
the logic that is different between the two builds.
Because we're going to restructure the entry point logic soon, we'd have
to duplicate the same new code between both entry point functions.
Push down the logic in which they differ to a new function:
- InstallAcpiTables() [AcpiPlatform.c]
- InstallAcpiTables() [QemuFwCfgAcpiPlatform.c]
and extract a common entry point function:
- AcpiPlatformEntryPoint() [EntryPoint.c]
which we can soon modify without code duplication.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16885
6f19259b-4bc3-4df7-8a09-
765794883524
}\r
\r
/**\r
- Entrypoint of Acpi Platform driver.\r
+ Effective entrypoint of Acpi Platform driver.\r
\r
@param ImageHandle\r
@param SystemTable\r
**/\r
EFI_STATUS\r
EFIAPI\r
-AcpiPlatformEntryPoint (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
+InstallAcpiTables (\r
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_ACPI_TABLE_PROTOCOL *AcpiTable;\r
-\r
- //\r
- // Find the AcpiTable protocol\r
- //\r
- Status = gBS->LocateProtocol (\r
- &gEfiAcpiTableProtocolGuid,\r
- NULL,\r
- (VOID**)&AcpiTable\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
\r
if (XenDetected ()) {\r
Status = InstallXenTables (AcpiTable);\r
IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol\r
);\r
\r
+EFI_STATUS\r
+EFIAPI\r
+InstallAcpiTables (\r
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable\r
+ );\r
+\r
#endif\r
\r
Qemu.c\r
QemuFwCfgAcpi.c\r
Xen.c\r
+ EntryPoint.c\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
--- /dev/null
+/** @file\r
+ Entry point of OVMF ACPI Platform Driver\r
+\r
+ Copyright (C) 2015, Red Hat, Inc.\r
+ Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>\r
+\r
+ This program and the accompanying materials are licensed and made available\r
+ under the terms and conditions of the BSD License which accompanies this\r
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#include "AcpiPlatform.h"\r
+\r
+STATIC\r
+EFI_ACPI_TABLE_PROTOCOL *\r
+FindAcpiTableProtocol (\r
+ VOID\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_ACPI_TABLE_PROTOCOL *AcpiTable;\r
+\r
+ Status = gBS->LocateProtocol (\r
+ &gEfiAcpiTableProtocolGuid,\r
+ NULL,\r
+ (VOID**)&AcpiTable\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+ return AcpiTable;\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+AcpiPlatformEntryPoint (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = InstallAcpiTables (FindAcpiTableProtocol ());\r
+ return Status;\r
+}\r
\r
return Status;\r
}\r
-\r
-\r
-/**\r
- Entrypoint of QEMU fw-cfg Acpi Platform driver.\r
-\r
- @param ImageHandle\r
- @param SystemTable\r
-\r
- @return EFI_SUCCESS\r
- @return EFI_LOAD_ERROR\r
- @return EFI_OUT_OF_RESOURCES\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-QemuFwCfgAcpiPlatformEntryPoint (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_ACPI_TABLE_PROTOCOL *AcpiTable;\r
-\r
- //\r
- // Find the AcpiTable protocol\r
- //\r
- Status = gBS->LocateProtocol (\r
- &gEfiAcpiTableProtocolGuid,\r
- NULL,\r
- (VOID**)&AcpiTable\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- Status = InstallQemuFwCfgTables (AcpiTable);\r
- return Status;\r
-}\r
--- /dev/null
+/** @file\r
+ OVMF ACPI Platform Driver using QEMU's fw-cfg interface\r
+\r
+ Copyright (C) 2015, Red Hat, Inc.\r
+ Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>\r
+\r
+ This program and the accompanying materials are licensed and made available\r
+ under the terms and conditions of the BSD License which accompanies this\r
+ distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
+ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+**/\r
+\r
+#include "AcpiPlatform.h"\r
+\r
+/**\r
+ Effective entrypoint of QEMU fw-cfg Acpi Platform driver.\r
+\r
+ @param ImageHandle\r
+ @param SystemTable\r
+\r
+ @return EFI_SUCCESS\r
+ @return EFI_LOAD_ERROR\r
+ @return EFI_OUT_OF_RESOURCES\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InstallAcpiTables (\r
+ IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ Status = InstallQemuFwCfgTables (AcpiTable);\r
+ return Status;\r
+}\r
FILE_GUID = 17985e6f-e778-4d94-aefa-c5dd2b77e186\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
- ENTRY_POINT = QemuFwCfgAcpiPlatformEntryPoint\r
+ ENTRY_POINT = AcpiPlatformEntryPoint\r
\r
#\r
# The following information is for reference only and not required by the build tools.\r
#\r
\r
[Sources]\r
+ QemuFwCfgAcpiPlatform.c\r
QemuFwCfgAcpi.c\r
+ EntryPoint.c\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r