Ignore:
File:
1 edited

Legend:

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

    rd99c1d2 rc15b374  
    6161                 * PA2KA(identity) mapping for all frames until last_frame.
    6262                 */
     63                page_table_lock(AS_KERNEL, true);
    6364                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    6465                        flags = PAGE_CACHEABLE | PAGE_WRITE;
     
    6768                        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    6869                }
     70                page_table_unlock(AS_KERNEL, true);
    6971               
    70                 exc_register(14, "page_fault", (iroutine) page_fault);
     72                exc_register(14, "page_fault", true, (iroutine_t) page_fault);
    7173                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    7274        } else
     
    8486        uintptr_t virtaddr = PA2KA(last_frame);
    8587        pfn_t i;
     88        page_table_lock(AS_KERNEL, true);
    8689        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    8790                uintptr_t addr = PFN2ADDR(i);
    8891                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    8992        }
     93        page_table_unlock(AS_KERNEL, true);
    9094       
    9195        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
     
    9498}
    9599
    96 void page_fault(int n __attribute__((unused)), istate_t *istate)
     100void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    97101{
    98102        uintptr_t page;
     
    111115        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
    112116                fault_if_from_uspace(istate, "Page fault: %#x.", page);
    113                
    114                 decode_istate(istate);
    115                 printf("page fault address: %#lx\n", page);
    116                 panic("Page fault.");
     117                panic_memtrap(istate, access, page, NULL);
    117118        }
    118119}
Note: See TracChangeset for help on using the changeset viewer.