WIP: ps2 bus driver
This commit is contained in:
@@ -162,6 +162,7 @@ fn system_call(state: *architecture.CpuState) void {
|
||||
.msi_bind => systemMsiBind(state),
|
||||
.io_read => systemIoRead(state),
|
||||
.io_write => systemIoWrite(state),
|
||||
.clock => systemClock(state),
|
||||
_ => fail(state),
|
||||
}
|
||||
}
|
||||
@@ -316,6 +317,15 @@ fn systemIoWrite(state: *architecture.CpuState) void {
|
||||
architecture.setSystemCallResult(state, 0);
|
||||
}
|
||||
|
||||
/// clock() -> nanoseconds since boot: a monotonic time source. The kernel already owns
|
||||
/// the scheduling timer and computes this for preemption, so surfacing it is pure
|
||||
/// mechanism — no policy (wall-clock time, calendars, timezones are a user-space
|
||||
/// service layered on top). It lets a driver bound a poll loop by real time instead of
|
||||
/// a spin count, and time short delays.
|
||||
fn systemClock(state: *architecture.CpuState) void {
|
||||
architecture.setSystemCallResult(state, architecture.nanos());
|
||||
}
|
||||
|
||||
/// dma_alloc(len, flags) -> vaddr (rax), paddr (rdx): grant `len` bytes (rounded up to
|
||||
/// whole pages) of DMA-capable memory — physically contiguous, zeroed, pinned, and
|
||||
/// strong-uncacheable (coherent) — mapping it into the caller's DMA arena and handing
|
||||
|
||||
Reference in New Issue
Block a user