mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 15:48:21 +00:00
ke: use assert_interface for ki.impl
This commit is contained in:
+59
-1
@@ -1,6 +1,7 @@
|
||||
const r = @import("root");
|
||||
const std = @import("std");
|
||||
const rtl = @import("rtl");
|
||||
const config = @import("config");
|
||||
|
||||
const init_mod = @import("init.zig");
|
||||
|
||||
pub const impl = switch (config.arch) {
|
||||
@@ -9,6 +10,63 @@ pub const impl = switch (config.arch) {
|
||||
else => @compileError("unsupported architecture"),
|
||||
};
|
||||
|
||||
const ImplSchema = struct {
|
||||
pub const ThreadContext = struct {};
|
||||
|
||||
/// Set the hardware interrupt priority level.
|
||||
pub fn set_hardware_ipl(level: ipl.Ipl) void {
|
||||
_ = level;
|
||||
}
|
||||
|
||||
/// Read a per-cpu pointer on another CPU.
|
||||
pub fn percpu_ptr_other(variable: anytype, id: u32) @TypeOf(variable) {
|
||||
_ = id;
|
||||
}
|
||||
|
||||
/// Read a per-cpu pointer on the current CPU.
|
||||
pub fn percpu_ptr(variable: anytype) @TypeOf(variable) {}
|
||||
|
||||
/// Send a rescheduling inter-processor interrupt (IPI)
|
||||
/// on the target CPU.
|
||||
pub fn send_resched_ipi(target: u32) void {
|
||||
_ = target;
|
||||
}
|
||||
|
||||
/// Send a TLB shootdown IPI on the target CPU.
|
||||
pub fn send_tlb_ipi(target: u32) void {
|
||||
_ = target;
|
||||
}
|
||||
|
||||
/// Flush the entire TLB on the current CPU.
|
||||
pub fn flush_full_tlb() void {}
|
||||
|
||||
/// Flush the TLB entry matching `va` on the current CPU.
|
||||
pub fn flush_tlb(va: r.VAddr) void {
|
||||
_ = va;
|
||||
}
|
||||
|
||||
/// Enable interrupts.
|
||||
pub fn enable_interrupts() void {}
|
||||
|
||||
/// Disable interrupts.
|
||||
/// Return the previous interrupt state.
|
||||
pub fn disable_interrupts() bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Restore the state of interrupts.
|
||||
pub fn restore_interrupts(state: bool) void {
|
||||
_ = state;
|
||||
}
|
||||
|
||||
/// Implementation-defined early initialization.
|
||||
pub fn early_init() void {}
|
||||
};
|
||||
|
||||
comptime {
|
||||
rtl.assert_interface(impl, ImplSchema);
|
||||
}
|
||||
|
||||
pub const init = init_mod.init;
|
||||
|
||||
// === Exported Modules ===
|
||||
|
||||
Reference in New Issue
Block a user