]>
Commit | Line | Data |
---|---|---|
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 | |
9cd9bdc6 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3a609e0a SM |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #include <Library/DebugLib.h>\r | |
11 | #include <Library/PcdLib.h>\r | |
12 | #include <Library/UefiBootServicesTableLib.h>\r | |
13 | #include <Protocol/AcpiTable.h>\r | |
14 | \r | |
15 | // Module specific include files.\r | |
16 | #include <AcpiTableGenerator.h>\r | |
17 | #include <ConfigurationManagerObject.h>\r | |
18 | #include <ConfigurationManagerHelper.h>\r | |
19 | #include <DeviceTreeTableGenerator.h>\r | |
20 | #include <Library/TableHelperLib.h>\r | |
21 | #include <Protocol/ConfigurationManagerProtocol.h>\r | |
22 | #include <Protocol/DynamicTableFactoryProtocol.h>\r | |
23 | #include <SmbiosTableGenerator.h>\r | |
24 | \r | |
25 | #include "DynamicTableFactory.h"\r | |
26 | \r | |
27 | /** The Dynamic Table Factory protocol structure that holds the\r | |
28 | list of registered ACPI and SMBIOS table generators.\r | |
29 | */\r | |
30 | EDKII_DYNAMIC_TABLE_FACTORY_INFO TableFactoryInfo;\r | |
31 | \r | |
32 | /** A structure describing the Dynamic Table Factory protocol.\r | |
33 | */\r | |
34 | STATIC\r | |
35 | CONST\r | |
36 | EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL DynamicTableFactoryProtocol = {\r | |
37 | CREATE_REVISION (1, 0),\r | |
38 | GetAcpiTableGenerator,\r | |
39 | RegisterAcpiTableGenerator,\r | |
40 | DeregisterAcpiTableGenerator,\r | |
41 | GetSmbiosTableGenerator,\r | |
42 | RegisterSmbiosTableGenerator,\r | |
43 | DeregisterSmbiosTableGenerator,\r | |
44 | GetDtTableGenerator,\r | |
45 | RegisterDtTableGenerator,\r | |
46 | DeregisterDtTableGenerator,\r | |
47 | &TableFactoryInfo\r | |
48 | };\r | |
49 | \r | |
50 | /** Entrypoint for Dynamic Table Factory Dxe.\r | |
51 | \r | |
52 | @param ImageHandle\r | |
53 | @param SystemTable\r | |
54 | \r | |
55 | @retval EFI_SUCCESS Success.\r | |
56 | @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r | |
57 | @retval EFI_NOT_FOUND Required interface/object was not found.\r | |
58 | @retval EFI_INVALID_PARAMETER Some parameter is incorrect/invalid.\r | |
59 | **/\r | |
60 | EFI_STATUS\r | |
61 | EFIAPI\r | |
62 | DynamicTableFactoryDxeInitialize (\r | |
63 | IN EFI_HANDLE ImageHandle,\r | |
64 | IN EFI_SYSTEM_TABLE * CONST SystemTable\r | |
65 | )\r | |
66 | {\r | |
67 | EFI_STATUS Status;\r | |
68 | \r | |
69 | Status = gBS->InstallProtocolInterface (\r | |
70 | &ImageHandle,\r | |
71 | &gEdkiiDynamicTableFactoryProtocolGuid,\r | |
72 | EFI_NATIVE_INTERFACE,\r | |
73 | (VOID*)&DynamicTableFactoryProtocol\r | |
74 | );\r | |
75 | if (EFI_ERROR (Status)) {\r | |
76 | DEBUG ((\r | |
77 | DEBUG_ERROR,\r | |
78 | "ERROR: Failed to install the Dynamic Table Factory Protocol." \\r | |
79 | " Status = %r\n",\r | |
80 | Status\r | |
81 | ));\r | |
82 | }\r | |
83 | return Status;\r | |
84 | }\r |