diff options
| author | hachem <im@hachem.wtf> | 2026-10-04 00:52:49 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-04 00:52:49 +0200 |
| commit | 627f05098785327744e666c9149375125499d2ff (patch) | |
| tree | a72f3949e0729f1e73ad39ccb1809698a5ed8298 /boot/port.zig | |
| parent | 09982d80c45805715984cc1cae96c37e4fc148c3 (diff) | |
feat: revelfs type shi
Diffstat (limited to 'boot/port.zig')
| -rw-r--r-- | boot/port.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/boot/port.zig b/boot/port.zig index be760b1..d38f829 100644 --- a/boot/port.zig +++ b/boot/port.zig @@ -17,3 +17,18 @@ pub inline fn inb(port: u16) u8 { : [port] "N{dx}" (port), ); } + +pub inline fn outw(port: u16, val: u16) void { + asm volatile ("outw %[val], %[port]" + : + : [val] "{ax}" (val), + [port] "N{dx}" (port), + ); +} + +pub inline fn inw(port: u16) u16 { + return asm volatile ("inw %[port], %[result]" + : [result] "={ax}" (-> u16), + : [port] "N{dx}" (port), + ); +} |
