2 This is an implementation of the ACPI Support protocol. This is defined in
3 the Tiano ACPI External Product Specification, revision 0.3.6.
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions
9 of the BSD License which accompanies this distribution. The
10 full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #include "AcpiSupport.h"
24 // Handle to install ACPI Table Protocol (and ACPI Suppport protocol).
26 EFI_HANDLE mHandle
= NULL
;
29 Entry point of the ACPI support driver. This function creates and initializes an instance of the ACPI Support
30 Protocol and installs it on a new handle.
32 @param ImageHandle A handle for the image that is initializing this driver
33 @param SystemTable A pointer to the EFI system table
35 @retval EFI_SUCCESS Driver initialized successfully
36 @retval EFI_LOAD_ERROR Failed to Initialize or has been loaded
37 @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
42 IN EFI_HANDLE ImageHandle
,
43 IN EFI_SYSTEM_TABLE
*SystemTable
48 EFI_ACPI_SUPPORT_INSTANCE
*PrivateData
;
51 // Initialize our protocol
53 PrivateData
= AllocateZeroPool (sizeof (EFI_ACPI_SUPPORT_INSTANCE
));
55 PrivateData
->Signature
= EFI_ACPI_SUPPORT_SIGNATURE
;
58 // Call all constructors per produced protocols
60 Status
= AcpiSupportAcpiSupportConstructor (PrivateData
);
61 if (EFI_ERROR (Status
)) {
62 gBS
->FreePool (PrivateData
);
63 return EFI_LOAD_ERROR
;
67 // Install ACPI Table protocol and optional ACPI support protocol based on
68 // feature flag: PcdInstallAcpiSupportProtocol.
70 if (FeaturePcdGet (PcdInstallAcpiSupportProtocol
)) {
71 Status
= gBS
->InstallMultipleProtocolInterfaces (
73 &gEfiAcpiTableProtocolGuid
,
74 &PrivateData
->AcpiTableProtocol
,
75 &gEfiAcpiSupportProtocolGuid
,
76 &PrivateData
->AcpiSupport
,
79 ASSERT_EFI_ERROR (Status
);
81 Status
= gBS
->InstallMultipleProtocolInterfaces (
83 &gEfiAcpiTableProtocolGuid
,
84 &PrivateData
->AcpiTableProtocol
,
87 ASSERT_EFI_ERROR (Status
);