next up previous contents index
Next: 10.11.2 phys_mem_max: Highest physical Up: (X86 PC) Base Environment: Previous: (X86 PC) Base Environment:

10.11.1 phys_lmm.h: Physical memory management for PCs

   

SYNOPSIS

#include <oskit/x86/pc/phys_lmm.h>

DESCRIPTION

There are three priority values assigned to regions of physical memory as they are made available at boot time (via lmm_add_region). In increasing order of priority (i.e., increasing preference for allocation):
LMM_PRI_1MB
  For physical memory below 1MB.
LMM_PRI_16MB
  For physical memory below 16MB.
LMM_PRI_HIGH
  For physical memory above 16MB.

These priorities prevent the simple memory allocation interfaces from handing out the more precious low-address memory. To enable savvy applications to explicitly allocate memory of a given type, the following flag values are assigned at boot time and can be passed to LMM allocation routines:
LMMF_1MB
  Set on memory below 1MB; i.e., the LMM_PRI_1MB region.
LMMF_16MB
  Set on memory below 16MB; i.e., the LMM_PRI_1MB and LMM_PRI_16MB regions.

Thus, if neither flag is set, memory can be allocated from any of the three regions with preference given to LMM_PRI_HIGH, followed by LMM_PRI_16MB and LMM_PRI_1MB. If just LMMF_16MB is set, memory can be allocated from either LMM_PRI_16MB or LMM_PRI_1MB in that order. If both flags are set, memory can only be allocated from the LMM_PRI_1MB region.



University of Utah Flux Research Group