[efi] Improve efi_wrap debugging

Add debug wrappers for more boot services functions, and print
symbolic values rather than raw numbers where possible.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2015-08-27 10:36:52 +01:00
parent e08d7ccc95
commit c522c11c7b
3 changed files with 344 additions and 13 deletions

View File

@@ -189,6 +189,26 @@ const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid ) {
return uuid_ntoa ( &u.uuid );
}
/**
* Name locate search type
*
* @v search_type Locate search type
* @ret name Locate search type name
*/
const __attribute__ (( pure )) char *
efi_locate_search_type_name ( EFI_LOCATE_SEARCH_TYPE search_type ) {
static char buf[16];
switch ( search_type ) {
case AllHandles : return "AllHandles";
case ByRegisterNotify: return "ByRegisterNotify";
case ByProtocol: return "ByProtocol";
default:
snprintf ( buf, sizeof ( buf ), "UNKNOWN<%d>", search_type );
return buf;
}
}
/**
* Name protocol open attributes
*
@@ -200,7 +220,8 @@ const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid ) {
* (T)EST_PROTOCOL, BY_(C)HILD_CONTROLLER, BY_(D)RIVER, and
* E(X)CLUSIVE.
*/
static const char * efi_open_attributes_name ( unsigned int attributes ) {
const __attribute__ (( pure )) char *
efi_open_attributes_name ( unsigned int attributes ) {
static char attribute_chars[] = "HGTCDX";
static char name[ sizeof ( attribute_chars ) ];
char *tmp = name;