]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Hash2DxeCrypto/Driver.h
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
[mirror_edk2.git] / SecurityPkg / Hash2DxeCrypto / Driver.h
CommitLineData
724dcbb2
JY
1/** @file\r
2 This is definition for service binding for Hash driver.\r
3\r
7622e594 4Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
724dcbb2
JY
5This program and the accompanying materials are licensed and made available under\r
6the terms and conditions of the BSD License that accompanies this distribution.\r
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php.\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _HASH2_DRIVER_H_\r
16#define _HASH2_DRIVER_H_\r
17\r
18#include <Uefi.h>\r
19\r
20#include <Protocol/ServiceBinding.h>\r
21#include <Protocol/Hash2.h>\r
22\r
23#include <Library/BaseLib.h>\r
24#include <Library/BaseMemoryLib.h>\r
25#include <Library/DebugLib.h>\r
26#include <Library/MemoryAllocationLib.h>\r
27#include <Library/UefiBootServicesTableLib.h>\r
28#include <Library/UefiRuntimeServicesTableLib.h>\r
29#include <Library/DevicePathLib.h>\r
30#include <Library/UefiLib.h>\r
31\r
32#define HASH2_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('H', 'S', '2', 'S')\r
33\r
34typedef struct {\r
35 UINT32 Signature;\r
36 EFI_HANDLE ServiceHandle;\r
37 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding;\r
38\r
39 LIST_ENTRY ChildrenList;\r
40} HASH2_SERVICE_DATA;\r
41\r
42#define HASH2_SERVICE_DATA_FROM_THIS(a) \\r
43 CR ( \\r
44 (a), \\r
45 HASH2_SERVICE_DATA, \\r
46 ServiceBinding, \\r
47 HASH2_SERVICE_DATA_SIGNATURE \\r
48 )\r
49\r
50#define HASH2_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('H', 's', '2', 'I')\r
51\r
52typedef struct {\r
53 UINT32 Signature;\r
54 HASH2_SERVICE_DATA *Hash2ServiceData;\r
55 EFI_HANDLE Handle;\r
56 LIST_ENTRY InstEntry;\r
57 EFI_HASH2_PROTOCOL Hash2Protocol;\r
58 VOID *HashContext;\r
59 VOID *HashInfoContext;\r
a3a09748 60 BOOLEAN Updated;\r
724dcbb2
JY
61} HASH2_INSTANCE_DATA;\r
62\r
63#define HASH2_INSTANCE_DATA_FROM_THIS(a) \\r
64 CR ( \\r
65 (a), \\r
66 HASH2_INSTANCE_DATA, \\r
67 Hash2Protocol, \\r
68 HASH2_INSTANCE_DATA_SIGNATURE \\r
69 )\r
70\r
71#define HASH2_INSTANCE_DATA_FROM_LINK(a) \\r
72 CR ( \\r
73 (a), \\r
74 HASH2_INSTANCE_DATA, \\r
75 InstEntry, \\r
76 HASH2_INSTANCE_DATA_SIGNATURE \\r
77 )\r
78\r
79/**\r
80 Creates a child handle with a set of I/O services.\r
81\r
82 @param[in] This Protocol instance pointer.\r
83 @param[in, out] ChildHandle Pointer to the handle of the child to create. If\r
84 it is NULL, then a new handle is created. If\r
85 it is not NULL, then the I/O services are added\r
86 to the existing child handle.\r
87\r
88 @retval EFI_SUCCES The protocol was added to ChildHandle.\r
89 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
7622e594 90 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to\r
724dcbb2
JY
91 create the child.\r
92 @retval Others The child handle was not created.\r
93\r
94**/\r
95EFI_STATUS\r
96EFIAPI\r
97Hash2ServiceBindingCreateChild (\r
98 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
99 IN OUT EFI_HANDLE *ChildHandle\r
100 );\r
101\r
102/**\r
103 Destroys a child handle with a set of I/O services.\r
104\r
105 The DestroyChild() function does the opposite of CreateChild(). It removes a\r
106 protocol that was installed by CreateChild() from ChildHandle. If the removed\r
107 protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.\r
108\r
109 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL\r
110 instance.\r
111 @param[in] ChildHandle Handle of the child to destroy.\r
112\r
113 @retval EFI_SUCCES The protocol was removed from ChildHandle.\r
114 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that\r
115 is being removed.\r
116 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
117 @retval EFI_ACCESS_DENIED The protocol could not be removed from the\r
118 ChildHandle because its services are being\r
119 used.\r
120 @retval Others The child handle was not destroyed.\r
121\r
122**/\r
123EFI_STATUS\r
124EFIAPI\r
125Hash2ServiceBindingDestroyChild (\r
126 IN EFI_SERVICE_BINDING_PROTOCOL *This,\r
127 IN EFI_HANDLE ChildHandle\r
128 );\r
129\r
130extern EFI_HASH2_PROTOCOL mHash2Protocol;\r
131\r
132#endif\r