Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset babb57e in mainline


Ignore:
Timestamp:
2012-01-28T12:36:01Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
93da799
Parents:
221c9ec
Message:

Add km_map_structure(), inspired from a soon-to-be-removed map_structure().

Location:
kernel/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/km.h

    r221c9ec rbabb57e  
    5050
    5151extern uintptr_t km_map(uintptr_t, size_t, unsigned int);
     52extern uintptr_t km_map_structure(uintptr_t, size_t, unsigned int);
    5253
    5354extern uintptr_t km_temporary_page_get(uintptr_t *, frame_flags_t);
  • kernel/generic/src/mm/km.c

    r221c9ec rbabb57e  
    145145}
    146146
     147uintptr_t km_map_structure(uintptr_t paddr, size_t size, unsigned int flags)
     148{
     149        size_t offs = paddr - ALIGN_DOWN(paddr, FRAME_SIZE);
     150        uintptr_t page;
     151
     152        page = km_map(ALIGN_DOWN(paddr, FRAME_SIZE), size + offs, flags);
     153        return page + offs;
     154}
    147155
    148156/** Unmap kernen non-identity page.
Note: See TracChangeset for help on using the changeset viewer.