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


Ignore:
Timestamp:
2011-11-26T16:37:37Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
056ddc30
Parents:
9aed144
Message:

Replace hw_map() implementations with one generic.
Currently the kernel is broken because of missing page allocator.

File:
1 edited

Legend:

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

    r9aed144 r1c01e6c  
    7474#include <syscall/copy.h>
    7575#include <errno.h>
     76#include <align.h>
    7677
    7778/** Virtual operations for page subsystem. */
     
    175176        return page_mapping_operations->mapping_find(as, page, nolock);
    176177}
     178
     179uintptr_t hw_map(uintptr_t physaddr, size_t size)
     180{
     181        uintptr_t virtaddr = (uintptr_t) NULL;  // FIXME
     182        pfn_t i;
     183
     184        page_table_lock(AS_KERNEL, true);
     185        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
     186                uintptr_t addr = PFN2ADDR(i);
     187                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr,
     188                    PAGE_NOT_CACHEABLE | PAGE_WRITE);
     189        }
     190        page_table_unlock(AS_KERNEL, true);
     191       
     192        return virtaddr;
     193}
     194
    177195
    178196/** Syscall wrapper for getting mapping of a virtual page.
Note: See TracChangeset for help on using the changeset viewer.