Rev 2701 | Rev 2712 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2701 | Rev 2702 | ||
|---|---|---|---|
| Line 59... | Line 59... | ||
| 59 | pfn_t start, conf; |
59 | pfn_t start, conf; |
| 60 | size_t size; |
60 | size_t size; |
| 61 | 61 | ||
| 62 | for (i = 0; i < e820counter; i++) { |
62 | for (i = 0; i < e820counter; i++) { |
| 63 | if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { |
63 | if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) { |
| 64 | start = ADDR2PFN(ALIGN_UP(e820table[i].base_address, |
64 | start = ADDR2PFN(ALIGN_UP(e820table[i].base_address, FRAME_SIZE)); |
| 65 | FRAME_SIZE)); |
- | |
| 66 | size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size, |
65 | size = SIZE2FRAMES(ALIGN_DOWN(e820table[i].size, FRAME_SIZE)); |
| 67 | FRAME_SIZE)); |
- | |
| 68 | if ((minconf < start) || (minconf >= start + size)) |
66 | if ((minconf < start) || (minconf >= start + size)) |
| 69 | conf = start; |
67 | conf = start; |
| 70 | else |
68 | else |
| 71 | conf = minconf; |
69 | conf = minconf; |
| 72 | zone_create(start, size, conf, 0); |
70 | zone_create(start, size, conf, 0); |
| 73 | if (last_frame < ALIGN_UP(e820table[i].base_address + |
71 | if (last_frame < ALIGN_UP(e820table[i].base_address + |
| 74 | e820table[i].size, FRAME_SIZE)) |
72 | e820table[i].size, FRAME_SIZE)) |
| 75 | last_frame = |
73 | last_frame = |
| 76 | ALIGN_UP(e820table[i].base_address + |
74 | ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE); |
| 77 | e820table[i].size, FRAME_SIZE); |
- | |
| 78 | } |
75 | } |
| 79 | } |
76 | } |
| 80 | } |
77 | } |
| 81 | 78 | ||
| 82 | static int cmd_e820mem(cmd_arg_t *argv); |
79 | static int cmd_e820mem(cmd_arg_t *argv); |
| Line 85... | Line 82... | ||
| 85 | .description = "List e820 memory.", |
82 | .description = "List e820 memory.", |
| 86 | .func = cmd_e820mem, |
83 | .func = cmd_e820mem, |
| 87 | .argc = 0 |
84 | .argc = 0 |
| 88 | }; |
85 | }; |
| 89 | 86 | ||
| 90 | static char *e820names[] = { "invalid", "available", "reserved", "acpi", "nvs", |
87 | static char *e820names[] = { |
| - | 88 | "invalid", |
|
| - | 89 | "available", |
|
| - | 90 | "reserved", |
|
| - | 91 | "acpi", |
|
| - | 92 | "nvs", |
|
| 91 | "unusable" }; |
93 | "unusable" |
| - | 94 | }; |
|
| 92 | 95 | ||
| 93 | 96 | ||
| 94 | static int cmd_e820mem(cmd_arg_t *argv) |
97 | static int cmd_e820mem(cmd_arg_t *argv) |
| 95 | { |
98 | { |
| 96 | int i; |
99 | int i; |