#ifndef __UEFI_LIB_H__\r
#define __UEFI_LIB_H__\r
\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DriverConfiguration.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/ComponentName2.h>\r
+#include <Protocol/DriverDiagnostics.h>\r
+#include <Protocol/DriverDiagnostics2.h>\r
+\r
//\r
// Unicode String Table\r
//\r
\r
**/\r
#define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \\r
- {Priority, EFI_TPL_APPLICATION, EfiLockReleased }\r
+ {Priority, TPL_APPLICATION, EfiLockReleased }\r
\r
\r
/**\r
OUT CHAR16 **UnicodeString\r
);\r
\r
+/**\r
+ This function looks up a Unicode string in UnicodeStringTable.\r
+ If Language is a member of SupportedLanguages and a Unicode\r
+ string is found in UnicodeStringTable that matches the\r
+ language code specified by Language, then it is returned in\r
+ UnicodeString.\r
+\r
+ @param Language A pointer to the ISO 639-2 or\r
+ RFC 3066 language code for the\r
+ Unicode string to look up and\r
+ return.\r
+ \r
+ @param SupportedLanguages A pointer to the set of ISO\r
+ 639-2 or RFC 3066 language\r
+ codes that the Unicode string\r
+ table supports. Language must\r
+ be a member of this set.\r
+ \r
+ @param UnicodeStringTable A pointer to the table of\r
+ Unicode strings.\r
+ \r
+ @param UnicodeString A pointer to the Unicode\r
+ string from UnicodeStringTable\r
+ that matches the language\r
+ specified by Language.\r
+\r
+ @param Iso639Language Specify the language code\r
+ format supported. If true,\r
+ then the format follow ISO\r
+ 639-2. If false, then it\r
+ follows RFC3066.\r
+\r
+ @retval EFI_SUCCESS The Unicode string that\r
+ matches the language specified\r
+ by Language was found in the\r
+ table of Unicoide strings\r
+ UnicodeStringTable, and it was\r
+ returned in UnicodeString.\r
+ \r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+ \r
+ @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r
+ \r
+ @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r
+ \r
+ @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.\r
+ \r
+ @retval EFI_UNSUPPORTED The language specified by\r
+ Language is not a member\r
+ ofSupportedLanguages.\r
+ \r
+ @retval EFI_UNSUPPORTED The language specified by\r
+ Language is not supported by\r
+ UnicodeStringTable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LookupUnicodeString2 (\r
+ IN CONST CHAR8 *Language,\r
+ IN CONST CHAR8 *SupportedLanguages,\r
+ IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,\r
+ OUT CHAR16 **UnicodeString,\r
+ IN BOOLEAN Iso639Language\r
+ )\r
+;\r
+\r
/**\r
This function adds a Unicode string to UnicodeStringTable.\r
If Language is a member of SupportedLanguages then UnicodeString is added to \r
IN CONST CHAR16 *UnicodeString\r
);\r
\r
+/**\r
+ \r
+ This function adds a Unicode string to UnicodeStringTable.\r
+ If Language is a member of SupportedLanguages then\r
+ UnicodeString is added to UnicodeStringTable. New buffers are\r
+ allocated for both Language and UnicodeString. The contents\r
+ of Language and UnicodeString are copied into these new\r
+ buffers. These buffers are automatically freed when\r
+ FreeUnicodeStringTable() is called.\r
+\r
+ @param Language A pointer to the ISO 639-2 or\r
+ RFC 3066 language code for the\r
+ Unicode string to add.\r
+ \r
+ @param SupportedLanguages A pointer to the set of ISO\r
+ 639-2 or RFC 3.66 language\r
+ codes that the Unicode string\r
+ table supports. Language must\r
+ be a member of this set.\r
+ \r
+ @param UnicodeStringTable A pointer to the table of\r
+ Unicode strings.\r
+ \r
+ @param UnicodeString A pointer to the Unicode\r
+ string to add.\r
+ \r
+ @param Iso639Language Specify the language code\r
+ format supported. If true,\r
+ then the format follow ISO\r
+ 639-2. If false, then it\r
+ follows RFC3066.\r
+\r
+ @retval EFI_SUCCESS The Unicode string that\r
+ matches the language specified\r
+ by Language was found in the\r
+ table of Unicode strings\r
+ UnicodeStringTable, and it was\r
+ returned in UnicodeString.\r
+ \r
+ @retval EFI_INVALID_PARAMETER Language is NULL.\r
+ \r
+ @retval EFI_INVALID_PARAMETER UnicodeString is NULL.\r
+ \r
+ @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.\r
+ \r
+ @retval EFI_UNSUPPORTED SupportedLanguages is NULL.\r
+ \r
+ @retval EFI_ALREADY_STARTED A Unicode string with language\r
+ Language is already present in\r
+ UnicodeStringTable.\r
+ \r
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory to\r
+ add another Unicode string to\r
+ UnicodeStringTable.\r
+ \r
+ @retval EFI_UNSUPPORTED The language specified by\r
+ Language is not a member of\r
+ SupportedLanguages.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddUnicodeString2 (\r
+ IN CONST CHAR8 *Language,\r
+ IN CONST CHAR8 *SupportedLanguages,\r
+ IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,\r
+ IN CONST CHAR16 *UnicodeString,\r
+ IN BOOLEAN Iso639Language\r
+ )\r
+;\r
+\r
/**\r
This function frees the table of Unicode strings in UnicodeStringTable.\r
If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode\r
);\r
\r
+/** \r
+ Prints a formatted Unicode string to the console output device specified by \r
+ ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+ This function prints a formatted Unicode string to the console output device \r
+ specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode \r
+ characters that printed to ConOut. If the length of the formatted Unicode \r
+ string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+ PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+ @param Format Null-terminated Unicode format string.\r
+ @param ... VARARG list consumed to process Format.\r
+ If Format is NULL, then ASSERT().\r
+ If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+Print (\r
+ IN CONST CHAR16 *Format,\r
+ ...\r
+ );\r
+\r
+/** \r
+ Prints a formatted Unicode string to the console output device specified by \r
+ StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+ This function prints a formatted Unicode string to the console output device \r
+ specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode \r
+ characters that printed to StdErr. If the length of the formatted Unicode \r
+ string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+ PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+ @param Format Null-terminated Unicode format string.\r
+ @param ... VARARG list consumed to process Format.\r
+ If Format is NULL, then ASSERT().\r
+ If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+ErrorPrint (\r
+ IN CONST CHAR16 *Format,\r
+ ...\r
+ );\r
+\r
+/** \r
+ Prints a formatted ASCII string to the console output device specified by \r
+ ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+ This function prints a formatted ASCII string to the console output device \r
+ specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII \r
+ characters that printed to ConOut. If the length of the formatted ASCII \r
+ string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+ PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+ @param Format Null-terminated ASCII format string.\r
+ @param ... VARARG list consumed to process Format.\r
+ If Format is NULL, then ASSERT().\r
+ If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiPrint (\r
+ IN CONST CHAR8 *Format,\r
+ ...\r
+ );\r
+\r
+/** \r
+ Prints a formatted ASCII string to the console output device specified by \r
+ StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+ This function prints a formatted ASCII string to the console output device \r
+ specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII \r
+ characters that printed to StdErr. If the length of the formatted ASCII \r
+ string is greater than PcdUefiLibMaxPrintBufferSize, then only the first \r
+ PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+ @param Format Null-terminated ASCII format string.\r
+ @param ... VARARG list consumed to process Format.\r
+ If Format is NULL, then ASSERT().\r
+ If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiErrorPrint (\r
+ IN CONST CHAR8 *Format,\r
+ ...\r
+ );\r
+\r
+/**\r
+ Intialize a driver by installing the Driver Binding Protocol onto the driver's\r
+ DriverBindingHandle. This is typically the same as the driver's ImageHandle, but\r
+ it can be different if the driver produces multiple DriverBinding Protocols. \r
+ If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+ If the installation fails, then ASSERT ().\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
+ @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
+ @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r
+ parameter is NULL, then a new handle is created.\r
+\r
+ @retval EFI_SUCCESS The protocol installation is completed successfully.\r
+ @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBinding (\r
+ IN CONST EFI_HANDLE ImageHandle,\r
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
+ IN EFI_HANDLE DriverBindingHandle\r
+ );\r
+\r
+\r
+/**\r
+ Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+ Driver Configure and Driver Diagnostic Protocols onto the driver's DriverBindingHandle. This is\r
+ typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple\r
+ DriverBinding Protocols. \r
+ If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+ If the installation fails, then ASSERT ().\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
+ @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
+ @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r
+ parameter is NULL, then a new handle is created.\r
+ @param ComponentName A Component Name Protocol instance that this driver is producing.\r
+ @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
+ @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
+\r
+ @retval EFI_SUCCESS The protocol installation is completed successfully.\r
+ @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols (\r
+ IN CONST EFI_HANDLE ImageHandle,\r
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
+ IN EFI_HANDLE DriverBindingHandle,\r
+ IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
+ IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
+ IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL\r
+ );\r
+\r
+\r
+\r
+/**\r
+ Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+ Component Name 2 onto the driver's DriverBindingHandle. This is typically the same as the driver's\r
+ ImageHandle, but it can be different if the driver produces multiple DriverBinding Protocols. \r
+ If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+ If the installation fails, then ASSERT ().\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
+ @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
+ @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r
+ parameter is NULL, then a new handle is created.\r
+ @param ComponentName A Component Name Protocol instance that this driver is producing.\r
+ @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
+\r
+ @retval EFI_SUCCESS The protocol installation is completed successfully.\r
+ @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallDriverBindingComponentName2 (\r
+ IN CONST EFI_HANDLE ImageHandle,\r
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
+ IN EFI_HANDLE DriverBindingHandle,\r
+ IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
+ IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL\r
+ );\r
+\r
+\r
+/**\r
+ Intialize a driver by installing the Driver Binding Protocol together with the optional Component Name,\r
+ Component Name 2, Driver Configure, Driver Diagnostic and Driver Diagnostic 2 Protocols onto the driver's\r
+ DriverBindingHandle. This is typically the same as the driver's ImageHandle, but it can be different if\r
+ the driver produces multiple DriverBinding Protocols. \r
+ If the Drvier Binding Protocol interface is NULL, then ASSERT (). \r
+ If the installation fails, then ASSERT ().\r
+\r
+ @param ImageHandle The image handle of the driver.\r
+ @param SystemTable The EFI System Table that was passed to the driver's entry point.\r
+ @param DriverBinding A Driver Binding Protocol instance that this driver is producing.\r
+ @param DriverBindingHandle The handle that DriverBinding is to be installe onto. If this\r
+ parameter is NULL, then a new handle is created.\r
+ @param ComponentName A Component Name Protocol instance that this driver is producing.\r
+ @param ComponentName2 A Component Name 2 Protocol instance that this driver is producing.\r
+ @param DriverConfiguration A Driver Configuration Protocol instance that this driver is producing.\r
+ @param DriverDiagnostics A Driver Diagnostics Protocol instance that this driver is producing.\r
+ @param DriverDiagnostics2 A Driver Diagnostics Protocol 2 instance that this driver is producing.\r
+\r
+ @retval EFI_SUCCESS The protocol installation is completed successfully.\r
+ @retval Others Status from gBS->InstallMultipleProtocolInterfaces().\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiLibInstallAllDriverProtocols2 (\r
+ IN CONST EFI_HANDLE ImageHandle,\r
+ IN CONST EFI_SYSTEM_TABLE *SystemTable,\r
+ IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,\r
+ IN EFI_HANDLE DriverBindingHandle,\r
+ IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL\r
+ IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL\r
+ IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL\r
+ IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics, OPTIONAL\r
+ IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL\r
+ );\r
+\r
#endif\r