diff --git a/build.zig.zon b/build.zig.zon index 67956cb..936bb1c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -13,8 +13,8 @@ .hash = "N-V-__8AAAAAjAwsopZIlbp4U6NN1Eh573uVdLTwl1mkFUug", }, .zonfig = .{ - .url = "git+https://github.com/rdmsr/zonfig?ref=HEAD#f2c9ab81c83750282ac4e4396a7537c6ecd0f7c2", - .hash = "zonfig-0.1.0-V0D8-ShLFACPRzB4c6AWjKwXlEdwxn-f6zt8eJKVwq_t", + .url = "git+https://github.com/rdmsr/zonfig?ref=HEAD#f353ad971985fb40d555401ebcee3fcbb057b490", + .hash = "zonfig-0.1.0-V0D8-SpLFABAqN9VkZ5tueJJ6d59ukdkpTJkonBWEZ1U", }, }, diff --git a/src/arch/amd64/paravirt/kvm.zig b/src/arch/amd64/paravirt/kvm.zig index 9600d01..7b9fb45 100644 --- a/src/arch/amd64/paravirt/kvm.zig +++ b/src/arch/amd64/paravirt/kvm.zig @@ -69,7 +69,7 @@ pub const PVClockSource = struct { else tsc_delta >> @intCast(-tsc_shift); const ns = self.page.system_time + - (shifted * @as(u128, self.page.tsc_to_system_mul) >> 32); + ((shifted * @as(u128, self.page.tsc_to_system_mul)) >> 32); if (@atomicLoad(u32, &self.page.version, .acquire) == ver) return @as(u64, @truncate(ns)) - self.time_at_boot; diff --git a/src/arch/amd64/root.zig b/src/arch/amd64/root.zig index 81a330a..6dd10e9 100644 --- a/src/arch/amd64/root.zig +++ b/src/arch/amd64/root.zig @@ -125,7 +125,7 @@ pub inline fn rdmsr(msr: u32) u64 { [high] "={edx}" (high), : [msr] "{ecx}" (msr), ); - return @as(u64, high) << 32 | low; + return (@as(u64, high) << 32) | low; } pub inline fn wrmsr(msr: u32, value: u64) void { @@ -234,7 +234,7 @@ pub inline fn rdtsc() u64 { : [low] "={eax}" (low), [high] "={edx}" (high), ); - return @as(u64, high) << 32 | low; + return (@as(u64, high) << 32) | low; } pub const Cr0 = packed struct(u64) { diff --git a/src/loader/mem.zig b/src/loader/mem.zig index 72cb958..563f8ed 100644 --- a/src/loader/mem.zig +++ b/src/loader/mem.zig @@ -292,8 +292,8 @@ pub fn init() void { // Figure out the memory layout. // NOTE: This assumes 64-bit (fix this when we port to 32-bit). // Higher half starts here, we give 1/2 to the kernel for its direct map. - const higher_half_start: usize = @bitCast(-@as(isize, 1) << vbits - 1); - const kernel_heap = higher_half_start + (@as(usize, 1) << vbits - 2); + const higher_half_start: usize = @bitCast(-@as(isize, 1) << (vbits - 1)); + const kernel_heap = higher_half_start + (@as(usize, 1) << (vbits - 2)); // Then, we give 16 TiB to the kernel heap. const pfndb = kernel_heap + 0x100000000000; diff --git a/src/sys/kern/turnstile.zig b/src/sys/kern/turnstile.zig index 8413803..a1c919d 100644 --- a/src/sys/kern/turnstile.zig +++ b/src/sys/kern/turnstile.zig @@ -232,7 +232,7 @@ fn update_prio(td: *ke.Thread) void { /// `to.lock` and the owning turnstile's lock. fn donate_to(boost: *Boost, to: *ke.Thread, pri: u8) void { // A lend only ever raises. - if (boost.donated != null and pri <= boost.donated orelse unreachable) + if (boost.donated != null and pri <= boost.donated.?) return; if (boost.donated == null) to.turnstiles_owned.insert_head(&boost.link); diff --git a/src/sys/mm/zone.zig b/src/sys/mm/zone.zig index bf0940b..1698d94 100644 --- a/src/sys/mm/zone.zig +++ b/src/sys/mm/zone.zig @@ -984,6 +984,7 @@ pub const Zone = struct { fn slab_free(self: *Zone, obj: *anyopaque, poison: bool) void { if (!is_poison_enabled or poison and !self.flags.dont_touch) { + if (!is_poison_enabled or (poison and !self.flags.dont_touch)) { if (self.dtor) |dtor| { dtor(obj); }