aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-30 22:28:51 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-30 22:28:51 +0100
commitf560a5312f524caaa427f4f548b97ab3f32904b8 (patch)
tree98a11c0c7c21a410bdfcaba20766567d4496527b /kernel
parent891742e62d79aeaf7dfd052df87777c2e4826357 (diff)
downloadfbos-f560a5312f524caaa427f4f548b97ab3f32904b8.tar.gz
fbos-f560a5312f524caaa427f4f548b97ab3f32904b8.zip
Rename 'switch_to' to 'set_return_address_to'
The original name came from a previous hack the did not work but somehow the old name remained. Now it was more misleading than anything else, so let's rename it to something that is closer to what it actually does. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/trap.c b/kernel/trap.c
index f98fcc7..4e31b6d 100644
--- a/kernel/trap.c
+++ b/kernel/trap.c
@@ -78,7 +78,7 @@ __aligned(4) __s_interrupt __kernel void interrupt_handler(void)
if (IS_EXCEPTION(cause)) {
exception_handler(cause);
- switch_to(TASK_INIT);
+ set_return_address_to(TASK_INIT);
goto end;
}
@@ -94,12 +94,11 @@ __aligned(4) __s_interrupt __kernel void interrupt_handler(void)
// BEHOLD! The fizz buzz logic! :D
seconds_elapsed += 1;
if ((seconds_elapsed % 15) == 0) {
- switch_to(TASK_FIZZBUZZ);
+ set_return_address_to(TASK_FIZZBUZZ);
} else if ((seconds_elapsed % 5) == 0) {
- switch_to(TASK_BUZZ);
+ set_return_address_to(TASK_BUZZ);
} else if ((seconds_elapsed % 3) == 0) {
- switch_to(TASK_FIZZ);
- } else {
+ set_return_address_to(TASK_FIZZ);
}
// Re-enable timer interrupts.