Rev 2071 | Rev 3071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2222 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | panic("Unable to map physical memory %p (%d bytes)", physaddr, size) |
51 | panic("Unable to map physical memory %p (%d bytes)", physaddr, size) |
52 | 52 | ||
53 | uintptr_t virtaddr = PA2KA(last_frame); |
53 | uintptr_t virtaddr = PA2KA(last_frame); |
54 | pfn_t i; |
54 | pfn_t i; |
55 | for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) |
55 | for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) |
56 | page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); |
56 | page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); |
57 | 57 | ||
58 | last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
58 | last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
59 | 59 | ||
60 | return virtaddr; |
60 | return virtaddr; |
61 | } |
61 | } |