Rev 814 | Rev 822 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 814 | Rev 820 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | 39 | ||
| 40 | #include <print.h> |
40 | #include <print.h> |
| 41 | #include <console/cmd.h> |
41 | #include <console/cmd.h> |
| 42 | #include <console/kconsole.h> |
42 | #include <console/kconsole.h> |
| 43 | 43 | ||
| 44 | - | ||
| 45 | size_t hardcoded_unmapped_ktext_size = 0; |
44 | size_t hardcoded_unmapped_ktext_size = 0; |
| 46 | size_t hardcoded_unmapped_kdata_size = 0; |
45 | size_t hardcoded_unmapped_kdata_size = 0; |
| 47 | 46 | ||
| 48 | __address last_frame = 0; |
47 | __address last_frame = 0; |
| 49 | 48 | ||
| 50 | static void init_e820_memory(pfn_t minconf) |
49 | static void init_e820_memory(pfn_t minconf) |
| 51 | { |
50 | { |
| 52 | int i; |
51 | int i; |
| 53 | pfn_t start, size,conf; |
52 | pfn_t start, conf; |
| - | 53 | size_t size; |
|
| 54 | 54 | ||
| 55 | for (i = 0; i < e820counter; i++) { |
55 | for (i = 0; i < e820counter; i++) { |
| 56 | if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { |
56 | if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { |
| 57 | start = ADDR2PFN(ALIGN_UP(e820table[i].base_address, |
57 | start = ADDR2PFN(ALIGN_UP(e820table[i].base_address, |
| 58 | FRAME_SIZE)); |
58 | FRAME_SIZE)); |
| 59 | size = SIZE2PFN(ALIGN_DOWN(e820table[i].size, |
59 | size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size, |
| 60 | FRAME_SIZE)); |
60 | FRAME_SIZE)); |
| 61 | if (minconf < start || minconf >= start+size) |
61 | if (minconf < start || minconf >= start+size) |
| 62 | conf = start; |
62 | conf = start; |
| 63 | else |
63 | else |
| 64 | conf = minconf; |
64 | conf = minconf; |
| 65 | zone_create(start,size, conf, 0); |
65 | zone_create(start, size, conf, 0); |
| 66 | if (last_frame < ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE)) |
66 | if (last_frame < ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE)) |
| 67 | last_frame = ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE); |
67 | last_frame = ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE); |
| 68 | } |
68 | } |
| 69 | } |
69 | } |
| 70 | } |
70 | } |