* CPUs can now be disabled - that is, they will keep idling.
* Added syscalls _kern_set_cpu_enabled() and _kern_cpu_enabled(). * scheduler.c::sRunQueue::tail was not maintained at all; changed sRunQueue to be a simple thread pointer instead of a struct thread_queue. * Turns out we're monitoring CPU activity incorrectly when we've got more than one CPU. * Renamed the global CPU array from "cpu" to gCPU. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16186 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1298,6 +1298,8 @@ thread_get_active_cpu_time(int32 cpuNum)
|
||||
state = disable_interrupts();
|
||||
GRAB_THREAD_LOCK();
|
||||
|
||||
// TODO: this is wrong - the idle threads are arbitrarly executed by the CPUs
|
||||
// there is no CPU affinity!
|
||||
activeTime -= sIdleThreads[cpuNum]->kernel_time;
|
||||
|
||||
RELEASE_THREAD_LOCK();
|
||||
@@ -1382,7 +1384,7 @@ thread_init(kernel_args *args)
|
||||
if (i == 0)
|
||||
arch_thread_set_current_thread(thread);
|
||||
|
||||
thread->cpu = &cpu[i];
|
||||
thread->cpu = &gCPU[i];
|
||||
}
|
||||
sUsedThreads = args->num_cpus;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user