Rev 195 | Rev 251 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 195 | Rev 226 | ||
---|---|---|---|
Line 52... | Line 52... | ||
52 | */ |
52 | */ |
53 | void map_structure(__address s, size_t size) |
53 | void map_structure(__address s, size_t size) |
54 | { |
54 | { |
55 | int i, cnt, length; |
55 | int i, cnt, length; |
56 | 56 | ||
57 | /* TODO: implement portable way of computing page address from address */ |
- | |
58 | length = size + (s - (s & 0xfffff000)); |
57 | length = size + (s - (s & ~(PAGE_SIZE-1))); |
59 | cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0); |
58 | cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0); |
60 | 59 | ||
61 | for (i = 0; i < cnt; i++) |
60 | for (i = 0; i < cnt; i++) |
62 | map_page_to_frame(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); |
61 | map_page_to_frame(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); |
63 | 62 |