1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

kernel/tasks: initialize task->last_core with initial core instead of 0

Otherwise it's not possible to determine on which core a task is running
if it hasn't been rescheduled at least one time.
This commit is contained in:
daniel-k 2016-07-08 18:23:51 +02:00
parent f93e66b4df
commit b7d2dc95c5

View file

@ -376,7 +376,7 @@ int clone_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio)
if (task_table[i].status == TASK_INVALID) {
task_table[i].id = i;
task_table[i].status = TASK_READY;
task_table[i].last_core = 0;
task_table[i].last_core = core_id;
task_table[i].last_stack_pointer = NULL;
task_table[i].stack = stack;
task_table[i].prio = prio;
@ -476,7 +476,7 @@ int create_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio, uint32_t c
if (task_table[i].status == TASK_INVALID) {
task_table[i].id = i;
task_table[i].status = TASK_READY;
task_table[i].last_core = 0;
task_table[i].last_core = core_id;
task_table[i].last_stack_pointer = NULL;
task_table[i].stack = stack;
task_table[i].prio = prio;