aboutsummaryrefslogtreecommitdiff
path: root/src/lib/interrupts.zig
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-06-13 22:33:52 +0200
committerHimbeer <himbeer@disroot.org>2024-06-13 22:33:52 +0200
commit235cff033077809565a89f77334866fddda899ad (patch)
tree6ae4f3f59d9691814529d7b3bae3f7efabd7182c /src/lib/interrupts.zig
parentb53cb2af26b43db9c7daa06d9fa2770679de04c8 (diff)
process: Disable interrupts while switching to U-mode
Diffstat (limited to 'src/lib/interrupts.zig')
-rw-r--r--src/lib/interrupts.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/interrupts.zig b/src/lib/interrupts.zig
index f9a9ca1..ebb6e9a 100644
--- a/src/lib/interrupts.zig
+++ b/src/lib/interrupts.zig
@@ -99,6 +99,10 @@ export fn handleTrap(epc: usize, tval: usize, cause_bits: usize, frame: *trap.Fr
switch (@as(AsyncCause, @enumFromInt(cause.num))) {
.supervisor_software => w.print("Hart {d}: Software interrupt\r\n", .{frame.hart_id}) catch unreachable,
.supervisor_timer => {
+ defer time.interruptInMillis(process.schedule_interval_millis) catch |err| {
+ std.debug.panic("Hart {d}: Unable to reset interrupt timer: {any}", .{ frame.hart_id, err });
+ };
+
if (status.previous_privilege == .user) {
// Trapped from U-mode, update pc for next time slice.
//