1

I found a really odd data type I've never seen before in some GNU EFI code, specifically a call to GetMemoryMap, wherein the map size, the map key, and the descriptor size are all declared to be the type UINTN. My IDE does not recognize this data type, so I assume this is something specific to GNU EFI.

I've tried Googling around for it, but all I get is completely irrelevant results or specifications talking about uint_[number of bits]_t (and similar) types.

The code I'm talking about:

UINTN mapSize = 0, mapKey, descriptorSize;
EFI_MEMORY_DESCRIPTOR *memoryMap = NULL;
UINT32 descriptorVersion;
// Get the required memory pool size for the memory map
Status = uefi_call_wrapper(BS->GetMemoryMap, 5, &mapSize, memoryMap, NULL, &descriptorSize, NULL);
if(Status != EFI_BUFFER_TOO_SMALL) { return Status; }
NickKnack
  • 119
  • 1
  • 8
  • Described in the [docs](https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/5_source_files/56_declarations_and_types) – Mark Benningfield Jun 03 '22 at 11:52
  • @MarkBenningfield Ah. For some reason my Google searches didn't turn up that. – NickKnack Jun 03 '22 at 11:53
  • 1
    I did a quick Google using `"UINTN" UEFI` and [the UEFI Spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf) occurred. It's in *2.3.1 Data Types* of the spec. – kotatsuyaki Jun 03 '22 at 11:54

0 Answers0