Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mm/page.c

    r00287cc r7e752b2  
    2727 */
    2828
    29 /** @addtogroup arm32mm 
     29/** @addtogroup arm32mm
    3030 * @{
    3131 */
     
    4141#include <arch/exception.h>
    4242#include <typedefs.h>
    43 #include <arch/types.h>
    4443#include <interrupt.h>
    4544#include <arch/mm/frame.h>
     
    5453        int flags = PAGE_CACHEABLE;
    5554        page_mapping_operations = &pt_mapping_operations;
     55
     56        page_table_lock(AS_KERNEL, true);
    5657       
    5758        uintptr_t cur;
    5859        /* Kernel identity mapping */
    59         for (cur = 0; cur < last_frame; cur += FRAME_SIZE)
     60        for (cur = PHYSMEM_START_ADDR; cur < last_frame; cur += FRAME_SIZE)
    6061                page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    6162       
     
    6768#error "Only high exception vector supported now"
    6869#endif
     70        cur = ALIGN_DOWN(0x50008010, FRAME_SIZE);
     71        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
     72
     73        page_table_unlock(AS_KERNEL, true);
    6974       
    7075        as_switch(NULL, AS_KERNEL);
     
    8893            KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) {
    8994                panic("Unable to map physical memory %p (%d bytes).",
    90                     physaddr, size)
     95                    (void *) physaddr, size);
    9196        }
    9297       
    9398        uintptr_t virtaddr = PA2KA(last_frame);
    9499        pfn_t i;
     100
     101        page_table_lock(AS_KERNEL, true);
    95102        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    96103                page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i),
     
    98105                    PAGE_NOT_CACHEABLE | PAGE_READ | PAGE_WRITE | PAGE_KERNEL);
    99106        }
     107        page_table_unlock(AS_KERNEL, true);
    100108       
    101109        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
Note: See TracChangeset for help on using the changeset viewer.