Changeset 404be7c in mainline


Ignore:
Timestamp:
2011-12-10T00:04:59Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8f1545
Parents:
7c3e482
Message:

Fix hw_map() by using the new km_alloc_page() interface.

File:
1 edited

Legend:

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

    r7c3e482 r404be7c  
    6565#include <arch/mm/asid.h>
    6666#include <mm/as.h>
     67#include <mm/km.h>
    6768#include <mm/frame.h>
    6869#include <arch/barrier.h>
     
    179180uintptr_t hw_map(uintptr_t physaddr, size_t size)
    180181{
    181         uintptr_t virtaddr = (uintptr_t) NULL;  // FIXME
     182        uintptr_t virtaddr;
     183        size_t asize;
    182184        pfn_t i;
    183185
     186        asize = ALIGN_UP(size, PAGE_SIZE);
     187        virtaddr = km_page_alloc(asize, PAGE_SIZE);
     188
    184189        page_table_lock(AS_KERNEL, true);
    185         for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
     190        for (i = 0; i < ADDR2PFN(asize); i++) {
    186191                uintptr_t addr = PFN2ADDR(i);
    187192                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr,
Note: See TracChangeset for help on using the changeset viewer.