Rev 2131 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2131 | Rev 2307 | ||
|---|---|---|---|
| Line 262... | Line 262... | ||
| 262 | page_mapping_operations = &pt_mapping_operations; |
262 | page_mapping_operations = &pt_mapping_operations; |
| 263 | 263 | ||
| 264 | uintptr_t cur; |
264 | uintptr_t cur; |
| 265 | int flags; |
265 | int flags; |
| 266 | 266 | ||
| 267 | /* Frames below 128 MB are mapped using BAT, |
- | |
| 268 | map rest of the physical memory */ |
- | |
| 269 | for (cur = 128 << 20; cur < last_frame; cur += FRAME_SIZE) { |
267 | for (cur = 128 << 20; cur < last_frame; cur += FRAME_SIZE) { |
| 270 | flags = PAGE_CACHEABLE; |
268 | flags = PAGE_CACHEABLE | PAGE_WRITE; |
| 271 | if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) |
269 | if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size)) |
| 272 | flags |= PAGE_GLOBAL; |
270 | flags |= PAGE_GLOBAL; |
| 273 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
271 | page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); |
| 274 | } |
272 | } |
| 275 | 273 | ||
| Line 294... | Line 292... | ||
| 294 | panic("Unable to map physical memory %p (%d bytes)", physaddr, size) |
292 | panic("Unable to map physical memory %p (%d bytes)", physaddr, size) |
| 295 | 293 | ||
| 296 | uintptr_t virtaddr = PA2KA(last_frame); |
294 | uintptr_t virtaddr = PA2KA(last_frame); |
| 297 | pfn_t i; |
295 | pfn_t i; |
| 298 | for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) |
296 | for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) |
| 299 | page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE); |
297 | page_mapping_insert(AS_KERNEL, virtaddr + PFN2ADDR(i), physaddr + PFN2ADDR(i), PAGE_NOT_CACHEABLE | PAGE_WRITE); |
| 300 | 298 | ||
| 301 | last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
299 | last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
| 302 | 300 | ||
| 303 | return virtaddr; |
301 | return virtaddr; |
| 304 | } |
302 | } |