Compare commits

..

3 Commits

2 changed files with 2 additions and 17 deletions

View File

@ -108,8 +108,7 @@ pub fn Arm32(comptime arch: Architecture) type {
};
}
// public so that we can set up fast-boot
pub inline fn regIdx(mode: Mode, kind: Kind) usize {
inline fn regIdx(mode: Mode, kind: Kind) usize {
const idx: usize = switch (mode) {
.User, .System => 0,
.Supervisor => 1,

View File

@ -139,7 +139,6 @@ pub const Scheduler = struct {
// VTable
nowFn: *const fn (ptr: *anyopaque) u64,
resetFn: *const fn (ptr: *anyopaque) void,
pub fn init(obj: anytype) @This() {
const P = @TypeOf(obj);
@ -156,23 +155,14 @@ pub const Scheduler = struct {
const self = @ptrCast(P, @alignCast(alignment, ptr));
return self.now();
}
fn reset(ptr: *anyopaque) void {
const self = @ptrCast(P, @alignCast(alignment, ptr));
self.reset();
}
};
return .{ .ptr = obj, .nowFn = impl.now, .resetFn = impl.reset };
return .{ .ptr = obj, .nowFn = impl.now };
}
pub fn now(self: @This()) u64 {
return self.nowFn(self.ptr);
}
pub fn reset(self: @This()) void {
self.resetFn(self.ptr);
}
};
// ---
@ -201,10 +191,6 @@ const ExampleScheduler = struct {
pub fn now(self: *const @This()) u64 {
return self.tick;
}
pub fn reset(self: *@This()) void {
self.tick = 0;
}
};
test "create ARMv4T interface" {