Changeset 65f3117 in mainline
- Timestamp:
- 2023-02-25T13:16:38Z (21 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6188fee
- Parents:
- 4f84ee42
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-14 13:38:14)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-25 13:16:38)
- Location:
- kernel
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/smp/ap.S
r4f84ee42 r65f3117 98 98 .code64 99 99 start64: 100 movabsq $ ctx, %rsp101 movq CONTEXT_OFFSET_SP(%rsp), %rsp100 movabsq $bootstrap_stack_top, %rsp 101 movq (%rsp), %rsp 102 102 103 pushq $0 103 104 pushq $0 104 105 movq %rsp, %rbp -
kernel/arch/ia32/src/smp/ap.S
r4f84ee42 r65f3117 75 75 movw %ax, %es 76 76 movw %ax, %ss 77 movl $KA2PA( ctx), %eax /* KA2PA((uintptr_t) &ctx) */78 movl CONTEXT_OFFSET_SP(%eax), %esp77 movl $KA2PA(bootstrap_stack_top), %eax /* KA2PA((uintptr_t) &bootstrap_stack_top) */ 78 movl (%eax), %esp 79 79 leal KA2PA(0)(%esp), %esp /* KA2PA(ctx.sp) */ 80 80 -
kernel/arch/mips32/src/mm/frame.c
r4f84ee42 r65f3117 111 111 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE, 112 112 KA2PA(config.base), config.kernel_size)) 113 return false;114 115 /* Kernel stack */116 if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,117 KA2PA(config.stack_base), config.stack_size))118 113 return false; 119 114 -
kernel/arch/sparc64/src/sun4u/start.S
r4f84ee42 r65f3117 356 356 * in the ctx global variable. 357 357 */ 358 set ctx, %g1 359 add %g1, CONTEXT_OFFSET_SP, %g1 358 set bootstrap_stack_top, %g1 360 359 ldx [%g1], %o6 361 360 -
kernel/generic/include/config.h
r4f84ee42 r65f3117 87 87 size_t kernel_size; 88 88 89 /** Base adddress of initial stack. */90 uintptr_t stack_base;91 /** Size of initial stack. */92 size_t stack_size;93 94 89 bool identity_configured; 95 90 /** Base address of the kernel identity mapped memory. */ -
kernel/generic/src/main/main.c
r4f84ee42 r65f3117 137 137 uintptr_t stack_safe = 0; 138 138 139 // NOTE: All kernel stacks must be aligned to STACK_SIZE, see CURRENT. 140 const size_t bootstrap_stack_size = STACK_SIZE; 141 _Alignas(STACK_SIZE) uint8_t bootstrap_stack[STACK_SIZE]; 142 /* Just a convenient value for some assembly code. */ 143 const uint8_t *bootstrap_stack_top = bootstrap_stack + STACK_SIZE; 144 139 145 /* 140 146 * These two functions prevent stack from underflowing during the … … 170 176 ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE); 171 177 172 /*173 * NOTE: All kernel stacks must be aligned to STACK_SIZE,174 * see CURRENT.175 */176 177 /* Place the stack after the kernel, init and ballocs. */178 config.stack_base =179 ALIGN_UP(config.base + config.kernel_size, STACK_SIZE);180 config.stack_size = STACK_SIZE;181 182 /* Avoid placing stack on top of init */183 size_t i;184 for (i = 0; i < init.cnt; i++) {185 uintptr_t p = init.tasks[i].paddr + init.tasks[i].size;186 uintptr_t bottom = PA2KA(ALIGN_UP(p, STACK_SIZE));187 188 if (config.stack_base < bottom)189 config.stack_base = bottom;190 }191 192 /* Avoid placing stack on top of boot allocations. */193 if (ballocs.size) {194 uintptr_t bottom =195 ALIGN_UP(ballocs.base + ballocs.size, STACK_SIZE);196 if (config.stack_base < bottom)197 config.stack_base = bottom;198 }199 200 if (config.stack_base < stack_safe)201 config.stack_base = ALIGN_UP(stack_safe, STACK_SIZE);202 203 178 context_save(&ctx); 204 179 context_set(&ctx, FADDR(main_bsp_separated_stack), 205 config.stack_base, STACK_SIZE);180 bootstrap_stack, bootstrap_stack_size); 206 181 context_restore(&ctx); 207 182 /* not reached */ -
kernel/generic/src/mm/frame.c
r4f84ee42 r65f3117 752 752 continue; 753 753 754 if (overlaps(addr, PFN2ADDR(confcount),755 KA2PA(config.stack_base), config.stack_size))756 continue;757 758 754 bool overlap = false; 759 755 for (size_t i = 0; i < init.cnt; i++) { … … 1121 1117 frame_mark_unavailable(ADDR2PFN(KA2PA(config.base)), 1122 1118 SIZE2FRAMES(config.kernel_size)); 1123 frame_mark_unavailable(ADDR2PFN(KA2PA(config.stack_base)),1124 SIZE2FRAMES(config.stack_size));1125 1119 1126 1120 for (size_t i = 0; i < init.cnt; i++)
Note:
See TracChangeset
for help on using the changeset viewer.