Changeset aecf79f in mainline for kernel/arch/xen32/src/mm/page.c
- Timestamp:
- 2006-07-24T16:07:15Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c59dd1a2
- Parents:
- 7b0599b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/xen32/src/mm/page.c
r7b0599b raecf79f 78 78 } 79 79 80 81 uintptr_t hw_map(uintptr_t physaddr, size_t size)82 {83 if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH))84 panic("Unable to map physical memory %p (%d bytes)", physaddr, size)85 86 uintptr_t virtaddr = PA2KA(last_frame);87 pfn_t i;88 for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++)89 page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE);90 91 last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE);92 93 return virtaddr;94 }95 96 80 void page_fault(int n, istate_t *istate) 97 81 { 98 82 uintptr_t page; 99 83 pf_access_t access; 100 84 101 102 103 85 page = read_cr2(); 86 87 if (istate->error_word & PFERR_CODE_RSVD) 104 88 panic("Reserved bit set in page directory.\n"); 105 89 106 90 if (istate->error_word & PFERR_CODE_RW) 107 91 access = PF_ACCESS_WRITE; 108 92 else 109 93 access = PF_ACCESS_READ; 110 111 94 95 if (as_page_fault(page, access, istate) == AS_PF_FAULT) { 112 96 fault_if_from_uspace(istate, "Page fault: %#x", page); 113 114 115 116 117 97 98 PRINT_INFO_ERRCODE(istate); 99 printf("page fault address: %#x\n", page); 100 panic("page fault\n"); 101 } 118 102 } 119 103
Note:
See TracChangeset
for help on using the changeset viewer.