• Jeffrey Lee's avatar
    Allow reservation of memory pages · 1f84ad9f
    Jeffrey Lee authored
    This change adds a new OS_Memory reason code, 23, for reserving memory
    without actually assigning it to a dynamic area. Other dynamic areas can
    still use the memory, but only the code that reserved it will be allowed
    to claim exclusive use over it (i.e. PageFlags_Unavailable).
    
    This is useful for systems such as the PCI heap, where physically
    contiguous memory is required, but the memory isn't needed all of the
    time. By reserving the pages, it allows other regular DAs to make use of
    the memory when the PCI heap is small. But when the PCI heap needs to
    grow, it guarantees that (if there's enough free memory in the system)
    the previously reserved pages can be allocated to the PCI heap.
    
    Notes:
    
    * Reservations are handled on an honour system; there's no checking that
    the program that reserved the memory is the one attempting to map it in.
    
    * For regular NeedsSpecificPages DAs, reserved pages can only be used if
    the special "RESV" R0 return value is used.
    
    * For PMP DAs, rese...
    1f84ad9f
ChangeDyn 263 KB