authorgravatar for hannesbredberg@gmail.comN00byEdge <hannesbredberg@gmail.com> 2021-07-30 19:04:18+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-08-02 11:05:05+00:00
log934df5bd448e7e27f2142d0d9ceec534f391c7f5
treebc6609f7fe68c2e946dfcf6c7a0f5337544e6c72
parentb465037a65dd6a31c5865086ec4392a1d3a372bc

Make linux syscalls accessible with non-Linux target OS


10 files changed, 10 insertions(+), 0 deletions(-)

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