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


Ignore:
Timestamp:
2013-12-28T17:16:44Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1023bcb
Parents:
f6f22cdb
Message:

code revision
coding style fixes
removal of debugging printouts and other temporary stuff

File:
1 edited

Legend:

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

    rf6f22cdb r32e8cd1  
    2727 */
    2828
    29 /** @addtogroup abs32lemm
     29/** @addtogroup sparc32mm
    3030 * @{
    3131 */
     
    5757        int flags = PAGE_CACHEABLE | PAGE_EXEC;
    5858        page_mapping_operations = &pt_mapping_operations;
    59 
     59       
    6060        page_table_lock(AS_KERNEL, true);
    6161       
    6262        /* Kernel identity mapping */
    63         //FIXME: We need to consider the possibility that
    64         //identity_base > identity_size and physmem_end.
    65         //This might lead to overflow if identity_size is too big.
     63        // FIXME:
     64        // We need to consider the possibility that
     65        // identity_base > identity_size and physmem_end.
     66        // This might lead to overflow if identity_size is too big.
    6667        for (uintptr_t cur = PHYSMEM_START_ADDR;
    6768            cur < min(KA2PA(config.identity_base) +
    68                 config.identity_size, config.physmem_end);
     69            config.identity_size, config.physmem_end);
    6970            cur += FRAME_SIZE)
    7071                page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    7172       
    72 
    7373        page_table_unlock(AS_KERNEL, true);
    7474        as_switch(NULL, AS_KERNEL);
    75 
    76 //      printf("as_context_table=0x%08x\n", as_context_table);
    77 
     75       
    7876        /* Switch MMU to new context table */
    7977        asi_u32_write(ASI_MMUREGS, MMU_CONTEXT_TABLE, KA2PA(as_context_table) >> 4);
    80 
    81         //boot_page_table_free();
    8278}
    8379
     
    8682        uint32_t fault_status = asi_u32_read(ASI_MMUREGS, MMU_FAULT_STATUS);
    8783        uintptr_t fault_address = asi_u32_read(ASI_MMUREGS, MMU_FAULT_ADDRESS);
    88         mmu_fault_status_t *fault = (mmu_fault_status_t *)&fault_status;
    89         mmu_fault_type_t type = (mmu_fault_type_t)fault->at;
    90 
    91 //      printf("page fault on address 0x%08x, status 0x%08x, type %d\n", fault_address, fault_status, type);
    92 
    93         if (type == FAULT_TYPE_LOAD_USER_DATA ||
    94             type == FAULT_TYPE_LOAD_SUPERVISOR_DATA)   
     84        mmu_fault_status_t *fault = (mmu_fault_status_t *) &fault_status;
     85        mmu_fault_type_t type = (mmu_fault_type_t) fault->at;
     86       
     87        if ((type == FAULT_TYPE_LOAD_USER_DATA) ||
     88            (type == FAULT_TYPE_LOAD_SUPERVISOR_DATA))
    9589                as_page_fault(fault_address, PF_ACCESS_READ, istate);
    9690
    97         if (type == FAULT_TYPE_EXECUTE_USER ||
    98             type == FAULT_TYPE_EXECUTE_SUPERVISOR)
     91        if ((type == FAULT_TYPE_EXECUTE_USER) ||
     92            (type == FAULT_TYPE_EXECUTE_SUPERVISOR))
    9993                as_page_fault(fault_address, PF_ACCESS_EXEC, istate);
    10094
    101         if (type == FAULT_TYPE_STORE_USER_DATA ||
    102             type == FAULT_TYPE_STORE_USER_INSTRUCTION ||
    103             type == FAULT_TYPE_STORE_SUPERVISOR_INSTRUCTION ||
    104             type == FAULT_TYPE_STORE_SUPERVISOR_DATA)
     95        if ((type == FAULT_TYPE_STORE_USER_DATA) ||
     96            (type == FAULT_TYPE_STORE_USER_INSTRUCTION) ||
     97            (type == FAULT_TYPE_STORE_SUPERVISOR_INSTRUCTION) ||
     98            (type == FAULT_TYPE_STORE_SUPERVISOR_DATA))
    10599                as_page_fault(fault_address, PF_ACCESS_WRITE, istate);
    106100}
Note: See TracChangeset for help on using the changeset viewer.