UEFI: Difference between revisions
Jump to navigation
Jump to search
→Developing with GNU-EFI: Mention that callbacks need to use the right ABI, not just main
[unchecked revision] | [unchecked revision] |
Artoria2e5 (talk | contribs) |
(→Developing with GNU-EFI: Mention that callbacks need to use the right ABI, not just main) |
||
Line 118:
A few notes:
* efi.h is included so we can use types like EFI_STATUS, EFI_HANDLE, and EFI_SYSTEM_TABLE.
* When creating a 32-bit UEFI application, EFIAPI is empty; GCC will compile the "efi_main" function using the standard C calling convention. When creating a 64-bit UEFI application, EFIAPI expands to "__attribute__((ms_abi))" and GCC will compile the "efi_main" function using Microsoft's x64 calling convention, as specified by UEFI. Only functions that will be called directly from UEFI (
* "InitializeLib" and "Print" are convenience functions provided by libefi.a with prototypes in efilib.h. "InitializeLib" lets libefi.a store a reference to the ImageHandle and SystemTable provided by BIOS. "Print" uses those stored references to print a string by reaching out to UEFI-provided functions in memory. (Later on we will see how to find and call UEFI-provided functions manually.)
|