Ignore:
File:
1 edited

Legend:

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

    r7e752b2 rf1a2c6e  
    3939#include <mm/page.h>
    4040#include <mm/as.h>
    41 #include <typedefs.h>
     41#include <arch/types.h>
    4242#include <align.h>
    4343#include <config.h>
     
    6161                 * PA2KA(identity) mapping for all frames until last_frame.
    6262                 */
    63                 page_table_lock(AS_KERNEL, true);
    6463                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    6564                        flags = PAGE_CACHEABLE | PAGE_WRITE;
     
    6867                        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    6968                }
    70                 page_table_unlock(AS_KERNEL, true);
    7169               
    72                 exc_register(14, "page_fault", true, (iroutine_t) page_fault);
     70                exc_register(14, "page_fault", (iroutine) page_fault);
    7371                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    7472        } else
     
    8280{
    8381        if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))
    84                 panic("Unable to map physical memory %p (%zu bytes).",
    85                     (void *) physaddr, size);
     82                panic("Unable to map physical memory %p (%d bytes).", physaddr, size);
    8683       
    8784        uintptr_t virtaddr = PA2KA(last_frame);
    8885        pfn_t i;
    89         page_table_lock(AS_KERNEL, true);
    9086        for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) {
    9187                uintptr_t addr = PFN2ADDR(i);
    9288                page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE);
    9389        }
    94         page_table_unlock(AS_KERNEL, true);
    9590       
    9691        last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);
     
    9994}
    10095
    101 void page_fault(unsigned int n __attribute__((unused)), istate_t *istate)
     96void page_fault(int n __attribute__((unused)), istate_t *istate)
    10297{
    10398        uintptr_t page;
     
    116111        if (as_page_fault(page, access, istate) == AS_PF_FAULT) {
    117112                fault_if_from_uspace(istate, "Page fault: %#x.", page);
    118                 panic_memtrap(istate, access, page, NULL);
     113               
     114                decode_istate(istate);
     115                printf("page fault address: %#lx\n", page);
     116                panic("Page fault.");
    119117        }
    120118}
Note: See TracChangeset for help on using the changeset viewer.