Changeset 1c01e6c in mainline for kernel/arch/ia32/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/arch/ia32/src/mm/page.c

    r9aed144 r1c01e6c  
    8585}
    8686
    87 
    88 uintptr_t hw_map(uintptr_t physaddr, size_t size)
    89 {
    90         if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    91                 panic("Unable to map physical memory %p (%zu bytes).",
    92                     (void *) physaddr, size);
    93        
    94         uintptr_t virtaddr = PA2KA(last_frame);
    95         pfn_t i;
    96         page_table_lock(AS_KERNEL, true);
    97         for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    98                 uintptr_t addr = PFN2ADDR(i);
    99                 page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    100         }
    101         page_table_unlock(AS_KERNEL, true);
    102        
    103         last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
    104        
    105         return virtaddr;
    106 }
    107 
    10887void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    10988{
Note: See TracChangeset for help on using the changeset viewer.