| author | |
| committer | |
| log | c829f2f7b7c5bdd13d3c39ae2960ed108393a210 |
| tree | f93b1df14908722f4e587f438102813067e3a4c6 |
| parent | a9eb4a6740e0bb00e1984de3768a7de6001c25dd |
24 files changed, 842 insertions(+), 718 deletions(-)
lib/std/bloom_filter.zig+3| ... | ... | @@ -160,6 +160,9 @@ fn hashFunc(out: []u8, Ki: usize, in: []const u8) void { |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | test "std.BloomFilter" { |
| 163 | // https://github.com/ziglang/zig/issues/5127 | |
| 164 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 165 | ||
| 163 | 166 | inline for ([_]type{ bool, u1, u2, u3, u4 }) |Cell| { |
| 164 | 167 | const emptyCell = if (Cell == bool) false else @as(Cell, 0); |
| 165 | 168 | const BF = BloomFilter(128 * 8, 8, Cell, builtin.endian, hashFunc); |
lib/std/crypto/gimli.zig+6| ... | ... | @@ -162,6 +162,9 @@ pub fn hash(out: []u8, in: []const u8) void { |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | test "hash" { |
| 165 | // https://github.com/ziglang/zig/issues/5127 | |
| 166 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 167 | ||
| 165 | 168 | // a test vector (30) from NIST KAT submission. |
| 166 | 169 | var msg: [58 / 2]u8 = undefined; |
| 167 | 170 | try std.fmt.hexToBytes(&msg, "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C"); |
| ... | ... | @@ -307,6 +310,9 @@ pub const Aead = struct { |
| 307 | 310 | }; |
| 308 | 311 | |
| 309 | 312 | test "cipher" { |
| 313 | // https://github.com/ziglang/zig/issues/5127 | |
| 314 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 315 | ||
| 310 | 316 | var key: [32]u8 = undefined; |
| 311 | 317 | try std.fmt.hexToBytes(&key, "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"); |
| 312 | 318 | var nonce: [16]u8 = undefined; |
lib/std/fmt.zig+1-1| ... | ... | @@ -1661,7 +1661,7 @@ test "positional/alignment/width/precision" { |
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | test "vector" { |
| 1664 | if (builtin.arch == .mipsel) { | |
| 1664 | if (builtin.arch == .mipsel or builtin.arch == .mips) { | |
| 1665 | 1665 | // https://github.com/ziglang/zig/issues/3317 |
| 1666 | 1666 | return error.SkipZigTest; |
| 1667 | 1667 | } |
lib/std/hash/auto_hash.zig+1-1| ... | ... | @@ -357,7 +357,7 @@ test "testHash union" { |
| 357 | 357 | |
| 358 | 358 | test "testHash vector" { |
| 359 | 359 | // Disabled because of #3317 |
| 360 | if (@import("builtin").arch == .mipsel) return error.SkipZigTest; | |
| 360 | if (@import("builtin").arch == .mipsel or @import("builtin").arch == .mips) return error.SkipZigTest; | |
| 361 | 361 | |
| 362 | 362 | const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 }; |
| 363 | 363 | const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 }; |
lib/std/hash_map.zig+3| ... | ... | @@ -463,6 +463,9 @@ test "basic hash map usage" { |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | test "iterator hash map" { |
| 466 | // https://github.com/ziglang/zig/issues/5127 | |
| 467 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 468 | ||
| 466 | 469 | var reset_map = AutoHashMap(i32, i32).init(std.testing.allocator); |
| 467 | 470 | defer reset_map.deinit(); |
| 468 | 471 |
lib/std/io/test.zig+3| ... | ... | @@ -126,6 +126,9 @@ test "File seek ops" { |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | test "setEndPos" { |
| 129 | // https://github.com/ziglang/zig/issues/5127 | |
| 130 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 131 | ||
| 129 | 132 | const tmp_file_name = "temp_test_file.txt"; |
| 130 | 133 | var file = try fs.cwd().createFile(tmp_file_name, .{}); |
| 131 | 134 | defer { |
lib/std/json.zig+6| ... | ... | @@ -2249,6 +2249,9 @@ test "integer after float has proper type" { |
| 2249 | 2249 | } |
| 2250 | 2250 | |
| 2251 | 2251 | test "escaped characters" { |
| 2252 | // https://github.com/ziglang/zig/issues/5127 | |
| 2253 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 2254 | ||
| 2252 | 2255 | var arena_allocator = std.heap.ArenaAllocator.init(std.testing.allocator); |
| 2253 | 2256 | defer arena_allocator.deinit(); |
| 2254 | 2257 | const input = |
| ... | ... | @@ -2281,6 +2284,9 @@ test "escaped characters" { |
| 2281 | 2284 | } |
| 2282 | 2285 | |
| 2283 | 2286 | test "string copy option" { |
| 2287 | // https://github.com/ziglang/zig/issues/5127 | |
| 2288 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 2289 | ||
| 2284 | 2290 | const input = |
| 2285 | 2291 | \\{ |
| 2286 | 2292 | \\ "noescape": "aą😂", |
lib/std/json/test.zig+69| ... | ... | @@ -332,12 +332,18 @@ test "y_string_1_2_3_bytes_UTF-8_sequences" { |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | test "y_string_accepted_surrogate_pair" { |
| 335 | // https://github.com/ziglang/zig/issues/5127 | |
| 336 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 337 | ||
| 335 | 338 | ok( |
| 336 | 339 | \\["\uD801\udc37"] |
| 337 | 340 | ); |
| 338 | 341 | } |
| 339 | 342 | |
| 340 | 343 | test "y_string_accepted_surrogate_pairs" { |
| 344 | // https://github.com/ziglang/zig/issues/5127 | |
| 345 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 346 | ||
| 341 | 347 | ok( |
| 342 | 348 | \\["\ud83d\ude39\ud83d\udc8d"] |
| 343 | 349 | ); |
| ... | ... | @@ -404,6 +410,9 @@ test "y_string_in_array_with_leading_space" { |
| 404 | 410 | } |
| 405 | 411 | |
| 406 | 412 | test "y_string_last_surrogates_1_and_2" { |
| 413 | // https://github.com/ziglang/zig/issues/5127 | |
| 414 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 415 | ||
| 407 | 416 | ok( |
| 408 | 417 | \\["\uDBFF\uDFFF"] |
| 409 | 418 | ); |
| ... | ... | @@ -464,6 +473,9 @@ test "y_string_space" { |
| 464 | 473 | } |
| 465 | 474 | |
| 466 | 475 | test "y_string_surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF" { |
| 476 | // https://github.com/ziglang/zig/issues/5127 | |
| 477 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 478 | ||
| 467 | 479 | ok( |
| 468 | 480 | \\["\uD834\uDd1e"] |
| 469 | 481 | ); |
| ... | ... | @@ -506,60 +518,90 @@ test "y_string_unescaped_char_delete" { |
| 506 | 518 | } |
| 507 | 519 | |
| 508 | 520 | test "y_string_unicode_2" { |
| 521 | // https://github.com/ziglang/zig/issues/5127 | |
| 522 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 523 | ||
| 509 | 524 | ok( |
| 510 | 525 | \\["⍂㈴⍂"] |
| 511 | 526 | ); |
| 512 | 527 | } |
| 513 | 528 | |
| 514 | 529 | test "y_string_unicodeEscapedBackslash" { |
| 530 | // https://github.com/ziglang/zig/issues/5127 | |
| 531 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 532 | ||
| 515 | 533 | ok( |
| 516 | 534 | \\["\u005C"] |
| 517 | 535 | ); |
| 518 | 536 | } |
| 519 | 537 | |
| 520 | 538 | test "y_string_unicode_escaped_double_quote" { |
| 539 | // https://github.com/ziglang/zig/issues/5127 | |
| 540 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 541 | ||
| 521 | 542 | ok( |
| 522 | 543 | \\["\u0022"] |
| 523 | 544 | ); |
| 524 | 545 | } |
| 525 | 546 | |
| 526 | 547 | test "y_string_unicode" { |
| 548 | // https://github.com/ziglang/zig/issues/5127 | |
| 549 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 550 | ||
| 527 | 551 | ok( |
| 528 | 552 | \\["\uA66D"] |
| 529 | 553 | ); |
| 530 | 554 | } |
| 531 | 555 | |
| 532 | 556 | test "y_string_unicode_U+10FFFE_nonchar" { |
| 557 | // https://github.com/ziglang/zig/issues/5127 | |
| 558 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 559 | ||
| 533 | 560 | ok( |
| 534 | 561 | \\["\uDBFF\uDFFE"] |
| 535 | 562 | ); |
| 536 | 563 | } |
| 537 | 564 | |
| 538 | 565 | test "y_string_unicode_U+1FFFE_nonchar" { |
| 566 | // https://github.com/ziglang/zig/issues/5127 | |
| 567 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 568 | ||
| 539 | 569 | ok( |
| 540 | 570 | \\["\uD83F\uDFFE"] |
| 541 | 571 | ); |
| 542 | 572 | } |
| 543 | 573 | |
| 544 | 574 | test "y_string_unicode_U+200B_ZERO_WIDTH_SPACE" { |
| 575 | // https://github.com/ziglang/zig/issues/5127 | |
| 576 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 577 | ||
| 545 | 578 | ok( |
| 546 | 579 | \\["\u200B"] |
| 547 | 580 | ); |
| 548 | 581 | } |
| 549 | 582 | |
| 550 | 583 | test "y_string_unicode_U+2064_invisible_plus" { |
| 584 | // https://github.com/ziglang/zig/issues/5127 | |
| 585 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 586 | ||
| 551 | 587 | ok( |
| 552 | 588 | \\["\u2064"] |
| 553 | 589 | ); |
| 554 | 590 | } |
| 555 | 591 | |
| 556 | 592 | test "y_string_unicode_U+FDD0_nonchar" { |
| 593 | // https://github.com/ziglang/zig/issues/5127 | |
| 594 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 595 | ||
| 557 | 596 | ok( |
| 558 | 597 | \\["\uFDD0"] |
| 559 | 598 | ); |
| 560 | 599 | } |
| 561 | 600 | |
| 562 | 601 | test "y_string_unicode_U+FFFE_nonchar" { |
| 602 | // https://github.com/ziglang/zig/issues/5127 | |
| 603 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 604 | ||
| 563 | 605 | ok( |
| 564 | 606 | \\["\uFFFE"] |
| 565 | 607 | ); |
| ... | ... | @@ -1811,42 +1853,63 @@ test "i_object_key_lone_2nd_surrogate" { |
| 1811 | 1853 | } |
| 1812 | 1854 | |
| 1813 | 1855 | test "i_string_1st_surrogate_but_2nd_missing" { |
| 1856 | // https://github.com/ziglang/zig/issues/5127 | |
| 1857 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1858 | ||
| 1814 | 1859 | anyStreamingErrNonStreaming( |
| 1815 | 1860 | \\["\uDADA"] |
| 1816 | 1861 | ); |
| 1817 | 1862 | } |
| 1818 | 1863 | |
| 1819 | 1864 | test "i_string_1st_valid_surrogate_2nd_invalid" { |
| 1865 | // https://github.com/ziglang/zig/issues/5127 | |
| 1866 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1867 | ||
| 1820 | 1868 | anyStreamingErrNonStreaming( |
| 1821 | 1869 | \\["\uD888\u1234"] |
| 1822 | 1870 | ); |
| 1823 | 1871 | } |
| 1824 | 1872 | |
| 1825 | 1873 | test "i_string_incomplete_surrogate_and_escape_valid" { |
| 1874 | // https://github.com/ziglang/zig/issues/5127 | |
| 1875 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1876 | ||
| 1826 | 1877 | anyStreamingErrNonStreaming( |
| 1827 | 1878 | \\["\uD800\n"] |
| 1828 | 1879 | ); |
| 1829 | 1880 | } |
| 1830 | 1881 | |
| 1831 | 1882 | test "i_string_incomplete_surrogate_pair" { |
| 1883 | // https://github.com/ziglang/zig/issues/5127 | |
| 1884 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1885 | ||
| 1832 | 1886 | anyStreamingErrNonStreaming( |
| 1833 | 1887 | \\["\uDd1ea"] |
| 1834 | 1888 | ); |
| 1835 | 1889 | } |
| 1836 | 1890 | |
| 1837 | 1891 | test "i_string_incomplete_surrogates_escape_valid" { |
| 1892 | // https://github.com/ziglang/zig/issues/5127 | |
| 1893 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1894 | ||
| 1838 | 1895 | anyStreamingErrNonStreaming( |
| 1839 | 1896 | \\["\uD800\uD800\n"] |
| 1840 | 1897 | ); |
| 1841 | 1898 | } |
| 1842 | 1899 | |
| 1843 | 1900 | test "i_string_invalid_lonely_surrogate" { |
| 1901 | // https://github.com/ziglang/zig/issues/5127 | |
| 1902 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1903 | ||
| 1844 | 1904 | anyStreamingErrNonStreaming( |
| 1845 | 1905 | \\["\ud800"] |
| 1846 | 1906 | ); |
| 1847 | 1907 | } |
| 1848 | 1908 | |
| 1849 | 1909 | test "i_string_invalid_surrogate" { |
| 1910 | // https://github.com/ziglang/zig/issues/5127 | |
| 1911 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1912 | ||
| 1850 | 1913 | anyStreamingErrNonStreaming( |
| 1851 | 1914 | \\["\ud800abc"] |
| 1852 | 1915 | ); |
| ... | ... | @@ -1859,6 +1922,9 @@ test "i_string_invalid_utf-8" { |
| 1859 | 1922 | } |
| 1860 | 1923 | |
| 1861 | 1924 | test "i_string_inverted_surrogates_U+1D11E" { |
| 1925 | // https://github.com/ziglang/zig/issues/5127 | |
| 1926 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1927 | ||
| 1862 | 1928 | anyStreamingErrNonStreaming( |
| 1863 | 1929 | \\["\uDd1e\uD834"] |
| 1864 | 1930 | ); |
| ... | ... | @@ -1871,6 +1937,9 @@ test "i_string_iso_latin_1" { |
| 1871 | 1937 | } |
| 1872 | 1938 | |
| 1873 | 1939 | test "i_string_lone_second_surrogate" { |
| 1940 | // https://github.com/ziglang/zig/issues/5127 | |
| 1941 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 1942 | ||
| 1874 | 1943 | anyStreamingErrNonStreaming( |
| 1875 | 1944 | \\["\uDFAA"] |
| 1876 | 1945 | ); |
lib/std/os/bits/linux.zig+1-1| ... | ... | @@ -14,7 +14,7 @@ pub usingnamespace switch (builtin.arch) { |
| 14 | 14 | .aarch64 => @import("linux/arm64.zig"), |
| 15 | 15 | .arm => @import("linux/arm-eabi.zig"), |
| 16 | 16 | .riscv64 => @import("linux/riscv64.zig"), |
| 17 | .mipsel => @import("linux/mipsel.zig"), | |
| 17 | .mips, .mipsel => @import("linux/mips.zig"), | |
| 18 | 18 | else => struct {}, |
| 19 | 19 | }; |
| 20 | 20 |
lib/std/os/bits/linux/mips.zig created+543| ... | ... | @@ -0,0 +1,543 @@ |
| 1 | const std = @import("../../../std.zig"); | |
| 2 | const linux = std.os.linux; | |
| 3 | const socklen_t = linux.socklen_t; | |
| 4 | const iovec = linux.iovec; | |
| 5 | const iovec_const = linux.iovec_const; | |
| 6 | const uid_t = linux.uid_t; | |
| 7 | const gid_t = linux.gid_t; | |
| 8 | const pid_t = linux.pid_t; | |
| 9 | ||
| 10 | pub const SYS = extern enum(usize) { | |
| 11 | pub const Linux = 4000; | |
| 12 | ||
| 13 | syscall = Linux + 0, | |
| 14 | exit = Linux + 1, | |
| 15 | fork = Linux + 2, | |
| 16 | read = Linux + 3, | |
| 17 | write = Linux + 4, | |
| 18 | open = Linux + 5, | |
| 19 | close = Linux + 6, | |
| 20 | waitpid = Linux + 7, | |
| 21 | creat = Linux + 8, | |
| 22 | link = Linux + 9, | |
| 23 | unlink = Linux + 10, | |
| 24 | execve = Linux + 11, | |
| 25 | chdir = Linux + 12, | |
| 26 | time = Linux + 13, | |
| 27 | mknod = Linux + 14, | |
| 28 | chmod = Linux + 15, | |
| 29 | lchown = Linux + 16, | |
| 30 | @"break" = Linux + 17, | |
| 31 | unused18 = Linux + 18, | |
| 32 | lseek = Linux + 19, | |
| 33 | getpid = Linux + 20, | |
| 34 | mount = Linux + 21, | |
| 35 | umount = Linux + 22, | |
| 36 | setuid = Linux + 23, | |
| 37 | getuid = Linux + 24, | |
| 38 | stime = Linux + 25, | |
| 39 | ptrace = Linux + 26, | |
| 40 | alarm = Linux + 27, | |
| 41 | unused28 = Linux + 28, | |
| 42 | pause = Linux + 29, | |
| 43 | utime = Linux + 30, | |
| 44 | stty = Linux + 31, | |
| 45 | gtty = Linux + 32, | |
| 46 | access = Linux + 33, | |
| 47 | nice = Linux + 34, | |
| 48 | ftime = Linux + 35, | |
| 49 | sync = Linux + 36, | |
| 50 | kill = Linux + 37, | |
| 51 | rename = Linux + 38, | |
| 52 | mkdir = Linux + 39, | |
| 53 | rmdir = Linux + 40, | |
| 54 | dup = Linux + 41, | |
| 55 | pipe = Linux + 42, | |
| 56 | times = Linux + 43, | |
| 57 | prof = Linux + 44, | |
| 58 | brk = Linux + 45, | |
| 59 | setgid = Linux + 46, | |
| 60 | getgid = Linux + 47, | |
| 61 | signal = Linux + 48, | |
| 62 | geteuid = Linux + 49, | |
| 63 | getegid = Linux + 50, | |
| 64 | acct = Linux + 51, | |
| 65 | umount2 = Linux + 52, | |
| 66 | lock = Linux + 53, | |
| 67 | ioctl = Linux + 54, | |
| 68 | fcntl = Linux + 55, | |
| 69 | mpx = Linux + 56, | |
| 70 | setpgid = Linux + 57, | |
| 71 | ulimit = Linux + 58, | |
| 72 | unused59 = Linux + 59, | |
| 73 | umask = Linux + 60, | |
| 74 | chroot = Linux + 61, | |
| 75 | ustat = Linux + 62, | |
| 76 | dup2 = Linux + 63, | |
| 77 | getppid = Linux + 64, | |
| 78 | getpgrp = Linux + 65, | |
| 79 | setsid = Linux + 66, | |
| 80 | sigaction = Linux + 67, | |
| 81 | sgetmask = Linux + 68, | |
| 82 | ssetmask = Linux + 69, | |
| 83 | setreuid = Linux + 70, | |
| 84 | setregid = Linux + 71, | |
| 85 | sigsuspend = Linux + 72, | |
| 86 | sigpending = Linux + 73, | |
| 87 | sethostname = Linux + 74, | |
| 88 | setrlimit = Linux + 75, | |
| 89 | getrlimit = Linux + 76, | |
| 90 | getrusage = Linux + 77, | |
| 91 | gettimeofday = Linux + 78, | |
| 92 | settimeofday = Linux + 79, | |
| 93 | getgroups = Linux + 80, | |
| 94 | setgroups = Linux + 81, | |
| 95 | reserved82 = Linux + 82, | |
| 96 | symlink = Linux + 83, | |
| 97 | unused84 = Linux + 84, | |
| 98 | readlink = Linux + 85, | |
| 99 | uselib = Linux + 86, | |
| 100 | swapon = Linux + 87, | |
| 101 | reboot = Linux + 88, | |
| 102 | readdir = Linux + 89, | |
| 103 | mmap = Linux + 90, | |
| 104 | munmap = Linux + 91, | |
| 105 | truncate = Linux + 92, | |
| 106 | ftruncate = Linux + 93, | |
| 107 | fchmod = Linux + 94, | |
| 108 | fchown = Linux + 95, | |
| 109 | getpriority = Linux + 96, | |
| 110 | setpriority = Linux + 97, | |
| 111 | profil = Linux + 98, | |
| 112 | statfs = Linux + 99, | |
| 113 | fstatfs = Linux + 100, | |
| 114 | ioperm = Linux + 101, | |
| 115 | socketcall = Linux + 102, | |
| 116 | syslog = Linux + 103, | |
| 117 | setitimer = Linux + 104, | |
| 118 | getitimer = Linux + 105, | |
| 119 | stat = Linux + 106, | |
| 120 | lstat = Linux + 107, | |
| 121 | fstat = Linux + 108, | |
| 122 | unused109 = Linux + 109, | |
| 123 | iopl = Linux + 110, | |
| 124 | vhangup = Linux + 111, | |
| 125 | idle = Linux + 112, | |
| 126 | vm86 = Linux + 113, | |
| 127 | wait4 = Linux + 114, | |
| 128 | swapoff = Linux + 115, | |
| 129 | sysinfo = Linux + 116, | |
| 130 | ipc = Linux + 117, | |
| 131 | fsync = Linux + 118, | |
| 132 | sigreturn = Linux + 119, | |
| 133 | clone = Linux + 120, | |
| 134 | setdomainname = Linux + 121, | |
| 135 | uname = Linux + 122, | |
| 136 | modify_ldt = Linux + 123, | |
| 137 | adjtimex = Linux + 124, | |
| 138 | mprotect = Linux + 125, | |
| 139 | sigprocmask = Linux + 126, | |
| 140 | create_module = Linux + 127, | |
| 141 | init_module = Linux + 128, | |
| 142 | delete_module = Linux + 129, | |
| 143 | get_kernel_syms = Linux + 130, | |
| 144 | quotactl = Linux + 131, | |
| 145 | getpgid = Linux + 132, | |
| 146 | fchdir = Linux + 133, | |
| 147 | bdflush = Linux + 134, | |
| 148 | sysfs = Linux + 135, | |
| 149 | personality = Linux + 136, | |
| 150 | afs_syscall = Linux + 137, | |
| 151 | setfsuid = Linux + 138, | |
| 152 | setfsgid = Linux + 139, | |
| 153 | _llseek = Linux + 140, | |
| 154 | getdents = Linux + 141, | |
| 155 | _newselect = Linux + 142, | |
| 156 | flock = Linux + 143, | |
| 157 | msync = Linux + 144, | |
| 158 | readv = Linux + 145, | |
| 159 | writev = Linux + 146, | |
| 160 | cacheflush = Linux + 147, | |
| 161 | cachectl = Linux + 148, | |
| 162 | sysmips = Linux + 149, | |
| 163 | unused150 = Linux + 150, | |
| 164 | getsid = Linux + 151, | |
| 165 | fdatasync = Linux + 152, | |
| 166 | _sysctl = Linux + 153, | |
| 167 | mlock = Linux + 154, | |
| 168 | munlock = Linux + 155, | |
| 169 | mlockall = Linux + 156, | |
| 170 | munlockall = Linux + 157, | |
| 171 | sched_setparam = Linux + 158, | |
| 172 | sched_getparam = Linux + 159, | |
| 173 | sched_setscheduler = Linux + 160, | |
| 174 | sched_getscheduler = Linux + 161, | |
| 175 | sched_yield = Linux + 162, | |
| 176 | sched_get_priority_max = Linux + 163, | |
| 177 | sched_get_priority_min = Linux + 164, | |
| 178 | sched_rr_get_interval = Linux + 165, | |
| 179 | nanosleep = Linux + 166, | |
| 180 | mremap = Linux + 167, | |
| 181 | accept = Linux + 168, | |
| 182 | bind = Linux + 169, | |
| 183 | connect = Linux + 170, | |
| 184 | getpeername = Linux + 171, | |
| 185 | getsockname = Linux + 172, | |
| 186 | getsockopt = Linux + 173, | |
| 187 | listen = Linux + 174, | |
| 188 | recv = Linux + 175, | |
| 189 | recvfrom = Linux + 176, | |
| 190 | recvmsg = Linux + 177, | |
| 191 | send = Linux + 178, | |
| 192 | sendmsg = Linux + 179, | |
| 193 | sendto = Linux + 180, | |
| 194 | setsockopt = Linux + 181, | |
| 195 | shutdown = Linux + 182, | |
| 196 | socket = Linux + 183, | |
| 197 | socketpair = Linux + 184, | |
| 198 | setresuid = Linux + 185, | |
| 199 | getresuid = Linux + 186, | |
| 200 | query_module = Linux + 187, | |
| 201 | poll = Linux + 188, | |
| 202 | nfsservctl = Linux + 189, | |
| 203 | setresgid = Linux + 190, | |
| 204 | getresgid = Linux + 191, | |
| 205 | prctl = Linux + 192, | |
| 206 | rt_sigreturn = Linux + 193, | |
| 207 | rt_sigaction = Linux + 194, | |
| 208 | rt_sigprocmask = Linux + 195, | |
| 209 | rt_sigpending = Linux + 196, | |
| 210 | rt_sigtimedwait = Linux + 197, | |
| 211 | rt_sigqueueinfo = Linux + 198, | |
| 212 | rt_sigsuspend = Linux + 199, | |
| 213 | pread64 = Linux + 200, | |
| 214 | pwrite64 = Linux + 201, | |
| 215 | chown = Linux + 202, | |
| 216 | getcwd = Linux + 203, | |
| 217 | capget = Linux + 204, | |
| 218 | capset = Linux + 205, | |
| 219 | sigaltstack = Linux + 206, | |
| 220 | sendfile = Linux + 207, | |
| 221 | getpmsg = Linux + 208, | |
| 222 | putpmsg = Linux + 209, | |
| 223 | mmap2 = Linux + 210, | |
| 224 | truncate64 = Linux + 211, | |
| 225 | ftruncate64 = Linux + 212, | |
| 226 | stat64 = Linux + 213, | |
| 227 | lstat64 = Linux + 214, | |
| 228 | fstat64 = Linux + 215, | |
| 229 | pivot_root = Linux + 216, | |
| 230 | mincore = Linux + 217, | |
| 231 | madvise = Linux + 218, | |
| 232 | getdents64 = Linux + 219, | |
| 233 | fcntl64 = Linux + 220, | |
| 234 | reserved221 = Linux + 221, | |
| 235 | gettid = Linux + 222, | |
| 236 | readahead = Linux + 223, | |
| 237 | setxattr = Linux + 224, | |
| 238 | lsetxattr = Linux + 225, | |
| 239 | fsetxattr = Linux + 226, | |
| 240 | getxattr = Linux + 227, | |
| 241 | lgetxattr = Linux + 228, | |
| 242 | fgetxattr = Linux + 229, | |
| 243 | listxattr = Linux + 230, | |
| 244 | llistxattr = Linux + 231, | |
| 245 | flistxattr = Linux + 232, | |
| 246 | removexattr = Linux + 233, | |
| 247 | lremovexattr = Linux + 234, | |
| 248 | fremovexattr = Linux + 235, | |
| 249 | tkill = Linux + 236, | |
| 250 | sendfile64 = Linux + 237, | |
| 251 | futex = Linux + 238, | |
| 252 | sched_setaffinity = Linux + 239, | |
| 253 | sched_getaffinity = Linux + 240, | |
| 254 | io_setup = Linux + 241, | |
| 255 | io_destroy = Linux + 242, | |
| 256 | io_getevents = Linux + 243, | |
| 257 | io_submit = Linux + 244, | |
| 258 | io_cancel = Linux + 245, | |
| 259 | exit_group = Linux + 246, | |
| 260 | lookup_dcookie = Linux + 247, | |
| 261 | epoll_create = Linux + 248, | |
| 262 | epoll_ctl = Linux + 249, | |
| 263 | epoll_wait = Linux + 250, | |
| 264 | remap_file_pages = Linux + 251, | |
| 265 | set_tid_address = Linux + 252, | |
| 266 | restart_syscall = Linux + 253, | |
| 267 | fadvise64 = Linux + 254, | |
| 268 | statfs64 = Linux + 255, | |
| 269 | fstatfs64 = Linux + 256, | |
| 270 | timer_create = Linux + 257, | |
| 271 | timer_settime = Linux + 258, | |
| 272 | timer_gettime = Linux + 259, | |
| 273 | timer_getoverrun = Linux + 260, | |
| 274 | timer_delete = Linux + 261, | |
| 275 | clock_settime = Linux + 262, | |
| 276 | clock_gettime = Linux + 263, | |
| 277 | clock_getres = Linux + 264, | |
| 278 | clock_nanosleep = Linux + 265, | |
| 279 | tgkill = Linux + 266, | |
| 280 | utimes = Linux + 267, | |
| 281 | mbind = Linux + 268, | |
| 282 | get_mempolicy = Linux + 269, | |
| 283 | set_mempolicy = Linux + 270, | |
| 284 | mq_open = Linux + 271, | |
| 285 | mq_unlink = Linux + 272, | |
| 286 | mq_timedsend = Linux + 273, | |
| 287 | mq_timedreceive = Linux + 274, | |
| 288 | mq_notify = Linux + 275, | |
| 289 | mq_getsetattr = Linux + 276, | |
| 290 | vserver = Linux + 277, | |
| 291 | waitid = Linux + 278, | |
| 292 | add_key = Linux + 280, | |
| 293 | request_key = Linux + 281, | |
| 294 | keyctl = Linux + 282, | |
| 295 | set_thread_area = Linux + 283, | |
| 296 | inotify_init = Linux + 284, | |
| 297 | inotify_add_watch = Linux + 285, | |
| 298 | inotify_rm_watch = Linux + 286, | |
| 299 | migrate_pages = Linux + 287, | |
| 300 | openat = Linux + 288, | |
| 301 | mkdirat = Linux + 289, | |
| 302 | mknodat = Linux + 290, | |
| 303 | fchownat = Linux + 291, | |
| 304 | futimesat = Linux + 292, | |
| 305 | fstatat64 = Linux + 293, | |
| 306 | unlinkat = Linux + 294, | |
| 307 | renameat = Linux + 295, | |
| 308 | linkat = Linux + 296, | |
| 309 | symlinkat = Linux + 297, | |
| 310 | readlinkat = Linux + 298, | |
| 311 | fchmodat = Linux + 299, | |
| 312 | faccessat = Linux + 300, | |
| 313 | pselect6 = Linux + 301, | |
| 314 | ppoll = Linux + 302, | |
| 315 | unshare = Linux + 303, | |
| 316 | splice = Linux + 304, | |
| 317 | sync_file_range = Linux + 305, | |
| 318 | tee = Linux + 306, | |
| 319 | vmsplice = Linux + 307, | |
| 320 | move_pages = Linux + 308, | |
| 321 | set_robust_list = Linux + 309, | |
| 322 | get_robust_list = Linux + 310, | |
| 323 | kexec_load = Linux + 311, | |
| 324 | getcpu = Linux + 312, | |
| 325 | epoll_pwait = Linux + 313, | |
| 326 | ioprio_set = Linux + 314, | |
| 327 | ioprio_get = Linux + 315, | |
| 328 | utimensat = Linux + 316, | |
| 329 | signalfd = Linux + 317, | |
| 330 | timerfd = Linux + 318, | |
| 331 | eventfd = Linux + 319, | |
| 332 | fallocate = Linux + 320, | |
| 333 | timerfd_create = Linux + 321, | |
| 334 | timerfd_gettime = Linux + 322, | |
| 335 | timerfd_settime = Linux + 323, | |
| 336 | signalfd4 = Linux + 324, | |
| 337 | eventfd2 = Linux + 325, | |
| 338 | epoll_create1 = Linux + 326, | |
| 339 | dup3 = Linux + 327, | |
| 340 | pipe2 = Linux + 328, | |
| 341 | inotify_init1 = Linux + 329, | |
| 342 | preadv = Linux + 330, | |
| 343 | pwritev = Linux + 331, | |
| 344 | rt_tgsigqueueinfo = Linux + 332, | |
| 345 | perf_event_open = Linux + 333, | |
| 346 | accept4 = Linux + 334, | |
| 347 | recvmmsg = Linux + 335, | |
| 348 | fanotify_init = Linux + 336, | |
| 349 | fanotify_mark = Linux + 337, | |
| 350 | prlimit64 = Linux + 338, | |
| 351 | name_to_handle_at = Linux + 339, | |
| 352 | open_by_handle_at = Linux + 340, | |
| 353 | clock_adjtime = Linux + 341, | |
| 354 | syncfs = Linux + 342, | |
| 355 | sendmmsg = Linux + 343, | |
| 356 | setns = Linux + 344, | |
| 357 | process_vm_readv = Linux + 345, | |
| 358 | process_vm_writev = Linux + 346, | |
| 359 | kcmp = Linux + 347, | |
| 360 | finit_module = Linux + 348, | |
| 361 | sched_setattr = Linux + 349, | |
| 362 | sched_getattr = Linux + 350, | |
| 363 | renameat2 = Linux + 351, | |
| 364 | seccomp = Linux + 352, | |
| 365 | getrandom = Linux + 353, | |
| 366 | memfd_create = Linux + 354, | |
| 367 | bpf = Linux + 355, | |
| 368 | execveat = Linux + 356, | |
| 369 | userfaultfd = Linux + 357, | |
| 370 | membarrier = Linux + 358, | |
| 371 | mlock2 = Linux + 359, | |
| 372 | copy_file_range = Linux + 360, | |
| 373 | preadv2 = Linux + 361, | |
| 374 | pwritev2 = Linux + 362, | |
| 375 | pkey_mprotect = Linux + 363, | |
| 376 | pkey_alloc = Linux + 364, | |
| 377 | pkey_free = Linux + 365, | |
| 378 | statx = Linux + 366, | |
| 379 | rseq = Linux + 367, | |
| 380 | io_pgetevents = Linux + 368, | |
| 381 | openat2 = Linux + 437, | |
| 382 | pidfd_getfd = Linux + 438, | |
| 383 | ||
| 384 | _, | |
| 385 | }; | |
| 386 | ||
| 387 | pub const O_CREAT = 0o0400; | |
| 388 | pub const O_EXCL = 0o02000; | |
| 389 | pub const O_NOCTTY = 0o04000; | |
| 390 | pub const O_TRUNC = 0o01000; | |
| 391 | pub const O_APPEND = 0o0010; | |
| 392 | pub const O_NONBLOCK = 0o0200; | |
| 393 | pub const O_DSYNC = 0o0020; | |
| 394 | pub const O_SYNC = 0o040020; | |
| 395 | pub const O_RSYNC = 0o040020; | |
| 396 | pub const O_DIRECTORY = 0o0200000; | |
| 397 | pub const O_NOFOLLOW = 0o0400000; | |
| 398 | pub const O_CLOEXEC = 0o02000000; | |
| 399 | ||
| 400 | pub const O_ASYNC = 0o010000; | |
| 401 | pub const O_DIRECT = 0o0100000; | |
| 402 | pub const O_LARGEFILE = 0o020000; | |
| 403 | pub const O_NOATIME = 0o01000000; | |
| 404 | pub const O_PATH = 0o010000000; | |
| 405 | pub const O_TMPFILE = 0o020200000; | |
| 406 | pub const O_NDELAY = O_NONBLOCK; | |
| 407 | ||
| 408 | pub const F_DUPFD = 0; | |
| 409 | pub const F_GETFD = 1; | |
| 410 | pub const F_SETFD = 2; | |
| 411 | pub const F_GETFL = 3; | |
| 412 | pub const F_SETFL = 4; | |
| 413 | ||
| 414 | pub const F_SETOWN = 24; | |
| 415 | pub const F_GETOWN = 23; | |
| 416 | pub const F_SETSIG = 10; | |
| 417 | pub const F_GETSIG = 11; | |
| 418 | ||
| 419 | pub const F_GETLK = 33; | |
| 420 | pub const F_SETLK = 34; | |
| 421 | pub const F_SETLKW = 35; | |
| 422 | ||
| 423 | pub const F_RDLCK = 0; | |
| 424 | pub const F_WRLCK = 1; | |
| 425 | pub const F_UNLCK = 2; | |
| 426 | ||
| 427 | pub const LOCK_SH = 1; | |
| 428 | pub const LOCK_EX = 2; | |
| 429 | pub const LOCK_UN = 8; | |
| 430 | pub const LOCK_NB = 4; | |
| 431 | ||
| 432 | pub const F_SETOWN_EX = 15; | |
| 433 | pub const F_GETOWN_EX = 16; | |
| 434 | ||
| 435 | pub const F_GETOWNER_UIDS = 17; | |
| 436 | ||
| 437 | pub const MMAP2_UNIT = 4096; | |
| 438 | ||
| 439 | pub const MAP_NORESERVE = 0x0400; | |
| 440 | pub const MAP_GROWSDOWN = 0x1000; | |
| 441 | pub const MAP_DENYWRITE = 0x2000; | |
| 442 | pub const MAP_EXECUTABLE = 0x4000; | |
| 443 | pub const MAP_LOCKED = 0x8000; | |
| 444 | pub const MAP_32BIT = 0x40; | |
| 445 | ||
| 446 | pub const SO_DEBUG = 1; | |
| 447 | pub const SO_REUSEADDR = 0x0004; | |
| 448 | pub const SO_KEEPALIVE = 0x0008; | |
| 449 | pub const SO_DONTROUTE = 0x0010; | |
| 450 | pub const SO_BROADCAST = 0x0020; | |
| 451 | pub const SO_LINGER = 0x0080; | |
| 452 | pub const SO_OOBINLINE = 0x0100; | |
| 453 | pub const SO_REUSEPORT = 0x0200; | |
| 454 | pub const SO_SNDBUF = 0x1001; | |
| 455 | pub const SO_RCVBUF = 0x1002; | |
| 456 | pub const SO_SNDLOWAT = 0x1003; | |
| 457 | pub const SO_RCVLOWAT = 0x1004; | |
| 458 | pub const SO_RCVTIMEO = 0x1006; | |
| 459 | pub const SO_SNDTIMEO = 0x1005; | |
| 460 | pub const SO_ERROR = 0x1007; | |
| 461 | pub const SO_TYPE = 0x1008; | |
| 462 | pub const SO_ACCEPTCONN = 0x1009; | |
| 463 | pub const SO_PROTOCOL = 0x1028; | |
| 464 | pub const SO_DOMAIN = 0x1029; | |
| 465 | pub const SO_NO_CHECK = 11; | |
| 466 | pub const SO_PRIORITY = 12; | |
| 467 | pub const SO_BSDCOMPAT = 14; | |
| 468 | pub const SO_PASSCRED = 17; | |
| 469 | pub const SO_PEERCRED = 18; | |
| 470 | pub const SO_PEERSEC = 30; | |
| 471 | pub const SO_SNDBUFFORCE = 31; | |
| 472 | pub const SO_RCVBUFFORCE = 33; | |
| 473 | ||
| 474 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; | |
| 475 | pub const VDSO_CGT_VER = "LINUX_2.6.39"; | |
| 476 | ||
| 477 | pub const Flock = extern struct { | |
| 478 | l_type: i16, | |
| 479 | l_whence: i16, | |
| 480 | __pad0: [4]u8, | |
| 481 | l_start: off_t, | |
| 482 | l_len: off_t, | |
| 483 | l_pid: pid_t, | |
| 484 | __unused: [4]u8, | |
| 485 | }; | |
| 486 | ||
| 487 | pub const blksize_t = i32; | |
| 488 | pub const nlink_t = u32; | |
| 489 | pub const time_t = isize; | |
| 490 | pub const mode_t = u32; | |
| 491 | pub const off_t = i64; | |
| 492 | pub const ino_t = u64; | |
| 493 | pub const dev_t = usize; | |
| 494 | pub const blkcnt_t = i64; | |
| 495 | ||
| 496 | pub const Stat = extern struct { | |
| 497 | dev: u32, | |
| 498 | __pad0: [3]u32, | |
| 499 | ino: ino_t, | |
| 500 | mode: mode_t, | |
| 501 | nlink: nlink_t, | |
| 502 | uid: uid_t, | |
| 503 | gid: gid_t, | |
| 504 | rdev: dev_t, | |
| 505 | __pad1: [3]u32, | |
| 506 | size: off_t, | |
| 507 | atim: timespec, | |
| 508 | mtim: timespec, | |
| 509 | ctim: timespec, | |
| 510 | blksize: blksize_t, | |
| 511 | __pad3: [1]u32, | |
| 512 | blocks: blkcnt_t, | |
| 513 | __pad4: [14]usize, | |
| 514 | ||
| 515 | pub fn atime(self: Stat) timespec { | |
| 516 | return self.atim; | |
| 517 | } | |
| 518 | ||
| 519 | pub fn mtime(self: Stat) timespec { | |
| 520 | return self.mtim; | |
| 521 | } | |
| 522 | ||
| 523 | pub fn ctime(self: Stat) timespec { | |
| 524 | return self.ctim; | |
| 525 | } | |
| 526 | }; | |
| 527 | ||
| 528 | pub const timespec = extern struct { | |
| 529 | tv_sec: isize, | |
| 530 | tv_nsec: isize, | |
| 531 | }; | |
| 532 | ||
| 533 | pub const timeval = extern struct { | |
| 534 | tv_sec: isize, | |
| 535 | tv_usec: isize, | |
| 536 | }; | |
| 537 | ||
| 538 | pub const timezone = extern struct { | |
| 539 | tz_minuteswest: i32, | |
| 540 | tz_dsttime: i32, | |
| 541 | }; | |
| 542 | ||
| 543 | pub const Elf_Symndx = u32; |
lib/std/os/bits/linux/mipsel.zig deleted-543| ... | ... | @@ -1,543 +0,0 @@ |
| 1 | const std = @import("../../../std.zig"); | |
| 2 | const linux = std.os.linux; | |
| 3 | const socklen_t = linux.socklen_t; | |
| 4 | const iovec = linux.iovec; | |
| 5 | const iovec_const = linux.iovec_const; | |
| 6 | const uid_t = linux.uid_t; | |
| 7 | const gid_t = linux.gid_t; | |
| 8 | const pid_t = linux.pid_t; | |
| 9 | ||
| 10 | pub const SYS = extern enum(usize) { | |
| 11 | pub const Linux = 4000; | |
| 12 | ||
| 13 | syscall = Linux + 0, | |
| 14 | exit = Linux + 1, | |
| 15 | fork = Linux + 2, | |
| 16 | read = Linux + 3, | |
| 17 | write = Linux + 4, | |
| 18 | open = Linux + 5, | |
| 19 | close = Linux + 6, | |
| 20 | waitpid = Linux + 7, | |
| 21 | creat = Linux + 8, | |
| 22 | link = Linux + 9, | |
| 23 | unlink = Linux + 10, | |
| 24 | execve = Linux + 11, | |
| 25 | chdir = Linux + 12, | |
| 26 | time = Linux + 13, | |
| 27 | mknod = Linux + 14, | |
| 28 | chmod = Linux + 15, | |
| 29 | lchown = Linux + 16, | |
| 30 | @"break" = Linux + 17, | |
| 31 | unused18 = Linux + 18, | |
| 32 | lseek = Linux + 19, | |
| 33 | getpid = Linux + 20, | |
| 34 | mount = Linux + 21, | |
| 35 | umount = Linux + 22, | |
| 36 | setuid = Linux + 23, | |
| 37 | getuid = Linux + 24, | |
| 38 | stime = Linux + 25, | |
| 39 | ptrace = Linux + 26, | |
| 40 | alarm = Linux + 27, | |
| 41 | unused28 = Linux + 28, | |
| 42 | pause = Linux + 29, | |
| 43 | utime = Linux + 30, | |
| 44 | stty = Linux + 31, | |
| 45 | gtty = Linux + 32, | |
| 46 | access = Linux + 33, | |
| 47 | nice = Linux + 34, | |
| 48 | ftime = Linux + 35, | |
| 49 | sync = Linux + 36, | |
| 50 | kill = Linux + 37, | |
| 51 | rename = Linux + 38, | |
| 52 | mkdir = Linux + 39, | |
| 53 | rmdir = Linux + 40, | |
| 54 | dup = Linux + 41, | |
| 55 | pipe = Linux + 42, | |
| 56 | times = Linux + 43, | |
| 57 | prof = Linux + 44, | |
| 58 | brk = Linux + 45, | |
| 59 | setgid = Linux + 46, | |
| 60 | getgid = Linux + 47, | |
| 61 | signal = Linux + 48, | |
| 62 | geteuid = Linux + 49, | |
| 63 | getegid = Linux + 50, | |
| 64 | acct = Linux + 51, | |
| 65 | umount2 = Linux + 52, | |
| 66 | lock = Linux + 53, | |
| 67 | ioctl = Linux + 54, | |
| 68 | fcntl = Linux + 55, | |
| 69 | mpx = Linux + 56, | |
| 70 | setpgid = Linux + 57, | |
| 71 | ulimit = Linux + 58, | |
| 72 | unused59 = Linux + 59, | |
| 73 | umask = Linux + 60, | |
| 74 | chroot = Linux + 61, | |
| 75 | ustat = Linux + 62, | |
| 76 | dup2 = Linux + 63, | |
| 77 | getppid = Linux + 64, | |
| 78 | getpgrp = Linux + 65, | |
| 79 | setsid = Linux + 66, | |
| 80 | sigaction = Linux + 67, | |
| 81 | sgetmask = Linux + 68, | |
| 82 | ssetmask = Linux + 69, | |
| 83 | setreuid = Linux + 70, | |
| 84 | setregid = Linux + 71, | |
| 85 | sigsuspend = Linux + 72, | |
| 86 | sigpending = Linux + 73, | |
| 87 | sethostname = Linux + 74, | |
| 88 | setrlimit = Linux + 75, | |
| 89 | getrlimit = Linux + 76, | |
| 90 | getrusage = Linux + 77, | |
| 91 | gettimeofday = Linux + 78, | |
| 92 | settimeofday = Linux + 79, | |
| 93 | getgroups = Linux + 80, | |
| 94 | setgroups = Linux + 81, | |
| 95 | reserved82 = Linux + 82, | |
| 96 | symlink = Linux + 83, | |
| 97 | unused84 = Linux + 84, | |
| 98 | readlink = Linux + 85, | |
| 99 | uselib = Linux + 86, | |
| 100 | swapon = Linux + 87, | |
| 101 | reboot = Linux + 88, | |
| 102 | readdir = Linux + 89, | |
| 103 | mmap = Linux + 90, | |
| 104 | munmap = Linux + 91, | |
| 105 | truncate = Linux + 92, | |
| 106 | ftruncate = Linux + 93, | |
| 107 | fchmod = Linux + 94, | |
| 108 | fchown = Linux + 95, | |
| 109 | getpriority = Linux + 96, | |
| 110 | setpriority = Linux + 97, | |
| 111 | profil = Linux + 98, | |
| 112 | statfs = Linux + 99, | |
| 113 | fstatfs = Linux + 100, | |
| 114 | ioperm = Linux + 101, | |
| 115 | socketcall = Linux + 102, | |
| 116 | syslog = Linux + 103, | |
| 117 | setitimer = Linux + 104, | |
| 118 | getitimer = Linux + 105, | |
| 119 | stat = Linux + 106, | |
| 120 | lstat = Linux + 107, | |
| 121 | fstat = Linux + 108, | |
| 122 | unused109 = Linux + 109, | |
| 123 | iopl = Linux + 110, | |
| 124 | vhangup = Linux + 111, | |
| 125 | idle = Linux + 112, | |
| 126 | vm86 = Linux + 113, | |
| 127 | wait4 = Linux + 114, | |
| 128 | swapoff = Linux + 115, | |
| 129 | sysinfo = Linux + 116, | |
| 130 | ipc = Linux + 117, | |
| 131 | fsync = Linux + 118, | |
| 132 | sigreturn = Linux + 119, | |
| 133 | clone = Linux + 120, | |
| 134 | setdomainname = Linux + 121, | |
| 135 | uname = Linux + 122, | |
| 136 | modify_ldt = Linux + 123, | |
| 137 | adjtimex = Linux + 124, | |
| 138 | mprotect = Linux + 125, | |
| 139 | sigprocmask = Linux + 126, | |
| 140 | create_module = Linux + 127, | |
| 141 | init_module = Linux + 128, | |
| 142 | delete_module = Linux + 129, | |
| 143 | get_kernel_syms = Linux + 130, | |
| 144 | quotactl = Linux + 131, | |
| 145 | getpgid = Linux + 132, | |
| 146 | fchdir = Linux + 133, | |
| 147 | bdflush = Linux + 134, | |
| 148 | sysfs = Linux + 135, | |
| 149 | personality = Linux + 136, | |
| 150 | afs_syscall = Linux + 137, | |
| 151 | setfsuid = Linux + 138, | |
| 152 | setfsgid = Linux + 139, | |
| 153 | _llseek = Linux + 140, | |
| 154 | getdents = Linux + 141, | |
| 155 | _newselect = Linux + 142, | |
| 156 | flock = Linux + 143, | |
| 157 | msync = Linux + 144, | |
| 158 | readv = Linux + 145, | |
| 159 | writev = Linux + 146, | |
| 160 | cacheflush = Linux + 147, | |
| 161 | cachectl = Linux + 148, | |
| 162 | sysmips = Linux + 149, | |
| 163 | unused150 = Linux + 150, | |
| 164 | getsid = Linux + 151, | |
| 165 | fdatasync = Linux + 152, | |
| 166 | _sysctl = Linux + 153, | |
| 167 | mlock = Linux + 154, | |
| 168 | munlock = Linux + 155, | |
| 169 | mlockall = Linux + 156, | |
| 170 | munlockall = Linux + 157, | |
| 171 | sched_setparam = Linux + 158, | |
| 172 | sched_getparam = Linux + 159, | |
| 173 | sched_setscheduler = Linux + 160, | |
| 174 | sched_getscheduler = Linux + 161, | |
| 175 | sched_yield = Linux + 162, | |
| 176 | sched_get_priority_max = Linux + 163, | |
| 177 | sched_get_priority_min = Linux + 164, | |
| 178 | sched_rr_get_interval = Linux + 165, | |
| 179 | nanosleep = Linux + 166, | |
| 180 | mremap = Linux + 167, | |
| 181 | accept = Linux + 168, | |
| 182 | bind = Linux + 169, | |
| 183 | connect = Linux + 170, | |
| 184 | getpeername = Linux + 171, | |
| 185 | getsockname = Linux + 172, | |
| 186 | getsockopt = Linux + 173, | |
| 187 | listen = Linux + 174, | |
| 188 | recv = Linux + 175, | |
| 189 | recvfrom = Linux + 176, | |
| 190 | recvmsg = Linux + 177, | |
| 191 | send = Linux + 178, | |
| 192 | sendmsg = Linux + 179, | |
| 193 | sendto = Linux + 180, | |
| 194 | setsockopt = Linux + 181, | |
| 195 | shutdown = Linux + 182, | |
| 196 | socket = Linux + 183, | |
| 197 | socketpair = Linux + 184, | |
| 198 | setresuid = Linux + 185, | |
| 199 | getresuid = Linux + 186, | |
| 200 | query_module = Linux + 187, | |
| 201 | poll = Linux + 188, | |
| 202 | nfsservctl = Linux + 189, | |
| 203 | setresgid = Linux + 190, | |
| 204 | getresgid = Linux + 191, | |
| 205 | prctl = Linux + 192, | |
| 206 | rt_sigreturn = Linux + 193, | |
| 207 | rt_sigaction = Linux + 194, | |
| 208 | rt_sigprocmask = Linux + 195, | |
| 209 | rt_sigpending = Linux + 196, | |
| 210 | rt_sigtimedwait = Linux + 197, | |
| 211 | rt_sigqueueinfo = Linux + 198, | |
| 212 | rt_sigsuspend = Linux + 199, | |
| 213 | pread64 = Linux + 200, | |
| 214 | pwrite64 = Linux + 201, | |
| 215 | chown = Linux + 202, | |
| 216 | getcwd = Linux + 203, | |
| 217 | capget = Linux + 204, | |
| 218 | capset = Linux + 205, | |
| 219 | sigaltstack = Linux + 206, | |
| 220 | sendfile = Linux + 207, | |
| 221 | getpmsg = Linux + 208, | |
| 222 | putpmsg = Linux + 209, | |
| 223 | mmap2 = Linux + 210, | |
| 224 | truncate64 = Linux + 211, | |
| 225 | ftruncate64 = Linux + 212, | |
| 226 | stat64 = Linux + 213, | |
| 227 | lstat64 = Linux + 214, | |
| 228 | fstat64 = Linux + 215, | |
| 229 | pivot_root = Linux + 216, | |
| 230 | mincore = Linux + 217, | |
| 231 | madvise = Linux + 218, | |
| 232 | getdents64 = Linux + 219, | |
| 233 | fcntl64 = Linux + 220, | |
| 234 | reserved221 = Linux + 221, | |
| 235 | gettid = Linux + 222, | |
| 236 | readahead = Linux + 223, | |
| 237 | setxattr = Linux + 224, | |
| 238 | lsetxattr = Linux + 225, | |
| 239 | fsetxattr = Linux + 226, | |
| 240 | getxattr = Linux + 227, | |
| 241 | lgetxattr = Linux + 228, | |
| 242 | fgetxattr = Linux + 229, | |
| 243 | listxattr = Linux + 230, | |
| 244 | llistxattr = Linux + 231, | |
| 245 | flistxattr = Linux + 232, | |
| 246 | removexattr = Linux + 233, | |
| 247 | lremovexattr = Linux + 234, | |
| 248 | fremovexattr = Linux + 235, | |
| 249 | tkill = Linux + 236, | |
| 250 | sendfile64 = Linux + 237, | |
| 251 | futex = Linux + 238, | |
| 252 | sched_setaffinity = Linux + 239, | |
| 253 | sched_getaffinity = Linux + 240, | |
| 254 | io_setup = Linux + 241, | |
| 255 | io_destroy = Linux + 242, | |
| 256 | io_getevents = Linux + 243, | |
| 257 | io_submit = Linux + 244, | |
| 258 | io_cancel = Linux + 245, | |
| 259 | exit_group = Linux + 246, | |
| 260 | lookup_dcookie = Linux + 247, | |
| 261 | epoll_create = Linux + 248, | |
| 262 | epoll_ctl = Linux + 249, | |
| 263 | epoll_wait = Linux + 250, | |
| 264 | remap_file_pages = Linux + 251, | |
| 265 | set_tid_address = Linux + 252, | |
| 266 | restart_syscall = Linux + 253, | |
| 267 | fadvise64 = Linux + 254, | |
| 268 | statfs64 = Linux + 255, | |
| 269 | fstatfs64 = Linux + 256, | |
| 270 | timer_create = Linux + 257, | |
| 271 | timer_settime = Linux + 258, | |
| 272 | timer_gettime = Linux + 259, | |
| 273 | timer_getoverrun = Linux + 260, | |
| 274 | timer_delete = Linux + 261, | |
| 275 | clock_settime = Linux + 262, | |
| 276 | clock_gettime = Linux + 263, | |
| 277 | clock_getres = Linux + 264, | |
| 278 | clock_nanosleep = Linux + 265, | |
| 279 | tgkill = Linux + 266, | |
| 280 | utimes = Linux + 267, | |
| 281 | mbind = Linux + 268, | |
| 282 | get_mempolicy = Linux + 269, | |
| 283 | set_mempolicy = Linux + 270, | |
| 284 | mq_open = Linux + 271, | |
| 285 | mq_unlink = Linux + 272, | |
| 286 | mq_timedsend = Linux + 273, | |
| 287 | mq_timedreceive = Linux + 274, | |
| 288 | mq_notify = Linux + 275, | |
| 289 | mq_getsetattr = Linux + 276, | |
| 290 | vserver = Linux + 277, | |
| 291 | waitid = Linux + 278, | |
| 292 | add_key = Linux + 280, | |
| 293 | request_key = Linux + 281, | |
| 294 | keyctl = Linux + 282, | |
| 295 | set_thread_area = Linux + 283, | |
| 296 | inotify_init = Linux + 284, | |
| 297 | inotify_add_watch = Linux + 285, | |
| 298 | inotify_rm_watch = Linux + 286, | |
| 299 | migrate_pages = Linux + 287, | |
| 300 | openat = Linux + 288, | |
| 301 | mkdirat = Linux + 289, | |
| 302 | mknodat = Linux + 290, | |
| 303 | fchownat = Linux + 291, | |
| 304 | futimesat = Linux + 292, | |
| 305 | fstatat64 = Linux + 293, | |
| 306 | unlinkat = Linux + 294, | |
| 307 | renameat = Linux + 295, | |
| 308 | linkat = Linux + 296, | |
| 309 | symlinkat = Linux + 297, | |
| 310 | readlinkat = Linux + 298, | |
| 311 | fchmodat = Linux + 299, | |
| 312 | faccessat = Linux + 300, | |
| 313 | pselect6 = Linux + 301, | |
| 314 | ppoll = Linux + 302, | |
| 315 | unshare = Linux + 303, | |
| 316 | splice = Linux + 304, | |
| 317 | sync_file_range = Linux + 305, | |
| 318 | tee = Linux + 306, | |
| 319 | vmsplice = Linux + 307, | |
| 320 | move_pages = Linux + 308, | |
| 321 | set_robust_list = Linux + 309, | |
| 322 | get_robust_list = Linux + 310, | |
| 323 | kexec_load = Linux + 311, | |
| 324 | getcpu = Linux + 312, | |
| 325 | epoll_pwait = Linux + 313, | |
| 326 | ioprio_set = Linux + 314, | |
| 327 | ioprio_get = Linux + 315, | |
| 328 | utimensat = Linux + 316, | |
| 329 | signalfd = Linux + 317, | |
| 330 | timerfd = Linux + 318, | |
| 331 | eventfd = Linux + 319, | |
| 332 | fallocate = Linux + 320, | |
| 333 | timerfd_create = Linux + 321, | |
| 334 | timerfd_gettime = Linux + 322, | |
| 335 | timerfd_settime = Linux + 323, | |
| 336 | signalfd4 = Linux + 324, | |
| 337 | eventfd2 = Linux + 325, | |
| 338 | epoll_create1 = Linux + 326, | |
| 339 | dup3 = Linux + 327, | |
| 340 | pipe2 = Linux + 328, | |
| 341 | inotify_init1 = Linux + 329, | |
| 342 | preadv = Linux + 330, | |
| 343 | pwritev = Linux + 331, | |
| 344 | rt_tgsigqueueinfo = Linux + 332, | |
| 345 | perf_event_open = Linux + 333, | |
| 346 | accept4 = Linux + 334, | |
| 347 | recvmmsg = Linux + 335, | |
| 348 | fanotify_init = Linux + 336, | |
| 349 | fanotify_mark = Linux + 337, | |
| 350 | prlimit64 = Linux + 338, | |
| 351 | name_to_handle_at = Linux + 339, | |
| 352 | open_by_handle_at = Linux + 340, | |
| 353 | clock_adjtime = Linux + 341, | |
| 354 | syncfs = Linux + 342, | |
| 355 | sendmmsg = Linux + 343, | |
| 356 | setns = Linux + 344, | |
| 357 | process_vm_readv = Linux + 345, | |
| 358 | process_vm_writev = Linux + 346, | |
| 359 | kcmp = Linux + 347, | |
| 360 | finit_module = Linux + 348, | |
| 361 | sched_setattr = Linux + 349, | |
| 362 | sched_getattr = Linux + 350, | |
| 363 | renameat2 = Linux + 351, | |
| 364 | seccomp = Linux + 352, | |
| 365 | getrandom = Linux + 353, | |
| 366 | memfd_create = Linux + 354, | |
| 367 | bpf = Linux + 355, | |
| 368 | execveat = Linux + 356, | |
| 369 | userfaultfd = Linux + 357, | |
| 370 | membarrier = Linux + 358, | |
| 371 | mlock2 = Linux + 359, | |
| 372 | copy_file_range = Linux + 360, | |
| 373 | preadv2 = Linux + 361, | |
| 374 | pwritev2 = Linux + 362, | |
| 375 | pkey_mprotect = Linux + 363, | |
| 376 | pkey_alloc = Linux + 364, | |
| 377 | pkey_free = Linux + 365, | |
| 378 | statx = Linux + 366, | |
| 379 | rseq = Linux + 367, | |
| 380 | io_pgetevents = Linux + 368, | |
| 381 | openat2 = Linux + 437, | |
| 382 | pidfd_getfd = Linux + 438, | |
| 383 | ||
| 384 | _, | |
| 385 | }; | |
| 386 | ||
| 387 | pub const O_CREAT = 0o0400; | |
| 388 | pub const O_EXCL = 0o02000; | |
| 389 | pub const O_NOCTTY = 0o04000; | |
| 390 | pub const O_TRUNC = 0o01000; | |
| 391 | pub const O_APPEND = 0o0010; | |
| 392 | pub const O_NONBLOCK = 0o0200; | |
| 393 | pub const O_DSYNC = 0o0020; | |
| 394 | pub const O_SYNC = 0o040020; | |
| 395 | pub const O_RSYNC = 0o040020; | |
| 396 | pub const O_DIRECTORY = 0o0200000; | |
| 397 | pub const O_NOFOLLOW = 0o0400000; | |
| 398 | pub const O_CLOEXEC = 0o02000000; | |
| 399 | ||
| 400 | pub const O_ASYNC = 0o010000; | |
| 401 | pub const O_DIRECT = 0o0100000; | |
| 402 | pub const O_LARGEFILE = 0o020000; | |
| 403 | pub const O_NOATIME = 0o01000000; | |
| 404 | pub const O_PATH = 0o010000000; | |
| 405 | pub const O_TMPFILE = 0o020200000; | |
| 406 | pub const O_NDELAY = O_NONBLOCK; | |
| 407 | ||
| 408 | pub const F_DUPFD = 0; | |
| 409 | pub const F_GETFD = 1; | |
| 410 | pub const F_SETFD = 2; | |
| 411 | pub const F_GETFL = 3; | |
| 412 | pub const F_SETFL = 4; | |
| 413 | ||
| 414 | pub const F_SETOWN = 24; | |
| 415 | pub const F_GETOWN = 23; | |
| 416 | pub const F_SETSIG = 10; | |
| 417 | pub const F_GETSIG = 11; | |
| 418 | ||
| 419 | pub const F_GETLK = 33; | |
| 420 | pub const F_SETLK = 34; | |
| 421 | pub const F_SETLKW = 35; | |
| 422 | ||
| 423 | pub const F_RDLCK = 0; | |
| 424 | pub const F_WRLCK = 1; | |
| 425 | pub const F_UNLCK = 2; | |
| 426 | ||
| 427 | pub const LOCK_SH = 1; | |
| 428 | pub const LOCK_EX = 2; | |
| 429 | pub const LOCK_UN = 8; | |
| 430 | pub const LOCK_NB = 4; | |
| 431 | ||
| 432 | pub const F_SETOWN_EX = 15; | |
| 433 | pub const F_GETOWN_EX = 16; | |
| 434 | ||
| 435 | pub const F_GETOWNER_UIDS = 17; | |
| 436 | ||
| 437 | pub const MMAP2_UNIT = 4096; | |
| 438 | ||
| 439 | pub const MAP_NORESERVE = 0x0400; | |
| 440 | pub const MAP_GROWSDOWN = 0x1000; | |
| 441 | pub const MAP_DENYWRITE = 0x2000; | |
| 442 | pub const MAP_EXECUTABLE = 0x4000; | |
| 443 | pub const MAP_LOCKED = 0x8000; | |
| 444 | pub const MAP_32BIT = 0x40; | |
| 445 | ||
| 446 | pub const SO_DEBUG = 1; | |
| 447 | pub const SO_REUSEADDR = 0x0004; | |
| 448 | pub const SO_KEEPALIVE = 0x0008; | |
| 449 | pub const SO_DONTROUTE = 0x0010; | |
| 450 | pub const SO_BROADCAST = 0x0020; | |
| 451 | pub const SO_LINGER = 0x0080; | |
| 452 | pub const SO_OOBINLINE = 0x0100; | |
| 453 | pub const SO_REUSEPORT = 0x0200; | |
| 454 | pub const SO_SNDBUF = 0x1001; | |
| 455 | pub const SO_RCVBUF = 0x1002; | |
| 456 | pub const SO_SNDLOWAT = 0x1003; | |
| 457 | pub const SO_RCVLOWAT = 0x1004; | |
| 458 | pub const SO_RCVTIMEO = 0x1006; | |
| 459 | pub const SO_SNDTIMEO = 0x1005; | |
| 460 | pub const SO_ERROR = 0x1007; | |
| 461 | pub const SO_TYPE = 0x1008; | |
| 462 | pub const SO_ACCEPTCONN = 0x1009; | |
| 463 | pub const SO_PROTOCOL = 0x1028; | |
| 464 | pub const SO_DOMAIN = 0x1029; | |
| 465 | pub const SO_NO_CHECK = 11; | |
| 466 | pub const SO_PRIORITY = 12; | |
| 467 | pub const SO_BSDCOMPAT = 14; | |
| 468 | pub const SO_PASSCRED = 17; | |
| 469 | pub const SO_PEERCRED = 18; | |
| 470 | pub const SO_PEERSEC = 30; | |
| 471 | pub const SO_SNDBUFFORCE = 31; | |
| 472 | pub const SO_RCVBUFFORCE = 33; | |
| 473 | ||
| 474 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; | |
| 475 | pub const VDSO_CGT_VER = "LINUX_2.6.39"; | |
| 476 | ||
| 477 | pub const Flock = extern struct { | |
| 478 | l_type: i16, | |
| 479 | l_whence: i16, | |
| 480 | __pad0: [4]u8, | |
| 481 | l_start: off_t, | |
| 482 | l_len: off_t, | |
| 483 | l_pid: pid_t, | |
| 484 | __unused: [4]u8, | |
| 485 | }; | |
| 486 | ||
| 487 | pub const blksize_t = i32; | |
| 488 | pub const nlink_t = u32; | |
| 489 | pub const time_t = isize; | |
| 490 | pub const mode_t = u32; | |
| 491 | pub const off_t = i64; | |
| 492 | pub const ino_t = u64; | |
| 493 | pub const dev_t = usize; | |
| 494 | pub const blkcnt_t = i64; | |
| 495 | ||
| 496 | pub const Stat = extern struct { | |
| 497 | dev: u32, | |
| 498 | __pad0: [3]u32, | |
| 499 | ino: ino_t, | |
| 500 | mode: mode_t, | |
| 501 | nlink: nlink_t, | |
| 502 | uid: uid_t, | |
| 503 | gid: gid_t, | |
| 504 | rdev: dev_t, | |
| 505 | __pad1: [3]u32, | |
| 506 | size: off_t, | |
| 507 | atim: timespec, | |
| 508 | mtim: timespec, | |
| 509 | ctim: timespec, | |
| 510 | blksize: blksize_t, | |
| 511 | __pad3: [1]u32, | |
| 512 | blocks: blkcnt_t, | |
| 513 | __pad4: [14]usize, | |
| 514 | ||
| 515 | pub fn atime(self: Stat) timespec { | |
| 516 | return self.atim; | |
| 517 | } | |
| 518 | ||
| 519 | pub fn mtime(self: Stat) timespec { | |
| 520 | return self.mtim; | |
| 521 | } | |
| 522 | ||
| 523 | pub fn ctime(self: Stat) timespec { | |
| 524 | return self.ctim; | |
| 525 | } | |
| 526 | }; | |
| 527 | ||
| 528 | pub const timespec = extern struct { | |
| 529 | tv_sec: isize, | |
| 530 | tv_nsec: isize, | |
| 531 | }; | |
| 532 | ||
| 533 | pub const timeval = extern struct { | |
| 534 | tv_sec: isize, | |
| 535 | tv_usec: isize, | |
| 536 | }; | |
| 537 | ||
| 538 | pub const timezone = extern struct { | |
| 539 | tz_minuteswest: i32, | |
| 540 | tz_dsttime: i32, | |
| 541 | }; | |
| 542 | ||
| 543 | pub const Elf_Symndx = u32; |
lib/std/os/linux.zig+1-1| ... | ... | @@ -19,7 +19,7 @@ pub usingnamespace switch (builtin.arch) { |
| 19 | 19 | .aarch64 => @import("linux/arm64.zig"), |
| 20 | 20 | .arm => @import("linux/arm-eabi.zig"), |
| 21 | 21 | .riscv64 => @import("linux/riscv64.zig"), |
| 22 | .mipsel => @import("linux/mipsel.zig"), | |
| 22 | .mips, .mipsel => @import("linux/mips.zig"), | |
| 23 | 23 | else => struct {}, |
| 24 | 24 | }; |
| 25 | 25 | pub usingnamespace @import("bits.zig"); |
lib/std/os/linux/mips.zig created+161| ... | ... | @@ -0,0 +1,161 @@ |
| 1 | usingnamespace @import("../bits.zig"); | |
| 2 | ||
| 3 | pub fn syscall0(number: SYS) usize { | |
| 4 | return asm volatile ( | |
| 5 | \\ syscall | |
| 6 | \\ blez $7, 1f | |
| 7 | \\ subu $2, $0, $2 | |
| 8 | \\ 1: | |
| 9 | : [ret] "={$2}" (-> usize) | |
| 10 | : [number] "{$2}" (@enumToInt(number)) | |
| 11 | : "memory", "cc", "$7" | |
| 12 | ); | |
| 13 | } | |
| 14 | ||
| 15 | pub fn syscall_pipe(fd: *[2]i32) usize { | |
| 16 | return asm volatile ( | |
| 17 | \\ .set noat | |
| 18 | \\ .set noreorder | |
| 19 | \\ syscall | |
| 20 | \\ blez $7, 1f | |
| 21 | \\ nop | |
| 22 | \\ b 2f | |
| 23 | \\ subu $2, $0, $2 | |
| 24 | \\ 1: | |
| 25 | \\ sw $2, 0($4) | |
| 26 | \\ sw $3, 4($4) | |
| 27 | \\ 2: | |
| 28 | : [ret] "={$2}" (-> usize) | |
| 29 | : [number] "{$2}" (@enumToInt(SYS.pipe)) | |
| 30 | : "memory", "cc", "$7" | |
| 31 | ); | |
| 32 | } | |
| 33 | ||
| 34 | pub fn syscall1(number: SYS, arg1: usize) usize { | |
| 35 | return asm volatile ( | |
| 36 | \\ syscall | |
| 37 | \\ blez $7, 1f | |
| 38 | \\ subu $2, $0, $2 | |
| 39 | \\ 1: | |
| 40 | : [ret] "={$2}" (-> usize) | |
| 41 | : [number] "{$2}" (@enumToInt(number)), | |
| 42 | [arg1] "{$4}" (arg1) | |
| 43 | : "memory", "cc", "$7" | |
| 44 | ); | |
| 45 | } | |
| 46 | ||
| 47 | pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { | |
| 48 | return asm volatile ( | |
| 49 | \\ syscall | |
| 50 | \\ blez $7, 1f | |
| 51 | \\ subu $2, $0, $2 | |
| 52 | \\ 1: | |
| 53 | : [ret] "={$2}" (-> usize) | |
| 54 | : [number] "{$2}" (@enumToInt(number)), | |
| 55 | [arg1] "{$4}" (arg1), | |
| 56 | [arg2] "{$5}" (arg2) | |
| 57 | : "memory", "cc", "$7" | |
| 58 | ); | |
| 59 | } | |
| 60 | ||
| 61 | pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { | |
| 62 | return asm volatile ( | |
| 63 | \\ syscall | |
| 64 | \\ blez $7, 1f | |
| 65 | \\ subu $2, $0, $2 | |
| 66 | \\ 1: | |
| 67 | : [ret] "={$2}" (-> usize) | |
| 68 | : [number] "{$2}" (@enumToInt(number)), | |
| 69 | [arg1] "{$4}" (arg1), | |
| 70 | [arg2] "{$5}" (arg2), | |
| 71 | [arg3] "{$6}" (arg3) | |
| 72 | : "memory", "cc", "$7" | |
| 73 | ); | |
| 74 | } | |
| 75 | ||
| 76 | pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { | |
| 77 | return asm volatile ( | |
| 78 | \\ syscall | |
| 79 | \\ blez $7, 1f | |
| 80 | \\ subu $2, $0, $2 | |
| 81 | \\ 1: | |
| 82 | : [ret] "={$2}" (-> usize) | |
| 83 | : [number] "{$2}" (@enumToInt(number)), | |
| 84 | [arg1] "{$4}" (arg1), | |
| 85 | [arg2] "{$5}" (arg2), | |
| 86 | [arg3] "{$6}" (arg3), | |
| 87 | [arg4] "{$7}" (arg4) | |
| 88 | : "memory", "cc", "$7" | |
| 89 | ); | |
| 90 | } | |
| 91 | ||
| 92 | pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { | |
| 93 | return asm volatile ( | |
| 94 | \\ .set noat | |
| 95 | \\ subu $sp, $sp, 24 | |
| 96 | \\ sw %[arg5], 16($sp) | |
| 97 | \\ syscall | |
| 98 | \\ addu $sp, $sp, 24 | |
| 99 | \\ blez $7, 1f | |
| 100 | \\ subu $2, $0, $2 | |
| 101 | \\ 1: | |
| 102 | : [ret] "={$2}" (-> usize) | |
| 103 | : [number] "{$2}" (@enumToInt(number)), | |
| 104 | [arg1] "{$4}" (arg1), | |
| 105 | [arg2] "{$5}" (arg2), | |
| 106 | [arg3] "{$6}" (arg3), | |
| 107 | [arg4] "{$7}" (arg4), | |
| 108 | [arg5] "r" (arg5) | |
| 109 | : "memory", "cc", "$7" | |
| 110 | ); | |
| 111 | } | |
| 112 | ||
| 113 | pub fn syscall6( | |
| 114 | number: SYS, | |
| 115 | arg1: usize, | |
| 116 | arg2: usize, | |
| 117 | arg3: usize, | |
| 118 | arg4: usize, | |
| 119 | arg5: usize, | |
| 120 | arg6: usize, | |
| 121 | ) usize { | |
| 122 | return asm volatile ( | |
| 123 | \\ .set noat | |
| 124 | \\ subu $sp, $sp, 24 | |
| 125 | \\ sw %[arg5], 16($sp) | |
| 126 | \\ sw %[arg6], 20($sp) | |
| 127 | \\ syscall | |
| 128 | \\ addu $sp, $sp, 24 | |
| 129 | \\ blez $7, 1f | |
| 130 | \\ subu $2, $0, $2 | |
| 131 | \\ 1: | |
| 132 | : [ret] "={$2}" (-> usize) | |
| 133 | : [number] "{$2}" (@enumToInt(number)), | |
| 134 | [arg1] "{$4}" (arg1), | |
| 135 | [arg2] "{$5}" (arg2), | |
| 136 | [arg3] "{$6}" (arg3), | |
| 137 | [arg4] "{$7}" (arg4), | |
| 138 | [arg5] "r" (arg5), | |
| 139 | [arg6] "r" (arg6) | |
| 140 | : "memory", "cc", "$7" | |
| 141 | ); | |
| 142 | } | |
| 143 | ||
| 144 | /// This matches the libc clone function. | |
| 145 | pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | |
| 146 | ||
| 147 | pub fn restore() callconv(.Naked) void { | |
| 148 | return asm volatile ("syscall" | |
| 149 | : | |
| 150 | : [number] "{$2}" (@enumToInt(SYS.sigreturn)) | |
| 151 | : "memory", "cc", "$7" | |
| 152 | ); | |
| 153 | } | |
| 154 | ||
| 155 | pub fn restore_rt() callconv(.Naked) void { | |
| 156 | return asm volatile ("syscall" | |
| 157 | : | |
| 158 | : [number] "{$2}" (@enumToInt(SYS.rt_sigreturn)) | |
| 159 | : "memory", "cc", "$7" | |
| 160 | ); | |
| 161 | } |
lib/std/os/linux/mipsel.zig deleted-161| ... | ... | @@ -1,161 +0,0 @@ |
| 1 | usingnamespace @import("../bits.zig"); | |
| 2 | ||
| 3 | pub fn syscall0(number: SYS) usize { | |
| 4 | return asm volatile ( | |
| 5 | \\ syscall | |
| 6 | \\ blez $7, 1f | |
| 7 | \\ subu $2, $0, $2 | |
| 8 | \\ 1: | |
| 9 | : [ret] "={$2}" (-> usize) | |
| 10 | : [number] "{$2}" (@enumToInt(number)) | |
| 11 | : "memory", "cc", "$7" | |
| 12 | ); | |
| 13 | } | |
| 14 | ||
| 15 | pub fn syscall_pipe(fd: *[2]i32) usize { | |
| 16 | return asm volatile ( | |
| 17 | \\ .set noat | |
| 18 | \\ .set noreorder | |
| 19 | \\ syscall | |
| 20 | \\ blez $7, 1f | |
| 21 | \\ nop | |
| 22 | \\ b 2f | |
| 23 | \\ subu $2, $0, $2 | |
| 24 | \\ 1: | |
| 25 | \\ sw $2, 0($4) | |
| 26 | \\ sw $3, 4($4) | |
| 27 | \\ 2: | |
| 28 | : [ret] "={$2}" (-> usize) | |
| 29 | : [number] "{$2}" (@enumToInt(SYS.pipe)) | |
| 30 | : "memory", "cc", "$7" | |
| 31 | ); | |
| 32 | } | |
| 33 | ||
| 34 | pub fn syscall1(number: SYS, arg1: usize) usize { | |
| 35 | return asm volatile ( | |
| 36 | \\ syscall | |
| 37 | \\ blez $7, 1f | |
| 38 | \\ subu $2, $0, $2 | |
| 39 | \\ 1: | |
| 40 | : [ret] "={$2}" (-> usize) | |
| 41 | : [number] "{$2}" (@enumToInt(number)), | |
| 42 | [arg1] "{$4}" (arg1) | |
| 43 | : "memory", "cc", "$7" | |
| 44 | ); | |
| 45 | } | |
| 46 | ||
| 47 | pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize { | |
| 48 | return asm volatile ( | |
| 49 | \\ syscall | |
| 50 | \\ blez $7, 1f | |
| 51 | \\ subu $2, $0, $2 | |
| 52 | \\ 1: | |
| 53 | : [ret] "={$2}" (-> usize) | |
| 54 | : [number] "{$2}" (@enumToInt(number)), | |
| 55 | [arg1] "{$4}" (arg1), | |
| 56 | [arg2] "{$5}" (arg2) | |
| 57 | : "memory", "cc", "$7" | |
| 58 | ); | |
| 59 | } | |
| 60 | ||
| 61 | pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize { | |
| 62 | return asm volatile ( | |
| 63 | \\ syscall | |
| 64 | \\ blez $7, 1f | |
| 65 | \\ subu $2, $0, $2 | |
| 66 | \\ 1: | |
| 67 | : [ret] "={$2}" (-> usize) | |
| 68 | : [number] "{$2}" (@enumToInt(number)), | |
| 69 | [arg1] "{$4}" (arg1), | |
| 70 | [arg2] "{$5}" (arg2), | |
| 71 | [arg3] "{$6}" (arg3) | |
| 72 | : "memory", "cc", "$7" | |
| 73 | ); | |
| 74 | } | |
| 75 | ||
| 76 | pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { | |
| 77 | return asm volatile ( | |
| 78 | \\ syscall | |
| 79 | \\ blez $7, 1f | |
| 80 | \\ subu $2, $0, $2 | |
| 81 | \\ 1: | |
| 82 | : [ret] "={$2}" (-> usize) | |
| 83 | : [number] "{$2}" (@enumToInt(number)), | |
| 84 | [arg1] "{$4}" (arg1), | |
| 85 | [arg2] "{$5}" (arg2), | |
| 86 | [arg3] "{$6}" (arg3), | |
| 87 | [arg4] "{$7}" (arg4) | |
| 88 | : "memory", "cc", "$7" | |
| 89 | ); | |
| 90 | } | |
| 91 | ||
| 92 | pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { | |
| 93 | return asm volatile ( | |
| 94 | \\ .set noat | |
| 95 | \\ subu $sp, $sp, 24 | |
| 96 | \\ sw %[arg5], 16($sp) | |
| 97 | \\ syscall | |
| 98 | \\ addu $sp, $sp, 24 | |
| 99 | \\ blez $7, 1f | |
| 100 | \\ subu $2, $0, $2 | |
| 101 | \\ 1: | |
| 102 | : [ret] "={$2}" (-> usize) | |
| 103 | : [number] "{$2}" (@enumToInt(number)), | |
| 104 | [arg1] "{$4}" (arg1), | |
| 105 | [arg2] "{$5}" (arg2), | |
| 106 | [arg3] "{$6}" (arg3), | |
| 107 | [arg4] "{$7}" (arg4), | |
| 108 | [arg5] "r" (arg5) | |
| 109 | : "memory", "cc", "$7" | |
| 110 | ); | |
| 111 | } | |
| 112 | ||
| 113 | pub fn syscall6( | |
| 114 | number: SYS, | |
| 115 | arg1: usize, | |
| 116 | arg2: usize, | |
| 117 | arg3: usize, | |
| 118 | arg4: usize, | |
| 119 | arg5: usize, | |
| 120 | arg6: usize, | |
| 121 | ) usize { | |
| 122 | return asm volatile ( | |
| 123 | \\ .set noat | |
| 124 | \\ subu $sp, $sp, 24 | |
| 125 | \\ sw %[arg5], 16($sp) | |
| 126 | \\ sw %[arg6], 20($sp) | |
| 127 | \\ syscall | |
| 128 | \\ addu $sp, $sp, 24 | |
| 129 | \\ blez $7, 1f | |
| 130 | \\ subu $2, $0, $2 | |
| 131 | \\ 1: | |
| 132 | : [ret] "={$2}" (-> usize) | |
| 133 | : [number] "{$2}" (@enumToInt(number)), | |
| 134 | [arg1] "{$4}" (arg1), | |
| 135 | [arg2] "{$5}" (arg2), | |
| 136 | [arg3] "{$6}" (arg3), | |
| 137 | [arg4] "{$7}" (arg4), | |
| 138 | [arg5] "r" (arg5), | |
| 139 | [arg6] "r" (arg6) | |
| 140 | : "memory", "cc", "$7" | |
| 141 | ); | |
| 142 | } | |
| 143 | ||
| 144 | /// This matches the libc clone function. | |
| 145 | pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; | |
| 146 | ||
| 147 | pub fn restore() callconv(.Naked) void { | |
| 148 | return asm volatile ("syscall" | |
| 149 | : | |
| 150 | : [number] "{$2}" (@enumToInt(SYS.sigreturn)) | |
| 151 | : "memory", "cc", "$7" | |
| 152 | ); | |
| 153 | } | |
| 154 | ||
| 155 | pub fn restore_rt() callconv(.Naked) void { | |
| 156 | return asm volatile ("syscall" | |
| 157 | : | |
| 158 | : [number] "{$2}" (@enumToInt(SYS.rt_sigreturn)) | |
| 159 | : "memory", "cc", "$7" | |
| 160 | ); | |
| 161 | } |
lib/std/os/linux/tls.zig+5-5| ... | ... | @@ -48,7 +48,7 @@ const TLSVariant = enum { |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | 50 | const tls_variant = switch (builtin.arch) { |
| 51 | .arm, .armeb, .aarch64, .aarch64_be, .riscv32, .riscv64, .mipsel => TLSVariant.VariantI, | |
| 51 | .arm, .armeb, .aarch64, .aarch64_be, .riscv32, .riscv64, .mips, .mipsel => TLSVariant.VariantI, | |
| 52 | 52 | .x86_64, .i386 => TLSVariant.VariantII, |
| 53 | 53 | else => @compileError("undefined tls_variant for this architecture"), |
| 54 | 54 | }; |
| ... | ... | @@ -64,7 +64,7 @@ const tls_tcb_size = switch (builtin.arch) { |
| 64 | 64 | |
| 65 | 65 | // Controls if the TP points to the end of the TCB instead of its beginning |
| 66 | 66 | const tls_tp_points_past_tcb = switch (builtin.arch) { |
| 67 | .riscv32, .riscv64, .mipsel, .powerpc64, .powerpc64le => true, | |
| 67 | .riscv32, .riscv64, .mips, .mipsel, .powerpc64, .powerpc64le => true, | |
| 68 | 68 | else => false, |
| 69 | 69 | }; |
| 70 | 70 | |
| ... | ... | @@ -72,12 +72,12 @@ const tls_tp_points_past_tcb = switch (builtin.arch) { |
| 72 | 72 | // make the generated code more efficient |
| 73 | 73 | |
| 74 | 74 | const tls_tp_offset = switch (builtin.arch) { |
| 75 | .mipsel => 0x7000, | |
| 75 | .mips, .mipsel => 0x7000, | |
| 76 | 76 | else => 0, |
| 77 | 77 | }; |
| 78 | 78 | |
| 79 | 79 | const tls_dtv_offset = switch (builtin.arch) { |
| 80 | .mipsel => 0x8000, | |
| 80 | .mips, .mipsel => 0x8000, | |
| 81 | 81 | .riscv32, .riscv64 => 0x800, |
| 82 | 82 | else => 0, |
| 83 | 83 | }; |
| ... | ... | @@ -156,7 +156,7 @@ pub fn setThreadPointer(addr: usize) void { |
| 156 | 156 | : [addr] "r" (addr) |
| 157 | 157 | ); |
| 158 | 158 | }, |
| 159 | .mipsel => { | |
| 159 | .mips, .mipsel => { | |
| 160 | 160 | const rc = std.os.linux.syscall1(.set_thread_area, addr); |
| 161 | 161 | assert(rc == 0); |
| 162 | 162 | }, |
lib/std/special/c.zig+1-1| ... | ... | @@ -354,7 +354,7 @@ fn clone() callconv(.Naked) void { |
| 354 | 354 | \\ ecall |
| 355 | 355 | ); |
| 356 | 356 | }, |
| 357 | .mipsel => { | |
| 357 | .mips, .mipsel => { | |
| 358 | 358 | asm volatile ( |
| 359 | 359 | \\ # Save function pointer and argument pointer on new thread stack |
| 360 | 360 | \\ and $5, $5, -8 |
lib/std/start.zig+1-1| ... | ... | @@ -108,7 +108,7 @@ fn _start() callconv(.Naked) noreturn { |
| 108 | 108 | : [argc] "=r" (-> [*]usize) |
| 109 | 109 | ); |
| 110 | 110 | }, |
| 111 | .mipsel => { | |
| 111 | .mips, .mipsel => { | |
| 112 | 112 | // Need noat here because LLVM is free to pick any register |
| 113 | 113 | starting_stack_ptr = asm ( |
| 114 | 114 | \\ .set noat |
lib/std/unicode.zig+3| ... | ... | @@ -660,6 +660,9 @@ fn calcUtf16LeLen(utf8: []const u8) usize { |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | test "utf8ToUtf16LeStringLiteral" { |
| 663 | // https://github.com/ziglang/zig/issues/5127 | |
| 664 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 665 | ||
| 663 | 666 | { |
| 664 | 667 | const bytes = [_:0]u16{0x41}; |
| 665 | 668 | const utf16 = utf8ToUtf16LeStringLiteral("A"); |
src/analyze.cpp+1-1| ... | ... | @@ -1007,7 +1007,7 @@ bool want_first_arg_sret(CodeGen *g, FnTypeId *fn_type_id) { |
| 1007 | 1007 | { |
| 1008 | 1008 | X64CABIClass abi_class = type_c_abi_x86_64_class(g, fn_type_id->return_type); |
| 1009 | 1009 | return abi_class == X64CABIClass_MEMORY || abi_class == X64CABIClass_MEMORY_nobyval; |
| 1010 | } else if (g->zig_target->arch == ZigLLVM_mipsel) { | |
| 1010 | } else if (g->zig_target->arch == ZigLLVM_mips || g->zig_target->arch == ZigLLVM_mipsel) { | |
| 1011 | 1011 | return false; |
| 1012 | 1012 | } |
| 1013 | 1013 | zig_panic("TODO implement C ABI for this architecture. See https://github.com/ziglang/zig/issues/1481"); |
test/stage1/behavior/byteswap.zig+1-1| ... | ... | @@ -43,7 +43,7 @@ test "@byteSwap vectors" { |
| 43 | 43 | if (std.Target.current.os.tag == .dragonfly) return error.SkipZigTest; |
| 44 | 44 | |
| 45 | 45 | // https://github.com/ziglang/zig/issues/3317 |
| 46 | if (std.Target.current.cpu.arch == .mipsel) return error.SkipZigTest; | |
| 46 | if (std.Target.current.cpu.arch == .mipsel or std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 47 | 47 | |
| 48 | 48 | const ByteSwapVectorTest = struct { |
| 49 | 49 | fn run() void { |
test/stage1/behavior/cast.zig+3| ... | ... | @@ -16,6 +16,9 @@ test "integer literal to pointer cast" { |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | test "pointer reinterpret const float to int" { |
| 19 | // https://github.com/ziglang/zig/issues/3345 | |
| 20 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 21 | ||
| 19 | 22 | const float: f64 = 5.99999999999994648725e-01; |
| 20 | 23 | const float_ptr = &float; |
| 21 | 24 | const int_ptr = @ptrCast(*const i32, float_ptr); |
test/stage1/behavior/shuffle.zig+1-1| ... | ... | @@ -34,7 +34,7 @@ test "@shuffle" { |
| 34 | 34 | |
| 35 | 35 | // bool |
| 36 | 36 | // Disabled because of #3317 |
| 37 | if (@import("builtin").arch != .mipsel) { | |
| 37 | if (@import("builtin").arch != .mipsel and std.Target.current.cpu.arch != .mips) { | |
| 38 | 38 | var x2: @Vector(4, bool) = [4]bool{ false, true, false, true }; |
| 39 | 39 | var v4: @Vector(2, bool) = [2]bool{ true, false }; |
| 40 | 40 | const mask5: @Vector(4, i32) = [4]i32{ 0, ~@as(i32, 1), 1, 2 }; |
test/stage1/behavior/union.zig+3| ... | ... | @@ -623,6 +623,9 @@ test "0-sized extern union definition" { |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | test "union initializer generates padding only if needed" { |
| 626 | // https://github.com/ziglang/zig/issues/5127 | |
| 627 | if (std.Target.current.cpu.arch == .mips) return error.SkipZigTest; | |
| 628 | ||
| 626 | 629 | const U = union(enum) { |
| 627 | 630 | A: u24, |
| 628 | 631 | }; |
test/tests.zig+25| ... | ... | @@ -145,6 +145,31 @@ const test_targets = blk: { |
| 145 | 145 | // .link_libc = true, |
| 146 | 146 | //}, |
| 147 | 147 | |
| 148 | TestTarget{ | |
| 149 | .target = .{ | |
| 150 | .cpu_arch = .mips, | |
| 151 | .os_tag = .linux, | |
| 152 | .abi = .none, | |
| 153 | }, | |
| 154 | }, | |
| 155 | TestTarget{ | |
| 156 | .target = .{ | |
| 157 | .cpu_arch = .mips, | |
| 158 | .os_tag = .linux, | |
| 159 | .abi = .musl, | |
| 160 | }, | |
| 161 | .link_libc = true, | |
| 162 | }, | |
| 163 | // https://github.com/ziglang/zig/issues/4927 | |
| 164 | //TestTarget{ | |
| 165 | // .target = .{ | |
| 166 | // .cpu_arch = .mips, | |
| 167 | // .os_tag = .linux, | |
| 168 | // .abi = .gnu, | |
| 169 | // }, | |
| 170 | // .link_libc = true, | |
| 171 | //}, | |
| 172 | ||
| 148 | 173 | TestTarget{ |
| 149 | 174 | .target = .{ |
| 150 | 175 | .cpu_arch = .mipsel, |