summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/AcpiPlatformDxe/EntryPoint.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2015-02-19 23:45:57 +0000
committerjljusten <jljusten@Edk2>2015-02-19 23:45:57 +0000
commit04951644cd8553e7cb40c56247d402fc10cb7dfb (patch)
tree7feb22f5c7ca2d508d1f67643489124a9b1c53d2 /OvmfPkg/AcpiPlatformDxe/EntryPoint.c
parentf186536bdd64424f7ee3f2b1909e0263dbb1e45f (diff)
downloadedk2-04951644cd8553e7cb40c56247d402fc10cb7dfb.tar.gz
edk2-04951644cd8553e7cb40c56247d402fc10cb7dfb.tar.bz2
edk2-04951644cd8553e7cb40c56247d402fc10cb7dfb.zip
OvmfPkg: AcpiPlatformDxe: extract common entry point
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
Diffstat (limited to 'OvmfPkg/AcpiPlatformDxe/EntryPoint.c')
-rw-r--r--OvmfPkg/AcpiPlatformDxe/EntryPoint.c47
1 files changed, 47 insertions, 0 deletions
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;
+}