4.2.2 Eliminate System Memory Assumptions
Do not make assumptions about the system memory configuration, including memory allocations and memory that is used for DMA buffers. There may be unexpected gaps in the memory map in any system and entire memory regions may be missing. For example, some memory regions could already be allocated (such as for an I/O device), some memory may be non-addressable, and/or physical memory could actually be missing. UEFI is designed for a wide variety of platforms. As such, portable drivers should not have hard-coded limits. Instead, they should rely on published specifications, UEFI, and the system firmware to provide them with the platform limitations and platform resources, including the following:
- The number of adapters that can be supported in a system
- The type of adapter that can be supported on each bus
- The available memory resources
In addition, drivers should not make assumptions on a platform. Instead, they should make sure they support all the cases that are allowed by the UEFI Specification. For example, memory is not always available beneath the 4 GB boundary (some systems may not have any memory under 4 GB at all) and drivers have to be designed to be compatible with these types of system configurations. As another example, some systems do not support PC-AT(R) legacy hardware and your drivers should not expect them to be present.