aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Orru <andrea@orru.io>2018-04-11 23:11:26 -0700
committerAndrea Orru <andrea@orru.io>2018-04-11 23:11:26 -0700
commit70f2bb03fd0ac63243afd985ece7713055845363 (patch)
treeee51622bf117ad6d06d60d2ebf6fa37b638dca91
parent135a335ce12a33666e44cb13e0be4bb893877565 (diff)
downloadzig-70f2bb03fd0ac63243afd985ece7713055845363.tar.gz
zig-70f2bb03fd0ac63243afd985ece7713055845363.zip
outb syscall
-rw-r--r--std/os/zen.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/std/os/zen.zig b/std/os/zen.zig
index 50d53dca5f..c008243ec7 100644
--- a/std/os/zen.zig
+++ b/std/os/zen.zig
@@ -122,8 +122,9 @@ pub const Syscall = enum(usize) {
receive = 2,
subscribeIRQ = 3,
inb = 4,
- map = 5,
- createThread = 6,
+ outb = 5,
+ map = 6,
+ createThread = 7,
};
@@ -152,6 +153,10 @@ pub fn inb(port: u16) u8 {
return u8(syscall1(Syscall.inb, port));
}
+pub fn outb(port: u16, value: u8) void {
+ _ = syscall2(Syscall.outb, port, value);
+}
+
pub fn map(v_addr: usize, p_addr: usize, size: usize, writable: bool) bool {
return syscall4(Syscall.map, v_addr, p_addr, size, usize(writable)) != 0;
}