]>
Commit | Line | Data |
---|---|---|
7130bcef SM |
1 | /** @file\r |
2 | \r | |
3 | Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.\r | |
4 | \r | |
9cd9bdc6 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
7130bcef | 6 | \r |
c1b53091 KK |
7 | @par Glossary:\r |
8 | - PFN - Pointer to a Function\r | |
9 | \r | |
7130bcef SM |
10 | **/\r |
11 | \r | |
12 | #ifndef TABLE_HELPER_LIB_H_\r | |
13 | #define TABLE_HELPER_LIB_H_\r | |
14 | \r | |
15 | /** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO\r | |
16 | object from the Configuration Manager.\r | |
17 | \r | |
18 | @param [in] CfgMgrProtocol Pointer to the Configuration Manager protocol\r | |
19 | interface.\r | |
20 | @param [out] CfgMfrInfo Pointer to the Configuration Manager Info\r | |
21 | object structure.\r | |
22 | \r | |
23 | @retval EFI_SUCCESS The object is returned.\r | |
24 | @retval EFI_INVALID_PARAMETER The Object ID is invalid.\r | |
25 | @retval EFI_NOT_FOUND The requested Object is not found.\r | |
26 | @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration\r | |
27 | Manager is less than the Object size.\r | |
28 | **/\r | |
29 | EFI_STATUS\r | |
30 | EFIAPI\r | |
31 | GetCgfMgrInfo (\r | |
32 | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,\r | |
33 | OUT CM_STD_OBJ_CONFIGURATION_MANAGER_INFO ** CfgMfrInfo\r | |
34 | );\r | |
35 | \r | |
36 | /** The AddAcpiHeader function updates the ACPI header structure. It uses the\r | |
37 | ACPI table Generator and the Configuration Manager protocol to obtain the\r | |
38 | information required for constructing the header.\r | |
39 | \r | |
40 | @param [in] CfgMgrProtocol Pointer to the Configuration Manager\r | |
41 | protocol interface.\r | |
42 | @param [in] Generator Pointer to the ACPI table Generator.\r | |
43 | @param [in,out] AcpiHeader Pointer to the ACPI table header to be\r | |
44 | updated.\r | |
e12bdeb1 | 45 | @param [in] AcpiTableInfo Pointer to the ACPI table info structure.\r |
7130bcef SM |
46 | @param [in] Length Length of the ACPI table.\r |
47 | \r | |
48 | @retval EFI_SUCCESS The ACPI table is updated successfully.\r | |
49 | @retval EFI_INVALID_PARAMETER A parameter is invalid.\r | |
50 | @retval EFI_NOT_FOUND The required object information is not found.\r | |
51 | @retval EFI_BAD_BUFFER_SIZE The size returned by the Configuration\r | |
52 | Manager is less than the Object size for the\r | |
53 | requested object.\r | |
54 | **/\r | |
55 | EFI_STATUS\r | |
56 | EFIAPI\r | |
57 | AddAcpiHeader (\r | |
58 | IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,\r | |
59 | IN CONST ACPI_TABLE_GENERATOR * CONST Generator,\r | |
60 | IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader,\r | |
e12bdeb1 | 61 | IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,\r |
7130bcef SM |
62 | IN CONST UINT32 Length\r |
63 | );\r | |
64 | \r | |
c1b53091 KK |
65 | /**\r |
66 | Function prototype for testing if two arbitrary objects are equal.\r | |
67 | \r | |
68 | @param [in] Object1 Pointer to the first object to compare.\r | |
69 | @param [in] Object2 Pointer to the second object to compare.\r | |
70 | @param [in] Index1 Index of Object1. This value is optional and\r | |
71 | can be ignored by the specified implementation.\r | |
72 | @param [in] Index2 Index of Object2. This value is optional and\r | |
73 | can be ignored by the specified implementation.\r | |
74 | \r | |
75 | @retval TRUE Object1 and Object2 are equal.\r | |
76 | @retval FALSE Object1 and Object2 are NOT equal.\r | |
77 | **/\r | |
78 | typedef\r | |
79 | BOOLEAN\r | |
80 | (EFIAPI *PFN_IS_EQUAL)(\r | |
81 | IN CONST VOID * Object1,\r | |
82 | IN CONST VOID * Object2,\r | |
83 | IN UINTN Index1 OPTIONAL,\r | |
84 | IN UINTN Index2 OPTIONAL\r | |
85 | );\r | |
86 | \r | |
87 | /**\r | |
88 | Test and report if a duplicate entry exists in the given array of comparable\r | |
89 | elements.\r | |
90 | \r | |
91 | @param [in] Array Array of elements to test for duplicates.\r | |
92 | @param [in] Count Number of elements in Array.\r | |
93 | @param [in] ElementSize Size of an element in bytes\r | |
94 | @param [in] EqualTestFunction The function to call to check if any two\r | |
95 | elements are equal.\r | |
96 | \r | |
97 | @retval TRUE A duplicate element was found or one of\r | |
98 | the input arguments is invalid.\r | |
99 | @retval FALSE Every element in Array is unique.\r | |
100 | **/\r | |
101 | BOOLEAN\r | |
102 | EFIAPI\r | |
103 | FindDuplicateValue (\r | |
104 | IN CONST VOID * Array,\r | |
105 | IN CONST UINTN Count,\r | |
106 | IN CONST UINTN ElementSize,\r | |
107 | IN PFN_IS_EQUAL EqualTestFunction\r | |
108 | );\r | |
109 | \r | |
7130bcef | 110 | #endif // TABLE_HELPER_LIB_H_\r |