2 ACPI Table Protocol Driver
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #include "AcpiTable.h"
15 // Handle to install ACPI Table Protocol
17 EFI_HANDLE mHandle
= NULL
;
18 GLOBAL_REMOVE_IF_UNREFERENCED EFI_ACPI_TABLE_INSTANCE
*mPrivateData
= NULL
;
21 Entry point of the ACPI table driver.
22 Creates and initializes an instance of the ACPI Table
23 Protocol and installs it on a new handle.
25 @param ImageHandle A handle for the image that is initializing this driver.
26 @param SystemTable A pointer to the EFI system table.
28 @return EFI_SUCCESS Driver initialized successfully.
29 @return EFI_LOAD_ERROR Failed to Initialize or has been loaded.
30 @return EFI_OUT_OF_RESOURCES Could not allocate needed resources.
35 InitializeAcpiTableDxe (
36 IN EFI_HANDLE ImageHandle
,
37 IN EFI_SYSTEM_TABLE
*SystemTable
41 EFI_ACPI_TABLE_INSTANCE
*PrivateData
;
44 // Initialize our protocol
46 PrivateData
= AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE
));
48 PrivateData
->Signature
= EFI_ACPI_TABLE_SIGNATURE
;
51 // Call all constructors per produced protocols
53 Status
= AcpiTableAcpiTableConstructor (PrivateData
);
54 if (EFI_ERROR (Status
)) {
55 gBS
->FreePool (PrivateData
);
56 return EFI_LOAD_ERROR
;
60 // Install ACPI Table protocol
62 if (FeaturePcdGet (PcdInstallAcpiSdtProtocol
)) {
63 mPrivateData
= PrivateData
;
64 Status
= gBS
->InstallMultipleProtocolInterfaces (
66 &gEfiAcpiTableProtocolGuid
,
67 &PrivateData
->AcpiTableProtocol
,
68 &gEfiAcpiSdtProtocolGuid
,
69 &mPrivateData
->AcpiSdtProtocol
,
73 Status
= gBS
->InstallMultipleProtocolInterfaces (
75 &gEfiAcpiTableProtocolGuid
,
76 &PrivateData
->AcpiTableProtocol
,
80 ASSERT_EFI_ERROR (Status
);