mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
rtl: check all decls in interfaces
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)) }));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user