mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 07:48:20 +00:00
refactor: use root instead of base
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
const b = @import("base");
|
||||
const ke = b.ke;
|
||||
const pl = b.pl;
|
||||
const amd64 = b.arch;
|
||||
const r = @import("root");
|
||||
const ke = r.ke;
|
||||
const pl = r.pl;
|
||||
const amd64 = r.arch;
|
||||
|
||||
const std = @import("std");
|
||||
|
||||
pub const init = @import("init.zig");
|
||||
pub const early_init = init.early_init;
|
||||
|
||||
pub export var cpu_self_offset: usize linksection(b.percpu) = 0;
|
||||
pub export var cpu_self_offset: usize linksection(r.percpu) = 0;
|
||||
pub export var cpu_offsets: [*]usize = undefined;
|
||||
|
||||
pub const ThreadContext = struct {
|
||||
@@ -28,7 +28,7 @@ pub const ThreadContext = struct {
|
||||
// TODO: This shouldn't be reached!!!
|
||||
}
|
||||
|
||||
pub fn init(stack: b.VAddr, stack_size: usize, entry: *const fn (?*anyopaque) void, arg: ?*anyopaque) @This() {
|
||||
pub fn init(stack: r.VAddr, stack_size: usize, entry: *const fn (?*anyopaque) void, arg: ?*anyopaque) @This() {
|
||||
var ctx: @This() = undefined;
|
||||
ctx.rdi = @intFromPtr(entry);
|
||||
ctx.rsi = @intFromPtr(arg);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
const amd64 = @import("arch");
|
||||
const int = @import("int.zig");
|
||||
const b = @import("base");
|
||||
const r = @import("root");
|
||||
const std = @import("std");
|
||||
const impl = @import("impl.zig");
|
||||
const ke = b.ke;
|
||||
const ki = b.ke.private;
|
||||
const pl = b.pl;
|
||||
const ke = r.ke;
|
||||
const ki = r.ke.private;
|
||||
const pl = r.pl;
|
||||
|
||||
var gdt = extern struct {
|
||||
entries: [9]u64 align(1),
|
||||
@@ -28,7 +28,7 @@ var gdt = extern struct {
|
||||
|
||||
extern fn gdt_load(gdtr: *const amd64.Gdtr) callconv(.{ .x86_64_sysv = .{} }) void;
|
||||
|
||||
fn early_cpu_init() linksection(b.init) void {
|
||||
fn early_cpu_init() linksection(r.init) void {
|
||||
const gdtr: amd64.Gdtr = .{
|
||||
.limit = @sizeOf(@TypeOf(gdt)) - 1,
|
||||
.base = @intFromPtr(&gdt),
|
||||
@@ -96,7 +96,7 @@ pub fn ap_entry(cpu_id: u32) noreturn {
|
||||
var initial_offsets: [1]usize = undefined;
|
||||
extern var __percpu_start: u8;
|
||||
|
||||
pub fn early_init() linksection(b.init) void {
|
||||
pub fn early_init() linksection(r.init) void {
|
||||
amd64.detect_cpu_features();
|
||||
early_cpu_init();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const amd64 = @import("arch");
|
||||
const std = @import("std");
|
||||
const b = @import("base");
|
||||
const ke = b.ke;
|
||||
const r = @import("root");
|
||||
const ke = r.ke;
|
||||
const ki = ke.private;
|
||||
|
||||
extern const __interrupt_vectors: [256]usize;
|
||||
@@ -79,7 +79,7 @@ export fn isr_handler_main(frame: *const amd64.IrqFrame) callconv(.{ .x86_64_sys
|
||||
|
||||
extern fn idt_load(idt_ptr: *const amd64.Idtr) callconv(.{ .x86_64_sysv = .{} }) void;
|
||||
|
||||
pub fn init() linksection(b.init) void {
|
||||
pub fn init() linksection(r.init) void {
|
||||
const idtr: amd64.Idtr = .{
|
||||
.limit = @sizeOf(@TypeOf(idt)) - 1,
|
||||
.base = @intFromPtr(&idt),
|
||||
|
||||
Reference in New Issue
Block a user