Changeset 5c7be3e in mainline


Ignore:
Timestamp:
2016-06-18T16:17:49Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a66923
Parents:
554e70f
Message:

When km_temporary_page_get() cannot allocate a page for a high-memory
frame, fallback to allocating a low-memory frame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/km.c

    r554e70f r5c7be3e  
    248248         */
    249249        uintptr_t page;
    250         uintptr_t frame =
    251             frame_alloc(1, FRAME_HIGHMEM | FRAME_ATOMIC | flags, 0);
     250        uintptr_t frame;
     251
     252        frame = frame_alloc(1, FRAME_HIGHMEM | FRAME_ATOMIC | flags, 0);
    252253        if (frame) {
    253254                page = km_map(frame, PAGE_SIZE,
    254255                    PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    255                
    256                 // FIXME
    257                 ASSERT(page);
     256                if (!page) {   
     257                        frame_free(frame, 1);
     258                        goto lowmem;
     259                }
    258260        } else {
     261lowmem:
    259262                frame = frame_alloc(1, FRAME_LOWMEM | flags, 0);
    260263                if (!frame)
Note: See TracChangeset for help on using the changeset viewer.