* merge fixes
This commit is contained in:
parent
1e238e4131
commit
11bc939d67
@ -76,7 +76,7 @@ void kernel_init(void)
|
|||||||
|
|
||||||
sched_init();
|
sched_init();
|
||||||
|
|
||||||
if (thread_create(&main_tcb, main_stack, sizeof(main_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_stack, idle_name) < 0) {
|
if (thread_create(&main_tcb, main_stack, sizeof(main_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, idle_name) < 0) {
|
||||||
printf("kernel_init(): error creating idle task.\n");
|
printf("kernel_init(): error creating idle task.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -149,14 +149,12 @@ extern void cpu_switch_context_exit(void);
|
|||||||
void sched_task_exit(void) {
|
void sched_task_exit(void) {
|
||||||
DEBUG("sched_task_exit(): ending task %s...\n", active_thread->name);
|
DEBUG("sched_task_exit(): ending task %s...\n", active_thread->name);
|
||||||
|
|
||||||
tcb* thread = (tcb*)active_thread;
|
|
||||||
dINT();
|
dINT();
|
||||||
sched_threads[active_thread->pid] = NULL;
|
sched_threads[active_thread->pid] = NULL;
|
||||||
num_tasks--;
|
num_tasks--;
|
||||||
|
|
||||||
sched_set_status((tcb*)active_thread, STATUS_STOPPED);
|
sched_set_status((tcb*)active_thread, STATUS_STOPPED);
|
||||||
|
|
||||||
free(((tcb*)active_thread)->stack_start);
|
|
||||||
active_thread = NULL;
|
active_thread = NULL;
|
||||||
cpu_switch_context_exit();
|
cpu_switch_context_exit();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ int thread_create(tcb *cb, char *stack, int stacksize, char priority, int flags,
|
|||||||
while (pid < MAXTHREADS) {
|
while (pid < MAXTHREADS) {
|
||||||
if (sched_threads[pid] == NULL) {
|
if (sched_threads[pid] == NULL) {
|
||||||
sched_threads[pid] = cb;
|
sched_threads[pid] = cb;
|
||||||
pd->pid = pid;
|
cb->pid = pid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pid++;
|
pid++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user