Changeset d1da1ff2 in mainline
- Timestamp:
- 2018-11-01T22:20:13Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2e4343b
- Parents:
- a6e55886
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-01 16:25:16)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-01 22:20:13)
- Location:
- kernel/generic/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cpu/cpu.c
ra6e55886 rd1da1ff2 72 72 memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0); 73 73 74 // XXX: All kernel stacks must be aligned to STACK_SIZE, 75 // see get_current(). 74 76 size_t i; 75 77 for (i = 0; i < config.cpu_count; i++) { -
kernel/generic/src/main/main.c
ra6e55886 rd1da1ff2 173 173 ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE); 174 174 175 // XXX: All kernel stacks must be aligned to STACK_SIZE, 176 // see get_current(). 177 175 178 /* Place the stack after the kernel, init and ballocs. */ 176 config.stack_base = config.base + config.kernel_size; 179 config.stack_base = 180 ALIGN_UP(config.base + config.kernel_size, STACK_SIZE); 177 181 config.stack_size = STACK_SIZE; 178 182 … … 181 185 for (i = 0; i < init.cnt; i++) { 182 186 uintptr_t p = init.tasks[i].paddr + init.tasks[i].size; 183 uintptr_t bottom = PA2KA(ALIGN_UP(p, PAGE_SIZE));187 uintptr_t bottom = PA2KA(ALIGN_UP(p, STACK_SIZE)); 184 188 185 189 if (config.stack_base < bottom) … … 190 194 if (ballocs.size) { 191 195 uintptr_t bottom = 192 ALIGN_UP(ballocs.base + ballocs.size, PAGE_SIZE);196 ALIGN_UP(ballocs.base + ballocs.size, STACK_SIZE); 193 197 if (config.stack_base < bottom) 194 198 config.stack_base = bottom; … … 196 200 197 201 if (config.stack_base < stack_safe) 198 config.stack_base = ALIGN_UP(stack_safe, PAGE_SIZE);202 config.stack_base = ALIGN_UP(stack_safe, STACK_SIZE); 199 203 200 204 context_save(&ctx); -
kernel/generic/src/proc/thread.c
ra6e55886 rd1da1ff2 194 194 kmflags &= ~FRAME_HIGHMEM; 195 195 196 // XXX: All kernel stacks must be aligned to STACK_SIZE, 197 // see get_current(). 198 196 199 uintptr_t stack_phys = 197 200 frame_alloc(STACK_FRAMES, kmflags, STACK_SIZE - 1);
Note:
See TracChangeset
for help on using the changeset viewer.