Rev 2087 | Rev 2701 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2087 | Rev 2697 | ||
---|---|---|---|
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 + e820table[i].size, FRAME_SIZE)) |
71 | if (last_frame < ALIGN_UP(e820table[i].base_address + e820table[i].size, FRAME_SIZE)) |
Line 109... | Line 107... | ||
109 | 107 | ||
110 | 108 | ||
111 | void frame_arch_init(void) |
109 | void frame_arch_init(void) |
112 | { |
110 | { |
113 | static pfn_t minconf; |
111 | static pfn_t minconf; |
114 | 112 | ||
115 | if (config.cpu_active == 1) { |
113 | if (config.cpu_active == 1) { |
116 | cmd_initialize(&e820_info); |
114 | cmd_initialize(&e820_info); |
117 | cmd_register(&e820_info); |
115 | cmd_register(&e820_info); |
118 | 116 | ||
119 | - | ||
120 | minconf = 1; |
117 | minconf = 1; |
121 | #ifdef CONFIG_SMP |
118 | #ifdef CONFIG_SMP |
122 | minconf = max(minconf, |
119 | minconf = max(minconf, |
123 | ADDR2PFN(AP_BOOT_OFFSET+hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size)); |
120 | ADDR2PFN(AP_BOOT_OFFSET + hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size)); |
124 | #endif |
121 | #endif |
125 | #ifdef CONFIG_SIMICS_FIX |
122 | #ifdef CONFIG_SIMICS_FIX |
126 | minconf = max(minconf, ADDR2PFN(0x10000)); |
123 | minconf = max(minconf, ADDR2PFN(0x10000)); |
127 | #endif |
124 | #endif |
128 | init_e820_memory(minconf); |
125 | init_e820_memory(minconf); |
Line 131... | Line 128... | ||
131 | frame_mark_unavailable(0, 1); |
128 | frame_mark_unavailable(0, 1); |
132 | 129 | ||
133 | #ifdef CONFIG_SMP |
130 | #ifdef CONFIG_SMP |
134 | /* Reserve AP real mode bootstrap memory */ |
131 | /* Reserve AP real mode bootstrap memory */ |
135 | frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, |
132 | frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, |
136 | (hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size) >> FRAME_WIDTH); |
133 | (hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size) >> FRAME_WIDTH); |
137 | 134 | ||
138 | #ifdef CONFIG_SIMICS_FIX |
135 | #ifdef CONFIG_SIMICS_FIX |
139 | /* Don't know why, but these addresses help */ |
136 | /* Don't know why, but these addresses help */ |
140 | frame_mark_unavailable(0xd000 >> FRAME_WIDTH,3); |
137 | frame_mark_unavailable(0xd000 >> FRAME_WIDTH, 3); |
141 | #endif |
138 | #endif |
142 | #endif |
139 | #endif |
143 | } |
140 | } |
144 | } |
141 | } |
145 | 142 |