Rev 1983 | Rev 2048 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1983 | Rev 1988 | ||
|---|---|---|---|
| Line 43... | Line 43... | ||
| 43 | uintptr_t last_frame = NULL; |
43 | uintptr_t last_frame = NULL; |
| 44 | 44 | ||
| 45 | /** Create memory zones according to information stored in bootinfo. |
45 | /** Create memory zones according to information stored in bootinfo. |
| 46 | * |
46 | * |
| 47 | * Walk the bootinfo memory map and create frame zones according to it. |
47 | * Walk the bootinfo memory map and create frame zones according to it. |
| 48 | * The first frame is not blacklisted here as it is done in generic |
- | |
| 49 | * frame_init(). |
- | |
| 50 | */ |
48 | */ |
| 51 | void frame_arch_init(void) |
49 | void frame_arch_init(void) |
| 52 | { |
50 | { |
| 53 | int i; |
51 | int i; |
| 54 | pfn_t confdata; |
52 | pfn_t confdata; |
| Line 60... | Line 58... | ||
| 60 | 58 | ||
| 61 | /* |
59 | /* |
| 62 | * The memmap is created by HelenOS boot loader. |
60 | * The memmap is created by HelenOS boot loader. |
| 63 | * It already contains no holes. |
61 | * It already contains no holes. |
| 64 | */ |
62 | */ |
| 65 | 63 | ||
| 66 | confdata = ADDR2PFN(start); |
64 | confdata = ADDR2PFN(start); |
| 67 | if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) |
65 | if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) |
| 68 | confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); |
66 | confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); |
| 69 | zone_create(ADDR2PFN(start), SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)), confdata, 0); |
67 | zone_create(ADDR2PFN(start), SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)), confdata, 0); |
| 70 | last_frame = max(last_frame, start + ALIGN_UP(size, FRAME_SIZE)); |
68 | last_frame = max(last_frame, start + ALIGN_UP(size, FRAME_SIZE)); |
| 71 | } |
69 | } |
| - | 70 | ||
| - | 71 | /* |
|
| - | 72 | * On sparc64, physical memory can start on a non-zero address. |
|
| - | 73 | * The generic frame_init() only marks PFN 0 as not free, so we |
|
| - | 74 | * must mark the physically first frame not free explicitly here, |
|
| - | 75 | * no matter what is its address. |
|
| - | 76 | */ |
|
| - | 77 | frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1); |
|
| 72 | } |
78 | } |
| 73 | 79 | ||
| 74 | /* |
- | |
| 75 | * On sparc64, physical memory can start on a non-zero address. |
- | |
| 76 | * The generic frame_init() only marks PFN 0 as not free, so we |
- | |
| 77 | * must mark the physically first frame not free explicitly here, |
- | |
| 78 | * no matter what is its address. |
- | |
| 79 | */ |
- | |
| 80 | frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1); |
- | |
| 81 | } |
80 | } |
| 82 | 81 | ||
| 83 | /** @} |
82 | /** @} |
| 84 | */ |
83 | */ |