From b81068c0c8839b9ef4923471e9e5443375784c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 27 Oct 2004 14:00:40 +0000 Subject: [PATCH] Turns out that the interrupts were temporarily turned on during startup, and that main2() cannot therefore just wait until interrupts become enabled. Now, the main2() thread is resumed after interrupts are turned on. I am not yet sure if this is really necessary, but I have the feeling that it is. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9531 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/kernel/core/main.c b/src/kernel/core/main.c index 94d244cae3..486dbe05d6 100644 --- a/src/kernel/core/main.c +++ b/src/kernel/core/main.c @@ -55,6 +55,8 @@ int _start(kernel_args *oldka, int cpu); /* keep compiler happy */ int _start(kernel_args *oldka, int cpu_num) { + thread_id thread = -1; + kernel_startup = true; if (oldka->kernel_args_size != sizeof(kernel_args) @@ -123,10 +125,7 @@ _start(kernel_args *oldka, int cpu_num) elf_init(&ka); // start a thread to finish initializing the rest of the system - { - thread_id thread = spawn_kernel_thread(&main2, "main2", B_NORMAL_PRIORITY, NULL); - resume_thread(thread); - } + thread = spawn_kernel_thread(&main2, "main2", B_NORMAL_PRIORITY, NULL); smp_wake_up_all_non_boot_cpus(); smp_enable_ici(); // ici's were previously being ignored @@ -143,6 +142,9 @@ _start(kernel_args *oldka, int cpu_num) kernel_startup = false; enable_interrupts(); + if (thread >= B_OK) + resume_thread(thread); + TRACE(("main: done... begin idle loop on cpu %d\n", cpu_num)); for (;;) arch_cpu_idle(); @@ -170,11 +172,6 @@ main2(void *unused) TRACE(("Bootstrap file systems\n")); vfs_bootstrap_file_systems(); - // before we bring up the device drivers, we better wait until - // interrupts become available, to make sure they'll work as expected - while (!are_interrupts_enabled()) - snooze(10000); - TRACE(("Init Device Manager\n")); device_manager_init(&ka);