]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Bus / Isa / IsaBusDxe / ComponentName.c
CommitLineData
9834b6c1
RN
1/** @file\r
2 UEFI Component Name(2) protocol implementation for IsaBusDxe driver.\r
9834b6c1 3\r
d1102dba 4 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9834b6c1
RN
6\r
7**/\r
8\r
9#include "ComponentName.h"\r
10#include <Library/UefiLib.h>\r
11\r
12//\r
d1102dba 13// Driver name table\r
9834b6c1 14//\r
1436aea4 15GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIsaBusDriverNameTable[] = {\r
9834b6c1 16 { "eng;en", L"PI ISA BUS Driver" },\r
1436aea4 17 { NULL, NULL }\r
9834b6c1
RN
18};\r
19\r
20//\r
21// EFI Component Name Protocol\r
22//\r
23GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIsaBusComponentName = {\r
24 IsaBusComponentNameGetDriverName,\r
25 IsaBusComponentNameGetControllerName,\r
26 "eng"\r
27};\r
28\r
29//\r
30// EFI Component Name 2 Protocol\r
31//\r
1436aea4
MK
32GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIsaBusComponentName2 = {\r
33 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)IsaBusComponentNameGetDriverName,\r
34 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)IsaBusComponentNameGetControllerName,\r
9834b6c1
RN
35 "en"\r
36};\r
37\r
38/**\r
39 Retrieves a Unicode string that is the user readable name of the driver.\r
40\r
41 This function retrieves the user readable name of a driver in the form of a\r
42 Unicode string. If the driver specified by This has a user readable name in\r
43 the language specified by Language, then a pointer to the driver name is\r
44 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
45 by This does not support the language specified by Language,\r
46 then EFI_UNSUPPORTED is returned.\r
47\r
48 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
49 EFI_COMPONENT_NAME_PROTOCOL instance.\r
50\r
51 @param Language[in] A pointer to a Null-terminated ASCII string\r
52 array indicating the language. This is the\r
53 language of the driver name that the caller is\r
54 requesting, and it must match one of the\r
55 languages specified in SupportedLanguages. The\r
56 number of languages supported by a driver is up\r
57 to the driver writer. Language is specified\r
58 in RFC 4646 or ISO 639-2 language code format.\r
59\r
60 @param DriverName[out] A pointer to the Unicode string to return.\r
61 This Unicode string is the name of the\r
62 driver specified by This in the language\r
63 specified by Language.\r
64\r
65 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
66 This and the language specified by Language was\r
67 returned in DriverName.\r
68\r
69 @retval EFI_INVALID_PARAMETER Language is NULL.\r
70\r
71 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
72\r
73 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
74 the language specified by Language.\r
75\r
76**/\r
77EFI_STATUS\r
78EFIAPI\r
79IsaBusComponentNameGetDriverName (\r
80 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
81 IN CHAR8 *Language,\r
82 OUT CHAR16 **DriverName\r
83 )\r
84{\r
85 return LookupUnicodeString2 (\r
86 Language,\r
87 This->SupportedLanguages,\r
88 mIsaBusDriverNameTable,\r
89 DriverName,\r
90 (BOOLEAN)(This == &gIsaBusComponentName)\r
91 );\r
92}\r
93\r
9834b6c1
RN
94/**\r
95 Retrieves a Unicode string that is the user readable name of the controller\r
96 that is being managed by a driver.\r
97\r
98 This function retrieves the user readable name of the controller specified by\r
99 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
100 driver specified by This has a user readable name in the language specified by\r
101 Language, then a pointer to the controller name is returned in ControllerName,\r
102 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
103 managing the controller specified by ControllerHandle and ChildHandle,\r
104 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
105 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
106\r
107 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
108 EFI_COMPONENT_NAME_PROTOCOL instance.\r
109\r
110 @param ControllerHandle[in] The handle of a controller that the driver\r
111 specified by This is managing. This handle\r
112 specifies the controller whose name is to be\r
113 returned.\r
114\r
115 @param ChildHandle[in] The handle of the child controller to retrieve\r
116 the name of. This is an optional parameter that\r
117 may be NULL. It will be NULL for device\r
118 drivers. It will also be NULL for a bus drivers\r
119 that wish to retrieve the name of the bus\r
120 controller. It will not be NULL for a bus\r
121 driver that wishes to retrieve the name of a\r
122 child controller.\r
123\r
124 @param Language[in] A pointer to a Null-terminated ASCII string\r
125 array indicating the language. This is the\r
126 language of the driver name that the caller is\r
127 requesting, and it must match one of the\r
128 languages specified in SupportedLanguages. The\r
129 number of languages supported by a driver is up\r
130 to the driver writer. Language is specified in\r
131 RFC 4646 or ISO 639-2 language code format.\r
132\r
133 @param ControllerName[out] A pointer to the Unicode string to return.\r
134 This Unicode string is the name of the\r
135 controller specified by ControllerHandle and\r
136 ChildHandle in the language specified by\r
137 Language from the point of view of the driver\r
138 specified by This.\r
139\r
140 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
141 the language specified by Language for the\r
142 driver specified by This was returned in\r
143 DriverName.\r
144\r
145 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
146\r
147 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
148 EFI_HANDLE.\r
149\r
150 @retval EFI_INVALID_PARAMETER Language is NULL.\r
151\r
152 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
153\r
154 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
155 managing the controller specified by\r
156 ControllerHandle and ChildHandle.\r
157\r
158 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
159 the language specified by Language.\r
160\r
161**/\r
162EFI_STATUS\r
163EFIAPI\r
164IsaBusComponentNameGetControllerName (\r
1436aea4
MK
165 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
166 IN EFI_HANDLE ControllerHandle,\r
167 IN EFI_HANDLE ChildHandle OPTIONAL,\r
168 IN CHAR8 *Language,\r
169 OUT CHAR16 **ControllerName\r
9834b6c1
RN
170 )\r
171{\r
172 return EFI_UNSUPPORTED;\r
173}\r