Rev 4148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4148 | Rev 4403 | ||
---|---|---|---|
Line 128... | Line 128... | ||
128 | #endif |
128 | #endif |
129 | 129 | ||
130 | phys = ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE); |
130 | phys = ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE); |
131 | offset = pio_addr - phys; |
131 | offset = pio_addr - phys; |
132 | pages = ALIGN_UP(offset + size, PAGE_SIZE) >> PAGE_WIDTH; |
132 | pages = ALIGN_UP(offset + size, PAGE_SIZE) >> PAGE_WIDTH; |
133 | virt = as_get_mappable_page(pages); |
133 | virt = as_get_mappable_page(pages << PAGE_WIDTH); |
134 | *use_addr = virt + offset; |
134 | *use_addr = virt + offset; |
135 | return physmem_map(phys, virt, pages, AS_AREA_READ | AS_AREA_WRITE); |
135 | return physmem_map(phys, virt, pages, AS_AREA_READ | AS_AREA_WRITE); |
136 | } |
136 | } |
137 | 137 | ||
138 | /** @} |
138 | /** @} |