mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-30 14:58:21 +00:00
feat(um): implement mm for um
This commit is contained in:
+1
-1
@@ -10,8 +10,8 @@ var thread0: ke.Thread = undefined;
|
||||
var stack: [8192]u8 align(16) = undefined;
|
||||
|
||||
pub fn init(boot_info: *pl.BootInfo) linksection(b.init) void {
|
||||
std.log.info("hello, world", .{});
|
||||
ki.impl.early_init();
|
||||
std.log.info("hello, world", .{});
|
||||
pl.early_init(boot_info);
|
||||
ki.cpu.init_cpu(0);
|
||||
|
||||
|
||||
@@ -99,6 +99,13 @@ pub const ThreadContext = struct {
|
||||
}
|
||||
};
|
||||
|
||||
const bootstrap_offsets = [1]usize{0};
|
||||
|
||||
pub fn early_init() void {
|
||||
// Ensure we can use per-cpu data.
|
||||
b.pl.impl.cpu_offsets = @constCast(&bootstrap_offsets);
|
||||
}
|
||||
|
||||
pub inline fn percpu_ptr_other(variable: anytype, cpu_id: usize) @TypeOf(variable) {
|
||||
return @ptrFromInt(@intFromPtr(variable) +% b.pl.impl.cpu_offsets[cpu_id]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user