Changes in kernel/generic/src/main/main.c [dabbe28:26aafe8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/main.c
rdabbe28 r26aafe8 68 68 #include <mm/page.h> 69 69 #include <genarch/mm/page_pt.h> 70 #include <mm/km.h>71 70 #include <mm/tlb.h> 72 71 #include <mm/as.h> … … 87 86 #include <sysinfo/sysinfo.h> 88 87 #include <sysinfo/stats.h> 89 #include <lib/ra.h>90 88 91 89 /** Global configuration structure. */ 92 config_t config = { 93 .identity_configured = false, 94 .non_identity_configured = false, 95 .physmem_end = 0 96 }; 90 config_t config; 97 91 98 92 /** Initial user-space tasks */ … … 151 145 size_t i; 152 146 for (i = 0; i < init.cnt; i++) { 153 if (overlaps(KA2PA(config.stack_base), config.stack_size, 154 init.tasks[i].paddr, init.tasks[i].size)) { 155 /* 156 * The init task overlaps with the memory behind the 157 * kernel image so it must be in low memory and we can 158 * use PA2KA on the init task's physical address. 159 */ 160 config.stack_base = ALIGN_UP( 161 PA2KA(init.tasks[i].paddr) + init.tasks[i].size, 162 config.stack_size); 163 } 147 if (PA_OVERLAPS(config.stack_base, config.stack_size, 148 init.tasks[i].addr, init.tasks[i].size)) 149 config.stack_base = ALIGN_UP(init.tasks[i].addr + 150 init.tasks[i].size, config.stack_size); 164 151 } 165 152 … … 218 205 */ 219 206 arch_pre_mm_init(); 220 km_identity_init();221 207 frame_init(); 208 209 /* Initialize at least 1 memory segment big enough for slab to work. */ 222 210 slab_cache_init(); 223 ra_init();224 211 sysinfo_init(); 225 212 btree_init(); … … 227 214 page_init(); 228 215 tlb_init(); 229 km_non_identity_init();230 216 ddi_init(); 231 217 arch_post_mm_init(); … … 257 243 for (i = 0; i < init.cnt; i++) 258 244 LOG("init[%zu].addr=%p, init[%zu].size=%zu", 259 i, (void *) init.tasks[i]. paddr, i, init.tasks[i].size);245 i, (void *) init.tasks[i].addr, i, init.tasks[i].size); 260 246 } else 261 247 printf("No init binaries found.\n"); … … 276 262 * Create the first thread. 277 263 */ 278 thread_t *kinit_thread =279 264 thread_t *kinit_thread 265 = thread_create(kinit, NULL, kernel, 0, "kinit", true); 280 266 if (!kinit_thread) 281 267 panic("Cannot create kinit thread.");
Note:
See TracChangeset
for help on using the changeset viewer.