Make scheduler_reschedule() an no-op until we're ready to start the

scheduler. This avoids the need to use the send_signal_etc() work-around for
resume_thread() during the early kernel initialization. Might fix #5851.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36530 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-04-29 15:10:37 +00:00
parent d3a302aae8
commit 28d05e026f
3 changed files with 28 additions and 1 deletions

View File

@ -62,6 +62,7 @@ void scheduler_add_listener(struct SchedulerListener* listener);
void scheduler_remove_listener(struct SchedulerListener* listener);
void scheduler_init(void);
void scheduler_enable_scheduling(void);
bigtime_t _user_estimate_max_scheduling_latency(thread_id thread);
status_t _user_analyze_scheduling(bigtime_t from, bigtime_t until, void* buffer,

View File

@ -192,7 +192,10 @@ _start(kernel_args *bootKernelArgs, int currentCPU)
TRACE("spawning main2 thread\n");
thread_id thread = spawn_kernel_thread(&main2, "main2",
B_NORMAL_PRIORITY, NULL);
send_signal_etc(thread, SIGCONT, B_DO_NOT_RESCHEDULE);
resume_thread(thread);
// We're ready to start the scheduler and enable interrupts on all CPUs.
scheduler_enable_scheduling();
// bring up the AP cpus in a lock step fashion
TRACE("waking up AP cpus\n");

View File

@ -18,6 +18,17 @@
struct scheduler_ops* gScheduler;
SchedulerListenerList gSchedulerListeners;
static void (*sRescheduleFunction)(void);
static void
scheduler_reschedule_no_op(void)
{
}
// #pragma mark -
SchedulerListener::~SchedulerListener()
{
@ -62,6 +73,11 @@ scheduler_init(void)
scheduler_simple_init();
}
// Disable rescheduling until the basic kernel initialization is done and
// CPUs are ready to enable interrupts.
sRescheduleFunction = gScheduler->reschedule;
gScheduler->reschedule = scheduler_reschedule_no_op;
#if SCHEDULER_TRACING
add_debugger_command_etc("scheduler", &cmd_scheduler,
"Analyze scheduler tracing information",
@ -72,6 +88,13 @@ scheduler_init(void)
}
void
scheduler_enable_scheduling(void)
{
gScheduler->reschedule = sRescheduleFunction;
}
// #pragma mark - Syscalls