Changeset b6b576c in mainline for generic/src/main/main.c
- Timestamp:
- 2006-03-16T11:34:51Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d764ddc
- Parents:
- 8dfef11
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/main/main.c
r8dfef11 rb6b576c 64 64 65 65 config_t config; /**< Global configuration structure. */ 66 init_t init = {0}; /**< Initial user-space tasks */ 66 67 67 68 context_t ctx; … … 75 76 size_t hardcoded_ktext_size = 0; 76 77 size_t hardcoded_kdata_size = 0; 77 78 __address init_addr = 0;79 size_t init_size = 0;80 78 81 79 void main_bsp(void); … … 111 109 config.base = hardcoded_load_address; 112 110 config.memory_size = get_memory_size(); 113 config.init_addr = init_addr;114 config.init_size = init_size;115 111 116 112 config.kernel_size = ALIGN_UP(hardcoded_ktext_size + hardcoded_kdata_size, PAGE_SIZE); 117 113 stackaddr = config.base + config.kernel_size; 114 118 115 /* Avoid placing kernel on top of init */ 119 if (overlaps(stackaddr,CONFIG_STACK_SIZE, 120 config.init_addr, config.init_size)) { 121 122 stackaddr = ALIGN_UP(config.init_addr+config.init_size, 123 CONFIG_STACK_SIZE); 124 config.init_size = ALIGN_UP(config.init_size,CONFIG_STACK_SIZE) + CONFIG_STACK_SIZE; 125 } else { 116 count_t i; 117 bool overlap = false; 118 for (i = 0; i < init.cnt; i++) 119 if (overlaps(stackaddr, CONFIG_STACK_SIZE, init.tasks[i].addr, init.tasks[i].size)) { 120 stackaddr = ALIGN_UP(init.tasks[i].addr + init.tasks[i].size, CONFIG_STACK_SIZE); 121 init.tasks[i].size = ALIGN_UP(init.tasks[i].size, CONFIG_STACK_SIZE) + CONFIG_STACK_SIZE; 122 overlap = true; 123 } 124 125 if (!overlap) 126 126 config.kernel_size += CONFIG_STACK_SIZE; 127 }128 127 129 128 context_save(&ctx); … … 152 151 */ 153 152 kconsole_init(); 154 153 155 154 /* 156 155 * Exception handler initialization, before architecture … … 190 189 thread_init(); 191 190 192 if (config.init_size > 0) 193 printf("config.init_addr=%P, config.init_size=%d\n", config.init_addr, config.init_size); 191 count_t i; 192 for (i = 0; i < init.cnt; i++) 193 printf("init[%d].addr=%P, init[%d].size=%d\n", i, init.tasks[i].addr, i, init.tasks[i].size); 194 194 195 195 ipc_init();
Note:
See TracChangeset
for help on using the changeset viewer.