Changeset 482f968 in mainline for kernel/generic/src/mm/km.c


Ignore:
Timestamp:
2018-10-31T16:48:51Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91a8f83, bab75df6
Parents:
37781819
Message:

Make FRAME_HIGHMEM fall back to low memory on failure.

Which is what existing users of it are doing, and there is no reason
not to as far as I can see.

Also make sure calls to frame_alloc all have either FRAME_LOWMEM or
FRAME_HIGHMEM explicitly set, as appropriate.

File:
1 edited

Legend:

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

    r37781819 r482f968  
    121121                return base;
    122122        else
    123                 return (uintptr_t) NULL;
     123                panic("Kernel ran out of virtual address space.");
    124124}
    125125
     
    256256        uintptr_t frame;
    257257
    258         frame = frame_alloc(1, FRAME_HIGHMEM | FRAME_ATOMIC | flags, 0);
    259         if (frame) {
     258        frame = frame_alloc(1, FRAME_HIGHMEM | flags, 0);
     259        if (frame >= config.identity_size) {
    260260                page = km_map(frame, PAGE_SIZE, PAGE_SIZE,
    261261                    PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    262                 if (!page) {
    263                         frame_free(frame, 1);
    264                         goto lowmem;
    265                 }
    266262        } else {
    267         lowmem:
    268                 frame = frame_alloc(1, FRAME_LOWMEM | flags, 0);
    269                 if (!frame)
    270                         return (uintptr_t) NULL;
    271 
    272263                page = PA2KA(frame);
    273264        }
Note: See TracChangeset for help on using the changeset viewer.