Rev 4220 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4220 | Rev 4223 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | 51 | ||
52 | /** Map memory-mapped device into virtual memory. |
52 | /** Map memory-mapped device into virtual memory. |
53 | * |
53 | * |
54 | * We are currently using identity mapping for mapping device registers. |
54 | * We are currently using identity mapping for mapping device registers. |
55 | * |
55 | * |
56 | * @param physaddr Physical address of the page where the device is |
56 | * @param physaddr Physical address of the page where the device is |
57 | * located. |
57 | * located. |
58 | * @param size Size of the device's registers. This argument is |
58 | * @param size Size of the device's registers. |
59 | * ignored. |
59 | * |
- | 60 | * @return Virtual address of the page where the device is mapped. |
|
60 | * |
61 | * |
61 | * @return Virtual address of the page where the device is mapped. |
- | |
62 | */ |
62 | */ |
63 | uintptr_t hw_map(uintptr_t physaddr, size_t size) |
63 | uintptr_t hw_map(uintptr_t physaddr, size_t size) |
64 | { |
64 | { |
65 | if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) |
65 | if (last_frame + ALIGN_UP(size, PAGE_SIZE) > KA2PA(KERNEL_ADDRESS_SPACE_END_ARCH)) |
66 | panic("Unable to map physical memory %p (%d bytes).", physaddr, size) |
66 | panic("Unable to map physical memory %p (%d bytes).", physaddr, size) |