diff --git a/src/kern/private.zig b/src/kern/private.zig index 4897d2c..f16ceb7 100644 --- a/src/kern/private.zig +++ b/src/kern/private.zig @@ -13,6 +13,10 @@ pub const impl = switch (config.arch) { const ImplSchema = struct { pub const ThreadContext = struct {}; + /// Maximum number of pages that can be flushed by individual TLB flushes + /// before it is more efficient to flush the entire TLB. + pub const tlb_max_pages = 0; + /// Set the hardware interrupt priority level. pub fn set_hardware_ipl(level: ipl.Ipl) void { _ = level; diff --git a/src/rtl/root.zig b/src/rtl/root.zig index 9bdc192..bb1d035 100644 --- a/src/rtl/root.zig +++ b/src/rtl/root.zig @@ -67,6 +67,15 @@ pub fn assert_interface(T: type, I: type) void { if (@TypeOf(impl_member) != type) { @compileError(std.fmt.comptimePrint("Declaration '{s}' in type '{s}' is required to be a type by '{s}', but got '{s}'", .{ decl.name, @typeName(T), @typeName(I), @typeName(@TypeOf(impl_member)) })); } + } else { + if (!@hasDecl(T, decl.name)) { + @compileError(std.fmt.comptimePrint("Expected variable declaration '{s}' in type '{s}' required by '{s}'", .{ decl.name, @typeName(T), @typeName(I) })); + } + + const impl_member = @field(T, decl.name); + if (@TypeOf(impl_member) != @TypeOf(member)) { + @compileError(std.fmt.comptimePrint("Declaration '{s}' in type '{s}' is required to be a variable of type '{s}' by '{s}', but got '{s}'", .{ decl.name, @typeName(T), @typeName(@TypeOf(member)), @typeName(I), @typeName(@TypeOf(impl_member)) })); + } } } }