diff options
author | Himbeer <himbeer@disroot.org> | 2024-07-03 13:37:33 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-07-03 13:37:33 +0200 |
commit | 5a9ba9400538f7a8f3fa494b384e0b6ecdf1c443 (patch) | |
tree | a3b7824cf2d8361f845bc55573896c92cc250542 /src | |
parent | 6d6a3dc3512b81c09bd863a061f9f04341fb08c9 (diff) |
syscall: Consult scheduler instead of returning into terminated process
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/syscall.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/syscall.zig b/src/lib/syscall.zig index c800ef0..419938f 100644 --- a/src/lib/syscall.zig +++ b/src/lib/syscall.zig @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later +const std = @import("std"); + const instructions = @import("instructions.zig"); const paging = @import("paging.zig"); const process = @import("process.zig"); @@ -221,6 +223,9 @@ fn write(proc: *const process.Info, trap_frame: *trap.Frame) void { } // terminate() noreturn -fn terminate(proc: *process.Info) void { +fn terminate(proc: *process.Info) noreturn { proc.terminate(); + process.schedule() catch |err| { + std.debug.panic("Unable to schedule because all processes are terminated: {any}", .{err}); + }; } |