EFI MEMORY DESCRIPTOR

From PhoenixWiki

Jump to: navigation, search

Prototype

typedef struct {
  UINT32               Type;
  EFI_PHYSICAL_ADDRESS PhysicalStart;
  EFI_VIRTUAL_ADDRESS  VirtualStart;
  UINT64               NumberOfPages;
  UINT64               Attribute;
} EFI_MEMORY_DESCRIPTOR;

Members

Member Description
Type Type of the memory region.
PhysicalStart Physical address of the first byte in the memory region. Physical start must be aligned on a 4 KB boundary.
VirtualStart Virtual address of the first byte in the memory region. Virtual start must be aligned on a 4 KB boundary.
NumberOfPages Number of 4 KB pages in the memory region.
Attribute Attributes of the memory region that describe the bit mask of capabilities for that memory region, and not necessarily the current settings for that memory region.
#define EFI_MEMORY_UC      0x0000000000000001
#define EFI_MEMORY_WC      0x0000000000000002
#define EFI_MEMORY_WT      0x0000000000000004
#define EFI_MEMORY_WB      0x0000000000000008
#define EFI_MEMORY_UCE     0x0000000000000010
#define EFI_MEMORY_WP      0x0000000000001000
#define EFI_MEMORY_RP      0x0000000000002000
#define EFI_MEMORY_XP      0x0000000000004000
#define EFI_MEMORY_RUNTIME 0x8000000000000000
Attribute Descrption
EFI_MEMORY_UC Memory cacheability attribute: The memory region supports being configured as not cacheable.
EFI_MEMORY_WC Memory cacheability attribute: The memory region supports being configured as write combining.
EFI_MEMORY_WT Memory cacheability attribute: The memory region supports being configured as cacheable with a “write through” policy. Writes that hit in the cache will also be written to main memory.
EFI_MEMORY_WB Memory cacheability attribute: The memory region supports being configured as cacheable with a “write back” policy. Reads and writes that hit in the cache do not propagate to main memory. Dirty data is written back to main memory when a new cache line is allocated.
EFI_MEMORY_UCE Memory cacheability attribute: The memory region supports being configured as not cacheable, exported, and supports the “fetch and add” semaphore mechanism.
EFI_MEMORY_WP Physical memory protection attribute: The memory region supports being configured as write-protected by system hardware.
EFI_MEMORY_RP Physical memory protection attribute: The memory region supports being configured as read-protected by system hardware.
EFI_MEMORY_XP Physical memory protection attribute: The memory region supports being configured so it is protected by system hardware from executing code.
EFI_MEMORY_RUNTIME Runtime memory attribute: The memory region needs to be given a virtual mapping by the operating system when SetVirtualAddressMap() is called.

Copyright (C) 2008 Phoenix Technologies Ltd. All Rights Reserved. Portions (C) 2005 UEFI Forum, Inc. Used with permission.

Personal tools