iPXE
Macros | Functions | Variables
efi_wrap.c File Reference

EFI image wrapping. More...

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/Protocol/LoadedImage.h>
#include <ipxe/efi/efi_wrap.h>

Go to the source code of this file.

Macros

#define colour   &efi_systab
 Colour for debug messages. More...
 
#define EFI_WRAP_PRESCROLL   16
 Number of lines to prescroll when needed. More...
 
#define MAX_WRAP_MULTI   20
 Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces() More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static const char * efi_status (EFI_STATUS efirc)
 Convert EFI status code to text. More...
 
static const char * efi_boolean (BOOLEAN boolean)
 Convert EFI boolean to text. More...
 
static const char * efi_allocate_type (EFI_ALLOCATE_TYPE type)
 Convert EFI allocation type to text. More...
 
static const char * efi_memory_type (EFI_MEMORY_TYPE type)
 Convert EFI memory type to text. More...
 
static const char * efi_timer_delay (EFI_TIMER_DELAY type)
 Convert EFI timer delay type to text. More...
 
static int efi_prescroll (unsigned int lines)
 Pre-scroll display to create space for output lines. More...
 
static void efi_dump_image (EFI_HANDLE handle)
 Dump information about a loaded image. More...
 
static EFI_TPL EFIAPI efi_raise_tpl_wrapper (EFI_TPL new_tpl)
 Wrap RaiseTPL() More...
 
static VOID EFIAPI efi_restore_tpl_wrapper (EFI_TPL old_tpl)
 Wrap RestoreTPL() More...
 
static EFI_STATUS EFIAPI efi_allocate_pages_wrapper (EFI_ALLOCATE_TYPE type, EFI_MEMORY_TYPE memory_type, UINTN pages, EFI_PHYSICAL_ADDRESS *memory)
 Wrap AllocatePages() More...
 
static EFI_STATUS EFIAPI efi_free_pages_wrapper (EFI_PHYSICAL_ADDRESS memory, UINTN pages)
 Wrap FreePages() More...
 
static EFI_STATUS EFIAPI efi_get_memory_map_wrapper (UINTN *memory_map_size, EFI_MEMORY_DESCRIPTOR *memory_map, UINTN *map_key, UINTN *descriptor_size, UINT32 *descriptor_version)
 Wrap GetMemoryMap() More...
 
static EFI_STATUS EFIAPI efi_allocate_pool_wrapper (EFI_MEMORY_TYPE pool_type, UINTN size, VOID **buffer)
 Wrap AllocatePool() More...
 
static EFI_STATUS EFIAPI efi_free_pool_wrapper (VOID *buffer)
 Wrap FreePool() More...
 
static EFI_STATUS EFIAPI efi_create_event_wrapper (UINT32 type, EFI_TPL notify_tpl, EFI_EVENT_NOTIFY notify_function, VOID *notify_context, EFI_EVENT *event)
 Wrap CreateEvent() More...
 
static EFI_STATUS EFIAPI efi_set_timer_wrapper (EFI_EVENT event, EFI_TIMER_DELAY type, UINT64 trigger_time)
 Wrap SetTimer() More...
 
static EFI_STATUS EFIAPI efi_wait_for_event_wrapper (UINTN number_of_events, EFI_EVENT *event, UINTN *index)
 Wrap WaitForEvent() More...
 
static EFI_STATUS EFIAPI efi_signal_event_wrapper (EFI_EVENT event)
 Wrap SignalEvent() More...
 
static EFI_STATUS EFIAPI efi_close_event_wrapper (EFI_EVENT event)
 Wrap CloseEvent() More...
 
static EFI_STATUS EFIAPI efi_check_event_wrapper (EFI_EVENT event)
 Wrap CheckEvent() More...
 
static EFI_STATUS EFIAPI efi_install_protocol_interface_wrapper (EFI_HANDLE *handle, EFI_GUID *protocol, EFI_INTERFACE_TYPE interface_type, VOID *interface)
 Wrap InstallProtocolInterface() More...
 
static EFI_STATUS EFIAPI efi_reinstall_protocol_interface_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, VOID *old_interface, VOID *new_interface)
 Wrap ReinstallProtocolInterface() More...
 
static EFI_STATUS EFIAPI efi_uninstall_protocol_interface_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, VOID *interface)
 Wrap UninstallProtocolInterface() More...
 
static EFI_STATUS EFIAPI efi_handle_protocol_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, VOID **interface)
 Wrap HandleProtocol() More...
 
static EFI_STATUS EFIAPI efi_register_protocol_notify_wrapper (EFI_GUID *protocol, EFI_EVENT event, VOID **registration)
 Wrap RegisterProtocolNotify() More...
 
static EFI_STATUS EFIAPI efi_locate_handle_wrapper (EFI_LOCATE_SEARCH_TYPE search_type, EFI_GUID *protocol, VOID *search_key, UINTN *buffer_size, EFI_HANDLE *buffer)
 Wrap LocateHandle() More...
 
static EFI_STATUS EFIAPI efi_locate_device_path_wrapper (EFI_GUID *protocol, EFI_DEVICE_PATH_PROTOCOL **device_path, EFI_HANDLE *device)
 Wrap LocateDevicePath() More...
 
static EFI_STATUS EFIAPI efi_install_configuration_table_wrapper (EFI_GUID *guid, VOID *table)
 Wrap InstallConfigurationTable() More...
 
static EFI_STATUS EFIAPI efi_load_image_wrapper (BOOLEAN boot_policy, EFI_HANDLE parent_image_handle, EFI_DEVICE_PATH_PROTOCOL *device_path, VOID *source_buffer, UINTN source_size, EFI_HANDLE *image_handle)
 Wrap LoadImage() More...
 
static EFI_STATUS EFIAPI efi_start_image_wrapper (EFI_HANDLE image_handle, UINTN *exit_data_size, CHAR16 **exit_data)
 Wrap StartImage() More...
 
static EFI_STATUS EFIAPI efi_exit_wrapper (EFI_HANDLE image_handle, EFI_STATUS exit_status, UINTN exit_data_size, CHAR16 *exit_data)
 Wrap Exit() More...
 
static EFI_STATUS EFIAPI efi_unload_image_wrapper (EFI_HANDLE image_handle)
 Wrap UnloadImage() More...
 
static EFI_STATUS EFIAPI efi_exit_boot_services_wrapper (EFI_HANDLE image_handle, UINTN map_key)
 Wrap ExitBootServices() More...
 
static EFI_STATUS EFIAPI efi_get_next_monotonic_count_wrapper (UINT64 *count)
 Wrap GetNextMonotonicCount() More...
 
static EFI_STATUS EFIAPI efi_stall_wrapper (UINTN microseconds)
 Wrap Stall() More...
 
static EFI_STATUS EFIAPI efi_set_watchdog_timer_wrapper (UINTN timeout, UINT64 watchdog_code, UINTN data_size, CHAR16 *watchdog_data)
 Wrap SetWatchdogTimer() More...
 
static EFI_STATUS EFIAPI efi_connect_controller_wrapper (EFI_HANDLE controller_handle, EFI_HANDLE *driver_image_handle, EFI_DEVICE_PATH_PROTOCOL *remaining_path, BOOLEAN recursive)
 Wrap ConnectController() More...
 
static EFI_STATUS EFIAPI efi_disconnect_controller_wrapper (EFI_HANDLE controller_handle, EFI_HANDLE driver_image_handle, EFI_HANDLE child_handle)
 Wrap DisconnectController() More...
 
static EFI_STATUS EFIAPI efi_open_protocol_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, VOID **interface, EFI_HANDLE agent_handle, EFI_HANDLE controller_handle, UINT32 attributes)
 Wrap OpenProtocol() More...
 
static EFI_STATUS EFIAPI efi_close_protocol_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, EFI_HANDLE agent_handle, EFI_HANDLE controller_handle)
 Wrap CloseProtocol() More...
 
static EFI_STATUS EFIAPI efi_open_protocol_information_wrapper (EFI_HANDLE handle, EFI_GUID *protocol, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **entry_buffer, UINTN *entry_count)
 Wrap OpenProtocolInformation() More...
 
static EFI_STATUS EFIAPI efi_protocols_per_handle_wrapper (EFI_HANDLE handle, EFI_GUID ***protocol_buffer, UINTN *protocol_buffer_count)
 Wrap ProtocolsPerHandle() More...
 
static EFI_STATUS EFIAPI efi_locate_handle_buffer_wrapper (EFI_LOCATE_SEARCH_TYPE search_type, EFI_GUID *protocol, VOID *search_key, UINTN *no_handles, EFI_HANDLE **buffer)
 Wrap LocateHandleBuffer() More...
 
static EFI_STATUS EFIAPI efi_locate_protocol_wrapper (EFI_GUID *protocol, VOID *registration, VOID **interface)
 Wrap LocateProtocol() More...
 
static EFI_STATUS EFIAPI efi_install_multiple_protocol_interfaces_wrapper (EFI_HANDLE *handle,...)
 Wrap InstallMultipleProtocolInterfaces() More...
 
static EFI_STATUS EFIAPI efi_uninstall_multiple_protocol_interfaces_wrapper (EFI_HANDLE handle,...)
 Wrap UninstallMultipleProtocolInterfaces() More...
 
static EFI_STATUS EFIAPI efi_create_event_ex_wrapper (UINT32 type, EFI_TPL notify_tpl, EFI_EVENT_NOTIFY notify_function, CONST VOID *notify_context, CONST EFI_GUID *event_group, EFI_EVENT *event)
 Wrap CreateEventEx() More...
 
void efi_wrap_bs (EFI_BOOT_SERVICES *wrapper)
 Wrap a boot services table. More...
 
void efi_wrap_systab (int global)
 Wrap the public EFI system table. More...
 
void efi_unwrap (void)
 Remove boot services table wrapper. More...
 
void efi_wrap_image (EFI_HANDLE handle)
 Wrap calls made by a newly loaded image. More...
 

Variables

static EFI_SYSTEM_TABLEefi_systab_pub
 Public EFI system table pointer. More...
 
static EFI_SYSTEM_TABLE efi_systab_priv
 Private EFI system table used while wrapping is active. More...
 
static EFI_BOOT_SERVICESefi_bs_orig
 Original EFI boot services table pointer. More...
 
static EFI_BOOT_SERVICES efi_bs_copy
 Backup of original EFI boot services table. More...
 

Detailed Description

EFI image wrapping.

Definition in file efi_wrap.c.

Macro Definition Documentation

◆ colour

#define colour   &efi_systab

Colour for debug messages.

Definition at line 41 of file efi_wrap.c.

◆ EFI_WRAP_PRESCROLL

#define EFI_WRAP_PRESCROLL   16

Number of lines to prescroll when needed.

Definition at line 44 of file efi_wrap.c.

◆ MAX_WRAP_MULTI

#define MAX_WRAP_MULTI   20

Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces()

Definition at line 1073 of file efi_wrap.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ efi_status()

static const char* efi_status ( EFI_STATUS  efirc)
static

Convert EFI status code to text.

Parameters
efircEFI status code
Return values
textEFI status code text

Definition at line 64 of file efi_wrap.c.

64  {
65  static char buf[ 19 /* "0xXXXXXXXXXXXXXXXX" + NUL */ ];
66 
67  switch ( efirc ) {
68  case EFI_SUCCESS : return "0";
69  case EFI_LOAD_ERROR : return "LOAD_ERROR";
70  case EFI_INVALID_PARAMETER : return "INVALID_PARAMETER";
71  case EFI_UNSUPPORTED : return "UNSUPPORTED";
72  case EFI_BAD_BUFFER_SIZE : return "BAD_BUFFER_SIZE";
73  case EFI_BUFFER_TOO_SMALL : return "BUFFER_TOO_SMALL";
74  case EFI_NOT_READY : return "NOT_READY";
75  case EFI_DEVICE_ERROR : return "DEVICE_ERROR";
76  case EFI_WRITE_PROTECTED : return "WRITE_PROTECTED";
77  case EFI_OUT_OF_RESOURCES : return "OUT_OF_RESOURCES";
78  case EFI_VOLUME_CORRUPTED : return "VOLUME_CORRUPTED";
79  case EFI_VOLUME_FULL : return "VOLUME_FULL";
80  case EFI_NO_MEDIA : return "NO_MEDIA";
81  case EFI_MEDIA_CHANGED : return "MEDIA_CHANGED";
82  case EFI_NOT_FOUND : return "NOT_FOUND";
83  case EFI_ACCESS_DENIED : return "ACCESS_DENIED";
84  case EFI_NO_RESPONSE : return "NO_RESPONSE";
85  case EFI_NO_MAPPING : return "NO_MAPPING";
86  case EFI_TIMEOUT : return "TIMEOUT";
87  case EFI_NOT_STARTED : return "NOT_STARTED";
88  case EFI_ALREADY_STARTED : return "ALREADY_STARTED";
89  case EFI_ABORTED : return "ABORTED";
90  case EFI_ICMP_ERROR : return "ICMP_ERROR";
91  case EFI_TFTP_ERROR : return "TFTP_ERROR";
92  case EFI_PROTOCOL_ERROR : return "PROTOCOL_ERROR";
93  case EFI_INCOMPATIBLE_VERSION : return "INCOMPATIBLE_VERSION";
94  case EFI_SECURITY_VIOLATION : return "SECURITY_VIOLATION";
95  case EFI_CRC_ERROR : return "CRC_ERROR";
96  case EFI_END_OF_MEDIA : return "END_OF_MEDIA";
97  case EFI_END_OF_FILE : return "END_OF_FILE";
98  case EFI_INVALID_LANGUAGE : return "INVALID_LANGUAGE";
99  case EFI_COMPROMISED_DATA : return "COMPROMISED_DATA";
100  case EFI_WARN_UNKNOWN_GLYPH : return "WARN_UNKNOWN_GLYPH";
101  case EFI_WARN_DELETE_FAILURE : return "WARN_DELETE_FAILURE";
102  case EFI_WARN_WRITE_FAILURE : return "WARN_WRITE_FAILURE";
103  case EFI_WARN_BUFFER_TOO_SMALL : return "WARN_BUFFER_TOO_SMALL";
104  case EFI_WARN_STALE_DATA : return "WARN_STALE_DATA";
105  default:
106  snprintf ( buf, sizeof ( buf ), "%#lx",
107  ( unsigned long ) efirc );
108  return buf;
109  }
110 }
#define EFI_UNSUPPORTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:117
#define EFI_VOLUME_CORRUPTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:124
#define EFI_WARN_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:152
#define EFI_ICMP_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:136
#define EFI_NO_RESPONSE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:130
#define EFI_ALREADY_STARTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:134
#define EFI_CRC_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:141
#define EFI_BAD_BUFFER_SIZE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:118
#define EFI_PROTOCOL_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:138
#define EFI_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:119
#define EFI_NO_MEDIA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:126
#define EFI_OUT_OF_RESOURCES
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:123
#define EFI_DEVICE_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:121
#define EFI_LOAD_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:115
#define EFI_VOLUME_FULL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:125
#define EFI_ACCESS_DENIED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:129
#define EFI_COMPROMISED_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:145
#define EFI_NOT_STARTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:133
#define EFI_WRITE_PROTECTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:122
#define EFI_NOT_READY
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:120
#define EFI_INVALID_PARAMETER
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:116
#define EFI_END_OF_FILE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:143
#define EFI_INVALID_LANGUAGE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:144
#define EFI_WARN_STALE_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:153
#define EFI_WARN_DELETE_FAILURE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:150
#define EFI_SECURITY_VIOLATION
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:140
#define EFI_MEDIA_CHANGED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:127
#define EFI_NOT_FOUND
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:128
#define EFI_INCOMPATIBLE_VERSION
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:139
#define EFI_SUCCESS
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:114
#define EFI_WARN_UNKNOWN_GLYPH
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:149
#define EFI_NO_MAPPING
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:131
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
#define EFI_WARN_WRITE_FAILURE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:151
#define EFI_END_OF_MEDIA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:142
#define EFI_ABORTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:135
#define EFI_TFTP_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:137
#define EFI_TIMEOUT
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:132

References EFI_ABORTED, EFI_ACCESS_DENIED, EFI_ALREADY_STARTED, EFI_BAD_BUFFER_SIZE, EFI_BUFFER_TOO_SMALL, EFI_COMPROMISED_DATA, EFI_CRC_ERROR, EFI_DEVICE_ERROR, EFI_END_OF_FILE, EFI_END_OF_MEDIA, EFI_ICMP_ERROR, EFI_INCOMPATIBLE_VERSION, EFI_INVALID_LANGUAGE, EFI_INVALID_PARAMETER, EFI_LOAD_ERROR, EFI_MEDIA_CHANGED, EFI_NO_MAPPING, EFI_NO_MEDIA, EFI_NO_RESPONSE, EFI_NOT_FOUND, EFI_NOT_READY, EFI_NOT_STARTED, EFI_OUT_OF_RESOURCES, EFI_PROTOCOL_ERROR, EFI_SECURITY_VIOLATION, EFI_SUCCESS, EFI_TFTP_ERROR, EFI_TIMEOUT, EFI_UNSUPPORTED, EFI_VOLUME_CORRUPTED, EFI_VOLUME_FULL, EFI_WARN_BUFFER_TOO_SMALL, EFI_WARN_DELETE_FAILURE, EFI_WARN_STALE_DATA, EFI_WARN_UNKNOWN_GLYPH, EFI_WARN_WRITE_FAILURE, EFI_WRITE_PROTECTED, and snprintf().

Referenced by efi_allocate_pages_wrapper(), efi_allocate_pool_wrapper(), efi_check_event_wrapper(), efi_close_event_wrapper(), efi_close_protocol_wrapper(), efi_connect_controller_wrapper(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_disconnect_controller_wrapper(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), efi_free_pages_wrapper(), efi_free_pool_wrapper(), efi_get_memory_map_wrapper(), efi_get_next_monotonic_count_wrapper(), efi_handle_protocol_wrapper(), efi_install_configuration_table_wrapper(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_load_image_wrapper(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_locate_protocol_wrapper(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_protocols_per_handle_wrapper(), efi_register_protocol_notify_wrapper(), efi_reinstall_protocol_interface_wrapper(), efi_set_timer_wrapper(), efi_set_watchdog_timer_wrapper(), efi_signal_event_wrapper(), efi_stall_wrapper(), efi_start_image_wrapper(), efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_unload_image_wrapper(), and efi_wait_for_event_wrapper().

◆ efi_boolean()

static const char* efi_boolean ( BOOLEAN  boolean)
static

Convert EFI boolean to text.

Parameters
booleanBoolean value
Return values
textBoolean value text

Definition at line 118 of file efi_wrap.c.

118  {
119 
120  return ( boolean ? "TRUE" : "FALSE" );
121 }

Referenced by efi_connect_controller_wrapper(), and efi_load_image_wrapper().

◆ efi_allocate_type()

static const char* efi_allocate_type ( EFI_ALLOCATE_TYPE  type)
static

Convert EFI allocation type to text.

Parameters
typeAllocation type
Return values
textAllocation type as text

Definition at line 129 of file efi_wrap.c.

129  {
130  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
131 
132  switch ( type ) {
133  case AllocateAnyPages: return "AnyPages";
134  case AllocateMaxAddress: return "MaxAddress";
135  case AllocateAddress: return "Address";
136  default:
137  snprintf ( buf, sizeof ( buf ), "%#x", type );
138  return buf;
139  }
140 }
uint32_t type
Operating system type.
Definition: ena.h:12
Allocate pages at a specified address.
Definition: UefiSpec.h:44
Allocate any available range of pages whose uppermost address is less than or equal to a specified ma...
Definition: UefiSpec.h:40
Allocate any available range of pages that satisfies the request.
Definition: UefiSpec.h:35
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382

References AllocateAddress, AllocateAnyPages, AllocateMaxAddress, snprintf(), and type.

Referenced by efi_allocate_pages_wrapper().

◆ efi_memory_type()

static const char* efi_memory_type ( EFI_MEMORY_TYPE  type)
static

Convert EFI memory type to text.

Parameters
typeMemory type
Return values
textMemory type as text

Definition at line 148 of file efi_wrap.c.

148  {
149  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
150 
151  switch ( type ) {
152  case EfiReservedMemoryType: return "Reserved";
153  case EfiLoaderCode: return "LoaderCode";
154  case EfiLoaderData: return "LoaderData";
155  case EfiBootServicesCode: return "BootCode";
156  case EfiBootServicesData: return "BootData";
157  case EfiRuntimeServicesCode: return "RuntimeCode";
158  case EfiRuntimeServicesData: return "RuntimeData";
159  case EfiConventionalMemory: return "Conventional";
160  case EfiUnusableMemory: return "Unusable";
161  case EfiACPIReclaimMemory: return "ACPIReclaim";
162  case EfiACPIMemoryNVS: return "ACPINVS";
163  case EfiMemoryMappedIO: return "MMIO";
164  case EfiMemoryMappedIOPortSpace:return "PIO";
165  case EfiPalCode: return "PalCode";
166  case EfiPersistentMemory: return "Persistent";
167  default:
168  snprintf ( buf, sizeof ( buf ), "%#x", type );
169  return buf;
170  }
171 }
uint32_t type
Operating system type.
Definition: ena.h:12
A memory region that operates as EfiConventionalMemory, however it happens to also support byte-addre...
The code portions of a loaded application.
Address space reserved by the firmware for code that is part of the processor.
Used by system firmware to request that a memory-mapped IO region be mapped by the OS to a virtual ad...
Memory that holds the ACPI tables.
The code portions of a loaded Boot Services Driver.
Free (unallocated) memory.
System memory-mapped IO region that is used to translate memory cycles to IO cycles by the processor.
The data portions of a loaded Runtime Services Driver and the default data allocation type used by a ...
The code portions of a loaded Runtime Services Driver.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
Address space reserved for use by the firmware.
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
The data portions of a loaded application and the default data allocation type used by an application...
Memory in which errors have been detected.

References EfiACPIMemoryNVS, EfiACPIReclaimMemory, EfiBootServicesCode, EfiBootServicesData, EfiConventionalMemory, EfiLoaderCode, EfiLoaderData, EfiMemoryMappedIO, EfiMemoryMappedIOPortSpace, EfiPalCode, EfiPersistentMemory, EfiReservedMemoryType, EfiRuntimeServicesCode, EfiRuntimeServicesData, EfiUnusableMemory, snprintf(), and type.

Referenced by efi_allocate_pages_wrapper(), efi_allocate_pool_wrapper(), and efi_get_memory_map_wrapper().

◆ efi_timer_delay()

static const char* efi_timer_delay ( EFI_TIMER_DELAY  type)
static

Convert EFI timer delay type to text.

Parameters
typeTimer delay type
Return values
textTimer delay type as text

Definition at line 179 of file efi_wrap.c.

179  {
180  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
181 
182  switch ( type ) {
183  case TimerCancel: return "Cancel";
184  case TimerPeriodic: return "Periodic";
185  case TimerRelative: return "Relative";
186  default:
187  snprintf ( buf, sizeof ( buf ), "%#x", type );
188  return buf;
189  }
190 }
An event is to be signaled periodically at a specified interval from the current time.
Definition: UefiSpec.h:547
An event is to be signaled once at a specified interval from the current time.
Definition: UefiSpec.h:551
uint32_t type
Operating system type.
Definition: ena.h:12
An event's timer settings is to be cancelled and not trigger time is to be set/.
Definition: UefiSpec.h:543
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382

References snprintf(), TimerCancel, TimerPeriodic, TimerRelative, and type.

Referenced by efi_set_timer_wrapper().

◆ efi_prescroll()

static int efi_prescroll ( unsigned int  lines)
static

Pre-scroll display to create space for output lines.

Parameters
linesNumber of lines required
Return values
efircEFI status code

Definition at line 198 of file efi_wrap.c.

198  {
200  UINTN columns;
201  UINTN rows;
202  UINTN space;
203  EFI_STATUS efirc;
204 
205  /* Get number of rows and columns */
206  if ( ( efirc = conout->QueryMode ( conout, conout->Mode->Mode,
207  &columns, &rows ) ) != 0 )
208  return efirc;
209 
210  /* Calculate available space */
211  space = ( rows - conout->Mode->CursorRow - 1 );
212 
213  /* Scroll to create space */
214  while ( space++ < lines )
215  conout->OutputString ( conout, L"\n" );
216 
217  /* Move cursor to start of space */
218  conout->SetCursorPosition ( conout, 0,
219  ( conout->Mode->CursorRow - lines ) );
220 
221  return 0;
222 }
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition
The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition: UefiSpec.h:2079
INT32 Mode
The text mode of the output device(s).
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
UINT64 UINTN
Unsigned value of native width.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
INT32 CursorRow
The cursor's row.

References EFI_SYSTEM_TABLE::ConOut, EFI_SIMPLE_TEXT_OUTPUT_MODE::CursorRow, efi_systab, EFI_SIMPLE_TEXT_OUTPUT_MODE::Mode, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::Mode, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::OutputString, _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::QueryMode, and _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL::SetCursorPosition.

Referenced by efi_exit_boot_services_wrapper().

◆ efi_dump_image()

static void efi_dump_image ( EFI_HANDLE  handle)
static

Dump information about a loaded image.

Parameters
handleImage handle

Definition at line 229 of file efi_wrap.c.

229  {
231  int rc;
232 
233  /* Open loaded image protocol */
235  &loaded ) ) != 0 ) {
236  DBGC ( colour, "WRAP %s could not get loaded image protocol: "
237  "%s\n", efi_handle_name ( handle ), strerror ( rc ) );
238  return;
239  }
240 
241  /* Dump image information */
242  DBGC ( colour, "WRAP %s at base %p has protocols:\n",
245  DBGC ( colour, "WRAP %s parent", efi_handle_name ( handle ) );
246  DBGC ( colour, " %s\n", efi_handle_name ( loaded->ParentHandle ) );
247  DBGC ( colour, "WRAP %s device", efi_handle_name ( handle ) );
248  DBGC ( colour, " %s\n", efi_handle_name ( loaded->DeviceHandle ) );
249  DBGC ( colour, "WRAP %s file", efi_handle_name ( handle ) );
250  DBGC ( colour, " %s\n", efi_devpath_text ( loaded->FilePath ) );
251 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define DBGC_EFI_PROTOCOLS(...)
Definition: efi.h:345
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:265
EFI_DEVICE_PATH_PROTOCOL * FilePath
A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from.
Definition: LoadedImage.h:56
VOID * ImageBase
The base address at which the image was loaded.
Definition: LoadedImage.h:69
Can be used on any image handle to obtain information about the loaded image.
Definition: LoadedImage.h:45
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:247
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition: efi.h:440
EFI_LOADED_IMAGE_PROTOCOL * loaded
Loaded image protocol.
Definition: efi_veto.c:68
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16
EFI_HANDLE ParentHandle
Parent image's image handle.
Definition: LoadedImage.h:48
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
Definition: LoadedImage.h:55

References colour, DBGC, DBGC_EFI_PROTOCOLS, EFI_LOADED_IMAGE_PROTOCOL::DeviceHandle, efi_devpath_text(), efi_handle_name(), efi_loaded_image_protocol_guid, efi_open, EFI_LOADED_IMAGE_PROTOCOL::FilePath, handle, EFI_LOADED_IMAGE_PROTOCOL::ImageBase, EFI_LOADED_IMAGE_PROTOCOL::ParentHandle, rc, and strerror().

Referenced by efi_load_image_wrapper(), and efi_wrap_image().

◆ efi_raise_tpl_wrapper()

static EFI_TPL EFIAPI efi_raise_tpl_wrapper ( EFI_TPL  new_tpl)
static

Wrap RaiseTPL()

Definition at line 258 of file efi_wrap.c.

258  {
260  void *retaddr = __builtin_return_address ( 0 );
261  EFI_TPL old_tpl;
262 
263  DBGCP ( colour, "RaiseTPL ( %s ) ", efi_tpl_name ( new_tpl ) );
264  old_tpl = bs->RaiseTPL ( new_tpl );
265  DBGCP ( colour, "= %s -> %p\n", efi_tpl_name ( old_tpl ), retaddr );
266  return old_tpl;
267 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1939
EFI Boot Services Table.
Definition: UefiSpec.h:1930
UINTN EFI_TPL
Task priority level.
Definition: UefiBaseType.h:43
#define DBGCP(...)
Definition: compiler.h:539
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55

References EFI_SYSTEM_TABLE::BootServices, colour, DBGCP, efi_systab, efi_tpl_name(), and EFI_BOOT_SERVICES::RaiseTPL.

Referenced by efi_wrap_bs().

◆ efi_restore_tpl_wrapper()

static VOID EFIAPI efi_restore_tpl_wrapper ( EFI_TPL  old_tpl)
static

Wrap RestoreTPL()

Definition at line 274 of file efi_wrap.c.

274  {
276  void *retaddr = __builtin_return_address ( 0 );
277 
278  DBGCP ( colour, "RestoreTPL ( %s ) ", efi_tpl_name ( old_tpl ) );
279  bs->RestoreTPL ( old_tpl );
280  DBGCP ( colour, "-> %p\n", retaddr );
281 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGCP(...)
Definition: compiler.h:539
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1940
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55

References EFI_SYSTEM_TABLE::BootServices, colour, DBGCP, efi_systab, efi_tpl_name(), and EFI_BOOT_SERVICES::RestoreTPL.

Referenced by efi_wrap_bs().

◆ efi_allocate_pages_wrapper()

static EFI_STATUS EFIAPI efi_allocate_pages_wrapper ( EFI_ALLOCATE_TYPE  type,
EFI_MEMORY_TYPE  memory_type,
UINTN  pages,
EFI_PHYSICAL_ADDRESS memory 
)
static

Wrap AllocatePages()

Definition at line 288 of file efi_wrap.c.

290  {
292  void *retaddr = __builtin_return_address ( 0 );
293  EFI_STATUS efirc;
294 
295  DBGC2 ( colour, "AllocatePages ( %s, %s, %#llx, %#llx ) ",
296  efi_allocate_type ( type ), efi_memory_type ( memory_type ),
297  ( ( unsigned long long ) pages ),
298  ( ( unsigned long long ) *memory ) );
299  efirc = bs->AllocatePages ( type, memory_type, pages, memory );
300  DBGC2 ( colour, "= %s ( %#llx ) -> %p\n", efi_status ( efirc ),
301  ( ( unsigned long long ) *memory ), retaddr );
302  return efirc;
303 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint32_t type
Operating system type.
Definition: ena.h:12
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_ALLOCATE_PAGES AllocatePages
Definition: UefiSpec.h:1945
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
static const char * efi_allocate_type(EFI_ALLOCATE_TYPE type)
Convert EFI allocation type to text.
Definition: efi_wrap.c:129
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
static const char * efi_memory_type(EFI_MEMORY_TYPE type)
Convert EFI memory type to text.
Definition: efi_wrap.c:148

References EFI_BOOT_SERVICES::AllocatePages, EFI_SYSTEM_TABLE::BootServices, colour, DBGC2, efi_allocate_type(), efi_memory_type(), efi_status(), efi_systab, and type.

Referenced by efi_wrap_bs().

◆ efi_free_pages_wrapper()

static EFI_STATUS EFIAPI efi_free_pages_wrapper ( EFI_PHYSICAL_ADDRESS  memory,
UINTN  pages 
)
static

Wrap FreePages()

Definition at line 310 of file efi_wrap.c.

310  {
312  void *retaddr = __builtin_return_address ( 0 );
313  EFI_STATUS efirc;
314 
315  DBGC2 ( colour, "FreePages ( %#llx, %#llx ) ",
316  ( ( unsigned long long ) memory ),
317  ( ( unsigned long long ) pages ) );
318  efirc = bs->FreePages ( memory, pages );
319  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
320  return efirc;
321 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_FREE_PAGES FreePages
Definition: UefiSpec.h:1946

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC2, efi_status(), efi_systab, and EFI_BOOT_SERVICES::FreePages.

Referenced by efi_wrap_bs().

◆ efi_get_memory_map_wrapper()

static EFI_STATUS EFIAPI efi_get_memory_map_wrapper ( UINTN memory_map_size,
EFI_MEMORY_DESCRIPTOR memory_map,
UINTN map_key,
UINTN descriptor_size,
UINT32 descriptor_version 
)
static

Wrap GetMemoryMap()

Definition at line 328 of file efi_wrap.c.

331  {
333  void *retaddr = __builtin_return_address ( 0 );
335  size_t remaining;
336  EFI_STATUS efirc;
337 
338  DBGC ( colour, "GetMemoryMap ( %#llx, %p ) ",
339  ( ( unsigned long long ) *memory_map_size ), memory_map );
340  efirc = bs->GetMemoryMap ( memory_map_size, memory_map, map_key,
341  descriptor_size, descriptor_version );
342  DBGC ( colour, "= %s ( %#llx, %#llx, %#llx, v%d",
343  efi_status ( efirc ),
344  ( ( unsigned long long ) *memory_map_size ),
345  ( ( unsigned long long ) *map_key ),
346  ( ( unsigned long long ) *descriptor_size ),
347  *descriptor_version );
348  if ( DBG_EXTRA && ( efirc == 0 ) ) {
349  DBGC2 ( colour, ",\n" );
350  for ( desc = memory_map, remaining = *memory_map_size ;
351  remaining >= *descriptor_size ;
352  desc = ( ( ( void * ) desc ) + *descriptor_size ),
353  remaining -= *descriptor_size ) {
354  DBGC2 ( colour, "%#016llx+%#08llx %#016llx "
355  "%s\n", desc->PhysicalStart,
356  ( desc->NumberOfPages * EFI_PAGE_SIZE ),
357  desc->Attribute,
358  efi_memory_type ( desc->Type ) );
359  }
360  } else {
361  DBGC ( colour, " " );
362  }
363  DBGC ( colour, ") -> %p\n", retaddr );
364  return efirc;
365 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
#define EFI_PAGE_SIZE
Definition: UefiBaseType.h:187
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
Definition of an EFI memory descriptor.
Definition: UefiSpec.h:155
#define DBGC(...)
Definition: compiler.h:505
struct ena_llq_option desc
Descriptor counts.
Definition: ena.h:20
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_GET_MEMORY_MAP GetMemoryMap
Definition: UefiSpec.h:1947
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define DBG_EXTRA
Definition: compiler.h:319
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
static const char * efi_memory_type(EFI_MEMORY_TYPE type)
Convert EFI memory type to text.
Definition: efi_wrap.c:148

References EFI_SYSTEM_TABLE::BootServices, colour, DBG_EXTRA, DBGC, DBGC2, desc, efi_memory_type(), EFI_PAGE_SIZE, efi_status(), efi_systab, and EFI_BOOT_SERVICES::GetMemoryMap.

Referenced by efi_wrap_bs().

◆ efi_allocate_pool_wrapper()

static EFI_STATUS EFIAPI efi_allocate_pool_wrapper ( EFI_MEMORY_TYPE  pool_type,
UINTN  size,
VOID **  buffer 
)
static

Wrap AllocatePool()

Definition at line 372 of file efi_wrap.c.

373  {
375  void *retaddr = __builtin_return_address ( 0 );
376  EFI_STATUS efirc;
377 
378  DBGC2 ( colour, "AllocatePool ( %s, %#llx ) ",
379  efi_memory_type ( pool_type ),
380  ( ( unsigned long long ) size ) );
381  efirc = bs->AllocatePool ( pool_type, size, buffer );
382  DBGC2 ( colour, "= %s ( %p ) -> %p\n",
383  efi_status ( efirc ), *buffer, retaddr );
384  return efirc;
385 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint16_t size
Buffer size.
Definition: dwmac.h:14
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
static const char * efi_memory_type(EFI_MEMORY_TYPE type)
Convert EFI memory type to text.
Definition: efi_wrap.c:148
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1948

References EFI_BOOT_SERVICES::AllocatePool, EFI_SYSTEM_TABLE::BootServices, buffer, colour, DBGC2, efi_memory_type(), efi_status(), efi_systab, and size.

Referenced by efi_wrap_bs().

◆ efi_free_pool_wrapper()

static EFI_STATUS EFIAPI efi_free_pool_wrapper ( VOID buffer)
static

Wrap FreePool()

Definition at line 392 of file efi_wrap.c.

392  {
394  void *retaddr = __builtin_return_address ( 0 );
395  EFI_STATUS efirc;
396 
397  DBGC2 ( colour, "FreePool ( %p ) ", buffer );
398  efirc = bs->FreePool ( buffer );
399  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
400  return efirc;
401 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, buffer, colour, DBGC2, efi_status(), efi_systab, and EFI_BOOT_SERVICES::FreePool.

Referenced by efi_wrap_bs().

◆ efi_create_event_wrapper()

static EFI_STATUS EFIAPI efi_create_event_wrapper ( UINT32  type,
EFI_TPL  notify_tpl,
EFI_EVENT_NOTIFY  notify_function,
VOID notify_context,
EFI_EVENT event 
)
static

Wrap CreateEvent()

Definition at line 408 of file efi_wrap.c.

410  {
412  void *retaddr = __builtin_return_address ( 0 );
413  EFI_STATUS efirc;
414 
415  DBGC ( colour, "CreateEvent ( %#x, %s, %p, %p ) ", type,
416  efi_tpl_name ( notify_tpl ), notify_function, notify_context );
417  efirc = bs->CreateEvent ( type, notify_tpl, notify_function,
418  notify_context, event );
419  DBGC ( colour, "= %s ( %p ) -> %p\n",
420  efi_status ( efirc ), *event, retaddr );
421  return efirc;
422 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint32_t type
Operating system type.
Definition: ena.h:12
#define DBGC(...)
Definition: compiler.h:505
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1954
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55

References EFI_SYSTEM_TABLE::BootServices, colour, EFI_BOOT_SERVICES::CreateEvent, DBGC, efi_status(), efi_systab, efi_tpl_name(), and type.

Referenced by efi_wrap_bs().

◆ efi_set_timer_wrapper()

static EFI_STATUS EFIAPI efi_set_timer_wrapper ( EFI_EVENT  event,
EFI_TIMER_DELAY  type,
UINT64  trigger_time 
)
static

Wrap SetTimer()

Definition at line 429 of file efi_wrap.c.

430  {
432  void *retaddr = __builtin_return_address ( 0 );
433  EFI_STATUS efirc;
434 
435  DBGC ( colour, "SetTimer ( %p, %s, %ld.%07ld00s ) ",
436  event, efi_timer_delay ( type ),
437  ( ( unsigned long ) ( trigger_time / 10000000 ) ),
438  ( ( unsigned long ) ( trigger_time % 10000000 ) ) );
439  efirc = bs->SetTimer ( event, type, trigger_time );
440  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
441  return efirc;
442 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint32_t type
Operating system type.
Definition: ena.h:12
#define DBGC(...)
Definition: compiler.h:505
EFI_SET_TIMER SetTimer
Definition: UefiSpec.h:1955
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
static const char * efi_timer_delay(EFI_TIMER_DELAY type)
Convert EFI timer delay type to text.
Definition: efi_wrap.c:179
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_status(), efi_systab, efi_timer_delay(), EFI_BOOT_SERVICES::SetTimer, and type.

Referenced by efi_wrap_bs().

◆ efi_wait_for_event_wrapper()

static EFI_STATUS EFIAPI efi_wait_for_event_wrapper ( UINTN  number_of_events,
EFI_EVENT event,
UINTN index 
)
static

Wrap WaitForEvent()

Definition at line 449 of file efi_wrap.c.

450  {
452  void *retaddr = __builtin_return_address ( 0 );
453  unsigned int i;
454  EFI_STATUS efirc;
455 
456  DBGC ( colour, "WaitForEvent (" );
457  for ( i = 0 ; i < number_of_events ; i++ )
458  DBGC ( colour, " %p", event[i] );
459  DBGC ( colour, " ) " );
460  efirc = bs->WaitForEvent ( number_of_events, event, index );
461  DBGC ( colour, "= %s", efi_status ( efirc ) );
462  if ( efirc == 0 )
463  DBGC ( colour, " ( %p )", event[*index] );
464  DBGC ( colour, " -> %p\n", retaddr );
465  return efirc;
466 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
long index
Definition: bigint.h:62
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_WAIT_FOR_EVENT WaitForEvent
Definition: UefiSpec.h:1956
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_status(), efi_systab, index, and EFI_BOOT_SERVICES::WaitForEvent.

Referenced by efi_wrap_bs().

◆ efi_signal_event_wrapper()

static EFI_STATUS EFIAPI efi_signal_event_wrapper ( EFI_EVENT  event)
static

Wrap SignalEvent()

Definition at line 473 of file efi_wrap.c.

473  {
475  void *retaddr = __builtin_return_address ( 0 );
476  EFI_STATUS efirc;
477 
478  DBGC2 ( colour, "SignalEvent ( %p ) ", event );
479  efirc = bs->SignalEvent ( event );
480  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
481  return efirc;
482 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_SIGNAL_EVENT SignalEvent
Definition: UefiSpec.h:1957
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC2, efi_status(), efi_systab, and EFI_BOOT_SERVICES::SignalEvent.

Referenced by efi_wrap_bs().

◆ efi_close_event_wrapper()

static EFI_STATUS EFIAPI efi_close_event_wrapper ( EFI_EVENT  event)
static

Wrap CloseEvent()

Definition at line 489 of file efi_wrap.c.

489  {
491  void *retaddr = __builtin_return_address ( 0 );
492  EFI_STATUS efirc;
493 
494  DBGC ( colour, "CloseEvent ( %p ) ", event );
495  efirc = bs->CloseEvent ( event );
496  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
497  return efirc;
498 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1958
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, colour, DBGC, efi_status(), and efi_systab.

Referenced by efi_wrap_bs().

◆ efi_check_event_wrapper()

static EFI_STATUS EFIAPI efi_check_event_wrapper ( EFI_EVENT  event)
static

Wrap CheckEvent()

Definition at line 504 of file efi_wrap.c.

504  {
506  void *retaddr = __builtin_return_address ( 0 );
507  EFI_STATUS efirc;
508 
509  DBGCP ( colour, "CheckEvent ( %p ) ", event );
510  efirc = bs->CheckEvent ( event );
511  DBGCP ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
512  return efirc;
513 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_CHECK_EVENT CheckEvent
Definition: UefiSpec.h:1959
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
#define DBGCP(...)
Definition: compiler.h:539
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CheckEvent, colour, DBGCP, efi_status(), and efi_systab.

Referenced by efi_wrap_bs().

◆ efi_install_protocol_interface_wrapper()

static EFI_STATUS EFIAPI efi_install_protocol_interface_wrapper ( EFI_HANDLE handle,
EFI_GUID protocol,
EFI_INTERFACE_TYPE  interface_type,
VOID interface 
)
static

Wrap InstallProtocolInterface()

Definition at line 520 of file efi_wrap.c.

522  {
524  void *retaddr = __builtin_return_address ( 0 );
525  EFI_STATUS efirc;
526 
527  DBGC ( colour, "InstallProtocolInterface ( %s, %s, %d, %p ) ",
531  interface );
532  DBGC ( colour, "= %s ( %s ) -> %p\n",
533  efi_status ( efirc ), efi_handle_name ( *handle ), retaddr );
534  return efirc;
535 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
An object interface.
Definition: interface.h:124
EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
Definition: UefiSpec.h:1964
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
struct edd_interface_type interface_type
Interface type.
Definition: edd.h:20
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, EFI_BOOT_SERVICES::InstallProtocolInterface, interface_type, and protocol.

Referenced by efi_wrap_bs().

◆ efi_reinstall_protocol_interface_wrapper()

static EFI_STATUS EFIAPI efi_reinstall_protocol_interface_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
VOID old_interface,
VOID new_interface 
)
static

Wrap ReinstallProtocolInterface()

Definition at line 542 of file efi_wrap.c.

545  {
547  void *retaddr = __builtin_return_address ( 0 );
548  EFI_STATUS efirc;
549 
550  DBGC ( colour, "ReinstallProtocolInterface ( %s, %s, %p, %p ) ",
552  old_interface, new_interface );
554  old_interface, new_interface );
555  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
556  return efirc;
557 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
Definition: UefiSpec.h:1965
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, protocol, and EFI_BOOT_SERVICES::ReinstallProtocolInterface.

Referenced by efi_wrap_bs().

◆ efi_uninstall_protocol_interface_wrapper()

static EFI_STATUS EFIAPI efi_uninstall_protocol_interface_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
VOID interface 
)
static

Wrap UninstallProtocolInterface()

Definition at line 564 of file efi_wrap.c.

566  {
568  void *retaddr = __builtin_return_address ( 0 );
569  EFI_STATUS efirc;
570 
571  DBGC ( colour, "UninstallProtocolInterface ( %s, %s, %p ) ",
573  interface );
575  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
576  return efirc;
577 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
Definition: UefiSpec.h:1966
#define DBGC(...)
Definition: compiler.h:505
An object interface.
Definition: interface.h:124
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, protocol, and EFI_BOOT_SERVICES::UninstallProtocolInterface.

Referenced by efi_wrap_bs().

◆ efi_handle_protocol_wrapper()

static EFI_STATUS EFIAPI efi_handle_protocol_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
VOID **  interface 
)
static

Wrap HandleProtocol()

Definition at line 584 of file efi_wrap.c.

585  {
587  void *retaddr = __builtin_return_address ( 0 );
588  EFI_STATUS efirc;
589 
590  DBGC ( colour, "HandleProtocol ( %s, %s ) ",
592  efirc = bs->HandleProtocol ( handle, protocol, interface );
593  DBGC ( colour, "= %s ( %p ) -> %p\n",
594  efi_status ( efirc ), *interface, retaddr );
595  return efirc;
596 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
An object interface.
Definition: interface.h:124
EFI_HANDLE_PROTOCOL HandleProtocol
Definition: UefiSpec.h:1967
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, EFI_BOOT_SERVICES::HandleProtocol, and protocol.

Referenced by efi_wrap_bs().

◆ efi_register_protocol_notify_wrapper()

static EFI_STATUS EFIAPI efi_register_protocol_notify_wrapper ( EFI_GUID protocol,
EFI_EVENT  event,
VOID **  registration 
)
static

Wrap RegisterProtocolNotify()

Definition at line 603 of file efi_wrap.c.

604  {
606  void *retaddr = __builtin_return_address ( 0 );
607  EFI_STATUS efirc;
608 
609  DBGC ( colour, "RegisterProtocolNotify ( %s, %p ) ",
610  efi_guid_ntoa ( protocol ), event );
611  efirc = bs->RegisterProtocolNotify ( protocol, event, registration );
612  DBGC ( colour, "= %s ( %p ) -> %p\n",
613  efi_status ( efirc ), *registration, retaddr );
614  return efirc;
615 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
Definition: UefiSpec.h:1969
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_status(), efi_systab, protocol, and EFI_BOOT_SERVICES::RegisterProtocolNotify.

Referenced by efi_wrap_bs().

◆ efi_locate_handle_wrapper()

static EFI_STATUS EFIAPI efi_locate_handle_wrapper ( EFI_LOCATE_SEARCH_TYPE  search_type,
EFI_GUID protocol,
VOID search_key,
UINTN buffer_size,
EFI_HANDLE buffer 
)
static

Wrap LocateHandle()

Definition at line 622 of file efi_wrap.c.

624  {
626  void *retaddr = __builtin_return_address ( 0 );
627  unsigned int i;
628  EFI_STATUS efirc;
629 
630  DBGC ( colour, "LocateHandle ( %s, %s, %p, %zd ) ",
631  efi_locate_search_type_name ( search_type ),
632  efi_guid_ntoa ( protocol ), search_key,
633  ( ( size_t ) *buffer_size ) );
634  efirc = bs->LocateHandle ( search_type, protocol, search_key,
635  buffer_size, buffer );
636  DBGC ( colour, "= %s ( %zd", efi_status ( efirc ),
637  ( ( size_t ) *buffer_size ) );
638  if ( efirc == 0 ) {
639  DBGC ( colour, ", {" );
640  for ( i = 0; i < ( *buffer_size / sizeof ( buffer[0] ) ); i++ ){
641  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
642  efi_handle_name ( buffer[i] ) );
643  }
644  DBGC ( colour, " }" );
645  }
646  DBGC ( colour, " ) -> %p\n", retaddr );
647  return efirc;
648 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
EFI_LOCATE_HANDLE LocateHandle
Definition: UefiSpec.h:1970
const char * efi_locate_search_type_name(EFI_LOCATE_SEARCH_TYPE search_type)
Name locate search type.
Definition: efi_debug.c:77
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
UINT16_t buffer_size
UDP payload buffer size.
Definition: pxe_api.h:62

References EFI_SYSTEM_TABLE::BootServices, buffer, buffer_size, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_locate_search_type_name(), efi_status(), efi_systab, EFI_BOOT_SERVICES::LocateHandle, and protocol.

Referenced by efi_wrap_bs().

◆ efi_locate_device_path_wrapper()

static EFI_STATUS EFIAPI efi_locate_device_path_wrapper ( EFI_GUID protocol,
EFI_DEVICE_PATH_PROTOCOL **  device_path,
EFI_HANDLE device 
)
static

Wrap LocateDevicePath()

Definition at line 655 of file efi_wrap.c.

657  {
659  void *retaddr = __builtin_return_address ( 0 );
660  EFI_STATUS efirc;
661 
662  DBGC ( colour, "LocateDevicePath ( %s, %s ) ",
664  efirc = bs->LocateDevicePath ( protocol, device_path, device );
665  DBGC ( colour, "= %s ( %s, ",
666  efi_status ( efirc ), efi_devpath_text ( *device_path ) );
667  DBGC ( colour, "%s ) -> %p\n", efi_handle_name ( *device ), retaddr );
668  return efirc;
669 }
union edd_device_path device_path
Device path.
Definition: edd.h:24
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
A hardware device.
Definition: device.h:76
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:247
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_LOCATE_DEVICE_PATH LocateDevicePath
Definition: UefiSpec.h:1971

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, device_path, efi_devpath_text(), efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, EFI_BOOT_SERVICES::LocateDevicePath, and protocol.

Referenced by efi_wrap_bs().

◆ efi_install_configuration_table_wrapper()

static EFI_STATUS EFIAPI efi_install_configuration_table_wrapper ( EFI_GUID guid,
VOID table 
)
static

Wrap InstallConfigurationTable()

Definition at line 676 of file efi_wrap.c.

676  {
678  void *retaddr = __builtin_return_address ( 0 );
679  EFI_STATUS efirc;
680 
681  DBGC ( colour, "InstallConfigurationTable ( %s, %p ) ",
682  efi_guid_ntoa ( guid ), table );
683  efirc = bs->InstallConfigurationTable ( guid, table );
684  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
685  return efirc;
686 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
uint64_t guid
GUID.
Definition: edd.h:30
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
Definition: UefiSpec.h:1972

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_status(), efi_systab, guid, and EFI_BOOT_SERVICES::InstallConfigurationTable.

Referenced by efi_wrap_bs().

◆ efi_load_image_wrapper()

static EFI_STATUS EFIAPI efi_load_image_wrapper ( BOOLEAN  boot_policy,
EFI_HANDLE  parent_image_handle,
EFI_DEVICE_PATH_PROTOCOL device_path,
VOID source_buffer,
UINTN  source_size,
EFI_HANDLE image_handle 
)
static

Wrap LoadImage()

Definition at line 693 of file efi_wrap.c.

696  {
698  void *retaddr = __builtin_return_address ( 0 );
699  EFI_STATUS efirc;
700 
701  DBGC ( colour, "LoadImage ( %s, %s, ", efi_boolean ( boot_policy ),
702  efi_handle_name ( parent_image_handle ) );
703  DBGC ( colour, "%s, %p, %#llx ) ",
704  efi_devpath_text ( device_path ), source_buffer,
705  ( ( unsigned long long ) source_size ) );
706  efirc = bs->LoadImage ( boot_policy, parent_image_handle, device_path,
707  source_buffer, source_size, image_handle );
708  DBGC ( colour, "= %s ( ", efi_status ( efirc ) );
709  if ( efirc == 0 )
710  DBGC ( colour, "%s ", efi_handle_name ( *image_handle ) );
711  DBGC ( colour, ") -> %p\n", retaddr );
712 
713  /* Dump information about loaded image */
714  if ( efirc == 0 )
715  efi_dump_image ( *image_handle );
716 
717  return efirc;
718 }
union edd_device_path device_path
Device path.
Definition: edd.h:24
static const char * efi_boolean(BOOLEAN boolean)
Convert EFI boolean to text.
Definition: efi_wrap.c:118
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_IMAGE_LOAD LoadImage
Definition: UefiSpec.h:1977
#define DBGC(...)
Definition: compiler.h:505
static void efi_dump_image(EFI_HANDLE handle)
Dump information about a loaded image.
Definition: efi_wrap.c:229
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:247
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
static unsigned int source_size
Definition: bigint.h:248
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, device_path, efi_boolean(), efi_devpath_text(), efi_dump_image(), efi_handle_name(), efi_status(), efi_systab, EFI_BOOT_SERVICES::LoadImage, and source_size.

Referenced by efi_wrap_bs().

◆ efi_start_image_wrapper()

static EFI_STATUS EFIAPI efi_start_image_wrapper ( EFI_HANDLE  image_handle,
UINTN exit_data_size,
CHAR16 **  exit_data 
)
static

Wrap StartImage()

Definition at line 725 of file efi_wrap.c.

726  {
728  void *retaddr = __builtin_return_address ( 0 );
729  EFI_STATUS efirc;
730 
731  DBGC ( colour, "StartImage ( %s ) ", efi_handle_name ( image_handle ) );
732  efirc = bs->StartImage ( image_handle, exit_data_size, exit_data );
733  DBGC ( colour, "= %s", efi_status ( efirc ) );
734  if ( ( efirc != 0 ) && exit_data && *exit_data_size )
735  DBGC ( colour, " ( \"%ls\" )", *exit_data );
736  DBGC ( colour, " -> %p\n", retaddr );
737  if ( ( efirc != 0 ) && exit_data && *exit_data_size )
738  DBGC_HD ( colour, *exit_data, *exit_data_size );
739  return efirc;
740 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC_HD(...)
Definition: compiler.h:507
EFI_IMAGE_START StartImage
Definition: UefiSpec.h:1978
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, DBGC_HD, efi_handle_name(), efi_status(), efi_systab, and EFI_BOOT_SERVICES::StartImage.

Referenced by efi_wrap_bs().

◆ efi_exit_wrapper()

static EFI_STATUS EFIAPI efi_exit_wrapper ( EFI_HANDLE  image_handle,
EFI_STATUS  exit_status,
UINTN  exit_data_size,
CHAR16 exit_data 
)
static

Wrap Exit()

Definition at line 747 of file efi_wrap.c.

748  {
750  void *retaddr = __builtin_return_address ( 0 );
751  EFI_STATUS efirc;
752 
753  if ( ( exit_status != 0 ) && exit_data && exit_data_size )
754  DBGC_HD ( colour, exit_data, exit_data_size );
755  DBGC ( colour, "Exit ( %s, %s",
756  efi_handle_name ( image_handle ), efi_status ( exit_status ) );
757  if ( ( exit_status != 0 ) && exit_data && exit_data_size )
758  DBGC ( colour, ", \"%ls\"", exit_data );
759  DBGC ( colour, " ) " );
760  efirc = bs->Exit ( image_handle, exit_status, exit_data_size,
761  exit_data );
762  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
763  return efirc;
764 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC_HD(...)
Definition: compiler.h:507
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, DBGC_HD, efi_handle_name(), efi_status(), efi_systab, and EFI_BOOT_SERVICES::Exit.

Referenced by efi_wrap_bs().

◆ efi_unload_image_wrapper()

static EFI_STATUS EFIAPI efi_unload_image_wrapper ( EFI_HANDLE  image_handle)
static

Wrap UnloadImage()

Definition at line 771 of file efi_wrap.c.

771  {
773  void *retaddr = __builtin_return_address ( 0 );
774  EFI_STATUS efirc;
775 
776  DBGC ( colour, "UnloadImage ( %s ) ",
777  efi_handle_name ( image_handle ) );
778  efirc = bs->UnloadImage ( image_handle );
779  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
780  return efirc;
781 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI_IMAGE_UNLOAD UnloadImage
Definition: UefiSpec.h:1980
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_handle_name(), efi_status(), efi_systab, and EFI_BOOT_SERVICES::UnloadImage.

Referenced by efi_wrap_bs().

◆ efi_exit_boot_services_wrapper()

static EFI_STATUS EFIAPI efi_exit_boot_services_wrapper ( EFI_HANDLE  image_handle,
UINTN  map_key 
)
static

Wrap ExitBootServices()

Definition at line 788 of file efi_wrap.c.

788  {
790  void *retaddr = __builtin_return_address ( 0 );
791  EFI_STATUS efirc;
792 
793  DBGC ( colour, "ExitBootServices ( %s, %#llx ) -> %p\n",
794  efi_handle_name ( image_handle ),
795  ( ( unsigned long long ) map_key ), retaddr );
796  efirc = bs->ExitBootServices ( image_handle, map_key );
797  if ( efirc != 0 ) {
798  DBGC ( colour, "ExitBootServices ( ... ) = %s -> %p\n",
799  efi_status ( efirc ), retaddr );
800  /* On some systems, scrolling the output will cause
801  * the system memory map to change (and so cause
802  * ExitBootServices() to fail).
803  *
804  * After the first failed attempt, prescroll the
805  * screen to maximise the chance of the subsequent
806  * attempt succeeding.
807  */
809  }
810  return efirc;
811 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_EXIT_BOOT_SERVICES ExitBootServices
Definition: UefiSpec.h:1981
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
static int efi_prescroll(unsigned int lines)
Pre-scroll display to create space for output lines.
Definition: efi_wrap.c:198
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
#define EFI_WRAP_PRESCROLL
Number of lines to prescroll when needed.
Definition: efi_wrap.c:44

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_handle_name(), efi_prescroll(), efi_status(), efi_systab, EFI_WRAP_PRESCROLL, and EFI_BOOT_SERVICES::ExitBootServices.

Referenced by efi_wrap_bs().

◆ efi_get_next_monotonic_count_wrapper()

static EFI_STATUS EFIAPI efi_get_next_monotonic_count_wrapper ( UINT64 count)
static

Wrap GetNextMonotonicCount()

Definition at line 818 of file efi_wrap.c.

818  {
820  void *retaddr = __builtin_return_address ( 0 );
821  EFI_STATUS efirc;
822 
823  DBGCP ( colour, "GetNextMonotonicCount() " );
824  efirc = bs->GetNextMonotonicCount ( count );
825  DBGCP ( colour, "= %s ( %#llx ) -> %p\n",
826  efi_status ( efirc ), *count, retaddr );
827  return efirc;
828 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
static unsigned int count
Number of entries.
Definition: dwmac.h:225
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
Definition: UefiSpec.h:1986
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
#define DBGCP(...)
Definition: compiler.h:539
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, count, DBGCP, efi_status(), efi_systab, and EFI_BOOT_SERVICES::GetNextMonotonicCount.

Referenced by efi_wrap_bs().

◆ efi_stall_wrapper()

static EFI_STATUS EFIAPI efi_stall_wrapper ( UINTN  microseconds)
static

Wrap Stall()

Definition at line 835 of file efi_wrap.c.

835  {
837  void *retaddr = __builtin_return_address ( 0 );
838  EFI_STATUS efirc;
839 
840  DBGC2 ( colour, "Stall ( %ld.%06lds ) ",
841  ( ( unsigned long ) ( microseconds / 1000000 ) ),
842  ( ( unsigned long ) ( microseconds % 1000000 ) ) );
843  efirc = bs->Stall ( microseconds );
844  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
845  return efirc;
846 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_STALL Stall
Definition: UefiSpec.h:1987
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define DBGC2(...)
Definition: compiler.h:522
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC2, efi_status(), efi_systab, and EFI_BOOT_SERVICES::Stall.

Referenced by efi_wrap_bs().

◆ efi_set_watchdog_timer_wrapper()

static EFI_STATUS EFIAPI efi_set_watchdog_timer_wrapper ( UINTN  timeout,
UINT64  watchdog_code,
UINTN  data_size,
CHAR16 watchdog_data 
)
static

Wrap SetWatchdogTimer()

Definition at line 853 of file efi_wrap.c.

854  {
856  void *retaddr = __builtin_return_address ( 0 );
857  EFI_STATUS efirc;
858 
859  DBGC ( colour, "SetWatchdogTimer ( %lds, %#llx, %#llx, %p ) ",
860  ( ( unsigned long ) timeout ), watchdog_code,
861  ( ( unsigned long long ) data_size ), watchdog_data );
862  efirc = bs->SetWatchdogTimer ( timeout, watchdog_code, data_size,
863  watchdog_data );
864  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
865  return efirc;
866 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
Definition: UefiSpec.h:1988
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
void timeout(int)
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_status(), efi_systab, EFI_BOOT_SERVICES::SetWatchdogTimer, and timeout().

Referenced by efi_wrap_bs().

◆ efi_connect_controller_wrapper()

static EFI_STATUS EFIAPI efi_connect_controller_wrapper ( EFI_HANDLE  controller_handle,
EFI_HANDLE driver_image_handle,
EFI_DEVICE_PATH_PROTOCOL remaining_path,
BOOLEAN  recursive 
)
static

Wrap ConnectController()

Definition at line 873 of file efi_wrap.c.

876  {
878  void *retaddr = __builtin_return_address ( 0 );
879  EFI_HANDLE *tmp;
880  EFI_STATUS efirc;
881 
882  DBGC ( colour, "ConnectController ( %s, {",
883  efi_handle_name ( controller_handle ) );
884  if ( driver_image_handle ) {
885  for ( tmp = driver_image_handle ; *tmp ; tmp++ ) {
886  DBGC ( colour, "%s%s",
887  ( ( tmp == driver_image_handle ) ? " " : ", " ),
888  efi_handle_name ( *tmp ) );
889  }
890  }
891  DBGC ( colour, " }, %s, %s ) ", efi_devpath_text ( remaining_path ),
892  efi_boolean ( recursive ) );
893  efirc = bs->ConnectController ( controller_handle, driver_image_handle,
894  remaining_path, recursive );
895  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
896  return efirc;
897 }
static const char * efi_boolean(BOOLEAN boolean)
Convert EFI boolean to text.
Definition: efi_wrap.c:118
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
unsigned long tmp
Definition: linux_pci.h:63
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:247
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_CONNECT_CONTROLLER ConnectController
Definition: UefiSpec.h:1993
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
Definition: efi.h:61

References EFI_SYSTEM_TABLE::BootServices, colour, EFI_BOOT_SERVICES::ConnectController, DBGC, efi_boolean(), efi_devpath_text(), efi_handle_name(), efi_status(), efi_systab, and tmp.

Referenced by efi_wrap_bs().

◆ efi_disconnect_controller_wrapper()

static EFI_STATUS EFIAPI efi_disconnect_controller_wrapper ( EFI_HANDLE  controller_handle,
EFI_HANDLE  driver_image_handle,
EFI_HANDLE  child_handle 
)
static

Wrap DisconnectController()

Definition at line 904 of file efi_wrap.c.

906  {
908  void *retaddr = __builtin_return_address ( 0 );
909  EFI_STATUS efirc;
910 
911  DBGC ( colour, "DisconnectController ( %s",
912  efi_handle_name ( controller_handle ) );
913  DBGC ( colour, ", %s", efi_handle_name ( driver_image_handle ) );
914  DBGC ( colour, ", %s ) ", efi_handle_name ( child_handle ) );
915  efirc = bs->DisconnectController ( controller_handle,
916  driver_image_handle,
917  child_handle );
918  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
919  return efirc;
920 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition: UefiSpec.h:1994

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, EFI_BOOT_SERVICES::DisconnectController, efi_handle_name(), efi_status(), and efi_systab.

Referenced by efi_wrap_bs().

◆ efi_open_protocol_wrapper()

static EFI_STATUS EFIAPI efi_open_protocol_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
VOID **  interface,
EFI_HANDLE  agent_handle,
EFI_HANDLE  controller_handle,
UINT32  attributes 
)
static

Wrap OpenProtocol()

Definition at line 927 of file efi_wrap.c.

929  {
931  void *retaddr = __builtin_return_address ( 0 );
932  EFI_STATUS efirc;
933 
934  DBGC ( colour, "OpenProtocol ( %s, %s, ",
936  DBGC ( colour, "%s, ", efi_handle_name ( agent_handle ) );
937  DBGC ( colour, "%s, %s ) ", efi_handle_name ( controller_handle ),
938  efi_open_attributes_name ( attributes ) );
939  efirc = bs->OpenProtocol ( handle, protocol, interface, agent_handle,
940  controller_handle, attributes );
941  DBGC ( colour, "= %s ( %p ) -> %p\n",
942  efi_status ( efirc ), *interface, retaddr );
943  return efirc;
944 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
An object interface.
Definition: interface.h:124
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition: efi_debug.c:102
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1999
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_open_attributes_name(), efi_status(), efi_systab, handle, EFI_BOOT_SERVICES::OpenProtocol, and protocol.

Referenced by efi_wrap_bs().

◆ efi_close_protocol_wrapper()

static EFI_STATUS EFIAPI efi_close_protocol_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
EFI_HANDLE  agent_handle,
EFI_HANDLE  controller_handle 
)
static

Wrap CloseProtocol()

Definition at line 951 of file efi_wrap.c.

953  {
955  void *retaddr = __builtin_return_address ( 0 );
956  EFI_STATUS efirc;
957 
958  DBGC ( colour, "CloseProtocol ( %s, %s, ",
960  DBGC ( colour, "%s, ", efi_handle_name ( agent_handle ) );
961  DBGC ( colour, "%s ) ", efi_handle_name ( controller_handle ) );
962  efirc = bs->CloseProtocol ( handle, protocol, agent_handle,
963  controller_handle );
964  DBGC ( colour, "= %s -> %p\n",
965  efi_status ( efirc ), retaddr );
966  return efirc;
967 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:2000
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseProtocol, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, and protocol.

Referenced by efi_wrap_bs().

◆ efi_open_protocol_information_wrapper()

static EFI_STATUS EFIAPI efi_open_protocol_information_wrapper ( EFI_HANDLE  handle,
EFI_GUID protocol,
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **  entry_buffer,
UINTN entry_count 
)
static

Wrap OpenProtocolInformation()

Definition at line 974 of file efi_wrap.c.

977  {
979  void *retaddr = __builtin_return_address ( 0 );
980  EFI_STATUS efirc;
981 
982  DBGC ( colour, "OpenProtocolInformation ( %s, %s ) ",
984  efirc = bs->OpenProtocolInformation ( handle, protocol, entry_buffer,
985  entry_count );
986  DBGC ( colour, "= %s ( %p, %#llx ) -> %p\n",
987  efi_status ( efirc ), *entry_buffer,
988  ( ( unsigned long long ) *entry_count ), retaddr );
989  return efirc;
990 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:2001
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, EFI_BOOT_SERVICES::OpenProtocolInformation, and protocol.

Referenced by efi_wrap_bs().

◆ efi_protocols_per_handle_wrapper()

static EFI_STATUS EFIAPI efi_protocols_per_handle_wrapper ( EFI_HANDLE  handle,
EFI_GUID ***  protocol_buffer,
UINTN protocol_buffer_count 
)
static

Wrap ProtocolsPerHandle()

Definition at line 997 of file efi_wrap.c.

999  {
1001  void *retaddr = __builtin_return_address ( 0 );
1002  unsigned int i;
1003  EFI_STATUS efirc;
1004 
1005  DBGC ( colour, "ProtocolsPerHandle ( %s ) ",
1006  efi_handle_name ( handle ) );
1007  efirc = bs->ProtocolsPerHandle ( handle, protocol_buffer,
1008  protocol_buffer_count );
1009  DBGC ( colour, "= %s", efi_status ( efirc ) );
1010  if ( efirc == 0 ) {
1011  DBGC ( colour, " ( {" );
1012  for ( i = 0 ; i < *protocol_buffer_count ; i++ ) {
1013  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
1014  efi_guid_ntoa ( (*protocol_buffer)[i] ) );
1015  }
1016  DBGC ( colour, " } )" );
1017  }
1018  DBGC ( colour, " -> %p\n", retaddr );
1019  return efirc;
1020 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:2006
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_status(), efi_systab, handle, and EFI_BOOT_SERVICES::ProtocolsPerHandle.

Referenced by efi_wrap_bs().

◆ efi_locate_handle_buffer_wrapper()

static EFI_STATUS EFIAPI efi_locate_handle_buffer_wrapper ( EFI_LOCATE_SEARCH_TYPE  search_type,
EFI_GUID protocol,
VOID search_key,
UINTN no_handles,
EFI_HANDLE **  buffer 
)
static

Wrap LocateHandleBuffer()

Definition at line 1027 of file efi_wrap.c.

1029  {
1031  void *retaddr = __builtin_return_address ( 0 );
1032  unsigned int i;
1033  EFI_STATUS efirc;
1034 
1035  DBGC ( colour, "LocateHandleBuffer ( %s, %s, %p ) ",
1036  efi_locate_search_type_name ( search_type ),
1037  efi_guid_ntoa ( protocol ), search_key );
1038  efirc = bs->LocateHandleBuffer ( search_type, protocol, search_key,
1039  no_handles, buffer );
1040  DBGC ( colour, "= %s", efi_status ( efirc ) );
1041  if ( efirc == 0 ) {
1042  DBGC ( colour, " ( %d, {", ( ( unsigned int ) *no_handles ) );
1043  for ( i = 0 ; i < *no_handles ; i++ ) {
1044  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
1045  efi_handle_name ( (*buffer)[i] ) );
1046  }
1047  DBGC ( colour, " } )" );
1048  }
1049  DBGC ( colour, " -> %p\n", retaddr );
1050  return efirc;
1051 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
#define DBGC(...)
Definition: compiler.h:505
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
const char * efi_locate_search_type_name(EFI_LOCATE_SEARCH_TYPE search_type)
Name locate search type.
Definition: efi_debug.c:77
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:2007

References EFI_SYSTEM_TABLE::BootServices, buffer, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), efi_locate_search_type_name(), efi_status(), efi_systab, EFI_BOOT_SERVICES::LocateHandleBuffer, and protocol.

Referenced by efi_wrap_bs().

◆ efi_locate_protocol_wrapper()

static EFI_STATUS EFIAPI efi_locate_protocol_wrapper ( EFI_GUID protocol,
VOID registration,
VOID **  interface 
)
static

Wrap LocateProtocol()

Definition at line 1058 of file efi_wrap.c.

1059  {
1061  void *retaddr = __builtin_return_address ( 0 );
1062  EFI_STATUS efirc;
1063 
1064  DBGC ( colour, "LocateProtocol ( %s, %p ) ",
1065  efi_guid_ntoa ( protocol ), registration );
1066  efirc = bs->LocateProtocol ( protocol, registration, interface );
1067  DBGC ( colour, "= %s ( %p ) -> %p\n",
1068  efi_status ( efirc ), *interface, retaddr );
1069  return efirc;
1070 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:2008
#define DBGC(...)
Definition: compiler.h:505
An object interface.
Definition: interface.h:124
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_status(), efi_systab, EFI_BOOT_SERVICES::LocateProtocol, and protocol.

Referenced by efi_wrap_bs().

◆ efi_install_multiple_protocol_interfaces_wrapper()

static EFI_STATUS EFIAPI efi_install_multiple_protocol_interfaces_wrapper ( EFI_HANDLE handle,
  ... 
)
static

Wrap InstallMultipleProtocolInterfaces()

Definition at line 1080 of file efi_wrap.c.

1080  {
1082  void *retaddr = __builtin_return_address ( 0 );
1085  va_list ap;
1086  unsigned int i;
1087  EFI_STATUS efirc;
1088 
1089  DBGC ( colour, "InstallMultipleProtocolInterfaces ( %s",
1090  efi_handle_name ( *handle ) );
1091  memset ( protocol, 0, sizeof ( protocol ) );
1092  memset ( interface, 0, sizeof ( interface ) );
1093  va_start ( ap, handle );
1094  for ( i = 0 ; ( protocol[i] = va_arg ( ap, EFI_GUID * ) ) ; i++ ) {
1095  if ( i == MAX_WRAP_MULTI ) {
1096  va_end ( ap );
1097  efirc = EFI_OUT_OF_RESOURCES;
1098  DBGC ( colour, "<FATAL: too many arguments> ) = %s "
1099  "-> %p\n", efi_status ( efirc ), retaddr );
1100  return efirc;
1101  }
1102  interface[i] = va_arg ( ap, VOID * );
1103  DBGC ( colour, ", %s, %p",
1104  efi_guid_ntoa ( protocol[i] ), interface[i] );
1105  }
1106  va_end ( ap );
1107  DBGC ( colour, " ) " );
1109  protocol[0], interface[0], protocol[1], interface[1],
1110  protocol[2], interface[2], protocol[3], interface[3],
1111  protocol[4], interface[4], protocol[5], interface[5],
1112  protocol[6], interface[6], protocol[7], interface[7],
1113  protocol[8], interface[8], protocol[9], interface[9],
1114  protocol[10], interface[10], protocol[11], interface[11],
1115  protocol[12], interface[12], protocol[13], interface[13],
1116  protocol[14], interface[14], protocol[15], interface[15],
1117  protocol[16], interface[16], protocol[17], interface[17],
1118  protocol[18], interface[18], protocol[19], interface[19],
1119  NULL );
1120  DBGC ( colour, "= %s ( %s ) -> %p\n",
1121  efi_status ( efirc ), efi_handle_name ( *handle ), retaddr );
1122  return efirc;
1123 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
#define va_end(ap)
Definition: stdarg.h:9
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
#define DBGC(...)
Definition: compiler.h:505
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
Definition: UefiSpec.h:2009
#define EFI_OUT_OF_RESOURCES
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:123
#define va_arg(ap, type)
Definition: stdarg.h:8
An object interface.
Definition: interface.h:124
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
#define VOID
Undeclared type.
Definition: Base.h:271
__builtin_va_list va_list
Definition: stdarg.h:6
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define va_start(ap, last)
Definition: stdarg.h:7
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define MAX_WRAP_MULTI
Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces()
Definition: efi_wrap.c:1073
void * memset(void *dest, int character, size_t len) __nonnull

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), EFI_OUT_OF_RESOURCES, efi_status(), efi_systab, handle, EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces, MAX_WRAP_MULTI, memset(), NULL, protocol, va_arg, va_end, va_start, and VOID.

Referenced by efi_wrap_bs().

◆ efi_uninstall_multiple_protocol_interfaces_wrapper()

static EFI_STATUS EFIAPI efi_uninstall_multiple_protocol_interfaces_wrapper ( EFI_HANDLE  handle,
  ... 
)
static

Wrap UninstallMultipleProtocolInterfaces()

Definition at line 1130 of file efi_wrap.c.

1130  {
1132  void *retaddr = __builtin_return_address ( 0 );
1135  va_list ap;
1136  unsigned int i;
1137  EFI_STATUS efirc;
1138 
1139  DBGC ( colour, "UninstallMultipleProtocolInterfaces ( %s",
1140  efi_handle_name ( handle ) );
1141  memset ( protocol, 0, sizeof ( protocol ) );
1142  memset ( interface, 0, sizeof ( interface ) );
1143  va_start ( ap, handle );
1144  for ( i = 0 ; ( protocol[i] = va_arg ( ap, EFI_GUID * ) ) ; i++ ) {
1145  if ( i == MAX_WRAP_MULTI ) {
1146  va_end ( ap );
1147  efirc = EFI_OUT_OF_RESOURCES;
1148  DBGC ( colour, "<FATAL: too many arguments> ) = %s "
1149  "-> %p\n", efi_status ( efirc ), retaddr );
1150  return efirc;
1151  }
1152  interface[i] = va_arg ( ap, VOID * );
1153  DBGC ( colour, ", %s, %p",
1154  efi_guid_ntoa ( protocol[i] ), interface[i] );
1155  }
1156  va_end ( ap );
1157  DBGC ( colour, " ) " );
1159  protocol[0], interface[0], protocol[1], interface[1],
1160  protocol[2], interface[2], protocol[3], interface[3],
1161  protocol[4], interface[4], protocol[5], interface[5],
1162  protocol[6], interface[6], protocol[7], interface[7],
1163  protocol[8], interface[8], protocol[9], interface[9],
1164  protocol[10], interface[10], protocol[11], interface[11],
1165  protocol[12], interface[12], protocol[13], interface[13],
1166  protocol[14], interface[14], protocol[15], interface[15],
1167  protocol[16], interface[16], protocol[17], interface[17],
1168  protocol[18], interface[18], protocol[19], interface[19],
1169  NULL );
1170  DBGC ( colour, "= %s -> %p\n",
1171  efi_status ( efirc ), retaddr );
1172  return efirc;
1173 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
#define va_end(ap)
Definition: stdarg.h:9
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
#define DBGC(...)
Definition: compiler.h:505
#define EFI_OUT_OF_RESOURCES
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:123
#define va_arg(ap, type)
Definition: stdarg.h:8
An object interface.
Definition: interface.h:124
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
Definition: UefiSpec.h:2010
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
#define VOID
Undeclared type.
Definition: Base.h:271
__builtin_va_list va_list
Definition: stdarg.h:6
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
#define va_start(ap, last)
Definition: stdarg.h:7
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define MAX_WRAP_MULTI
Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces()
Definition: efi_wrap.c:1073
void * memset(void *dest, int character, size_t len) __nonnull

References EFI_SYSTEM_TABLE::BootServices, colour, DBGC, efi_guid_ntoa(), efi_handle_name(), EFI_OUT_OF_RESOURCES, efi_status(), efi_systab, handle, MAX_WRAP_MULTI, memset(), NULL, protocol, EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces, va_arg, va_end, va_start, and VOID.

Referenced by efi_wrap_bs().

◆ efi_create_event_ex_wrapper()

static EFI_STATUS EFIAPI efi_create_event_ex_wrapper ( UINT32  type,
EFI_TPL  notify_tpl,
EFI_EVENT_NOTIFY  notify_function,
CONST VOID notify_context,
CONST EFI_GUID event_group,
EFI_EVENT event 
)
static

Wrap CreateEventEx()

Definition at line 1180 of file efi_wrap.c.

1183  {
1185  void *retaddr = __builtin_return_address ( 0 );
1186  EFI_STATUS efirc;
1187 
1188  DBGC ( colour, "CreateEventEx ( %#x, %s, %p, %p, %s ) ",
1189  type, efi_tpl_name ( notify_tpl ), notify_function,
1190  notify_context, efi_guid_ntoa ( event_group ) );
1191  efirc = bs->CreateEventEx ( type, notify_tpl, notify_function,
1192  notify_context, event_group, event );
1193  DBGC ( colour, "= %s ( %p ) -> %p\n",
1194  efi_status ( efirc ), *event, retaddr );
1195  return efirc;
1196 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:64
uint32_t type
Operating system type.
Definition: ena.h:12
#define DBGC(...)
Definition: compiler.h:505
EFI_CREATE_EVENT_EX CreateEventEx
Definition: UefiSpec.h:2022
EFI Boot Services Table.
Definition: UefiSpec.h:1930
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:702
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55

References EFI_SYSTEM_TABLE::BootServices, colour, EFI_BOOT_SERVICES::CreateEventEx, DBGC, efi_guid_ntoa(), efi_status(), efi_systab, efi_tpl_name(), and type.

Referenced by efi_wrap_bs().

◆ efi_wrap_bs()

void efi_wrap_bs ( EFI_BOOT_SERVICES wrapper)

Wrap a boot services table.

Parameters
wrapperBoot services table to wrap

Definition at line 1203 of file efi_wrap.c.

1203  {
1205 
1206  /* Do nothing unless debugging is enabled */
1207  if ( ! DBG_LOG )
1208  return;
1209 
1210  /* Build boot services table wrapper */
1211  memcpy ( wrapper, bs, sizeof ( *wrapper ) );
1212  wrapper->RaiseTPL = efi_raise_tpl_wrapper;
1215  wrapper->FreePages = efi_free_pages_wrapper;
1218  wrapper->FreePool = efi_free_pool_wrapper;
1220  wrapper->SetTimer = efi_set_timer_wrapper;
1225  wrapper->InstallProtocolInterface
1235  wrapper->InstallConfigurationTable
1237  wrapper->LoadImage = efi_load_image_wrapper;
1239  wrapper->Exit = efi_exit_wrapper;
1243  wrapper->Stall = efi_stall_wrapper;
1249  wrapper->OpenProtocolInformation
1259 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static EFI_STATUS EFIAPI efi_set_timer_wrapper(EFI_EVENT event, EFI_TIMER_DELAY type, UINT64 trigger_time)
Wrap SetTimer()
Definition: efi_wrap.c:429
static VOID EFIAPI efi_restore_tpl_wrapper(EFI_TPL old_tpl)
Wrap RestoreTPL()
Definition: efi_wrap.c:274
EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
Definition: UefiSpec.h:1988
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1939
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:2008
EFI_STALL Stall
Definition: UefiSpec.h:1987
static EFI_STATUS EFIAPI efi_reinstall_protocol_interface_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID *old_interface, VOID *new_interface)
Wrap ReinstallProtocolInterface()
Definition: efi_wrap.c:542
static EFI_STATUS EFIAPI efi_locate_handle_wrapper(EFI_LOCATE_SEARCH_TYPE search_type, EFI_GUID *protocol, VOID *search_key, UINTN *buffer_size, EFI_HANDLE *buffer)
Wrap LocateHandle()
Definition: efi_wrap.c:622
static EFI_STATUS EFIAPI efi_register_protocol_notify_wrapper(EFI_GUID *protocol, EFI_EVENT event, VOID **registration)
Wrap RegisterProtocolNotify()
Definition: efi_wrap.c:603
EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
Definition: UefiSpec.h:1965
EFI_EXIT_BOOT_SERVICES ExitBootServices
Definition: UefiSpec.h:1981
EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
Definition: UefiSpec.h:1966
EFI_IMAGE_LOAD LoadImage
Definition: UefiSpec.h:1977
static EFI_STATUS EFIAPI efi_close_protocol_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, EFI_HANDLE agent_handle, EFI_HANDLE controller_handle)
Wrap CloseProtocol()
Definition: efi_wrap.c:951
static EFI_STATUS EFIAPI efi_protocols_per_handle_wrapper(EFI_HANDLE handle, EFI_GUID ***protocol_buffer, UINTN *protocol_buffer_count)
Wrap ProtocolsPerHandle()
Definition: efi_wrap.c:997
static EFI_STATUS EFIAPI efi_handle_protocol_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID **interface)
Wrap HandleProtocol()
Definition: efi_wrap.c:584
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
Definition: UefiSpec.h:2009
static EFI_STATUS EFIAPI efi_install_configuration_table_wrapper(EFI_GUID *guid, VOID *table)
Wrap InstallConfigurationTable()
Definition: efi_wrap.c:676
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1958
EFI_SET_TIMER SetTimer
Definition: UefiSpec.h:1955
static EFI_STATUS EFIAPI efi_signal_event_wrapper(EFI_EVENT event)
Wrap SignalEvent()
Definition: efi_wrap.c:473
EFI_LOCATE_HANDLE LocateHandle
Definition: UefiSpec.h:1970
static EFI_STATUS EFIAPI efi_create_event_wrapper(UINT32 type, EFI_TPL notify_tpl, EFI_EVENT_NOTIFY notify_function, VOID *notify_context, EFI_EVENT *event)
Wrap CreateEvent()
Definition: efi_wrap.c:408
EFI_IMAGE_UNLOAD UnloadImage
Definition: UefiSpec.h:1980
static EFI_STATUS EFIAPI efi_get_next_monotonic_count_wrapper(UINT64 *count)
Wrap GetNextMonotonicCount()
Definition: efi_wrap.c:818
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:2000
EFI_CREATE_EVENT_EX CreateEventEx
Definition: UefiSpec.h:2022
static EFI_STATUS EFIAPI efi_create_event_ex_wrapper(UINT32 type, EFI_TPL notify_tpl, EFI_EVENT_NOTIFY notify_function, CONST VOID *notify_context, CONST EFI_GUID *event_group, EFI_EVENT *event)
Wrap CreateEventEx()
Definition: efi_wrap.c:1180
static EFI_STATUS EFIAPI efi_get_memory_map_wrapper(UINTN *memory_map_size, EFI_MEMORY_DESCRIPTOR *memory_map, UINTN *map_key, UINTN *descriptor_size, UINT32 *descriptor_version)
Wrap GetMemoryMap()
Definition: efi_wrap.c:328
void * memcpy(void *dest, const void *src, size_t len) __nonnull
EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
Definition: UefiSpec.h:1964
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1954
EFI_HANDLE_PROTOCOL HandleProtocol
Definition: UefiSpec.h:1967
EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
Definition: UefiSpec.h:1969
static EFI_STATUS EFIAPI efi_free_pages_wrapper(EFI_PHYSICAL_ADDRESS memory, UINTN pages)
Wrap FreePages()
Definition: efi_wrap.c:310
static EFI_STATUS EFIAPI efi_start_image_wrapper(EFI_HANDLE image_handle, UINTN *exit_data_size, CHAR16 **exit_data)
Wrap StartImage()
Definition: efi_wrap.c:725
EFI_SIGNAL_EVENT SignalEvent
Definition: UefiSpec.h:1957
EFI Boot Services Table.
Definition: UefiSpec.h:1930
static EFI_STATUS EFIAPI efi_set_watchdog_timer_wrapper(UINTN timeout, UINT64 watchdog_code, UINTN data_size, CHAR16 *watchdog_data)
Wrap SetWatchdogTimer()
Definition: efi_wrap.c:853
EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
Definition: UefiSpec.h:1986
static EFI_STATUS EFIAPI efi_install_protocol_interface_wrapper(EFI_HANDLE *handle, EFI_GUID *protocol, EFI_INTERFACE_TYPE interface_type, VOID *interface)
Wrap InstallProtocolInterface()
Definition: efi_wrap.c:520
static EFI_STATUS EFIAPI efi_open_protocol_information_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **entry_buffer, UINTN *entry_count)
Wrap OpenProtocolInformation()
Definition: efi_wrap.c:974
static EFI_STATUS EFIAPI efi_wait_for_event_wrapper(UINTN number_of_events, EFI_EVENT *event, UINTN *index)
Wrap WaitForEvent()
Definition: efi_wrap.c:449
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
Definition: UefiSpec.h:2010
EFI_CONNECT_CONTROLLER ConnectController
Definition: UefiSpec.h:1993
static EFI_STATUS EFIAPI efi_connect_controller_wrapper(EFI_HANDLE controller_handle, EFI_HANDLE *driver_image_handle, EFI_DEVICE_PATH_PROTOCOL *remaining_path, BOOLEAN recursive)
Wrap ConnectController()
Definition: efi_wrap.c:873
static EFI_STATUS EFIAPI efi_locate_protocol_wrapper(EFI_GUID *protocol, VOID *registration, VOID **interface)
Wrap LocateProtocol()
Definition: efi_wrap.c:1058
static EFI_STATUS EFIAPI efi_allocate_pages_wrapper(EFI_ALLOCATE_TYPE type, EFI_MEMORY_TYPE memory_type, UINTN pages, EFI_PHYSICAL_ADDRESS *memory)
Wrap AllocatePages()
Definition: efi_wrap.c:288
EFI_IMAGE_START StartImage
Definition: UefiSpec.h:1978
static EFI_TPL EFIAPI efi_raise_tpl_wrapper(EFI_TPL new_tpl)
Wrap RaiseTPL()
Definition: efi_wrap.c:258
static EFI_STATUS EFIAPI efi_install_multiple_protocol_interfaces_wrapper(EFI_HANDLE *handle,...)
Wrap InstallMultipleProtocolInterfaces()
Definition: efi_wrap.c:1080
static EFI_STATUS EFIAPI efi_unload_image_wrapper(EFI_HANDLE image_handle)
Wrap UnloadImage()
Definition: efi_wrap.c:771
EFI_WAIT_FOR_EVENT WaitForEvent
Definition: UefiSpec.h:1956
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:2001
static EFI_STATUS EFIAPI efi_uninstall_protocol_interface_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID *interface)
Wrap UninstallProtocolInterface()
Definition: efi_wrap.c:564
EFI_GET_MEMORY_MAP GetMemoryMap
Definition: UefiSpec.h:1947
EFI_ALLOCATE_PAGES AllocatePages
Definition: UefiSpec.h:1945
static EFI_STATUS EFIAPI efi_allocate_pool_wrapper(EFI_MEMORY_TYPE pool_type, UINTN size, VOID **buffer)
Wrap AllocatePool()
Definition: efi_wrap.c:372
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:2006
static EFI_STATUS EFIAPI efi_locate_handle_buffer_wrapper(EFI_LOCATE_SEARCH_TYPE search_type, EFI_GUID *protocol, VOID *search_key, UINTN *no_handles, EFI_HANDLE **buffer)
Wrap LocateHandleBuffer()
Definition: efi_wrap.c:1027
static EFI_STATUS EFIAPI efi_open_protocol_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID **interface, EFI_HANDLE agent_handle, EFI_HANDLE controller_handle, UINT32 attributes)
Wrap OpenProtocol()
Definition: efi_wrap.c:927
EFI_CHECK_EVENT CheckEvent
Definition: UefiSpec.h:1959
static EFI_STATUS EFIAPI efi_close_event_wrapper(EFI_EVENT event)
Wrap CloseEvent()
Definition: efi_wrap.c:489
static EFI_STATUS EFIAPI efi_load_image_wrapper(BOOLEAN boot_policy, EFI_HANDLE parent_image_handle, EFI_DEVICE_PATH_PROTOCOL *device_path, VOID *source_buffer, UINTN source_size, EFI_HANDLE *image_handle)
Wrap LoadImage()
Definition: efi_wrap.c:693
static EFI_STATUS EFIAPI efi_disconnect_controller_wrapper(EFI_HANDLE controller_handle, EFI_HANDLE driver_image_handle, EFI_HANDLE child_handle)
Wrap DisconnectController()
Definition: efi_wrap.c:904
static EFI_STATUS EFIAPI efi_locate_device_path_wrapper(EFI_GUID *protocol, EFI_DEVICE_PATH_PROTOCOL **device_path, EFI_HANDLE *device)
Wrap LocateDevicePath()
Definition: efi_wrap.c:655
static EFI_STATUS EFIAPI efi_exit_boot_services_wrapper(EFI_HANDLE image_handle, UINTN map_key)
Wrap ExitBootServices()
Definition: efi_wrap.c:788
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1999
static EFI_STATUS EFIAPI efi_exit_wrapper(EFI_HANDLE image_handle, EFI_STATUS exit_status, UINTN exit_data_size, CHAR16 *exit_data)
Wrap Exit()
Definition: efi_wrap.c:747
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1940
static EFI_STATUS EFIAPI efi_stall_wrapper(UINTN microseconds)
Wrap Stall()
Definition: efi_wrap.c:835
static EFI_STATUS EFIAPI efi_uninstall_multiple_protocol_interfaces_wrapper(EFI_HANDLE handle,...)
Wrap UninstallMultipleProtocolInterfaces()
Definition: efi_wrap.c:1130
static EFI_STATUS EFIAPI efi_check_event_wrapper(EFI_EVENT event)
Wrap CheckEvent()
Definition: efi_wrap.c:504
EFI_FREE_PAGES FreePages
Definition: UefiSpec.h:1946
#define DBG_LOG
Definition: compiler.h:317
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:2007
EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
Definition: UefiSpec.h:1972
EFI_LOCATE_DEVICE_PATH LocateDevicePath
Definition: UefiSpec.h:1971
static EFI_STATUS EFIAPI efi_free_pool_wrapper(VOID *buffer)
Wrap FreePool()
Definition: efi_wrap.c:392
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1948
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition: UefiSpec.h:1994

References EFI_BOOT_SERVICES::AllocatePages, EFI_BOOT_SERVICES::AllocatePool, EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CheckEvent, EFI_BOOT_SERVICES::CloseEvent, EFI_BOOT_SERVICES::CloseProtocol, EFI_BOOT_SERVICES::ConnectController, EFI_BOOT_SERVICES::CreateEvent, EFI_BOOT_SERVICES::CreateEventEx, DBG_LOG, EFI_BOOT_SERVICES::DisconnectController, efi_allocate_pages_wrapper(), efi_allocate_pool_wrapper(), efi_check_event_wrapper(), efi_close_event_wrapper(), efi_close_protocol_wrapper(), efi_connect_controller_wrapper(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_disconnect_controller_wrapper(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), efi_free_pages_wrapper(), efi_free_pool_wrapper(), efi_get_memory_map_wrapper(), efi_get_next_monotonic_count_wrapper(), efi_handle_protocol_wrapper(), efi_install_configuration_table_wrapper(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_load_image_wrapper(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_locate_protocol_wrapper(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_protocols_per_handle_wrapper(), efi_raise_tpl_wrapper(), efi_register_protocol_notify_wrapper(), efi_reinstall_protocol_interface_wrapper(), efi_restore_tpl_wrapper(), efi_set_timer_wrapper(), efi_set_watchdog_timer_wrapper(), efi_signal_event_wrapper(), efi_stall_wrapper(), efi_start_image_wrapper(), efi_systab, efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_unload_image_wrapper(), efi_wait_for_event_wrapper(), EFI_BOOT_SERVICES::Exit, EFI_BOOT_SERVICES::ExitBootServices, EFI_BOOT_SERVICES::FreePages, EFI_BOOT_SERVICES::FreePool, EFI_BOOT_SERVICES::GetMemoryMap, EFI_BOOT_SERVICES::GetNextMonotonicCount, EFI_BOOT_SERVICES::HandleProtocol, EFI_BOOT_SERVICES::InstallConfigurationTable, EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces, EFI_BOOT_SERVICES::InstallProtocolInterface, EFI_BOOT_SERVICES::LoadImage, EFI_BOOT_SERVICES::LocateDevicePath, EFI_BOOT_SERVICES::LocateHandle, EFI_BOOT_SERVICES::LocateHandleBuffer, EFI_BOOT_SERVICES::LocateProtocol, memcpy(), EFI_BOOT_SERVICES::OpenProtocol, EFI_BOOT_SERVICES::OpenProtocolInformation, EFI_BOOT_SERVICES::ProtocolsPerHandle, EFI_BOOT_SERVICES::RaiseTPL, EFI_BOOT_SERVICES::RegisterProtocolNotify, EFI_BOOT_SERVICES::ReinstallProtocolInterface, EFI_BOOT_SERVICES::RestoreTPL, EFI_BOOT_SERVICES::SetTimer, EFI_BOOT_SERVICES::SetWatchdogTimer, EFI_BOOT_SERVICES::SignalEvent, EFI_BOOT_SERVICES::Stall, EFI_BOOT_SERVICES::StartImage, EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces, EFI_BOOT_SERVICES::UninstallProtocolInterface, EFI_BOOT_SERVICES::UnloadImage, and EFI_BOOT_SERVICES::WaitForEvent.

Referenced by efi_wrap_systab().

◆ efi_wrap_systab()

void efi_wrap_systab ( int  global)

Wrap the public EFI system table.

Parameters
globalPatch global boot services table in-place

Definition at line 1266 of file efi_wrap.c.

1266  {
1267  static EFI_BOOT_SERVICES local;
1268  EFI_BOOT_SERVICES *wrapper;
1269 
1270  /* Do nothing unless debugging is enabled */
1271  if ( ! DBG_LOG )
1272  return;
1273 
1274  /* Preserve original system and boot services tables */
1275  if ( ! efi_systab_pub ) {
1278  memcpy ( &efi_bs_copy, efi_bs_orig, sizeof ( efi_bs_copy ) );
1279  }
1280 
1281  /* Construct and use private system table */
1282  if ( efi_systab != &efi_systab_priv ) {
1284  sizeof ( efi_systab_priv ) );
1287  }
1288 
1289  /* Wrap global or local boot services table as applicable */
1290  wrapper = ( global ? efi_bs_orig : &local );
1291  efi_wrap_bs ( wrapper );
1292  efi_systab_pub->BootServices = wrapper;
1293  DBGC ( colour, "WRAP installed %s wrappers\n",
1294  ( global ? "global" : "local" ) );
1295 }
void efi_wrap_bs(EFI_BOOT_SERVICES *wrapper)
Wrap a boot services table.
Definition: efi_wrap.c:1203
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static EFI_BOOT_SERVICES efi_bs_copy
Backup of original EFI boot services table.
Definition: efi_wrap.c:56
#define DBGC(...)
Definition: compiler.h:505
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static EFI_SYSTEM_TABLE efi_systab_priv
Private EFI system table used while wrapping is active.
Definition: efi_wrap.c:50
EFI Boot Services Table.
Definition: UefiSpec.h:1930
static EFI_BOOT_SERVICES * efi_bs_orig
Original EFI boot services table pointer.
Definition: efi_wrap.c:53
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
#define DBG_LOG
Definition: compiler.h:317
static EFI_SYSTEM_TABLE * efi_systab_pub
Public EFI system table pointer.
Definition: efi_wrap.c:47

References EFI_SYSTEM_TABLE::BootServices, colour, DBG_LOG, DBGC, efi_bs_copy, efi_bs_orig, efi_systab, efi_systab_priv, efi_systab_pub, efi_wrap_bs(), and memcpy().

Referenced by efi_wrap_image().

◆ efi_unwrap()

void efi_unwrap ( void  )

Remove boot services table wrapper.

Definition at line 1301 of file efi_wrap.c.

1301  {
1302 
1303  /* Do nothing unless debugging is enabled */
1304  if ( ! DBG_LOG )
1305  return;
1306 
1307  /* Do nothing if wrapping was never enabled */
1308  if ( ! efi_systab_pub )
1309  return;
1310 
1311  /* Restore original system and boot services tables */
1312  memcpy ( efi_bs_orig, &efi_bs_copy, sizeof ( *efi_bs_orig ) );
1314 
1315  /* Switch back to using public system table */
1317  DBGC ( colour, "WRAP uninstalled wrappers\n" );
1318 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
static EFI_BOOT_SERVICES efi_bs_copy
Backup of original EFI boot services table.
Definition: efi_wrap.c:56
#define DBGC(...)
Definition: compiler.h:505
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static EFI_BOOT_SERVICES * efi_bs_orig
Original EFI boot services table pointer.
Definition: efi_wrap.c:53
EFI_SYSTEM_TABLE * efi_systab
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
#define DBG_LOG
Definition: compiler.h:317
static EFI_SYSTEM_TABLE * efi_systab_pub
Public EFI system table pointer.
Definition: efi_wrap.c:47

References EFI_SYSTEM_TABLE::BootServices, colour, DBG_LOG, DBGC, efi_bs_copy, efi_bs_orig, efi_systab, efi_systab_pub, and memcpy().

Referenced by efi_image_exec().

◆ efi_wrap_image()

void efi_wrap_image ( EFI_HANDLE  handle)

Wrap calls made by a newly loaded image.

Parameters
handleImage handle

Definition at line 1325 of file efi_wrap.c.

1325  {
1326 
1327  /* Do nothing unless debugging is enabled */
1328  if ( ! DBG_LOG )
1329  return;
1330 
1331  /* Dump image information */
1332  efi_dump_image ( handle );
1333 
1334  /* Patch public system table */
1335  efi_wrap_systab ( 0 );
1336 }
static void efi_dump_image(EFI_HANDLE handle)
Dump information about a loaded image.
Definition: efi_wrap.c:229
void efi_wrap_systab(int global)
Wrap the public EFI system table.
Definition: efi_wrap.c:1266
#define DBG_LOG
Definition: compiler.h:317
uint16_t handle
Handle.
Definition: smbios.h:16

References DBG_LOG, efi_dump_image(), efi_wrap_systab(), and handle.

Referenced by efi_image_exec().

Variable Documentation

◆ efi_systab_pub

EFI_SYSTEM_TABLE* efi_systab_pub
static

Public EFI system table pointer.

Definition at line 47 of file efi_wrap.c.

Referenced by efi_unwrap(), and efi_wrap_systab().

◆ efi_systab_priv

EFI_SYSTEM_TABLE efi_systab_priv
static

Private EFI system table used while wrapping is active.

Definition at line 50 of file efi_wrap.c.

Referenced by efi_wrap_systab().

◆ efi_bs_orig

EFI_BOOT_SERVICES* efi_bs_orig
static

Original EFI boot services table pointer.

Definition at line 53 of file efi_wrap.c.

Referenced by efi_unwrap(), and efi_wrap_systab().

◆ efi_bs_copy

EFI_BOOT_SERVICES efi_bs_copy
static

Backup of original EFI boot services table.

Definition at line 56 of file efi_wrap.c.

Referenced by efi_unwrap(), and efi_wrap_systab().