]> git.corax.cc Git - corax/commitdiff
Don't perform arithmetic on the stack pointer arguments within task_prepare, i.e...
authorMatthias Kruk <m@m10k.eu>
Tue, 1 Oct 2019 07:01:49 +0000 (16:01 +0900)
committerMatthias Kruk <m@m10k.eu>
Tue, 1 Oct 2019 07:01:49 +0000 (16:01 +0900)
kernel/arch/task.S
kernel/core/process.c

index bd092ea21b95ff4286c3cb6e2fdaaf6c432c6c7f..032e2a597af29d7fa8aa95de160b611a03c4d862 100644 (file)
@@ -53,7 +53,6 @@ task_prepare:
 
        /* calculate stack start (since it grows down) */
        movl    16(%esp), %eax
-       addl    $CONFIG_KERNEL_STACK_SIZE, %eax
 
        /*
         * We will use _int_restore (the lower half of the interrupt handler)
index 387907c36ae648124bbd4841fb89c657edbbb537..8a4429d8ea3293fb9e358ecc793d61271fea3e4a 100644 (file)
@@ -48,7 +48,8 @@ int process_create(process_t **dst, u32_t ppl, void *entry)
                proc->p_privl = ppl;
 
                task_prepare(proc->p_tasks, (u32_t)pdbr, (u32_t)entry,
-                                        (u32_t)kstack, (u32_t)ustack + PAGE_SIZE, ppl);
+                                        (u32_t)kstack + CONFIG_KERNEL_STACK_SIZE,
+                                        (u32_t)ustack + CONFIG_USER_STACK_SIZE, ppl);
 
                proc->p_tasks->t_sp = (u32_t)(CONFIG_KERNEL_STACK_BASE +
                                                                          ((u32_t)proc->p_tasks->t_sp - (u32_t)kstack));