On 12/07/18 14:26, Knop, Ryszard wrote: > Hi Laszlo, > Regarding "functions that take variable arguments must be EFIAPI, even if > they are STATIC (long story)" - what's the story? :)
If I remember correctly, the issue was that the VA_*() macros could not be implemented on gcc -- or, on *all* supported gcc toolchains at the same time, anyway -- such that they'd work in both non-EFIAPI and EFIAPI functions. This held for both manual stack manipulation *and* gcc builtins, in the macros -- the gcc builtins would not auto-adapt (at compile time) to the actual calling convention of the containing function. Therefore, the VA_*() macros had to make a one-time choice (between being usable in EFIAPI vs. non-EFIAPI functions). Given that variable arguments are taken by both some edk2 lib class APIs, and (more importantly) some UEFI services (ex. gBS->InstallMultipleProtocolInterfaces()), VA_*() were made to assume EFIAPI in the containing function. So, I guess, to be more precise, I should say "functions that take variable arguments must be EFIAPI, as long as you want to use VA_*() macros in them". This is my recollection anyway. Thanks Laszlo _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

