Changeset d4673296 in mainline for kernel/generic/src/mm/page.c


Ignore:
Timestamp:
2012-01-27T21:12:25Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
adec5b45
Parents:
4dee0cb
Message:

Move hw_map() to km.c

File:
1 edited

Legend:

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

    r4dee0cb rd4673296  
    6565#include <arch/mm/asid.h>
    6666#include <mm/as.h>
    67 #include <mm/km.h>
    6867#include <mm/frame.h>
    6968#include <arch/barrier.h>
     
    7675#include <errno.h>
    7776#include <align.h>
    78 #include <macros.h>
    79 #include <bitops.h>
    8077
    8178/** Virtual operations for page subsystem. */
     
    193190}
    194191
    195 uintptr_t hw_map(uintptr_t physaddr, size_t size)
    196 {
    197         uintptr_t virtaddr;
    198         size_t asize;
    199         size_t align;
    200         pfn_t i;
    201 
    202         asize = ALIGN_UP(size, PAGE_SIZE);
    203         align = ispwr2(size) ? size : (1U << (fnzb(size) + 1));
    204         virtaddr = km_page_alloc(asize, max(PAGE_SIZE, align));
    205 
    206         page_table_lock(AS_KERNEL, true);
    207         for (i = 0; i < ADDR2PFN(asize); i++) {
    208                 uintptr_t addr = PFN2ADDR(i);
    209                 page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr,
    210                     PAGE_NOT_CACHEABLE | PAGE_WRITE);
    211         }
    212         page_table_unlock(AS_KERNEL, true);
    213        
    214         return virtaddr;
    215 }
    216 
    217192int page_find_mapping(uintptr_t virt, void **phys)
    218193{
Note: See TracChangeset for help on using the changeset viewer.