summaryrefslogtreecommitdiffstats
path: root/documentation/UEFI_from_spec/GetMemoryMap
blob: 362228cb2198c584b75a1e754c5337f8799ad45c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Returns current memory map

typedef
EFI_STATUS
GetMemoryMap (
	IN OUT UINTN			*MemoryMapSize,
	IN OUT EFI_MEMORY_DESCRIPTOR	*MemoryMap,
	OUT UINTN			*MapKey,
	OUT UINTN			*DescriptorSize,
	OUT UINT32			*DescriptorVersion
	);


MemoryMapSize		Pointer to the size in bytes of MemoryMap buffer. On input, it's the site of the buffer allocated by the caller.
			On output, size of the buffer returned by the firmware if the buffer was large enough, or the size of the
			buffer needed to contain the map if the buffer was too small.

MemoryMap		A pointer to the buffer in which firmware places the current memory map. Map is array of EFI_MEMORY_DESCRIPTORs.

MapKey			Pointer to the location in which firmware returns the key for the current memory map.

DescriptorSize		Pointer to location in which firmware returns the size in bytes of an individual EFI_MEMORY_DESCRIPTOR

DescriptorVersion	Pointer to location in which firmware returns version number associated with EFI_MEMORY_DESCRIPTOR.



The memory map is only used to describe memory that is present in the system. Memory descriptors are never used to describe holes in the system memory map. Until ExitBootServices(), the memory map is owned by the firmware. The firmware's MapKey is changed every time something in the memory map changes. In order to successfully invoke ExitBootServices() the caller must provide the current memory map key.