diff options
| author | hachem <im@hachem.wtf> | 2026-09-25 21:21:09 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-25 21:21:09 +0200 |
| commit | 09982d80c45805715984cc1cae96c37e4fc148c3 (patch) | |
| tree | f711d6e7f4d4cb2d4dcb555d6a139aae343d7334 /boot/timer.zig | |
| parent | fd3f51eecaecc12806a573c38263df1de43ee8c2 (diff) | |
feat: scheduler + cleanup
Diffstat (limited to 'boot/timer.zig')
| -rw-r--r-- | boot/timer.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/boot/timer.zig b/boot/timer.zig index 4569d6a..428c695 100644 --- a/boot/timer.zig +++ b/boot/timer.zig @@ -1,17 +1,17 @@ -// PIT channel 0 tick counter -// configuring the PIT itself (outb to 0x43/0x40) is done in revo (kernel -// `pit_init`), since it's just port writes the VM can drive +// pit channel 0 tick counter +// configuring the pit itself (outb to 0x43/0x40) is done in revo (kernel +// `pit_init`), since its just port writes the vm can drive var ticks: u64 = 0; -// called from the IRQ0 handler +// called from the irq0 handler pub fn onIrq() void { - const t: *volatile u64 = &ticks; - t.* +%= 1; + const ticks_ptr: *volatile u64 = &ticks; + ticks_ptr.* +%= 1; } // called from the event loop pub fn now() u64 { - const t: *volatile u64 = &ticks; - return t.*; + const ticks_ptr: *volatile u64 = &ticks; + return ticks_ptr.*; } |
