Rev 590 | Rev 606 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 590 | Rev 605 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | #include <arch.h> |
32 | #include <arch.h> |
33 | #include <arch/byteorder.h> |
33 | #include <arch/byteorder.h> |
34 | #include <arch/mm/frame.h> |
34 | #include <arch/mm/frame.h> |
35 | #include <mm/frame.h> |
35 | #include <mm/frame.h> |
36 | #include <interrupt.h> |
36 | #include <interrupt.h> |
- | 37 | #include <align.h> |
|
37 | 38 | ||
38 | /* This is a good joke, SGI HAS different types than NT bioses... */ |
39 | /* This is a good joke, SGI HAS different types than NT bioses... */ |
39 | /* Here is the SGI type */ |
40 | /* Here is the SGI type */ |
40 | static char *basetypes[] = { |
41 | static char *basetypes[] = { |
41 | "ExceptionBlock", |
42 | "ExceptionBlock", |
Line 261... | Line 262... | ||
261 | */ |
262 | */ |
262 | void arc_frame_init(void) |
263 | void arc_frame_init(void) |
263 | { |
264 | { |
264 | arc_memdescriptor_t *desc; |
265 | arc_memdescriptor_t *desc; |
265 | int total = 0; |
266 | int total = 0; |
- | 267 | __address base; |
|
- | 268 | size_t basesize; |
|
- | 269 | unsigned int i,j; |
|
266 | 270 | ||
267 | desc = arc_entry->getmemorydescriptor(NULL); |
271 | desc = arc_entry->getmemorydescriptor(NULL); |
268 | while (desc) { |
272 | while (desc) { |
269 | if (desc->type == FreeMemory || |
273 | if (desc->type == FreeMemory || |
270 | desc->type == FreeContiguous) { |
274 | desc->type == FreeContiguous) { |
271 | total += desc->basecount*ARC_FRAME; |
275 | base = desc->basepage*ARC_FRAME; |
272 | zone_create_in_region(desc->basepage*ARC_FRAME, |
276 | basesize = desc->basecount*ARC_FRAME; |
- | 277 | ||
- | 278 | if (base % FRAME_SIZE ) { |
|
- | 279 | basesize -= FRAME_SIZE - (base % FRAME_SIZE); |
|
273 | desc->basecount*ARC_FRAME); |
280 | base = ALIGN_UP(base, FRAME_SIZE); |
- | 281 | } |
|
- | 282 | basesize = ALIGN_DOWN(basesize, FRAME_SIZE); |
|
- | 283 | ||
- | 284 | total += basesize; |
|
- | 285 | zone_create_in_region(base, basesize); |
|
274 | } |
286 | } |
275 | desc = arc_entry->getmemorydescriptor(desc); |
287 | desc = arc_entry->getmemorydescriptor(desc); |
276 | } |
288 | } |
277 | 289 | ||
278 | config.memory_size = total; |
290 | config.memory_size = total; |