diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/process.zig | 12 | ||||
-rw-r--r-- | src/lib/syscall.zig | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/process.zig b/src/lib/process.zig index 28dc04b..3f4a906 100644 --- a/src/lib/process.zig +++ b/src/lib/process.zig @@ -21,12 +21,12 @@ const num_stack_pages = 2; var next_pid: u16 = 1; -pub const Error = error{ +pub const ScheduleError = error{ EmptySchedule, NoInit, }; -pub const ProcessError = error{ +pub const Error = error{ TooManyResourceDescriptors, BadRdHandle, }; @@ -75,7 +75,7 @@ pub const Info = struct { pub fn createRdHandle(self: *Info, rd: vfs.ResourceDescriptor) !usize { if (self.rds.count() == std.math.maxInt(usize)) { - return ProcessError.TooManyResourceDescriptors; + return Error.TooManyResourceDescriptors; } var handle = self.rds.count() + 1; @@ -105,7 +105,7 @@ pub const Info = struct { trap_frame.general_purpose_registers[2] = stack_top; const thread_id = std.math.add(usize, self.thread_id, 1) catch { - return ProcessError.TooManyThreads; + return Error.TooManyThreads; }; const proc = .{ @@ -200,7 +200,7 @@ pub fn schedule() !noreturn { switchTo(proc); } - return Error.EmptySchedule; + return ScheduleError.EmptySchedule; } pub fn switchTo(proc: *Info) noreturn { @@ -355,7 +355,7 @@ pub fn runInit(allocator: std.mem.Allocator, reader: anytype) !noreturn { if (std.mem.eql(u8, file.name, "./init")) { break file; } - } else return Error.NoInit; + } else return ScheduleError.NoInit; const alignment = @alignOf(elf.Elf64_Ehdr); diff --git a/src/lib/syscall.zig b/src/lib/syscall.zig index 63f9afd..715bcdb 100644 --- a/src/lib/syscall.zig +++ b/src/lib/syscall.zig @@ -198,7 +198,7 @@ fn read(proc: *const process.Info, trap_frame: *trap.Frame) void { const len = trap_frame.general_purpose_registers[12]; const rd = proc.rds.get(handle) orelse { - sysexchange.frameReturn(usize, trap_frame, process.ProcessError.BadRdHandle); + sysexchange.frameReturn(usize, trap_frame, process.Error.BadRdHandle); return; }; sysexchange.frameReturnResult(usize, trap_frame, rd.read(buffer[0..len])); @@ -214,7 +214,7 @@ fn write(proc: *const process.Info, trap_frame: *trap.Frame) void { const len = trap_frame.general_purpose_registers[12]; const rd = proc.rds.get(handle) orelse { - sysexchange.frameReturn(usize, trap_frame, process.ProcessError.BadRdHandle); + sysexchange.frameReturn(usize, trap_frame, process.Error.BadRdHandle); return; }; sysexchange.frameReturnResult(usize, trap_frame, rd.write(bytes[0..len])); |