]> git.proxmox.com Git - mirror_edk2.git/blame - DynamicTablesPkg/Drivers/DynamicTableFactoryDxe/DynamicTableFactoryDxe.c
DynamicTablesPkg: Dynamic Table Factory Dxe
[mirror_edk2.git] / DynamicTablesPkg / Drivers / DynamicTableFactoryDxe / DynamicTableFactoryDxe.c
CommitLineData
3a609e0a
SM
1/** @file\r
2 Dynamic Table Factory Dxe\r
3\r
4 Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.\r
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Library/DebugLib.h>\r
17#include <Library/PcdLib.h>\r
18#include <Library/UefiBootServicesTableLib.h>\r
19#include <Protocol/AcpiTable.h>\r
20\r
21// Module specific include files.\r
22#include <AcpiTableGenerator.h>\r
23#include <ConfigurationManagerObject.h>\r
24#include <ConfigurationManagerHelper.h>\r
25#include <DeviceTreeTableGenerator.h>\r
26#include <Library/TableHelperLib.h>\r
27#include <Protocol/ConfigurationManagerProtocol.h>\r
28#include <Protocol/DynamicTableFactoryProtocol.h>\r
29#include <SmbiosTableGenerator.h>\r
30\r
31#include "DynamicTableFactory.h"\r
32\r
33/** The Dynamic Table Factory protocol structure that holds the\r
34 list of registered ACPI and SMBIOS table generators.\r
35*/\r
36EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;\r
37\r
38/** A structure describing the Dynamic Table Factory protocol.\r
39*/\r
40STATIC\r
41CONST\r
42EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL DynamicTableFactoryProtocol = {\r
43 CREATE_REVISION (1, 0),\r
44 GetAcpiTableGenerator,\r
45 RegisterAcpiTableGenerator,\r
46 DeregisterAcpiTableGenerator,\r
47 GetSmbiosTableGenerator,\r
48 RegisterSmbiosTableGenerator,\r
49 DeregisterSmbiosTableGenerator,\r
50 GetDtTableGenerator,\r
51 RegisterDtTableGenerator,\r
52 DeregisterDtTableGenerator,\r
53 &TableFactoryInfo\r
54};\r
55\r
56/** Entrypoint for Dynamic Table Factory Dxe.\r
57\r
58 @param ImageHandle\r
59 @param SystemTable\r
60\r
61 @retval EFI_SUCCESS Success.\r
62 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
63 @retval EFI_NOT_FOUND Required interface/object was not found.\r
64 @retval EFI_INVALID_PARAMETER Some parameter is incorrect/invalid.\r
65**/\r
66EFI_STATUS\r
67EFIAPI\r
68DynamicTableFactoryDxeInitialize (\r
69 IN EFI_HANDLE ImageHandle,\r
70 IN EFI_SYSTEM_TABLE * CONST SystemTable\r
71 )\r
72{\r
73 EFI_STATUS Status;\r
74\r
75 Status = gBS->InstallProtocolInterface (\r
76 &ImageHandle,\r
77 &gEdkiiDynamicTableFactoryProtocolGuid,\r
78 EFI_NATIVE_INTERFACE,\r
79 (VOID*)&DynamicTableFactoryProtocol\r
80 );\r
81 if (EFI_ERROR (Status)) {\r
82 DEBUG ((\r
83 DEBUG_ERROR,\r
84 "ERROR: Failed to install the Dynamic Table Factory Protocol." \\r
85 " Status = %r\n",\r
86 Status\r
87 ));\r
88 }\r
89 return Status;\r
90}\r