mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 07:18:22 +00:00
all: tidy
This commit is contained in:
+17
-1
@@ -28,8 +28,24 @@ pub const Config = struct {
|
||||
};
|
||||
|
||||
pub fn parseConfig(b: *std.Build) !Config {
|
||||
const gpa = b.allocator;
|
||||
var arena_allocator: std.heap.ArenaAllocator = .init(gpa);
|
||||
defer arena_allocator.deinit();
|
||||
const arena = arena_allocator.allocator();
|
||||
|
||||
var diag: std.zon.parse.Diagnostics = undefined;
|
||||
|
||||
const file = try std.Io.Dir.cwd().readFileAllocOptions(b.graph.io, ".config.zig.zon", b.allocator, std.Io.Limit.unlimited, .@"1", 0);
|
||||
return std.zon.parse.fromSlice(Config, b.allocator, file, null, .{ .ignore_unknown_fields = true });
|
||||
return std.zon.parse.fromSlice(
|
||||
Config,
|
||||
.{
|
||||
.gpa = gpa,
|
||||
.source = file,
|
||||
.arena = arena,
|
||||
.diagnostics = &diag,
|
||||
.ignore_unknown_fields = true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn getPlatform(config: Config) !Platform {
|
||||
|
||||
+1
-1
@@ -11,4 +11,4 @@ timeout: 3
|
||||
|
||||
module_path: boot():/boot/kernel
|
||||
module_string: kernel
|
||||
|
||||
cmdline: test=fireworks
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ pub fn addRun(b: *std.Build, kernel: *std.Build.Step.Compile, loader: *std.Build
|
||||
|
||||
switch (plat.arch) {
|
||||
.x86_64 => {
|
||||
qemu.addArgs(&.{ "-serial", "stdio", "-m", "1G", "-smp", "4" });
|
||||
qemu.addArgs(&.{ "-serial", "stdio", "-m", "1G", "-smp", "1" });
|
||||
|
||||
if (!debug and builtin.target.os.tag == .linux and builtin.cpu.arch == .x86_64) qemu.addArgs(&.{ "-enable-kvm", "-cpu", "host,+invtsc" });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user