Ignore:
File:
1 edited

Legend:

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

    r8cbf1c3 raaceebc4  
    873873
    874874        return ADDR2PFN((uintptr_t) frame_alloc(order - FRAME_WIDTH,
    875             FRAME_LOWMEM | FRAME_ATOMIC, 0));
     875            FRAME_LOWMEM | FRAME_ATOMIC));
    876876}
    877877
     
    10241024 *
    10251025 */
    1026 uintptr_t frame_alloc_generic(uint8_t order, frame_flags_t flags,
    1027     uintptr_t constraint, size_t *pzone)
     1026void *frame_alloc_generic(uint8_t order, frame_flags_t flags, size_t *pzone)
    10281027{
    10291028        size_t size = ((size_t) 1) << order;
     
    10721071                        if (!(flags & FRAME_NO_RESERVE))
    10731072                                reserve_free(size);
    1074                         return 0;
     1073                        return NULL;
    10751074                }
    10761075               
     
    11271126                *pzone = znum;
    11281127       
    1129         return PFN2ADDR(pfn);
    1130 }
    1131 
    1132 uintptr_t frame_alloc(uint8_t order, frame_flags_t flags, uintptr_t constraint)
    1133 {
    1134         return frame_alloc_generic(order, flags, constraint, NULL);
    1135 }
    1136 
    1137 uintptr_t frame_alloc_noreserve(uint8_t order, frame_flags_t flags,
    1138     uintptr_t constraint)
    1139 {
    1140         return frame_alloc_generic(order, flags | FRAME_NO_RESERVE, constraint,
    1141             NULL);
     1128        if (flags & FRAME_KA)
     1129                return (void *) PA2KA(PFN2ADDR(pfn));
     1130       
     1131        return (void *) PFN2ADDR(pfn);
     1132}
     1133
     1134void *frame_alloc(uint8_t order, frame_flags_t flags)
     1135{
     1136        return frame_alloc_generic(order, flags, NULL);
     1137}
     1138
     1139void *frame_alloc_noreserve(uint8_t order, frame_flags_t flags)
     1140{
     1141        return frame_alloc_generic(order, flags | FRAME_NO_RESERVE, NULL);
    11421142}
    11431143
Note: See TracChangeset for help on using the changeset viewer.