2 ACPI Table Protocol Driver
4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include "AcpiTable.h"
21 // Handle to install ACPI Table Protocol
23 EFI_HANDLE mHandle
= NULL
;
24 GLOBAL_REMOVE_IF_UNREFERENCED EFI_ACPI_TABLE_INSTANCE
*mPrivateData
= NULL
;
27 Entry point of the ACPI table driver.
28 Creates and initializes an instance of the ACPI Table
29 Protocol and installs it on a new handle.
31 @param ImageHandle A handle for the image that is initializing this driver.
32 @param SystemTable A pointer to the EFI system table.
34 @return EFI_SUCCESS Driver initialized successfully.
35 @return EFI_LOAD_ERROR Failed to Initialize or has been loaded.
36 @return EFI_OUT_OF_RESOURCES Could not allocate needed resources.
41 InitializeAcpiTableDxe (
42 IN EFI_HANDLE ImageHandle
,
43 IN EFI_SYSTEM_TABLE
*SystemTable
47 EFI_ACPI_TABLE_INSTANCE
*PrivateData
;
50 // Initialize our protocol
52 PrivateData
= AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE
));
54 PrivateData
->Signature
= EFI_ACPI_TABLE_SIGNATURE
;
57 // Call all constructors per produced protocols
59 Status
= AcpiTableAcpiTableConstructor (PrivateData
);
60 if (EFI_ERROR (Status
)) {
61 gBS
->FreePool (PrivateData
);
62 return EFI_LOAD_ERROR
;
66 // Install ACPI Table protocol
68 if (FeaturePcdGet (PcdInstallAcpiSdtProtocol
)) {
69 mPrivateData
= PrivateData
;
70 Status
= gBS
->InstallMultipleProtocolInterfaces (
72 &gEfiAcpiTableProtocolGuid
,
73 &PrivateData
->AcpiTableProtocol
,
74 &gEfiAcpiSdtProtocolGuid
,
75 &mPrivateData
->AcpiSdtProtocol
,
79 Status
= gBS
->InstallMultipleProtocolInterfaces (
81 &gEfiAcpiTableProtocolGuid
,
82 &PrivateData
->AcpiTableProtocol
,
86 ASSERT_EFI_ERROR (Status
);