On 12/06/18 23:46, Bill Paul wrote: > Of all the gin joints in all the towns in all the world, Peter Wiehe had to > walk into mine at 14:34 on Thursday 06 December 2018 and say: > >> OK, another question: >> >> when writing an UEFI application, edk2 and gnu-efi have different 64bit >> calling schemes. Does that only apply to calling the >> runtime-library/object file (and inside of the UEFI-application, of >> course)? Or does the call from application to UEFI differ in both >> toolkits, too? (If it is the latter, it would mean that the UEFI >> standard is unprecise!) > > Both the EDK and GNU EFI obey the same standards when calling UEFI APIs. > Their > exact implementations may differ depending on the circumstances. For example, > GNU EFI may use the __attribute__((ms_abi)) tag to tell the compiler what ABI > to use, or if the compiler doesn't support this it can fall back to using > some > compatibility wrapper macros (see lib/x86_64/efi_stub.S). Either way, you end > up with the same behavior. > > Within a given FOO.EFI application, the application code itself can get away > with using whatever calling convention it wants, right up until it needs to > call a UEFI firmware routine. At that point, it has to follow the conventions > spelled out in the UEFI spec.
I'd like to add: - in edk2, functions declared in lib class headers have to be EFIAPI; - functions that take variable arguments must be EFIAPI, even if they are STATIC (long story). Thanks Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

