From 70c3008a003345fe32d5f9cf6e2701c035e22ed3 Mon Sep 17 00:00:00 2001 From: Andrea Orru Date: Fri, 9 Mar 2018 22:24:52 -0800 Subject: [PATCH] Added 6 parameters syscalls for zen --- std/os/zen.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/std/os/zen.zig b/std/os/zen.zig index 867bc6578f..b10b870d17 100644 --- a/std/os/zen.zig +++ b/std/os/zen.zig @@ -103,3 +103,17 @@ pub inline fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, [arg4] "{esi}" (arg4), [arg5] "{edi}" (arg5)); } + +pub inline fn syscall6(number: usize, arg1: usize, arg2: usize, arg3: usize, + arg4: usize, arg5: usize, arg6: usize) usize +{ + return asm volatile ("int $0x80" + : [ret] "={eax}" (-> usize) + : [number] "{eax}" (number), + [arg1] "{ecx}" (arg1), + [arg2] "{edx}" (arg2), + [arg3] "{ebx}" (arg3), + [arg4] "{esi}" (arg4), + [arg5] "{edi}" (arg5), + [arg6] "{ebp}" (arg6)); +}