aboutsummaryrefslogtreecommitdiff
path: root/src/process.zig
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-05-13 23:35:15 +0200
committerHimbeer <himbeer@disroot.org>2024-05-13 23:35:15 +0200
commit6bfb99b969621fd51fde4562a09a78f363297b18 (patch)
treeb0b0ca38d2b415d770398818e0e93e27407a0e5c /src/process.zig
parent17abd1049d12f335012578426ccfaab21b1e94c5 (diff)
interrupts: Fix context switching to U-mode from S-mode
This ensures that kernel code never gets skipped or otherwise messed with. The first switch to U-mode is handled explicitly elsewhere by manually calling process.switchTo on the init process.
Diffstat (limited to 'src/process.zig')
-rw-r--r--src/process.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/process.zig b/src/process.zig
index 5cec65f..690f4f3 100644
--- a/src/process.zig
+++ b/src/process.zig
@@ -167,6 +167,7 @@ pub fn demo(allocator: std.mem.Allocator) !void {
list.prepend(proc_node);
try time.interruptInMillis(null, schedule_interval_millis);
+ try switchTo(&proc_node.data);
while (true) asm volatile ("wfi");
}