Changeset ef9a2a8 in mainline for kernel/arch/sparc32/src/mm/page.c


Ignore:
Timestamp:
2013-09-15T19:23:19Z (12 years ago)
Author:
Jakub Klama <jakub.klama@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3efc35a
Parents:
b6b02c0
Message:

Introduce early MMU support in kernel. At current state, it
is possible to create initial kernel address space, map kernel
identity into it and take over MMU control. ASID FIFO support
should also work.

File:
1 edited

Legend:

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

    rb6b02c0 ref9a2a8  
    4949#include <print.h>
    5050#include <interrupt.h>
     51#include <macros.h>
    5152
    5253void page_arch_init(void)
    5354{
    54         if (config.cpu_active == 1)
    55                 page_mapping_operations = &pt_mapping_operations;
     55        int flags = PAGE_CACHEABLE | PAGE_EXEC;
     56        page_mapping_operations = &pt_mapping_operations;
     57
     58        page_table_lock(AS_KERNEL, true);
     59       
     60        /* Kernel identity mapping */
     61        //FIXME: We need to consider the possibility that
     62        //identity_base > identity_size and physmem_end.
     63        //This might lead to overflow if identity_size is too big.
     64        for (uintptr_t cur = PHYSMEM_START_ADDR;
     65            cur < min(KA2PA(config.identity_base) +
     66                config.identity_size, config.physmem_end);
     67            cur += FRAME_SIZE)
     68                page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
     69       
     70
     71        page_table_unlock(AS_KERNEL, true);
     72        as_switch(NULL, AS_KERNEL);
     73
     74        printf("as_context_table=0x%08x\n", as_context_table);
     75
     76        /* Switch MMU to new context table */
     77        asi_u32_write(ASI_MMUREGS, 0x100, KA2PA(as_context_table) >> 4);
     78
     79        //boot_page_table_free();
    5680}
    5781
Note: See TracChangeset for help on using the changeset viewer.