zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 934df5bd448e7e27f2142d0d9ceec534f391c7f5 (tree)
parent b465037a65dd6a31c5865086ec4392a1d3a372bc
Author: N00byEdge <hannesbredberg@gmail.com>
Date:   Fri, 30 Jul 2021 19:04:18 +0200

Make linux syscalls accessible with non-Linux target OS

Diffstat:
Mlib/std/os/linux/arm-eabi.zig | 1+
Mlib/std/os/linux/arm64.zig | 1+
Mlib/std/os/linux/i386.zig | 1+
Mlib/std/os/linux/mips.zig | 1+
Mlib/std/os/linux/powerpc.zig | 1+
Mlib/std/os/linux/powerpc64.zig | 1+
Mlib/std/os/linux/riscv64.zig | 1+
Mlib/std/os/linux/sparc64.zig | 1+
Mlib/std/os/linux/thumb.zig | 1+
Mlib/std/os/linux/x86_64.zig | 1+
10 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/lib/std/os/linux/arm-eabi.zig b/lib/std/os/linux/arm-eabi.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ("svc #0" diff --git a/lib/std/os/linux/arm64.zig b/lib/std/os/linux/arm64.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ("svc #0" diff --git a/lib/std/os/linux/i386.zig b/lib/std/os/linux/i386.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ("int $0x80" diff --git a/lib/std/os/linux/mips.zig b/lib/std/os/linux/mips.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ( diff --git a/lib/std/os/linux/powerpc.zig b/lib/std/os/linux/powerpc.zig @@ -5,6 +5,7 @@ // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ( diff --git a/lib/std/os/linux/powerpc64.zig b/lib/std/os/linux/powerpc64.zig @@ -5,6 +5,7 @@ // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ( diff --git a/lib/std/os/linux/riscv64.zig b/lib/std/os/linux/riscv64.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ("ecall" diff --git a/lib/std/os/linux/sparc64.zig b/lib/std/os/linux/sparc64.zig @@ -1,4 +1,5 @@ usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall_pipe(fd: *[2]i32) usize { return asm volatile ( diff --git a/lib/std/os/linux/thumb.zig b/lib/std/os/linux/thumb.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); // The syscall interface is identical to the ARM one but we're facing an extra // challenge: r7, the register where the syscall number is stored, may be diff --git a/lib/std/os/linux/x86_64.zig b/lib/std/os/linux/x86_64.zig @@ -4,6 +4,7 @@ // The MIT license requires this copyright notice to be included in all copies // and substantial portions of the software. usingnamespace @import("../bits.zig"); +usingnamespace @import("../bits/linux.zig"); pub fn syscall0(number: SYS) usize { return asm volatile ("syscall"