iPXE
efi_wrap.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  *
19  * You can also choose to distribute this program under the terms of
20  * the Unmodified Binary Distribution Licence (as given in the file
21  * COPYING.UBDL), provided that you have satisfied its requirements.
22  */
23 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 
26 /**
27  * @file
28  *
29  * EFI image wrapping
30  *
31  */
32 
33 #include <string.h>
34 #include <stdio.h>
35 #include <errno.h>
36 #include <ipxe/efi/efi.h>
38 #include <ipxe/efi/efi_wrap.h>
39 
40 /** Colour for debug messages */
41 #define colour &efi_systab
42 
43 /**
44  * Convert EFI status code to text
45  *
46  * @v efirc EFI status code
47  * @ret text EFI status code text
48  */
49 static const char * efi_status ( EFI_STATUS efirc ) {
50  static char buf[ 19 /* "0xXXXXXXXXXXXXXXXX" + NUL */ ];
51 
52  switch ( efirc ) {
53  case EFI_SUCCESS : return "0";
54  case EFI_LOAD_ERROR : return "LOAD_ERROR";
55  case EFI_INVALID_PARAMETER : return "INVALID_PARAMETER";
56  case EFI_UNSUPPORTED : return "UNSUPPORTED";
57  case EFI_BAD_BUFFER_SIZE : return "BAD_BUFFER_SIZE";
58  case EFI_BUFFER_TOO_SMALL : return "BUFFER_TOO_SMALL";
59  case EFI_NOT_READY : return "NOT_READY";
60  case EFI_DEVICE_ERROR : return "DEVICE_ERROR";
61  case EFI_WRITE_PROTECTED : return "WRITE_PROTECTED";
62  case EFI_OUT_OF_RESOURCES : return "OUT_OF_RESOURCES";
63  case EFI_VOLUME_CORRUPTED : return "VOLUME_CORRUPTED";
64  case EFI_VOLUME_FULL : return "VOLUME_FULL";
65  case EFI_NO_MEDIA : return "NO_MEDIA";
66  case EFI_MEDIA_CHANGED : return "MEDIA_CHANGED";
67  case EFI_NOT_FOUND : return "NOT_FOUND";
68  case EFI_ACCESS_DENIED : return "ACCESS_DENIED";
69  case EFI_NO_RESPONSE : return "NO_RESPONSE";
70  case EFI_NO_MAPPING : return "NO_MAPPING";
71  case EFI_TIMEOUT : return "TIMEOUT";
72  case EFI_NOT_STARTED : return "NOT_STARTED";
73  case EFI_ALREADY_STARTED : return "ALREADY_STARTED";
74  case EFI_ABORTED : return "ABORTED";
75  case EFI_ICMP_ERROR : return "ICMP_ERROR";
76  case EFI_TFTP_ERROR : return "TFTP_ERROR";
77  case EFI_PROTOCOL_ERROR : return "PROTOCOL_ERROR";
78  case EFI_INCOMPATIBLE_VERSION : return "INCOMPATIBLE_VERSION";
79  case EFI_SECURITY_VIOLATION : return "SECURITY_VIOLATION";
80  case EFI_CRC_ERROR : return "CRC_ERROR";
81  case EFI_END_OF_MEDIA : return "END_OF_MEDIA";
82  case EFI_END_OF_FILE : return "END_OF_FILE";
83  case EFI_INVALID_LANGUAGE : return "INVALID_LANGUAGE";
84  case EFI_COMPROMISED_DATA : return "COMPROMISED_DATA";
85  case EFI_WARN_UNKNOWN_GLYPH : return "WARN_UNKNOWN_GLYPH";
86  case EFI_WARN_DELETE_FAILURE : return "WARN_DELETE_FAILURE";
87  case EFI_WARN_WRITE_FAILURE : return "WARN_WRITE_FAILURE";
88  case EFI_WARN_BUFFER_TOO_SMALL : return "WARN_BUFFER_TOO_SMALL";
89  case EFI_WARN_STALE_DATA : return "WARN_STALE_DATA";
90  default:
91  snprintf ( buf, sizeof ( buf ), "%#lx",
92  ( unsigned long ) efirc );
93  return buf;
94  }
95 }
96 
97 /**
98  * Convert EFI boolean to text
99  *
100  * @v boolean Boolean value
101  * @ret text Boolean value text
102  */
103 static const char * efi_boolean ( BOOLEAN boolean ) {
104 
105  return ( boolean ? "TRUE" : "FALSE" );
106 }
107 
108 /**
109  * Convert EFI TPL to text
110  *
111  * @v tpl Task priority level
112  * @ret text Task priority level as text
113  */
114 static const char * efi_tpl ( EFI_TPL tpl ) {
115  static char buf[ 19 /* "0xXXXXXXXXXXXXXXXX" + NUL */ ];
116 
117  switch ( tpl ) {
118  case TPL_APPLICATION: return "Application";
119  case TPL_CALLBACK: return "Callback";
120  case TPL_NOTIFY: return "Notify";
121  case TPL_HIGH_LEVEL: return "HighLevel";
122  default:
123  snprintf ( buf, sizeof ( buf ), "%#lx",
124  ( unsigned long ) tpl );
125  return buf;
126  }
127 }
128 
129 /**
130  * Convert EFI allocation type to text
131  *
132  * @v type Allocation type
133  * @ret text Allocation type as text
134  */
135 static const char * efi_allocate_type ( EFI_ALLOCATE_TYPE type ) {
136  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
137 
138  switch ( type ) {
139  case AllocateAnyPages: return "AnyPages";
140  case AllocateMaxAddress: return "MaxAddress";
141  case AllocateAddress: return "Address";
142  default:
143  snprintf ( buf, sizeof ( buf ), "%#x", type );
144  return buf;
145  }
146 }
147 
148 /**
149  * Convert EFI memory type to text
150  *
151  * @v type Memory type
152  * @ret text Memory type as text
153  */
154 static const char * efi_memory_type ( EFI_MEMORY_TYPE type ) {
155  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
156 
157  switch ( type ) {
158  case EfiReservedMemoryType: return "Reserved";
159  case EfiLoaderCode: return "LoaderCode";
160  case EfiLoaderData: return "LoaderData";
161  case EfiBootServicesCode: return "BootCode";
162  case EfiBootServicesData: return "BootData";
163  case EfiRuntimeServicesCode: return "RuntimeCode";
164  case EfiRuntimeServicesData: return "RuntimeData";
165  case EfiConventionalMemory: return "Conventional";
166  case EfiUnusableMemory: return "Unusable";
167  case EfiACPIReclaimMemory: return "ACPIReclaim";
168  case EfiACPIMemoryNVS: return "ACPINVS";
169  case EfiMemoryMappedIO: return "MMIO";
170  case EfiMemoryMappedIOPortSpace:return "PIO";
171  case EfiPalCode: return "PalCode";
172  case EfiPersistentMemory: return "Persistent";
173  default:
174  snprintf ( buf, sizeof ( buf ), "%#x", type );
175  return buf;
176  }
177 }
178 
179 /**
180  * Convert EFI timer delay type to text
181  *
182  * @v type Timer delay type
183  * @ret text Timer delay type as text
184  */
185 static const char * efi_timer_delay ( EFI_TIMER_DELAY type ) {
186  static char buf[ 11 /* "0xXXXXXXXX" + NUL */ ];
187 
188  switch ( type ) {
189  case TimerCancel: return "Cancel";
190  case TimerPeriodic: return "Periodic";
191  case TimerRelative: return "Relative";
192  default:
193  snprintf ( buf, sizeof ( buf ), "%#x", type );
194  return buf;
195  }
196 }
197 
198 /**
199  * Dump information about a loaded image
200  *
201  * @v handle Image handle
202  */
205  union {
207  void *intf;
208  } loaded;
209  EFI_STATUS efirc;
210  int rc;
211 
212  /* Open loaded image protocol */
213  if ( ( efirc = bs->OpenProtocol ( handle,
215  &loaded.intf, efi_image_handle, NULL,
217  rc = -EEFI ( efirc );
218  DBGC ( colour, "WRAP %s could not get loaded image protocol: "
219  "%s\n", efi_handle_name ( handle ), strerror ( rc ) );
220  return;
221  }
222 
223  /* Dump image information */
224  DBGC ( colour, "WRAP %s at base %p has protocols:\n",
225  efi_handle_name ( handle ), loaded.image->ImageBase );
227  DBGC ( colour, "WRAP %s parent", efi_handle_name ( handle ) );
228  DBGC ( colour, " %s\n", efi_handle_name ( loaded.image->ParentHandle ));
229  DBGC ( colour, "WRAP %s device", efi_handle_name ( handle ) );
230  DBGC ( colour, " %s\n", efi_handle_name ( loaded.image->DeviceHandle ));
231  DBGC ( colour, "WRAP %s file", efi_handle_name ( handle ) );
232  DBGC ( colour, " %s\n", efi_devpath_text ( loaded.image->FilePath ) );
233 
234  /* Close loaded image protocol */
237 }
238 
239 /**
240  * Wrap RaiseTPL()
241  *
242  */
243 static EFI_TPL EFIAPI
246  void *retaddr = __builtin_return_address ( 0 );
247  EFI_TPL old_tpl;
248 
249  DBGCP ( colour, "RaiseTPL ( %s ) ", efi_tpl ( new_tpl ) );
250  old_tpl = bs->RaiseTPL ( new_tpl );
251  DBGCP ( colour, "= %s -> %p\n", efi_tpl ( old_tpl ), retaddr );
252  return old_tpl;
253 }
254 
255 /**
256  * Wrap RestoreTPL()
257  *
258  */
259 static VOID EFIAPI
262  void *retaddr = __builtin_return_address ( 0 );
263 
264  DBGCP ( colour, "RestoreTPL ( %s ) ", efi_tpl ( old_tpl ) );
265  bs->RestoreTPL ( old_tpl );
266  DBGCP ( colour, "-> %p\n", retaddr );
267 }
268 
269 /**
270  * Wrap AllocatePages()
271  *
272  */
273 static EFI_STATUS EFIAPI
275  EFI_MEMORY_TYPE memory_type, UINTN pages,
276  EFI_PHYSICAL_ADDRESS *memory ) {
278  void *retaddr = __builtin_return_address ( 0 );
279  EFI_STATUS efirc;
280 
281  DBGC2 ( colour, "AllocatePages ( %s, %s, %#llx, %#llx ) ",
282  efi_allocate_type ( type ), efi_memory_type ( memory_type ),
283  ( ( unsigned long long ) pages ),
284  ( ( unsigned long long ) *memory ) );
285  efirc = bs->AllocatePages ( type, memory_type, pages, memory );
286  DBGC2 ( colour, "= %s ( %#llx ) -> %p\n", efi_status ( efirc ),
287  ( ( unsigned long long ) *memory ), retaddr );
288  return efirc;
289 }
290 
291 /**
292  * Wrap FreePages()
293  *
294  */
295 static EFI_STATUS EFIAPI
298  void *retaddr = __builtin_return_address ( 0 );
299  EFI_STATUS efirc;
300 
301  DBGC2 ( colour, "FreePages ( %#llx, %#llx ) ",
302  ( ( unsigned long long ) memory ),
303  ( ( unsigned long long ) pages ) );
304  efirc = bs->FreePages ( memory, pages );
305  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
306  return efirc;
307 }
308 
309 /**
310  * Wrap GetMemoryMap()
311  *
312  */
313 static EFI_STATUS EFIAPI
316  UINTN *descriptor_size,
317  UINT32 *descriptor_version ) {
319  void *retaddr = __builtin_return_address ( 0 );
320  EFI_MEMORY_DESCRIPTOR *desc;
321  size_t remaining;
322  EFI_STATUS efirc;
323 
324  DBGC ( colour, "GetMemoryMap ( %#llx, %p ) ",
325  ( ( unsigned long long ) *memory_map_size ), memory_map );
326  efirc = bs->GetMemoryMap ( memory_map_size, memory_map, map_key,
327  descriptor_size, descriptor_version );
328  DBGC ( colour, "= %s ( %#llx, %#llx, %#llx, v%d",
329  efi_status ( efirc ),
330  ( ( unsigned long long ) *memory_map_size ),
331  ( ( unsigned long long ) *map_key ),
332  ( ( unsigned long long ) *descriptor_size ),
333  *descriptor_version );
334  if ( DBG_EXTRA && ( efirc == 0 ) ) {
335  DBGC2 ( colour, ",\n" );
336  for ( desc = memory_map, remaining = *memory_map_size ;
337  remaining >= *descriptor_size ;
338  desc = ( ( ( void * ) desc ) + *descriptor_size ),
339  remaining -= *descriptor_size ) {
340  DBGC2 ( colour, "%#016llx+%#08llx %#016llx "
341  "%s\n", desc->PhysicalStart,
342  ( desc->NumberOfPages * EFI_PAGE_SIZE ),
343  desc->Attribute,
344  efi_memory_type ( desc->Type ) );
345  }
346  } else {
347  DBGC ( colour, " " );
348  }
349  DBGC ( colour, ") -> %p\n", retaddr );
350  return efirc;
351 }
352 
353 /**
354  * Wrap AllocatePool()
355  *
356  */
357 static EFI_STATUS EFIAPI
359  VOID **buffer ) {
361  void *retaddr = __builtin_return_address ( 0 );
362  EFI_STATUS efirc;
363 
364  DBGC2 ( colour, "AllocatePool ( %s, %#llx ) ",
365  efi_memory_type ( pool_type ),
366  ( ( unsigned long long ) size ) );
367  efirc = bs->AllocatePool ( pool_type, size, buffer );
368  DBGC2 ( colour, "= %s ( %p ) -> %p\n",
369  efi_status ( efirc ), *buffer, retaddr );
370  return efirc;
371 }
372 
373 /**
374  * Wrap FreePool()
375  *
376  */
377 static EFI_STATUS EFIAPI
380  void *retaddr = __builtin_return_address ( 0 );
381  EFI_STATUS efirc;
382 
383  DBGC2 ( colour, "FreePool ( %p ) ", buffer );
384  efirc = bs->FreePool ( buffer );
385  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
386  return efirc;
387 }
388 
389 /**
390  * Wrap CreateEvent()
391  *
392  */
393 static EFI_STATUS EFIAPI
395  EFI_EVENT_NOTIFY notify_function,
396  VOID *notify_context, EFI_EVENT *event ) {
398  void *retaddr = __builtin_return_address ( 0 );
399  EFI_STATUS efirc;
400 
401  DBGC ( colour, "CreateEvent ( %#x, %s, %p, %p ) ",
402  type, efi_tpl ( notify_tpl ), notify_function, notify_context );
403  efirc = bs->CreateEvent ( type, notify_tpl, notify_function,
404  notify_context, event );
405  DBGC ( colour, "= %s ( %p ) -> %p\n",
406  efi_status ( efirc ), *event, retaddr );
407  return efirc;
408 }
409 
410 /**
411  * Wrap SetTimer()
412  *
413  */
414 static EFI_STATUS EFIAPI
416  UINT64 trigger_time ) {
418  void *retaddr = __builtin_return_address ( 0 );
419  EFI_STATUS efirc;
420 
421  DBGC ( colour, "SetTimer ( %p, %s, %ld.%07ld00s ) ",
422  event, efi_timer_delay ( type ),
423  ( ( unsigned long ) ( trigger_time / 10000000 ) ),
424  ( ( unsigned long ) ( trigger_time % 10000000 ) ) );
425  efirc = bs->SetTimer ( event, type, trigger_time );
426  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
427  return efirc;
428 }
429 
430 /**
431  * Wrap WaitForEvent()
432  *
433  */
434 static EFI_STATUS EFIAPI
435 efi_wait_for_event_wrapper ( UINTN number_of_events, EFI_EVENT *event,
436  UINTN *index ) {
438  void *retaddr = __builtin_return_address ( 0 );
439  unsigned int i;
440  EFI_STATUS efirc;
441 
442  DBGC ( colour, "WaitForEvent (" );
443  for ( i = 0 ; i < number_of_events ; i++ )
444  DBGC ( colour, " %p", event[i] );
445  DBGC ( colour, " ) " );
446  efirc = bs->WaitForEvent ( number_of_events, event, index );
447  DBGC ( colour, "= %s", efi_status ( efirc ) );
448  if ( efirc == 0 )
449  DBGC ( colour, " ( %p )", event[*index] );
450  DBGC ( colour, " -> %p\n", retaddr );
451  return efirc;
452 }
453 
454 /**
455  * Wrap SignalEvent()
456  *
457  */
458 static EFI_STATUS EFIAPI
461  void *retaddr = __builtin_return_address ( 0 );
462  EFI_STATUS efirc;
463 
464  DBGC2 ( colour, "SignalEvent ( %p ) ", event );
465  efirc = bs->SignalEvent ( event );
466  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
467  return efirc;
468 }
469 
470 /**
471  * Wrap CloseEvent()
472  *
473  */
474 static EFI_STATUS EFIAPI
477  void *retaddr = __builtin_return_address ( 0 );
478  EFI_STATUS efirc;
479 
480  DBGC ( colour, "CloseEvent ( %p ) ", event );
481  efirc = bs->SignalEvent ( event );
482  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
483  return efirc;
484 }
485 /**
486  * Wrap CheckEvent()
487  *
488  */
489 static EFI_STATUS EFIAPI
492  void *retaddr = __builtin_return_address ( 0 );
493  EFI_STATUS efirc;
494 
495  DBGCP ( colour, "CheckEvent ( %p ) ", event );
496  efirc = bs->SignalEvent ( event );
497  DBGCP ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
498  return efirc;
499 }
500 
501 /**
502  * Wrap InstallProtocolInterface()
503  *
504  */
505 static EFI_STATUS EFIAPI
508  VOID *interface ) {
510  void *retaddr = __builtin_return_address ( 0 );
511  EFI_STATUS efirc;
512 
513  DBGC ( colour, "InstallProtocolInterface ( %s, %s, %d, %p ) ",
517  interface );
518  DBGC ( colour, "= %s ( %s ) -> %p\n",
519  efi_status ( efirc ), efi_handle_name ( *handle ), retaddr );
520  return efirc;
521 }
522 
523 /**
524  * Wrap ReinstallProtocolInterface()
525  *
526  */
527 static EFI_STATUS EFIAPI
530  VOID *old_interface,
531  VOID *new_interface ) {
533  void *retaddr = __builtin_return_address ( 0 );
534  EFI_STATUS efirc;
535 
536  DBGC ( colour, "ReinstallProtocolInterface ( %s, %s, %p, %p ) ",
538  old_interface, new_interface );
540  old_interface, new_interface );
541  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
542  return efirc;
543 }
544 
545 /**
546  * Wrap UninstallProtocolInterface()
547  *
548  */
549 static EFI_STATUS EFIAPI
552  VOID *interface ) {
554  void *retaddr = __builtin_return_address ( 0 );
555  EFI_STATUS efirc;
556 
557  DBGC ( colour, "UninstallProtocolInterface ( %s, %s, %p ) ",
559  interface );
561  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
562  return efirc;
563 }
564 
565 /**
566  * Wrap HandleProtocol()
567  *
568  */
569 static EFI_STATUS EFIAPI
571  VOID **interface ) {
573  void *retaddr = __builtin_return_address ( 0 );
574  EFI_STATUS efirc;
575 
576  DBGC ( colour, "HandleProtocol ( %s, %s ) ",
578  efirc = bs->HandleProtocol ( handle, protocol, interface );
579  DBGC ( colour, "= %s ( %p ) -> %p\n",
580  efi_status ( efirc ), *interface, retaddr );
581  return efirc;
582 }
583 
584 /**
585  * Wrap RegisterProtocolNotify()
586  *
587  */
588 static EFI_STATUS EFIAPI
590  VOID **registration ) {
592  void *retaddr = __builtin_return_address ( 0 );
593  EFI_STATUS efirc;
594 
595  DBGC ( colour, "RegisterProtocolNotify ( %s, %p ) ",
596  efi_guid_ntoa ( protocol ), event );
597  efirc = bs->RegisterProtocolNotify ( protocol, event, registration );
598  DBGC ( colour, "= %s ( %p ) -> %p\n",
599  efi_status ( efirc ), *registration, retaddr );
600  return efirc;
601 }
602 
603 /**
604  * Wrap LocateHandle()
605  *
606  */
607 static EFI_STATUS EFIAPI
609  EFI_GUID *protocol, VOID *search_key,
612  void *retaddr = __builtin_return_address ( 0 );
613  unsigned int i;
614  EFI_STATUS efirc;
615 
616  DBGC ( colour, "LocateHandle ( %s, %s, %p, %zd ) ",
617  efi_locate_search_type_name ( search_type ),
618  efi_guid_ntoa ( protocol ), search_key,
619  ( ( size_t ) *buffer_size ) );
620  efirc = bs->LocateHandle ( search_type, protocol, search_key,
621  buffer_size, buffer );
622  DBGC ( colour, "= %s ( %zd", efi_status ( efirc ),
623  ( ( size_t ) *buffer_size ) );
624  if ( efirc == 0 ) {
625  DBGC ( colour, ", {" );
626  for ( i = 0; i < ( *buffer_size / sizeof ( buffer[0] ) ); i++ ){
627  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
628  efi_handle_name ( buffer[i] ) );
629  }
630  DBGC ( colour, " }" );
631  }
632  DBGC ( colour, " ) -> %p\n", retaddr );
633  return efirc;
634 }
635 
636 /**
637  * Wrap LocateDevicePath()
638  *
639  */
640 static EFI_STATUS EFIAPI
643  EFI_HANDLE *device ) {
645  void *retaddr = __builtin_return_address ( 0 );
646  EFI_STATUS efirc;
647 
648  DBGC ( colour, "LocateDevicePath ( %s, %s ) ",
650  efirc = bs->LocateDevicePath ( protocol, device_path, device );
651  DBGC ( colour, "= %s ( %s, ",
652  efi_status ( efirc ), efi_devpath_text ( *device_path ) );
653  DBGC ( colour, "%s ) -> %p\n", efi_handle_name ( *device ), retaddr );
654  return efirc;
655 }
656 
657 /**
658  * Wrap InstallConfigurationTable()
659  *
660  */
661 static EFI_STATUS EFIAPI
664  void *retaddr = __builtin_return_address ( 0 );
665  EFI_STATUS efirc;
666 
667  DBGC ( colour, "InstallConfigurationTable ( %s, %p ) ",
668  efi_guid_ntoa ( guid ), table );
669  efirc = bs->InstallConfigurationTable ( guid, table );
670  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
671  return efirc;
672 }
673 
674 /**
675  * Wrap LoadImage()
676  *
677  */
678 static EFI_STATUS EFIAPI
679 efi_load_image_wrapper ( BOOLEAN boot_policy, EFI_HANDLE parent_image_handle,
681  VOID *source_buffer, UINTN source_size,
682  EFI_HANDLE *image_handle ) {
684  void *retaddr = __builtin_return_address ( 0 );
685  EFI_STATUS efirc;
686 
687  DBGC ( colour, "LoadImage ( %s, %s, ", efi_boolean ( boot_policy ),
688  efi_handle_name ( parent_image_handle ) );
689  DBGC ( colour, "%s, %p, %#llx ) ",
690  efi_devpath_text ( device_path ), source_buffer,
691  ( ( unsigned long long ) source_size ) );
692  efirc = bs->LoadImage ( boot_policy, parent_image_handle, device_path,
693  source_buffer, source_size, image_handle );
694  DBGC ( colour, "= %s ( ", efi_status ( efirc ) );
695  if ( efirc == 0 )
696  DBGC ( colour, "%s ", efi_handle_name ( *image_handle ) );
697  DBGC ( colour, ") -> %p\n", retaddr );
698 
699  /* Dump information about loaded image */
700  if ( efirc == 0 )
701  efi_dump_image ( *image_handle );
702 
703  return efirc;
704 }
705 
706 /**
707  * Wrap StartImage()
708  *
709  */
710 static EFI_STATUS EFIAPI
711 efi_start_image_wrapper ( EFI_HANDLE image_handle, UINTN *exit_data_size,
712  CHAR16 **exit_data ) {
714  void *retaddr = __builtin_return_address ( 0 );
715  EFI_STATUS efirc;
716 
717  DBGC ( colour, "StartImage ( %s ) ", efi_handle_name ( image_handle ) );
718  efirc = bs->StartImage ( image_handle, exit_data_size, exit_data );
719  DBGC ( colour, "= %s", efi_status ( efirc ) );
720  if ( ( efirc != 0 ) && exit_data && *exit_data_size )
721  DBGC ( colour, " ( \"%ls\" )", *exit_data );
722  DBGC ( colour, " -> %p\n", retaddr );
723  if ( ( efirc != 0 ) && exit_data && *exit_data_size )
724  DBGC_HD ( colour, *exit_data, *exit_data_size );
725  return efirc;
726 }
727 
728 /**
729  * Wrap Exit()
730  *
731  */
732 static EFI_STATUS EFIAPI
733 efi_exit_wrapper ( EFI_HANDLE image_handle, EFI_STATUS exit_status,
734  UINTN exit_data_size, CHAR16 *exit_data ) {
736  void *retaddr = __builtin_return_address ( 0 );
737  EFI_STATUS efirc;
738 
739  if ( ( exit_status != 0 ) && exit_data && exit_data_size )
740  DBGC_HD ( colour, exit_data, exit_data_size );
741  DBGC ( colour, "Exit ( %s, %s",
742  efi_handle_name ( image_handle ), efi_status ( exit_status ) );
743  if ( ( exit_status != 0 ) && exit_data && exit_data_size )
744  DBGC ( colour, ", \"%ls\"", exit_data );
745  DBGC ( colour, " ) " );
746  efirc = bs->Exit ( image_handle, exit_status, exit_data_size,
747  exit_data );
748  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
749  return efirc;
750 }
751 
752 /**
753  * Wrap UnloadImage()
754  *
755  */
756 static EFI_STATUS EFIAPI
759  void *retaddr = __builtin_return_address ( 0 );
760  EFI_STATUS efirc;
761 
762  DBGC ( colour, "UnloadImage ( %s ) ",
763  efi_handle_name ( image_handle ) );
764  efirc = bs->UnloadImage ( image_handle );
765  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
766  return efirc;
767 }
768 
769 /**
770  * Wrap ExitBootServices()
771  *
772  */
773 static EFI_STATUS EFIAPI
776  void *retaddr = __builtin_return_address ( 0 );
777  EFI_STATUS efirc;
778 
779  DBGC ( colour, "ExitBootServices ( %s, %#llx ) -> %p\n",
780  efi_handle_name ( image_handle ),
781  ( ( unsigned long long ) map_key ), retaddr );
782  efirc = bs->ExitBootServices ( image_handle, map_key );
783  if ( efirc != 0 ) {
784  DBGC ( colour, "ExitBootServices ( ... ) = %s -> %p\n",
785  efi_status ( efirc ), retaddr );
786  }
787  return efirc;
788 }
789 
790 /**
791  * Wrap GetNextMonotonicCount()
792  *
793  */
794 static EFI_STATUS EFIAPI
797  void *retaddr = __builtin_return_address ( 0 );
798  EFI_STATUS efirc;
799 
800  DBGCP ( colour, "GetNextMonotonicCount() " );
801  efirc = bs->GetNextMonotonicCount ( count );
802  DBGCP ( colour, "= %s ( %#llx ) -> %p\n",
803  efi_status ( efirc ), *count, retaddr );
804  return efirc;
805 }
806 
807 /**
808  * Wrap Stall()
809  *
810  */
811 static EFI_STATUS EFIAPI
812 efi_stall_wrapper ( UINTN microseconds ) {
814  void *retaddr = __builtin_return_address ( 0 );
815  EFI_STATUS efirc;
816 
817  DBGC2 ( colour, "Stall ( %ld.%06lds ) ",
818  ( ( unsigned long ) ( microseconds / 1000000 ) ),
819  ( ( unsigned long ) ( microseconds % 1000000 ) ) );
820  efirc = bs->Stall ( microseconds );
821  DBGC2 ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
822  return efirc;
823 }
824 
825 /**
826  * Wrap SetWatchdogTimer()
827  *
828  */
829 static EFI_STATUS EFIAPI
831  UINTN data_size, CHAR16 *watchdog_data ) {
833  void *retaddr = __builtin_return_address ( 0 );
834  EFI_STATUS efirc;
835 
836  DBGC ( colour, "SetWatchdogTimer ( %lds, %#llx, %#llx, %p ) ",
837  ( ( unsigned long ) timeout ), watchdog_code,
838  ( ( unsigned long long ) data_size ), watchdog_data );
839  efirc = bs->SetWatchdogTimer ( timeout, watchdog_code, data_size,
840  watchdog_data );
841  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
842  return efirc;
843 }
844 
845 /**
846  * Wrap ConnectController()
847  *
848  */
849 static EFI_STATUS EFIAPI
851  EFI_HANDLE *driver_image_handle,
852  EFI_DEVICE_PATH_PROTOCOL *remaining_path,
853  BOOLEAN recursive ) {
855  void *retaddr = __builtin_return_address ( 0 );
856  EFI_HANDLE *tmp;
857  EFI_STATUS efirc;
858 
859  DBGC ( colour, "ConnectController ( %s, {",
860  efi_handle_name ( controller_handle ) );
861  if ( driver_image_handle ) {
862  for ( tmp = driver_image_handle ; *tmp ; tmp++ ) {
863  DBGC ( colour, "%s%s",
864  ( ( tmp == driver_image_handle ) ? " " : ", " ),
865  efi_handle_name ( *tmp ) );
866  }
867  }
868  DBGC ( colour, " }, %s, %s ) ", efi_devpath_text ( remaining_path ),
869  efi_boolean ( recursive ) );
870  efirc = bs->ConnectController ( controller_handle, driver_image_handle,
871  remaining_path, recursive );
872  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
873  return efirc;
874 }
875 
876 /**
877  * Wrap DisconnectController()
878  *
879  */
880 static EFI_STATUS EFIAPI
882  EFI_HANDLE driver_image_handle,
883  EFI_HANDLE child_handle ) {
885  void *retaddr = __builtin_return_address ( 0 );
886  EFI_STATUS efirc;
887 
888  DBGC ( colour, "DisconnectController ( %s",
889  efi_handle_name ( controller_handle ) );
890  DBGC ( colour, ", %s", efi_handle_name ( driver_image_handle ) );
891  DBGC ( colour, ", %s ) ", efi_handle_name ( child_handle ) );
892  efirc = bs->DisconnectController ( controller_handle,
893  driver_image_handle,
894  child_handle );
895  DBGC ( colour, "= %s -> %p\n", efi_status ( efirc ), retaddr );
896  return efirc;
897 }
898 
899 /**
900  * Wrap OpenProtocol()
901  *
902  */
903 static EFI_STATUS EFIAPI
905  VOID **interface, EFI_HANDLE agent_handle,
906  EFI_HANDLE controller_handle, UINT32 attributes ) {
908  void *retaddr = __builtin_return_address ( 0 );
909  EFI_STATUS efirc;
910 
911  DBGC ( colour, "OpenProtocol ( %s, %s, ",
913  DBGC ( colour, "%s, ", efi_handle_name ( agent_handle ) );
914  DBGC ( colour, "%s, %s ) ", efi_handle_name ( controller_handle ),
915  efi_open_attributes_name ( attributes ) );
916  efirc = bs->OpenProtocol ( handle, protocol, interface, agent_handle,
917  controller_handle, attributes );
918  DBGC ( colour, "= %s ( %p ) -> %p\n",
919  efi_status ( efirc ), *interface, retaddr );
920  return efirc;
921 }
922 
923 /**
924  * Wrap CloseProtocol()
925  *
926  */
927 static EFI_STATUS EFIAPI
929  EFI_HANDLE agent_handle,
930  EFI_HANDLE controller_handle ) {
932  void *retaddr = __builtin_return_address ( 0 );
933  EFI_STATUS efirc;
934 
935  DBGC ( colour, "CloseProtocol ( %s, %s, ",
937  DBGC ( colour, "%s, ", efi_handle_name ( agent_handle ) );
938  DBGC ( colour, "%s ) ", efi_handle_name ( controller_handle ) );
939  efirc = bs->CloseProtocol ( handle, protocol, agent_handle,
940  controller_handle );
941  DBGC ( colour, "= %s -> %p\n",
942  efi_status ( efirc ), retaddr );
943  return efirc;
944 }
945 
946 /**
947  * Wrap OpenProtocolInformation()
948  *
949  */
950 static EFI_STATUS EFIAPI
953  **entry_buffer,
954  UINTN *entry_count ) {
956  void *retaddr = __builtin_return_address ( 0 );
957  EFI_STATUS efirc;
958 
959  DBGC ( colour, "OpenProtocolInformation ( %s, %s ) ",
961  efirc = bs->OpenProtocolInformation ( handle, protocol, entry_buffer,
962  entry_count );
963  DBGC ( colour, "= %s ( %p, %#llx ) -> %p\n",
964  efi_status ( efirc ), *entry_buffer,
965  ( ( unsigned long long ) *entry_count ), retaddr );
966  return efirc;
967 }
968 
969 /**
970  * Wrap ProtocolsPerHandle()
971  *
972  */
973 static EFI_STATUS EFIAPI
975  EFI_GUID ***protocol_buffer,
976  UINTN *protocol_buffer_count ) {
978  void *retaddr = __builtin_return_address ( 0 );
979  unsigned int i;
980  EFI_STATUS efirc;
981 
982  DBGC ( colour, "ProtocolsPerHandle ( %s ) ",
983  efi_handle_name ( handle ) );
984  efirc = bs->ProtocolsPerHandle ( handle, protocol_buffer,
985  protocol_buffer_count );
986  DBGC ( colour, "= %s", efi_status ( efirc ) );
987  if ( efirc == 0 ) {
988  DBGC ( colour, " ( {" );
989  for ( i = 0 ; i < *protocol_buffer_count ; i++ ) {
990  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
991  efi_guid_ntoa ( (*protocol_buffer)[i] ) );
992  }
993  DBGC ( colour, " } )" );
994  }
995  DBGC ( colour, " -> %p\n", retaddr );
996  return efirc;
997 }
998 
999 /**
1000  * Wrap LocateHandleBuffer()
1001  *
1002  */
1003 static EFI_STATUS EFIAPI
1005  EFI_GUID *protocol, VOID *search_key,
1006  UINTN *no_handles, EFI_HANDLE **buffer ) {
1008  void *retaddr = __builtin_return_address ( 0 );
1009  unsigned int i;
1010  EFI_STATUS efirc;
1011 
1012  DBGC ( colour, "LocateHandleBuffer ( %s, %s, %p ) ",
1013  efi_locate_search_type_name ( search_type ),
1014  efi_guid_ntoa ( protocol ), search_key );
1015  efirc = bs->LocateHandleBuffer ( search_type, protocol, search_key,
1016  no_handles, buffer );
1017  DBGC ( colour, "= %s", efi_status ( efirc ) );
1018  if ( efirc == 0 ) {
1019  DBGC ( colour, " ( %d, {", ( ( unsigned int ) *no_handles ) );
1020  for ( i = 0 ; i < *no_handles ; i++ ) {
1021  DBGC ( colour, "%s%s", ( i ? ", " : " " ),
1022  efi_handle_name ( (*buffer)[i] ) );
1023  }
1024  DBGC ( colour, " } )" );
1025  }
1026  DBGC ( colour, " -> %p\n", retaddr );
1027  return efirc;
1028 }
1029 
1030 /**
1031  * Wrap LocateProtocol()
1032  *
1033  */
1034 static EFI_STATUS EFIAPI
1036  VOID **interface ) {
1038  void *retaddr = __builtin_return_address ( 0 );
1039  EFI_STATUS efirc;
1040 
1041  DBGC ( colour, "LocateProtocol ( %s, %p ) ",
1042  efi_guid_ntoa ( protocol ), registration );
1043  efirc = bs->LocateProtocol ( protocol, registration, interface );
1044  DBGC ( colour, "= %s ( %p ) -> %p\n",
1045  efi_status ( efirc ), *interface, retaddr );
1046  return efirc;
1047 }
1048 
1049 /** Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces() */
1050 #define MAX_WRAP_MULTI 20
1051 
1052 /**
1053  * Wrap InstallMultipleProtocolInterfaces()
1054  *
1055  */
1056 static EFI_STATUS EFIAPI
1059  void *retaddr = __builtin_return_address ( 0 );
1062  VA_LIST ap;
1063  unsigned int i;
1064  EFI_STATUS efirc;
1065 
1066  DBGC ( colour, "InstallMultipleProtocolInterfaces ( %s",
1067  efi_handle_name ( *handle ) );
1068  memset ( protocol, 0, sizeof ( protocol ) );
1069  memset ( interface, 0, sizeof ( interface ) );
1070  VA_START ( ap, handle );
1071  for ( i = 0 ; ( protocol[i] = VA_ARG ( ap, EFI_GUID * ) ) ; i++ ) {
1072  if ( i == MAX_WRAP_MULTI ) {
1073  VA_END ( ap );
1074  efirc = EFI_OUT_OF_RESOURCES;
1075  DBGC ( colour, "<FATAL: too many arguments> ) = %s "
1076  "-> %p\n", efi_status ( efirc ), retaddr );
1077  return efirc;
1078  }
1079  interface[i] = VA_ARG ( ap, VOID * );
1080  DBGC ( colour, ", %s, %p",
1081  efi_guid_ntoa ( protocol[i] ), interface[i] );
1082  }
1083  VA_END ( ap );
1084  DBGC ( colour, " ) " );
1086  protocol[0], interface[0], protocol[1], interface[1],
1087  protocol[2], interface[2], protocol[3], interface[3],
1088  protocol[4], interface[4], protocol[5], interface[5],
1089  protocol[6], interface[6], protocol[7], interface[7],
1090  protocol[8], interface[8], protocol[9], interface[9],
1091  protocol[10], interface[10], protocol[11], interface[11],
1092  protocol[12], interface[12], protocol[13], interface[13],
1093  protocol[14], interface[14], protocol[15], interface[15],
1094  protocol[16], interface[16], protocol[17], interface[17],
1095  protocol[18], interface[18], protocol[19], interface[19],
1096  NULL );
1097  DBGC ( colour, "= %s ( %s ) -> %p\n",
1098  efi_status ( efirc ), efi_handle_name ( *handle ), retaddr );
1099  return efirc;
1100 }
1101 
1102 /**
1103  * Wrap UninstallMultipleProtocolInterfaces()
1104  *
1105  */
1106 static EFI_STATUS EFIAPI
1109  void *retaddr = __builtin_return_address ( 0 );
1112  VA_LIST ap;
1113  unsigned int i;
1114  EFI_STATUS efirc;
1115 
1116  DBGC ( colour, "UninstallMultipleProtocolInterfaces ( %s",
1117  efi_handle_name ( handle ) );
1118  memset ( protocol, 0, sizeof ( protocol ) );
1119  memset ( interface, 0, sizeof ( interface ) );
1120  VA_START ( ap, handle );
1121  for ( i = 0 ; ( protocol[i] = VA_ARG ( ap, EFI_GUID * ) ) ; i++ ) {
1122  if ( i == MAX_WRAP_MULTI ) {
1123  VA_END ( ap );
1124  efirc = EFI_OUT_OF_RESOURCES;
1125  DBGC ( colour, "<FATAL: too many arguments> ) = %s "
1126  "-> %p\n", efi_status ( efirc ), retaddr );
1127  return efirc;
1128  }
1129  interface[i] = VA_ARG ( ap, VOID * );
1130  DBGC ( colour, ", %s, %p",
1131  efi_guid_ntoa ( protocol[i] ), interface[i] );
1132  }
1133  VA_END ( ap );
1134  DBGC ( colour, " ) " );
1136  protocol[0], interface[0], protocol[1], interface[1],
1137  protocol[2], interface[2], protocol[3], interface[3],
1138  protocol[4], interface[4], protocol[5], interface[5],
1139  protocol[6], interface[6], protocol[7], interface[7],
1140  protocol[8], interface[8], protocol[9], interface[9],
1141  protocol[10], interface[10], protocol[11], interface[11],
1142  protocol[12], interface[12], protocol[13], interface[13],
1143  protocol[14], interface[14], protocol[15], interface[15],
1144  protocol[16], interface[16], protocol[17], interface[17],
1145  protocol[18], interface[18], protocol[19], interface[19],
1146  NULL );
1147  DBGC ( colour, "= %s -> %p\n",
1148  efi_status ( efirc ), retaddr );
1149  return efirc;
1150 }
1151 
1152 /**
1153  * Wrap CreateEventEx()
1154  *
1155  */
1156 static EFI_STATUS EFIAPI
1158  EFI_EVENT_NOTIFY notify_function,
1159  CONST VOID *notify_context,
1160  CONST EFI_GUID *event_group, EFI_EVENT *event ) {
1162  void *retaddr = __builtin_return_address ( 0 );
1163  EFI_STATUS efirc;
1164 
1165  DBGC ( colour, "CreateEventEx ( %#x, %s, %p, %p, %s ) ",
1166  type, efi_tpl ( notify_tpl ), notify_function, notify_context,
1167  efi_guid_ntoa ( event_group ) );
1168  efirc = bs->CreateEventEx ( type, notify_tpl, notify_function,
1169  notify_context, event_group, event );
1170  DBGC ( colour, "= %s ( %p ) -> %p\n",
1171  efi_status ( efirc ), *event, retaddr );
1172  return efirc;
1173 }
1174 
1175 /**
1176  * Build boot services table wrapper
1177  *
1178  * @ret bs Wrapped boot services table
1179  */
1181  static EFI_BOOT_SERVICES efi_bs_wrapper;
1183 
1184  /* Build boot services table wrapper */
1185  memcpy ( &efi_bs_wrapper, bs, sizeof ( efi_bs_wrapper ) );
1186  efi_bs_wrapper.RaiseTPL = efi_raise_tpl_wrapper;
1187  efi_bs_wrapper.RestoreTPL = efi_restore_tpl_wrapper;
1188  efi_bs_wrapper.AllocatePages = efi_allocate_pages_wrapper;
1189  efi_bs_wrapper.FreePages = efi_free_pages_wrapper;
1190  efi_bs_wrapper.GetMemoryMap = efi_get_memory_map_wrapper;
1191  efi_bs_wrapper.AllocatePool = efi_allocate_pool_wrapper;
1192  efi_bs_wrapper.FreePool = efi_free_pool_wrapper;
1193  efi_bs_wrapper.CreateEvent = efi_create_event_wrapper;
1194  efi_bs_wrapper.SetTimer = efi_set_timer_wrapper;
1195  efi_bs_wrapper.WaitForEvent = efi_wait_for_event_wrapper;
1196  efi_bs_wrapper.SignalEvent = efi_signal_event_wrapper;
1197  efi_bs_wrapper.CloseEvent = efi_close_event_wrapper;
1198  efi_bs_wrapper.CheckEvent = efi_check_event_wrapper;
1199  efi_bs_wrapper.InstallProtocolInterface
1201  efi_bs_wrapper.ReinstallProtocolInterface
1203  efi_bs_wrapper.UninstallProtocolInterface
1206  efi_bs_wrapper.RegisterProtocolNotify
1208  efi_bs_wrapper.LocateHandle = efi_locate_handle_wrapper;
1210  efi_bs_wrapper.InstallConfigurationTable
1212  efi_bs_wrapper.LoadImage = efi_load_image_wrapper;
1213  efi_bs_wrapper.StartImage = efi_start_image_wrapper;
1214  efi_bs_wrapper.Exit = efi_exit_wrapper;
1215  efi_bs_wrapper.UnloadImage = efi_unload_image_wrapper;
1217  efi_bs_wrapper.GetNextMonotonicCount
1219  efi_bs_wrapper.Stall = efi_stall_wrapper;
1221  efi_bs_wrapper.ConnectController
1223  efi_bs_wrapper.DisconnectController
1225  efi_bs_wrapper.OpenProtocol = efi_open_protocol_wrapper;
1226  efi_bs_wrapper.CloseProtocol = efi_close_protocol_wrapper;
1227  efi_bs_wrapper.OpenProtocolInformation
1229  efi_bs_wrapper.ProtocolsPerHandle
1231  efi_bs_wrapper.LocateHandleBuffer
1234  efi_bs_wrapper.InstallMultipleProtocolInterfaces
1238  efi_bs_wrapper.CreateEventEx = efi_create_event_ex_wrapper;
1239 
1240  return &efi_bs_wrapper;
1241 }
1242 
1243 /**
1244  * Wrap the calls made by a loaded image
1245  *
1246  * @v handle Image handle
1247  */
1249  static EFI_SYSTEM_TABLE efi_systab_copy;
1250 
1251  /* Do nothing unless debugging is enabled */
1252  if ( ! DBG_LOG )
1253  return;
1254 
1255  /* Construct modified system table */
1256  if ( efi_systab != &efi_systab_copy ) {
1257  memcpy ( &efi_systab_copy, efi_systab,
1258  sizeof ( efi_systab_copy ) );
1260  efi_systab = &efi_systab_copy;
1261  }
1262 
1263  /* Dump image information */
1264  efi_dump_image ( handle );
1265 }
union edd_device_path device_path
Device path.
Definition: edd.h:24
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static const char * efi_boolean(BOOLEAN boolean)
Convert EFI boolean to text.
Definition: efi_wrap.c:103
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
#define EFI_PAGE_SIZE
Definition: UefiBaseType.h:191
#define EFI_UNSUPPORTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:123
#define EFI_VOLUME_CORRUPTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:130
static EFI_STATUS EFIAPI efi_set_timer_wrapper(EFI_EVENT event, EFI_TIMER_DELAY type, UINT64 trigger_time)
Wrap SetTimer()
Definition: efi_wrap.c:415
static VOID EFIAPI efi_restore_tpl_wrapper(EFI_TPL old_tpl)
Wrap RestoreTPL()
Definition: efi_wrap.c:260
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
EFI_SET_WATCHDOG_TIMER SetWatchdogTimer
Definition: UefiSpec.h:1894
#define EFI_WARN_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:157
#define EFI_ICMP_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:142
EFI Oprn Protocol Information Entry.
Definition: UefiSpec.h:1349
#define EFI_NO_RESPONSE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:136
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:162
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1845
An event is to be signaled periodically at a specified interval from the current time.
Definition: UefiSpec.h:489
#define VA_END(Marker)
Terminates the use of a variable argument list.
Definition: Base.h:734
#define EFI_ALREADY_STARTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:140
static const char * efi_status(EFI_STATUS efirc)
Convert EFI status code to text.
Definition: efi_wrap.c:49
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:1914
EFI_STALL Stall
Definition: UefiSpec.h:1893
An event is to be signaled once at a specified interval from the current time.
Definition: UefiSpec.h:493
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:528
Definition of an EFI memory descriptor.
Definition: UefiSpec.h:106
#define EFI_CRC_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:147
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
#define EFI_BAD_BUFFER_SIZE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:124
EFI_BOOT_SERVICES * efi_wrap_bs(void)
Build boot services table wrapper.
Definition: efi_wrap.c:1180
Error codes.
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:608
static EFI_STATUS EFIAPI efi_register_protocol_notify_wrapper(EFI_GUID *protocol, EFI_EVENT event, VOID **registration)
Wrap RegisterProtocolNotify()
Definition: efi_wrap.c:589
#define DBGC_EFI_PROTOCOLS(...)
Definition: efi.h:288
EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface
Definition: UefiSpec.h:1871
EFI_EXIT_BOOT_SERVICES ExitBootServices
Definition: UefiSpec.h:1887
#define TPL_APPLICATION
Definition: UefiSpec.h:590
EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface
Definition: UefiSpec.h:1872
VOID * EFI_EVENT
Handle to an event structure.
Definition: UefiBaseType.h:43
EFI_IMAGE_LOAD LoadImage
Definition: UefiSpec.h:1883
unsigned char BOOLEAN
Definition: ProcessorBind.h:61
uint32_t type
Operating system type.
Definition: ena.h:12
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:928
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:974
#define EFI_PROTOCOL_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:144
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:184
A memory region that operates as EfiConventionalMemory, however it happens to also support byte-addre...
unsigned int UINT32
Definition: ProcessorBind.h:56
static EFI_STATUS EFIAPI efi_handle_protocol_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID **interface)
Wrap HandleProtocol()
Definition: efi_wrap.c:570
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
Definition: UefiSpec.h:1915
static EFI_STATUS EFIAPI efi_install_configuration_table_wrapper(EFI_GUID *guid, VOID *table)
Wrap InstallConfigurationTable()
Definition: efi_wrap.c:662
unsigned short CHAR16
Definition: ProcessorBind.h:59
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1864
EFI_SET_TIMER SetTimer
Definition: UefiSpec.h:1861
static void efi_dump_image(EFI_HANDLE handle)
Dump information about a loaded image.
Definition: efi_wrap.c:203
static EFI_STATUS EFIAPI efi_signal_event_wrapper(EFI_EVENT event)
Wrap SignalEvent()
Definition: efi_wrap.c:459
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition: netvsc.h:16
EFI_LOCATE_HANDLE LocateHandle
Definition: UefiSpec.h:1876
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:394
EFI_IMAGE_UNLOAD UnloadImage
Definition: UefiSpec.h:1886
An executable image.
Definition: image.h:24
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:51
#define EFI_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:125
VOID(EFIAPI * EFI_EVENT_NOTIFY)(IN EFI_EVENT Event, IN VOID *Context)
Invoke a notification event.
Definition: UefiSpec.h:417
static EFI_STATUS EFIAPI efi_get_next_monotonic_count_wrapper(UINT64 *count)
Wrap GetNextMonotonicCount()
Definition: efi_wrap.c:795
A memory map.
Definition: io.h:499
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:1906
EFI_CREATE_EVENT_EX CreateEventEx
Definition: UefiSpec.h:1928
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:56
#define TPL_NOTIFY
Definition: UefiSpec.h:592
#define EFI_NO_MEDIA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:132
#define EFI_OUT_OF_RESOURCES
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:129
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:1157
UINT64 NumberOfPages
Number of 4KB pages in the memory region.
Definition: UefiSpec.h:124
#define EFI_DEVICE_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:127
UEFI 2.0 Loaded image protocol definition.
The code portions of a loaded application.
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:314
#define EFI_LOAD_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:121
A hardware device.
Definition: device.h:73
void * memcpy(void *dest, const void *src, size_t len) __nonnull
An event's timer settings is to be cancelled and not trigger time is to be set/.
Definition: UefiSpec.h:485
Can be used on any image handle to obtain information about the loaded image.
Definition: LoadedImage.h:51
#define EFI_VOLUME_FULL
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:131
EFI_MEMORY_TYPE
Enumeration of memory types introduced in UEFI.
#define EFI_ACCESS_DENIED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:135
An object interface.
Definition: interface.h:124
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...
#define EFI_COMPROMISED_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:151
Allocate pages at a specified address.
Definition: UefiSpec.h:47
EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface
Definition: UefiSpec.h:1870
void efi_wrap(EFI_HANDLE handle)
Wrap the calls made by a loaded image.
Definition: efi_wrap.c:1248
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1860
#define VA_ARG(Marker, TYPE)
Returns an argument of a specified type from a variable argument list and updates the pointer to the ...
Definition: Base.h:722
const char * efi_locate_search_type_name(EFI_LOCATE_SEARCH_TYPE search_type)
Name locate search type.
Definition: efi_debug.c:225
EFI_HANDLE_PROTOCOL HandleProtocol
Definition: UefiSpec.h:1873
EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify
Definition: UefiSpec.h:1875
Memory that holds the ACPI tables.
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:375
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1271
static EFI_STATUS EFIAPI efi_free_pages_wrapper(EFI_PHYSICAL_ADDRESS memory, UINTN pages)
Wrap FreePages()
Definition: efi_wrap.c:296
The code portions of a loaded Boot Services Driver.
#define EFI_NOT_STARTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:139
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:722
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:711
EFI_SIGNAL_EVENT SignalEvent
Definition: UefiSpec.h:1863
#define EFI_WRITE_PROTECTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:128
EFI_PHYSICAL_ADDRESS PhysicalStart
Physical address of the first byte of the memory region.
Definition: UefiSpec.h:115
Free (unallocated) memory.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
Allocate any available range of pages whose uppermost address is less than or equal to a specified ma...
Definition: UefiSpec.h:43
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
#define EFIAPI
EFI Boot Services Table.
Definition: UefiSpec.h:1836
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:830
EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount
Definition: UefiSpec.h:1892
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:33
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:506
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:951
uint8_t * tmp
Definition: entropy.h:156
static EFI_STATUS EFIAPI efi_wait_for_event_wrapper(UINTN number_of_events, EFI_EVENT *event, UINTN *index)
Wrap WaitForEvent()
Definition: efi_wrap.c:435
#define DBGC_HD(...)
Definition: compiler.h:507
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
Definition: UefiSpec.h:1916
EFI_CONNECT_CONTROLLER ConnectController
Definition: UefiSpec.h:1899
#define TPL_CALLBACK
Definition: UefiSpec.h:591
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:850
static EFI_STATUS EFIAPI efi_locate_protocol_wrapper(EFI_GUID *protocol, VOID *registration, VOID **interface)
Wrap LocateProtocol()
Definition: efi_wrap.c:1035
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:274
EFI_IMAGE_START StartImage
Definition: UefiSpec.h:1884
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
#define VA_START(Marker, Parameter)
Retrieves a pointer to the beginning of a variable argument list, based on the name of the parameter ...
Definition: Base.h:704
EFI System Table.
Definition: UefiSpec.h:1949
#define EFI_NOT_READY
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:126
static EFI_TPL EFIAPI efi_raise_tpl_wrapper(EFI_TPL new_tpl)
Wrap RaiseTPL()
Definition: efi_wrap.c:244
static EFI_STATUS EFIAPI efi_install_multiple_protocol_interfaces_wrapper(EFI_HANDLE *handle,...)
Wrap InstallMultipleProtocolInterfaces()
Definition: efi_wrap.c:1057
#define EFI_INVALID_PARAMETER
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:122
UINT32 Type
Type of the memory region.
Definition: UefiSpec.h:110
#define EFI_END_OF_FILE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:149
static EFI_STATUS EFIAPI efi_unload_image_wrapper(EFI_HANDLE image_handle)
Wrap UnloadImage()
Definition: efi_wrap.c:757
#define VOID
Undeclared type.
Definition: Base.h:319
unsigned long long UINT64
Definition: ProcessorBind.h:54
System memory-mapped IO region that is used to translate memory cycles to IO cycles by the processor.
EFI_WAIT_FOR_EVENT WaitForEvent
Definition: UefiSpec.h:1862
#define EFI_INVALID_LANGUAGE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:150
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
#define EFI_WARN_STALE_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:158
#define TPL_HIGH_LEVEL
Definition: UefiSpec.h:593
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:1907
#define EFI_WARN_DELETE_FAILURE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:155
EFI API.
static EFI_STATUS EFIAPI efi_uninstall_protocol_interface_wrapper(EFI_HANDLE handle, EFI_GUID *protocol, VOID *interface)
Wrap UninstallProtocolInterface()
Definition: efi_wrap.c:550
uint64_t guid
GUID.
Definition: edd.h:30
#define EFI_SECURITY_VIOLATION
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:146
EFI_ALLOCATE_TYPE
Enumeration of EFI memory allocation types.
Definition: UefiSpec.h:34
struct edd_interface_type interface_type
Interface type.
Definition: edd.h:20
#define EFI_MEDIA_CHANGED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:133
EFI_GET_MEMORY_MAP GetMemoryMap
Definition: UefiSpec.h:1853
EFI_ALLOCATE_PAGES AllocatePages
Definition: UefiSpec.h:1851
static EFI_STATUS EFIAPI efi_allocate_pool_wrapper(EFI_MEMORY_TYPE pool_type, UINTN size, VOID **buffer)
Wrap AllocatePool()
Definition: efi_wrap.c:358
The data portions of a loaded Runtime Services Driver and the default data allocation type used by a ...
static unsigned int source_size
Definition: bigint.h:252
#define EFI_NOT_FOUND
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:134
UINTN EFI_TPL
Task priority level.
Definition: UefiBaseType.h:47
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1912
#define DBGC2(...)
Definition: compiler.h:522
#define CONST
Datum is read-only.
Definition: Base.h:309
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:1004
#define EFI_INCOMPATIBLE_VERSION
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:145
#define EFI_SUCCESS
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:120
#define EFI_WARN_UNKNOWN_GLYPH
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:154
EFI_TIMER_DELAY
Timer delay types.
Definition: UefiSpec.h:481
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:904
#define EFI_NO_MAPPING
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:137
EFI_CHECK_EVENT CheckEvent
Definition: UefiSpec.h:1865
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
static const char * efi_tpl(EFI_TPL tpl)
Convert EFI TPL to text.
Definition: efi_wrap.c:114
The code portions of a loaded Runtime Services Driver.
uint16_t count
Number of entries.
Definition: ena.h:22
static EFI_STATUS EFIAPI efi_close_event_wrapper(EFI_EVENT event)
Wrap CloseEvent()
Definition: efi_wrap.c:475
Allocate any available range of pages that satisfies the request.
Definition: UefiSpec.h:38
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
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:679
static const char * efi_timer_delay(EFI_TIMER_DELAY type)
Convert EFI timer delay type to text.
Definition: efi_wrap.c:185
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition: efi_debug.c:250
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:881
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:641
#define DBGCP(...)
Definition: compiler.h:539
static EFI_STATUS EFIAPI efi_exit_boot_services_wrapper(EFI_HANDLE image_handle, UINTN map_key)
Wrap ExitBootServices()
Definition: efi_wrap.c:774
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
void timeout(int)
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1905
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:733
uint16_t protocol
Protocol ID.
Definition: stp.h:18
UINT64 Attribute
Attributes of the memory region that describe the bit mask of capabilities for that memory region,...
Definition: UefiSpec.h:130
EFI_LOCATE_SEARCH_TYPE
Enumeration of EFI Locate Search Types.
Definition: UefiSpec.h:1435
#define DBG_EXTRA
Definition: compiler.h:319
Address space reserved for use by the firmware.
EFI_INTERFACE_TYPE
Enumeration of EFI Interface Types.
Definition: UefiSpec.h:1118
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1846
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
static const char * efi_allocate_type(EFI_ALLOCATE_TYPE type)
Convert EFI allocation type to text.
Definition: efi_wrap.c:135
static EFI_STATUS EFIAPI efi_stall_wrapper(UINTN microseconds)
Wrap Stall()
Definition: efi_wrap.c:812
static EFI_STATUS EFIAPI efi_uninstall_multiple_protocol_interfaces_wrapper(EFI_HANDLE handle,...)
Wrap UninstallMultipleProtocolInterfaces()
Definition: efi_wrap.c:1107
#define EFI_WARN_WRITE_FAILURE
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:156
#define EFI_END_OF_MEDIA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:148
static EFI_STATUS EFIAPI efi_check_event_wrapper(EFI_EVENT event)
Wrap CheckEvent()
Definition: efi_wrap.c:490
#define EFI_ABORTED
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:141
#define colour
Colour for debug messages.
Definition: efi_wrap.c:41
EFI_FREE_PAGES FreePages
Definition: UefiSpec.h:1852
#define DBG_LOG
Definition: compiler.h:317
#define EFI_TFTP_ERROR
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:143
static const char * efi_memory_type(EFI_MEMORY_TYPE type)
Convert EFI memory type to text.
Definition: efi_wrap.c:154
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
UINT16_t buffer_size
UDP payload buffer size.
Definition: pxe_api.h:62
String functions.
#define MAX_WRAP_MULTI
Maximum number of interfaces for wrapped ...MultipleProtocolInterfaces()
Definition: efi_wrap.c:1050
EFI driver interface.
CHAR8 * VA_LIST
Variable used to traverse the list of arguments.
Definition: Base.h:686
Definition: efi.h:50
The data portions of a loaded application and the default data allocation type used by an application...
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:1913
EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable
Definition: UefiSpec.h:1878
EFI_LOCATE_DEVICE_PATH LocateDevicePath
Definition: UefiSpec.h:1877
#define EFI_TIMEOUT
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:138
Memory in which errors have been detected.
static EFI_STATUS EFIAPI efi_free_pool_wrapper(VOID *buffer)
Wrap FreePool()
Definition: efi_wrap.c:378
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1854
void * memset(void *dest, int character, size_t len) __nonnull
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition: UefiSpec.h:1900