Rev 2927 | Rev 4343 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2927 | Rev 3588 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | #include <config.h> |
45 | #include <config.h> |
46 | #include <panic.h> |
46 | #include <panic.h> |
47 | #include <arch/asm.h> |
47 | #include <arch/asm.h> |
48 | #include <arch/barrier.h> |
48 | #include <arch/barrier.h> |
49 | #include <memstr.h> |
49 | #include <memstr.h> |
- | 50 | #include <align.h> |
|
50 | 51 | ||
51 | static void set_environment(void); |
52 | static void set_environment(void); |
52 | 53 | ||
53 | /** Initialize ia64 virtual address translation subsystem. */ |
54 | /** Initialize ia64 virtual address translation subsystem. */ |
54 | void page_arch_init(void) |
55 | void page_arch_init(void) |
Line 260... | Line 261... | ||
260 | v->present.ps = PAGE_WIDTH; |
261 | v->present.ps = PAGE_WIDTH; |
261 | v->present.key = 0; |
262 | v->present.key = 0; |
262 | v->present.tag.tag_word = tag; |
263 | v->present.tag.tag_word = tag; |
263 | } |
264 | } |
264 | 265 | ||
- | 266 | extern uintptr_t last_frame; |
|
- | 267 | ||
- | 268 | ||
- | 269 | uintptr_t hw_map(uintptr_t physaddr, size_t size) |
|
- | 270 | { |
|
- | 271 | if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) |
|
- | 272 | panic("Unable to map physical memory %p (%d bytes)", physaddr, size) |
|
- | 273 | ||
- | 274 | uintptr_t virtaddr = PA2KA(last_frame); |
|
- | 275 | pfn_t i; |
|
- | 276 | for (i = 0; i < ADDR2PFN(ALIGN_UP(size, PAGE_SIZE)); i++) { |
|
- | 277 | uintptr_t addr = PFN2ADDR(i); |
|
- | 278 | page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, PAGE_NOT_CACHEABLE | PAGE_WRITE); |
|
- | 279 | } |
|
- | 280 | ||
- | 281 | last_frame = ALIGN_UP(last_frame + size, FRAME_SIZE); |
|
- | 282 | ||
- | 283 | return virtaddr; |
|
- | 284 | } |
|
- | 285 | ||
- | 286 | ||
- | 287 | ||
265 | /** @} |
288 | /** @} |
266 | */ |
289 | */ |