So, I set off to create the necessary structs, enums, declarations, and such to pass the RuntimeServices structure to the kernel. I've been translating types and creating types, however I've had one issue. Namely, the EFIAPI attribute.
I originally thought it was a defined type, but upon closer research it turns out to be EFI compiler magic. I don't know what to replace this keyword with, if anything at all.
Here is an example
UEFI header:
Code: Select all
typedef
EFI_STATUS
(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (
IN UINTN MemoryMapSize,
IN UINTN DescriptorSize,
IN UINT32 DescriptorVersion,
IN EFI_MEMORY_DESCRIPTOR *VirtualMap
);
Code: Select all
typedef
uint64_t
(EfiApi *Efi_Set_Virtual_Address_Map) (
uint64_t MemoryMapSize,
uint64_t DescriptorSize,
uint64_t DescriptorVersion,
Memory_Map_Descriptor *VirtualMap
);
I have EfiApi defined as nothing, just a valueless macro. It compiles, though when calling UEFI functions it triple faults, I assume due to the lack of EFI calling convention. Anyone know how I could fix this?