Changeset f2cb80a in mainline for kernel/generic/src/main/main.c


Ignore:
Timestamp:
2024-02-23T17:57:23Z (3 months ago)
Author:
GitHub <noreply@…>
Children:
192019f
Parents:
86f862c (diff), 90ba06c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2024-02-23 17:57:23)
git-committer:
GitHub <noreply@…> (2024-02-23 17:57:23)
Message:

Merge branch 'HelenOS:master' into topic/packet-capture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/main.c

    r86f862c rf2cb80a  
    8080#include <arch/arch.h>
    8181#include <arch.h>
    82 #include <arch/faddr.h>
    8382#include <ipc/ipc.h>
    8483#include <macros.h>
     
    174173            ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE);
    175174
    176         context_save(&ctx);
    177         context_set(&ctx, FADDR(main_bsp_separated_stack),
     175        context_create(&ctx, main_bsp_separated_stack,
    178176            bootstrap_stack, bootstrap_stack_size);
    179177        context_restore(&ctx);
     
    282280        if (!kinit_thread)
    283281                panic("Cannot create kinit thread.");
    284         thread_ready(kinit_thread);
    285 
    286         /*
    287          * This call to scheduler() will return to kinit,
     282        thread_start(kinit_thread);
     283        thread_detach(kinit_thread);
     284
     285        /*
     286         * This call to scheduler_run() will return to kinit,
    288287         * starting the thread of kernel threads.
    289288         */
    290         scheduler();
     289        current_copy(CURRENT, (current_t *) CPU_LOCAL->stack);
     290        context_replace(scheduler_run, CPU_LOCAL->stack, STACK_SIZE);
    291291        /* not reached */
    292292}
     
    328328        ARCH_OP(post_cpu_init);
    329329
    330         current_copy(CURRENT, (current_t *) CPU->stack);
    331 
    332330        /*
    333331         * If we woke kmp up before we left the kernel stack, we could
     
    335333         * switch to this cpu's private stack prior to waking kmp up.
    336334         */
    337         context_t ctx;
    338         context_save(&ctx);
    339         context_set(&ctx, FADDR(main_ap_separated_stack),
    340             (uintptr_t) CPU->stack, STACK_SIZE);
    341         context_restore(&ctx);
     335        current_copy(CURRENT, (current_t *) CPU_LOCAL->stack);
     336        context_replace(main_ap_separated_stack, CPU_LOCAL->stack, STACK_SIZE);
    342337        /* not reached */
    343338}
     
    356351
    357352        semaphore_up(&ap_completion_semaphore);
    358         scheduler();
     353        scheduler_run();
    359354        /* not reached */
    360355}
Note: See TracChangeset for help on using the changeset viewer.