diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-10-17 12:07:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-17 12:07:51 +0200 |
| commit | 1f8a72175b5352e77b41ed4d165acccad08ffb16 (patch) | |
| tree | d573a9ef3ad64fc8e257fe7a736e57e50c2d8e2d /lib/std/os/linux/m68k.zig | |
| parent | 3091efaa1845bf049ce1d4aaacb95e3b1e346453 (diff) | |
| parent | 29fb9e4da7d60f32f7efe6d280a69e020cd117a7 (diff) | |
| download | zig-1f8a72175b5352e77b41ed4d165acccad08ffb16.tar.gz zig-1f8a72175b5352e77b41ed4d165acccad08ffb16.zip | |
Merge pull request #25610 from alexrp/std-os-linux-cleanup
`std.os.linux`: some miscellaneous cleanup in arch bits
Diffstat (limited to 'lib/std/os/linux/m68k.zig')
| -rw-r--r-- | lib/std/os/linux/m68k.zig | 112 |
1 files changed, 31 insertions, 81 deletions
diff --git a/lib/std/os/linux/m68k.zig b/lib/std/os/linux/m68k.zig index c3bd42b2ff..29d9adf1f7 100644 --- a/lib/std/os/linux/m68k.zig +++ b/lib/std/os/linux/m68k.zig @@ -1,43 +1,34 @@ const builtin = @import("builtin"); const std = @import("../../std.zig"); -const iovec = std.posix.iovec; -const iovec_const = std.posix.iovec_const; -const linux = std.os.linux; -const SYS = linux.SYS; -const uid_t = std.os.linux.uid_t; -const gid_t = std.os.linux.uid_t; -const pid_t = std.os.linux.pid_t; -const sockaddr = linux.sockaddr; -const socklen_t = linux.socklen_t; -const timespec = std.os.linux.timespec; - -pub fn syscall0(number: SYS) usize { +const SYS = std.os.linux.SYS; + +pub fn syscall0(number: SYS) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), : .{ .memory = true }); } -pub fn syscall1(number: SYS, arg1: usize) usize { +pub fn syscall1(number: SYS, arg1: u32) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), : .{ .memory = true }); } -pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { +pub fn syscall2(number: SYS, arg1: u32, arg2: u32) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), [arg2] "{d2}" (arg2), : .{ .memory = true }); } -pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { +pub fn syscall3(number: SYS, arg1: u32, arg2: u32, arg3: u32) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), [arg2] "{d2}" (arg2), @@ -45,9 +36,9 @@ pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { : .{ .memory = true }); } -pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { +pub fn syscall4(number: SYS, arg1: u32, arg2: u32, arg3: u32, arg4: u32) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), [arg2] "{d2}" (arg2), @@ -56,9 +47,9 @@ pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) : .{ .memory = true }); } -pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { +pub fn syscall5(number: SYS, arg1: u32, arg2: u32, arg3: u32, arg4: u32, arg5: u32) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), [arg2] "{d2}" (arg2), @@ -70,15 +61,15 @@ pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, pub fn syscall6( number: SYS, - arg1: usize, - arg2: usize, - arg3: usize, - arg4: usize, - arg5: usize, - arg6: usize, -) usize { + arg1: u32, + arg2: u32, + arg3: u32, + arg4: u32, + arg5: u32, + arg6: u32, +) u32 { return asm volatile ("trap #0" - : [ret] "={d0}" (-> usize), + : [ret] "={d0}" (-> u32), : [number] "{d0}" (@intFromEnum(number)), [arg1] "{d1}" (arg1), [arg2] "{d2}" (arg2), @@ -89,7 +80,7 @@ pub fn syscall6( : .{ .memory = true }); } -pub fn clone() callconv(.naked) usize { +pub fn clone() callconv(.naked) u32 { // __clone(func, stack, flags, arg, ptid, tls, ctid) // +4, +8, +12, +16, +20, +24, +28 // @@ -151,32 +142,6 @@ pub fn restore_rt() callconv(.naked) noreturn { ); } -pub const F = struct { - pub const DUPFD = 0; - pub const GETFD = 1; - pub const SETFD = 2; - pub const GETFL = 3; - pub const SETFL = 4; - - pub const SETOWN = 8; - pub const GETOWN = 9; - pub const SETSIG = 10; - pub const GETSIG = 11; - - pub const GETLK = 12; - pub const SETLK = 13; - pub const SETLKW = 14; - - pub const SETOWN_EX = 15; - pub const GETOWN_EX = 16; - - pub const GETOWNER_UIDS = 17; - - pub const RDLCK = 0; - pub const WRLCK = 1; - pub const UNLCK = 2; -}; - pub const blksize_t = i32; pub const nlink_t = u32; pub const time_t = i32; @@ -186,51 +151,36 @@ pub const ino_t = u64; pub const dev_t = u64; pub const blkcnt_t = i64; -pub const timeval = extern struct { - sec: time_t, - usec: i32, -}; - -pub const Flock = extern struct { - type: i16, - whence: i16, - start: off_t, - len: off_t, - pid: pid_t, -}; - pub const Stat = extern struct { dev: dev_t, __pad: i16, __ino_truncated: i32, mode: mode_t, nlink: nlink_t, - uid: uid_t, - gid: gid_t, + uid: std.os.linux.uid_t, + gid: std.os.linux.gid_t, rdev: dev_t, __pad2: i16, size: off_t, blksize: blksize_t, blocks: blkcnt_t, - atim: timespec, - mtim: timespec, - ctim: timespec, + atim: std.os.linux.timespec, + mtim: std.os.linux.timespec, + ctim: std.os.linux.timespec, ino: ino_t, - pub fn atime(self: @This()) timespec { + pub fn atime(self: @This()) std.os.linux.timespec { return self.atim; } - pub fn mtime(self: @This()) timespec { + pub fn mtime(self: @This()) std.os.linux.timespec { return self.mtim; } - pub fn ctime(self: @This()) timespec { + pub fn ctime(self: @This()) std.os.linux.timespec { return self.ctim; } }; -pub const Elf_Symndx = u32; - // No VDSO used as of glibc 112a0ae18b831bf31f44d81b82666980312511d6. pub const VDSO = void; |
