1.1 --- a/stage2/tasks.c Sat Apr 23 23:25:58 2016 +0200
1.2 +++ b/stage2/tasks.c Sun Apr 24 01:29:39 2016 +0200
1.3 @@ -45,6 +45,11 @@
1.4 void init_tasks()
1.5 {
1.6 current_task = 0;
1.7 + init_task();
1.8 +}
1.9 +
1.10 +void init_task()
1.11 +{
1.12 current_stack_pointer = &stack_pointers[current_task];
1.13 current_registers = registers[current_task];
1.14 }
1.15 @@ -84,9 +89,5 @@
1.16
1.17 current_task++;
1.18 if (current_task == max_tasks) current_task = 0;
1.19 -
1.20 - /* Indicate the current stack pointer and task registers. */
1.21 -
1.22 - current_stack_pointer = &stack_pointers[current_task];
1.23 - current_registers = registers[current_task];
1.24 + init_task();
1.25 }
2.1 --- a/stage2/tasks.h Sat Apr 23 23:25:58 2016 +0200
2.2 +++ b/stage2/tasks.h Sun Apr 24 01:29:39 2016 +0200
2.3 @@ -8,6 +8,7 @@
2.4 /* Task management functions. */
2.5
2.6 void init_tasks(void);
2.7 +void init_task(void);
2.8 void start_task(unsigned short, void (*)(), u32[], u8);
2.9 void switch_task(void);
2.10