Ignore:
File:
1 edited

Legend:

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

    r59fb782 r40c8c17  
    7171        for (cur = 0; cur < min(config.identity_size, config.physmem_end);
    7272            cur += FRAME_SIZE) {
    73                 flags = PAGE_GLOBAL | PAGE_CACHEABLE | PAGE_WRITE | PAGE_READ;
     73                flags = PAGE_CACHEABLE | PAGE_WRITE;
     74                if ((PA2KA(cur) >= config.base) &&
     75                    (PA2KA(cur) < config.base + config.kernel_size))
     76                        flags |= PAGE_GLOBAL;
    7477                page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    7578        }
     
    8487void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
    8588{
    86         uintptr_t badvaddr;
     89        uintptr_t page;
    8790        pf_access_t access;
    8891       
    89         badvaddr = read_cr2();
     92        page = read_cr2();
    9093               
    9194        if (istate->error_word & PFERR_CODE_RSVD)
     
    97100                access = PF_ACCESS_READ;
    98101       
    99         (void) as_page_fault(badvaddr, access, istate);
     102        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
     103                fault_if_from_uspace(istate, "Page fault: %#x.", page);
     104                panic_memtrap(istate, access, page, NULL);
     105        }
    100106}
    101107
Note: See TracChangeset for help on using the changeset viewer.