]>
Commit | Line | Data |
---|---|---|
4af04335 DB |
1 | /** @file\r |
2 | Utility routines used by boot maintenance modules.\r | |
3 | \r | |
d1102dba | 4 | Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
4af04335 DB |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #include "BootMaintenanceManager.h"\r | |
10 | \r | |
11 | /**\r | |
12 | Function deletes the variable specified by VarName and VarGuid.\r | |
13 | \r | |
14 | @param VarName A Null-terminated Unicode string that is\r | |
15 | the name of the vendor's variable.\r | |
16 | \r | |
17 | @param VarGuid A unique identifier for the vendor.\r | |
18 | \r | |
19 | @retval EFI_SUCCESS The variable was found and removed\r | |
20 | @retval EFI_UNSUPPORTED The variable store was inaccessible\r | |
21 | @retval EFI_NOT_FOUND The variable was not found\r | |
22 | \r | |
23 | **/\r | |
24 | EFI_STATUS\r | |
25 | EfiLibDeleteVariable (\r | |
26 | IN CHAR16 *VarName,\r | |
27 | IN EFI_GUID *VarGuid\r | |
28 | )\r | |
29 | {\r | |
30 | return gRT->SetVariable (\r | |
31 | VarName,\r | |
32 | VarGuid,\r | |
33 | 0,\r | |
34 | 0,\r | |
35 | NULL\r | |
36 | );\r | |
37 | }\r | |
38 | \r | |
39 | /**\r | |
40 | Function is used to determine the number of device path instances\r | |
41 | that exist in a device path.\r | |
42 | \r | |
43 | \r | |
44 | @param DevicePath A pointer to a device path data structure.\r | |
45 | \r | |
46 | @return This function counts and returns the number of device path instances\r | |
47 | in DevicePath.\r | |
48 | \r | |
49 | **/\r | |
50 | UINTN\r | |
51 | EfiDevicePathInstanceCount (\r | |
52 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
53 | )\r | |
54 | {\r | |
55 | UINTN Count;\r | |
56 | UINTN Size;\r | |
57 | \r | |
58 | Count = 0;\r | |
59 | while (GetNextDevicePathInstance (&DevicePath, &Size) != NULL) {\r | |
60 | Count += 1;\r | |
61 | }\r | |
62 | \r | |
63 | return Count;\r | |
64 | }\r | |
65 | \r | |
66 | /**\r | |
d1102dba | 67 | Get a string from the Data Hub record based on\r |
4af04335 DB |
68 | a device path.\r |
69 | \r | |
70 | @param DevPath The device Path.\r | |
71 | \r | |
72 | @return A string located from the Data Hub records based on\r | |
73 | the device path.\r | |
74 | @retval NULL If failed to get the String from Data Hub.\r | |
75 | \r | |
76 | **/\r | |
77 | UINT16 *\r | |
78 | EfiLibStrFromDatahub (\r | |
79 | IN EFI_DEVICE_PATH_PROTOCOL *DevPath\r | |
80 | )\r | |
81 | {\r | |
82 | return NULL;\r | |
83 | }\r |