]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTable.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / AcpiTableDxe / AcpiTable.c
1 /** @file
2 ACPI Table Protocol Driver
3
4 Copyright (c) 2006 - 2009, 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
9
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.
12
13 **/
14
15 //
16 // Includes
17 //
18 #include "AcpiTable.h"
19
20 //
21 // Handle to install ACPI Table Protocol
22 //
23 EFI_HANDLE mHandle = NULL;
24
25 /**
26 Entry point of the ACPI table driver.
27 Creates and initializes an instance of the ACPI Table
28 Protocol and installs it on a new handle.
29
30 @param ImageHandle A handle for the image that is initializing this driver.
31 @param SystemTable A pointer to the EFI system table.
32
33 @return EFI_SUCCESS Driver initialized successfully.
34 @return EFI_LOAD_ERROR Failed to Initialize or has been loaded.
35 @return EFI_OUT_OF_RESOURCES Could not allocate needed resources.
36
37 **/
38 EFI_STATUS
39 EFIAPI
40 InitializeAcpiTableDxe (
41 IN EFI_HANDLE ImageHandle,
42 IN EFI_SYSTEM_TABLE *SystemTable
43 )
44 {
45 EFI_STATUS Status;
46 EFI_ACPI_TABLE_INSTANCE *PrivateData;
47
48 //
49 // Initialize our protocol
50 //
51 PrivateData = AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE));
52 ASSERT (PrivateData);
53 PrivateData->Signature = EFI_ACPI_TABLE_SIGNATURE;
54
55 //
56 // Call all constructors per produced protocols
57 //
58 Status = AcpiTableAcpiTableConstructor (PrivateData);
59 if (EFI_ERROR (Status)) {
60 gBS->FreePool (PrivateData);
61 return EFI_LOAD_ERROR;
62 }
63
64 //
65 // Install ACPI Table protocol
66 //
67 Status = gBS->InstallMultipleProtocolInterfaces (
68 &mHandle,
69 &gEfiAcpiTableProtocolGuid,
70 &PrivateData->AcpiTableProtocol,
71 NULL
72 );
73 ASSERT_EFI_ERROR (Status);
74
75 return Status;
76 }
77