mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
pl: add debug_read
This commit is contained in:
@@ -102,6 +102,13 @@ pub fn debug_write(c: u8) void {
|
||||
com1_write(c);
|
||||
}
|
||||
|
||||
pub fn debug_read() u8 {
|
||||
while ((amd64.inb(com1 + 0x5) & 0x01) == 0) {
|
||||
std.atomic.spinLoopHint();
|
||||
}
|
||||
return amd64.inb(com1);
|
||||
}
|
||||
|
||||
pub fn arm_timer(deadline: r.Nanoseconds) void {
|
||||
apic.arm_timer(deadline);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,11 @@ pub inline fn debug_write(c: u8) void {
|
||||
return impl.debug_write(c);
|
||||
}
|
||||
|
||||
/// Read a single character from the debug console.
|
||||
pub inline fn debug_read() u8 {
|
||||
return impl.debug_read();
|
||||
}
|
||||
|
||||
/// Arm a one-shot timer to fire in `ns` nanoseconds.
|
||||
pub inline fn arm_timer(ns: u64) void {
|
||||
return impl.arm_timer(ns);
|
||||
|
||||
Reference in New Issue
Block a user