aboutsummaryrefslogtreecommitdiff
path: root/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index 43be54b..a8cc12c 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
const std = @import("std");
+pub const hwinfo = @import("hwinfo.zig");
pub const max_args = 6;
@@ -85,3 +86,9 @@ pub fn rawUserinit() []const u8 {
const result = ecall(100007, .{&ptr});
return ptr[0..result.value];
}
+
+pub fn devicesByKind(kind: hwinfo.DevKind, devices: []hwinfo.Dev) !usize {
+ const result = ecall(100008, .{ kind, devices.ptr, devices.len });
+ if (result.error_code != 0) return SyscallError.Kernel;
+ return result.value;
+}