| author | |
| committer | |
| log | 4d65373a3d0f616cceb4bef67289d014f30d8ea4 |
| tree | 3a3aa42808895a117240fd32a3bbecfe2a7ed78c |
| parent | 2c8864f634cbb42bf45f4f6b7109e9129b357247 |
| parent | a94372231ca3c4daab3cf2bc54d2de135ecdd5e8 |
| signature |
Initial support for mipsel architecture20 files changed, 1343 insertions(+), 476 deletions(-)
lib/std/hash/auto_hash.zig+3| ... | ... | @@ -355,6 +355,9 @@ test "testHash union" { |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | test "testHash vector" { |
| 358 | // Disabled because of #3317 | |
| 359 | if (@import("builtin").arch == .mipsel) return error.SkipZigTest; | |
| 360 | ||
| 358 | 361 | const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 }; |
| 359 | 362 | const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 }; |
| 360 | 363 | testing.expect(testHash(a) == testHash(a)); |
lib/std/os/bits/linux.zig+57-44| ... | ... | @@ -3,15 +3,22 @@ const std = @import("../../std.zig"); |
| 3 | 3 | const maxInt = std.math.maxInt; |
| 4 | 4 | usingnamespace @import("../bits.zig"); |
| 5 | 5 | |
| 6 | pub usingnamespace @import("linux/errno.zig"); | |
| 6 | pub usingnamespace switch (builtin.arch) { | |
| 7 | .mips, .mipsel => @import("linux/errno-mips.zig"), | |
| 8 | else => @import("linux/errno-generic.zig"), | |
| 9 | }; | |
| 10 | ||
| 7 | 11 | pub usingnamespace switch (builtin.arch) { |
| 8 | 12 | .x86_64 => @import("linux/x86_64.zig"), |
| 9 | 13 | .aarch64 => @import("linux/arm64.zig"), |
| 10 | 14 | .arm => @import("linux/arm-eabi.zig"), |
| 11 | 15 | .riscv64 => @import("linux/riscv64.zig"), |
| 16 | .mipsel => @import("linux/mipsel.zig"), | |
| 12 | 17 | else => struct {}, |
| 13 | 18 | }; |
| 14 | 19 | |
| 20 | const is_mips = builtin.arch == .mipsel; | |
| 21 | ||
| 15 | 22 | pub const pid_t = i32; |
| 16 | 23 | pub const fd_t = i32; |
| 17 | 24 | pub const uid_t = i32; |
| ... | ... | @@ -96,21 +103,21 @@ pub const MAP_TYPE = 0x0f; |
| 96 | 103 | pub const MAP_FIXED = 0x10; |
| 97 | 104 | |
| 98 | 105 | /// don't use a file |
| 99 | pub const MAP_ANONYMOUS = 0x20; | |
| 106 | pub const MAP_ANONYMOUS = if (is_mips) 0x800 else 0x20; | |
| 100 | 107 | |
| 101 | 108 | // MAP_ 0x0100 - 0x4000 flags are per architecture |
| 102 | 109 | |
| 103 | 110 | /// populate (prefault) pagetables |
| 104 | pub const MAP_POPULATE = 0x8000; | |
| 111 | pub const MAP_POPULATE = if (is_mips) 0x10000 else 0x8000; | |
| 105 | 112 | |
| 106 | 113 | /// do not block on IO |
| 107 | pub const MAP_NONBLOCK = 0x10000; | |
| 114 | pub const MAP_NONBLOCK = if (is_mips) 0x20000 else 0x10000; | |
| 108 | 115 | |
| 109 | 116 | /// give out an address that is best suited for process/thread stacks |
| 110 | pub const MAP_STACK = 0x20000; | |
| 117 | pub const MAP_STACK = if (is_mips) 0x40000 else 0x20000; | |
| 111 | 118 | |
| 112 | 119 | /// create a huge page mapping |
| 113 | pub const MAP_HUGETLB = 0x40000; | |
| 120 | pub const MAP_HUGETLB = if (is_mips) 0x80000 else 0x40000; | |
| 114 | 121 | |
| 115 | 122 | /// perform synchronous page faults for the mapping |
| 116 | 123 | pub const MAP_SYNC = 0x80000; |
| ... | ... | @@ -247,15 +254,15 @@ pub const SHUT_RD = 0; |
| 247 | 254 | pub const SHUT_WR = 1; |
| 248 | 255 | pub const SHUT_RDWR = 2; |
| 249 | 256 | |
| 250 | pub const SOCK_STREAM = 1; | |
| 251 | pub const SOCK_DGRAM = 2; | |
| 257 | pub const SOCK_STREAM = if (is_mips) 2 else 1; | |
| 258 | pub const SOCK_DGRAM = if (is_mips) 1 else 2; | |
| 252 | 259 | pub const SOCK_RAW = 3; |
| 253 | 260 | pub const SOCK_RDM = 4; |
| 254 | 261 | pub const SOCK_SEQPACKET = 5; |
| 255 | 262 | pub const SOCK_DCCP = 6; |
| 256 | 263 | pub const SOCK_PACKET = 10; |
| 257 | 264 | pub const SOCK_CLOEXEC = 0o2000000; |
| 258 | pub const SOCK_NONBLOCK = 0o4000; | |
| 265 | pub const SOCK_NONBLOCK = if (is_mips) 0o200 else 0o4000; | |
| 259 | 266 | |
| 260 | 267 | pub const PF_UNSPEC = 0; |
| 261 | 268 | pub const PF_LOCAL = 1; |
| ... | ... | @@ -355,32 +362,38 @@ pub const AF_QIPCRTR = PF_QIPCRTR; |
| 355 | 362 | pub const AF_SMC = PF_SMC; |
| 356 | 363 | pub const AF_MAX = PF_MAX; |
| 357 | 364 | |
| 358 | pub const SO_DEBUG = 1; | |
| 359 | pub const SO_REUSEADDR = 2; | |
| 360 | pub const SO_TYPE = 3; | |
| 361 | pub const SO_ERROR = 4; | |
| 362 | pub const SO_DONTROUTE = 5; | |
| 363 | pub const SO_BROADCAST = 6; | |
| 364 | pub const SO_SNDBUF = 7; | |
| 365 | pub const SO_RCVBUF = 8; | |
| 366 | pub const SO_KEEPALIVE = 9; | |
| 367 | pub const SO_OOBINLINE = 10; | |
| 368 | pub const SO_NO_CHECK = 11; | |
| 369 | pub const SO_PRIORITY = 12; | |
| 370 | pub const SO_LINGER = 13; | |
| 371 | pub const SO_BSDCOMPAT = 14; | |
| 372 | pub const SO_REUSEPORT = 15; | |
| 373 | pub const SO_PASSCRED = 16; | |
| 374 | pub const SO_PEERCRED = 17; | |
| 375 | pub const SO_RCVLOWAT = 18; | |
| 376 | pub const SO_SNDLOWAT = 19; | |
| 377 | pub const SO_RCVTIMEO = 20; | |
| 378 | pub const SO_SNDTIMEO = 21; | |
| 379 | pub const SO_ACCEPTCONN = 30; | |
| 380 | pub const SO_SNDBUFFORCE = 32; | |
| 381 | pub const SO_RCVBUFFORCE = 33; | |
| 382 | pub const SO_PROTOCOL = 38; | |
| 383 | pub const SO_DOMAIN = 39; | |
| 365 | pub usingnamespace if (!@hasDecl(@This(), "SO_DEBUG")) | |
| 366 | struct { | |
| 367 | const SO_DEBUG = 1; | |
| 368 | const SO_REUSEADDR = 2; | |
| 369 | const SO_TYPE = 3; | |
| 370 | const SO_ERROR = 4; | |
| 371 | const SO_DONTROUTE = 5; | |
| 372 | const SO_BROADCAST = 6; | |
| 373 | const SO_SNDBUF = 7; | |
| 374 | const SO_RCVBUF = 8; | |
| 375 | const SO_KEEPALIVE = 9; | |
| 376 | const SO_OOBINLINE = 10; | |
| 377 | const SO_NO_CHECK = 11; | |
| 378 | const SO_PRIORITY = 12; | |
| 379 | const SO_LINGER = 13; | |
| 380 | const SO_BSDCOMPAT = 14; | |
| 381 | const SO_REUSEPORT = 15; | |
| 382 | const SO_PASSCRED = 16; | |
| 383 | const SO_PEERCRED = 17; | |
| 384 | const SO_RCVLOWAT = 18; | |
| 385 | const SO_SNDLOWAT = 19; | |
| 386 | const SO_RCVTIMEO = 20; | |
| 387 | const SO_SNDTIMEO = 21; | |
| 388 | const SO_ACCEPTCONN = 30; | |
| 389 | const SO_PEERSEC = 31; | |
| 390 | const SO_SNDBUFFORCE = 32; | |
| 391 | const SO_RCVBUFFORCE = 33; | |
| 392 | const SO_PROTOCOL = 38; | |
| 393 | const SO_DOMAIN = 39; | |
| 394 | } | |
| 395 | else | |
| 396 | struct {}; | |
| 384 | 397 | |
| 385 | 398 | pub const SO_SECURITY_AUTHENTICATION = 22; |
| 386 | 399 | pub const SO_SECURITY_ENCRYPTION_TRANSPORT = 23; |
| ... | ... | @@ -394,11 +407,11 @@ pub const SO_GET_FILTER = SO_ATTACH_FILTER; |
| 394 | 407 | |
| 395 | 408 | pub const SO_PEERNAME = 28; |
| 396 | 409 | pub const SO_TIMESTAMP_OLD = 29; |
| 397 | pub const SO_PEERSEC = 31; | |
| 398 | 410 | pub const SO_PASSSEC = 34; |
| 399 | 411 | pub const SO_TIMESTAMPNS_OLD = 35; |
| 400 | 412 | pub const SO_MARK = 36; |
| 401 | 413 | pub const SO_TIMESTAMPING_OLD = 37; |
| 414 | ||
| 402 | 415 | pub const SO_RXQ_OVFL = 40; |
| 403 | 416 | pub const SO_WIFI_STATUS = 41; |
| 404 | 417 | pub const SCM_WIFI_STATUS = SO_WIFI_STATUS; |
| ... | ... | @@ -432,7 +445,7 @@ pub const SO_RCVTIMEO_NEW = 66; |
| 432 | 445 | pub const SO_SNDTIMEO_NEW = 67; |
| 433 | 446 | pub const SO_DETACH_REUSEPORT_BPF = 68; |
| 434 | 447 | |
| 435 | pub const SOL_SOCKET = 1; | |
| 448 | pub const SOL_SOCKET = if (is_mips) 65535 else 1; | |
| 436 | 449 | |
| 437 | 450 | pub const SOL_IP = 0; |
| 438 | 451 | pub const SOL_IPV6 = 41; |
| ... | ... | @@ -496,7 +509,7 @@ pub const DT_LNK = 10; |
| 496 | 509 | pub const DT_SOCK = 12; |
| 497 | 510 | pub const DT_WHT = 14; |
| 498 | 511 | |
| 499 | pub const TCGETS = 0x5401; | |
| 512 | pub const TCGETS = if (is_mips) 0x540D else 0x5401; | |
| 500 | 513 | pub const TCSETS = 0x5402; |
| 501 | 514 | pub const TCSETSW = 0x5403; |
| 502 | 515 | pub const TCSETSF = 0x5404; |
| ... | ... | @@ -512,17 +525,17 @@ pub const TIOCNXCL = 0x540D; |
| 512 | 525 | pub const TIOCSCTTY = 0x540E; |
| 513 | 526 | pub const TIOCGPGRP = 0x540F; |
| 514 | 527 | pub const TIOCSPGRP = 0x5410; |
| 515 | pub const TIOCOUTQ = 0x5411; | |
| 528 | pub const TIOCOUTQ = if (is_mips) 0x7472 else 0x5411; | |
| 516 | 529 | pub const TIOCSTI = 0x5412; |
| 517 | pub const TIOCGWINSZ = 0x5413; | |
| 518 | pub const TIOCSWINSZ = 0x5414; | |
| 530 | pub const TIOCGWINSZ = if (is_mips) 0x40087468 else 0x5413; | |
| 531 | pub const TIOCSWINSZ = if (is_mips) 0x80087467 else 0x5414; | |
| 519 | 532 | pub const TIOCMGET = 0x5415; |
| 520 | 533 | pub const TIOCMBIS = 0x5416; |
| 521 | 534 | pub const TIOCMBIC = 0x5417; |
| 522 | 535 | pub const TIOCMSET = 0x5418; |
| 523 | 536 | pub const TIOCGSOFTCAR = 0x5419; |
| 524 | 537 | pub const TIOCSSOFTCAR = 0x541A; |
| 525 | pub const FIONREAD = 0x541B; | |
| 538 | pub const FIONREAD = if (is_mips) 0x467F else 0x541B; | |
| 526 | 539 | pub const TIOCINQ = FIONREAD; |
| 527 | 540 | pub const TIOCLINUX = 0x541C; |
| 528 | 541 | pub const TIOCCONS = 0x541D; |
| ... | ... | @@ -563,8 +576,8 @@ pub const EPOLLPRI = 0x002; |
| 563 | 576 | pub const EPOLLOUT = 0x004; |
| 564 | 577 | pub const EPOLLRDNORM = 0x040; |
| 565 | 578 | pub const EPOLLRDBAND = 0x080; |
| 566 | pub const EPOLLWRNORM = 0x100; | |
| 567 | pub const EPOLLWRBAND = 0x200; | |
| 579 | pub const EPOLLWRNORM = if (is_mips) 0x004 else 0x100; | |
| 580 | pub const EPOLLWRBAND = if (is_mips) 0x100 else 0x200; | |
| 568 | 581 | pub const EPOLLMSG = 0x400; |
| 569 | 582 | pub const EPOLLERR = 0x008; |
| 570 | 583 | pub const EPOLLHUP = 0x010; |
lib/std/os/bits/linux/errno-generic.zig created+428| ... | ... | @@ -0,0 +1,428 @@ |
| 1 | /// Operation not permitted | |
| 2 | pub const EPERM = 1; | |
| 3 | ||
| 4 | /// No such file or directory | |
| 5 | pub const ENOENT = 2; | |
| 6 | ||
| 7 | /// No such process | |
| 8 | pub const ESRCH = 3; | |
| 9 | ||
| 10 | /// Interrupted system call | |
| 11 | pub const EINTR = 4; | |
| 12 | ||
| 13 | /// I/O error | |
| 14 | pub const EIO = 5; | |
| 15 | ||
| 16 | /// No such device or address | |
| 17 | pub const ENXIO = 6; | |
| 18 | ||
| 19 | /// Arg list too long | |
| 20 | pub const E2BIG = 7; | |
| 21 | ||
| 22 | /// Exec format error | |
| 23 | pub const ENOEXEC = 8; | |
| 24 | ||
| 25 | /// Bad file number | |
| 26 | pub const EBADF = 9; | |
| 27 | ||
| 28 | /// No child processes | |
| 29 | pub const ECHILD = 10; | |
| 30 | ||
| 31 | /// Try again | |
| 32 | pub const EAGAIN = 11; | |
| 33 | ||
| 34 | /// Out of memory | |
| 35 | pub const ENOMEM = 12; | |
| 36 | ||
| 37 | /// Permission denied | |
| 38 | pub const EACCES = 13; | |
| 39 | ||
| 40 | /// Bad address | |
| 41 | pub const EFAULT = 14; | |
| 42 | ||
| 43 | /// Block device required | |
| 44 | pub const ENOTBLK = 15; | |
| 45 | ||
| 46 | /// Device or resource busy | |
| 47 | pub const EBUSY = 16; | |
| 48 | ||
| 49 | /// File exists | |
| 50 | pub const EEXIST = 17; | |
| 51 | ||
| 52 | /// Cross-device link | |
| 53 | pub const EXDEV = 18; | |
| 54 | ||
| 55 | /// No such device | |
| 56 | pub const ENODEV = 19; | |
| 57 | ||
| 58 | /// Not a directory | |
| 59 | pub const ENOTDIR = 20; | |
| 60 | ||
| 61 | /// Is a directory | |
| 62 | pub const EISDIR = 21; | |
| 63 | ||
| 64 | /// Invalid argument | |
| 65 | pub const EINVAL = 22; | |
| 66 | ||
| 67 | /// File table overflow | |
| 68 | pub const ENFILE = 23; | |
| 69 | ||
| 70 | /// Too many open files | |
| 71 | pub const EMFILE = 24; | |
| 72 | ||
| 73 | /// Not a typewriter | |
| 74 | pub const ENOTTY = 25; | |
| 75 | ||
| 76 | /// Text file busy | |
| 77 | pub const ETXTBSY = 26; | |
| 78 | ||
| 79 | /// File too large | |
| 80 | pub const EFBIG = 27; | |
| 81 | ||
| 82 | /// No space left on device | |
| 83 | pub const ENOSPC = 28; | |
| 84 | ||
| 85 | /// Illegal seek | |
| 86 | pub const ESPIPE = 29; | |
| 87 | ||
| 88 | /// Read-only file system | |
| 89 | pub const EROFS = 30; | |
| 90 | ||
| 91 | /// Too many links | |
| 92 | pub const EMLINK = 31; | |
| 93 | ||
| 94 | /// Broken pipe | |
| 95 | pub const EPIPE = 32; | |
| 96 | ||
| 97 | /// Math argument out of domain of func | |
| 98 | pub const EDOM = 33; | |
| 99 | ||
| 100 | /// Math result not representable | |
| 101 | pub const ERANGE = 34; | |
| 102 | ||
| 103 | /// Resource deadlock would occur | |
| 104 | pub const EDEADLK = 35; | |
| 105 | ||
| 106 | /// File name too long | |
| 107 | pub const ENAMETOOLONG = 36; | |
| 108 | ||
| 109 | /// No record locks available | |
| 110 | pub const ENOLCK = 37; | |
| 111 | ||
| 112 | /// Function not implemented | |
| 113 | pub const ENOSYS = 38; | |
| 114 | ||
| 115 | /// Directory not empty | |
| 116 | pub const ENOTEMPTY = 39; | |
| 117 | ||
| 118 | /// Too many symbolic links encountered | |
| 119 | pub const ELOOP = 40; | |
| 120 | ||
| 121 | /// Operation would block | |
| 122 | pub const EWOULDBLOCK = EAGAIN; | |
| 123 | ||
| 124 | /// No message of desired type | |
| 125 | pub const ENOMSG = 42; | |
| 126 | ||
| 127 | /// Identifier removed | |
| 128 | pub const EIDRM = 43; | |
| 129 | ||
| 130 | /// Channel number out of range | |
| 131 | pub const ECHRNG = 44; | |
| 132 | ||
| 133 | /// Level 2 not synchronized | |
| 134 | pub const EL2NSYNC = 45; | |
| 135 | ||
| 136 | /// Level 3 halted | |
| 137 | pub const EL3HLT = 46; | |
| 138 | ||
| 139 | /// Level 3 reset | |
| 140 | pub const EL3RST = 47; | |
| 141 | ||
| 142 | /// Link number out of range | |
| 143 | pub const ELNRNG = 48; | |
| 144 | ||
| 145 | /// Protocol driver not attached | |
| 146 | pub const EUNATCH = 49; | |
| 147 | ||
| 148 | /// No CSI structure available | |
| 149 | pub const ENOCSI = 50; | |
| 150 | ||
| 151 | /// Level 2 halted | |
| 152 | pub const EL2HLT = 51; | |
| 153 | ||
| 154 | /// Invalid exchange | |
| 155 | pub const EBADE = 52; | |
| 156 | ||
| 157 | /// Invalid request descriptor | |
| 158 | pub const EBADR = 53; | |
| 159 | ||
| 160 | /// Exchange full | |
| 161 | pub const EXFULL = 54; | |
| 162 | ||
| 163 | /// No anode | |
| 164 | pub const ENOANO = 55; | |
| 165 | ||
| 166 | /// Invalid request code | |
| 167 | pub const EBADRQC = 56; | |
| 168 | ||
| 169 | /// Invalid slot | |
| 170 | pub const EBADSLT = 57; | |
| 171 | ||
| 172 | /// Bad font file format | |
| 173 | pub const EBFONT = 59; | |
| 174 | ||
| 175 | /// Device not a stream | |
| 176 | pub const ENOSTR = 60; | |
| 177 | ||
| 178 | /// No data available | |
| 179 | pub const ENODATA = 61; | |
| 180 | ||
| 181 | /// Timer expired | |
| 182 | pub const ETIME = 62; | |
| 183 | ||
| 184 | /// Out of streams resources | |
| 185 | pub const ENOSR = 63; | |
| 186 | ||
| 187 | /// Machine is not on the network | |
| 188 | pub const ENONET = 64; | |
| 189 | ||
| 190 | /// Package not installed | |
| 191 | pub const ENOPKG = 65; | |
| 192 | ||
| 193 | /// Object is remote | |
| 194 | pub const EREMOTE = 66; | |
| 195 | ||
| 196 | /// Link has been severed | |
| 197 | pub const ENOLINK = 67; | |
| 198 | ||
| 199 | /// Advertise error | |
| 200 | pub const EADV = 68; | |
| 201 | ||
| 202 | /// Srmount error | |
| 203 | pub const ESRMNT = 69; | |
| 204 | ||
| 205 | /// Communication error on send | |
| 206 | pub const ECOMM = 70; | |
| 207 | ||
| 208 | /// Protocol error | |
| 209 | pub const EPROTO = 71; | |
| 210 | ||
| 211 | /// Multihop attempted | |
| 212 | pub const EMULTIHOP = 72; | |
| 213 | ||
| 214 | /// RFS specific error | |
| 215 | pub const EDOTDOT = 73; | |
| 216 | ||
| 217 | /// Not a data message | |
| 218 | pub const EBADMSG = 74; | |
| 219 | ||
| 220 | /// Value too large for defined data type | |
| 221 | pub const EOVERFLOW = 75; | |
| 222 | ||
| 223 | /// Name not unique on network | |
| 224 | pub const ENOTUNIQ = 76; | |
| 225 | ||
| 226 | /// File descriptor in bad state | |
| 227 | pub const EBADFD = 77; | |
| 228 | ||
| 229 | /// Remote address changed | |
| 230 | pub const EREMCHG = 78; | |
| 231 | ||
| 232 | /// Can not access a needed shared library | |
| 233 | pub const ELIBACC = 79; | |
| 234 | ||
| 235 | /// Accessing a corrupted shared library | |
| 236 | pub const ELIBBAD = 80; | |
| 237 | ||
| 238 | /// .lib section in a.out corrupted | |
| 239 | pub const ELIBSCN = 81; | |
| 240 | ||
| 241 | /// Attempting to link in too many shared libraries | |
| 242 | pub const ELIBMAX = 82; | |
| 243 | ||
| 244 | /// Cannot exec a shared library directly | |
| 245 | pub const ELIBEXEC = 83; | |
| 246 | ||
| 247 | /// Illegal byte sequence | |
| 248 | pub const EILSEQ = 84; | |
| 249 | ||
| 250 | /// Interrupted system call should be restarted | |
| 251 | pub const ERESTART = 85; | |
| 252 | ||
| 253 | /// Streams pipe error | |
| 254 | pub const ESTRPIPE = 86; | |
| 255 | ||
| 256 | /// Too many users | |
| 257 | pub const EUSERS = 87; | |
| 258 | ||
| 259 | /// Socket operation on non-socket | |
| 260 | pub const ENOTSOCK = 88; | |
| 261 | ||
| 262 | /// Destination address required | |
| 263 | pub const EDESTADDRREQ = 89; | |
| 264 | ||
| 265 | /// Message too long | |
| 266 | pub const EMSGSIZE = 90; | |
| 267 | ||
| 268 | /// Protocol wrong type for socket | |
| 269 | pub const EPROTOTYPE = 91; | |
| 270 | ||
| 271 | /// Protocol not available | |
| 272 | pub const ENOPROTOOPT = 92; | |
| 273 | ||
| 274 | /// Protocol not supported | |
| 275 | pub const EPROTONOSUPPORT = 93; | |
| 276 | ||
| 277 | /// Socket type not supported | |
| 278 | pub const ESOCKTNOSUPPORT = 94; | |
| 279 | ||
| 280 | /// Operation not supported on transport endpoint | |
| 281 | pub const EOPNOTSUPP = 95; | |
| 282 | pub const ENOTSUP = EOPNOTSUPP; | |
| 283 | ||
| 284 | /// Protocol family not supported | |
| 285 | pub const EPFNOSUPPORT = 96; | |
| 286 | ||
| 287 | /// Address family not supported by protocol | |
| 288 | pub const EAFNOSUPPORT = 97; | |
| 289 | ||
| 290 | /// Address already in use | |
| 291 | pub const EADDRINUSE = 98; | |
| 292 | ||
| 293 | /// Cannot assign requested address | |
| 294 | pub const EADDRNOTAVAIL = 99; | |
| 295 | ||
| 296 | /// Network is down | |
| 297 | pub const ENETDOWN = 100; | |
| 298 | ||
| 299 | /// Network is unreachable | |
| 300 | pub const ENETUNREACH = 101; | |
| 301 | ||
| 302 | /// Network dropped connection because of reset | |
| 303 | pub const ENETRESET = 102; | |
| 304 | ||
| 305 | /// Software caused connection abort | |
| 306 | pub const ECONNABORTED = 103; | |
| 307 | ||
| 308 | /// Connection reset by peer | |
| 309 | pub const ECONNRESET = 104; | |
| 310 | ||
| 311 | /// No buffer space available | |
| 312 | pub const ENOBUFS = 105; | |
| 313 | ||
| 314 | /// Transport endpoint is already connected | |
| 315 | pub const EISCONN = 106; | |
| 316 | ||
| 317 | /// Transport endpoint is not connected | |
| 318 | pub const ENOTCONN = 107; | |
| 319 | ||
| 320 | /// Cannot send after transport endpoint shutdown | |
| 321 | pub const ESHUTDOWN = 108; | |
| 322 | ||
| 323 | /// Too many references: cannot splice | |
| 324 | pub const ETOOMANYREFS = 109; | |
| 325 | ||
| 326 | /// Connection timed out | |
| 327 | pub const ETIMEDOUT = 110; | |
| 328 | ||
| 329 | /// Connection refused | |
| 330 | pub const ECONNREFUSED = 111; | |
| 331 | ||
| 332 | /// Host is down | |
| 333 | pub const EHOSTDOWN = 112; | |
| 334 | ||
| 335 | /// No route to host | |
| 336 | pub const EHOSTUNREACH = 113; | |
| 337 | ||
| 338 | /// Operation already in progress | |
| 339 | pub const EALREADY = 114; | |
| 340 | ||
| 341 | /// Operation now in progress | |
| 342 | pub const EINPROGRESS = 115; | |
| 343 | ||
| 344 | /// Stale NFS file handle | |
| 345 | pub const ESTALE = 116; | |
| 346 | ||
| 347 | /// Structure needs cleaning | |
| 348 | pub const EUCLEAN = 117; | |
| 349 | ||
| 350 | /// Not a XENIX named type file | |
| 351 | pub const ENOTNAM = 118; | |
| 352 | ||
| 353 | /// No XENIX semaphores available | |
| 354 | pub const ENAVAIL = 119; | |
| 355 | ||
| 356 | /// Is a named type file | |
| 357 | pub const EISNAM = 120; | |
| 358 | ||
| 359 | /// Remote I/O error | |
| 360 | pub const EREMOTEIO = 121; | |
| 361 | ||
| 362 | /// Quota exceeded | |
| 363 | pub const EDQUOT = 122; | |
| 364 | ||
| 365 | /// No medium found | |
| 366 | pub const ENOMEDIUM = 123; | |
| 367 | ||
| 368 | /// Wrong medium type | |
| 369 | pub const EMEDIUMTYPE = 124; | |
| 370 | ||
| 371 | // nameserver query return codes | |
| 372 | ||
| 373 | /// DNS server returned answer with no data | |
| 374 | pub const ENSROK = 0; | |
| 375 | ||
| 376 | /// DNS server returned answer with no data | |
| 377 | pub const ENSRNODATA = 160; | |
| 378 | ||
| 379 | /// DNS server claims query was misformatted | |
| 380 | pub const ENSRFORMERR = 161; | |
| 381 | ||
| 382 | /// DNS server returned general failure | |
| 383 | pub const ENSRSERVFAIL = 162; | |
| 384 | ||
| 385 | /// Domain name not found | |
| 386 | pub const ENSRNOTFOUND = 163; | |
| 387 | ||
| 388 | /// DNS server does not implement requested operation | |
| 389 | pub const ENSRNOTIMP = 164; | |
| 390 | ||
| 391 | /// DNS server refused query | |
| 392 | pub const ENSRREFUSED = 165; | |
| 393 | ||
| 394 | /// Misformatted DNS query | |
| 395 | pub const ENSRBADQUERY = 166; | |
| 396 | ||
| 397 | /// Misformatted domain name | |
| 398 | pub const ENSRBADNAME = 167; | |
| 399 | ||
| 400 | /// Unsupported address family | |
| 401 | pub const ENSRBADFAMILY = 168; | |
| 402 | ||
| 403 | /// Misformatted DNS reply | |
| 404 | pub const ENSRBADRESP = 169; | |
| 405 | ||
| 406 | /// Could not contact DNS servers | |
| 407 | pub const ENSRCONNREFUSED = 170; | |
| 408 | ||
| 409 | /// Timeout while contacting DNS servers | |
| 410 | pub const ENSRTIMEOUT = 171; | |
| 411 | ||
| 412 | /// End of file | |
| 413 | pub const ENSROF = 172; | |
| 414 | ||
| 415 | /// Error reading file | |
| 416 | pub const ENSRFILE = 173; | |
| 417 | ||
| 418 | /// Out of memory | |
| 419 | pub const ENSRNOMEM = 174; | |
| 420 | ||
| 421 | /// Application terminated lookup | |
| 422 | pub const ENSRDESTRUCTION = 175; | |
| 423 | ||
| 424 | /// Domain name is too long | |
| 425 | pub const ENSRQUERYDOMAINTOOLONG = 176; | |
| 426 | ||
| 427 | /// Domain name is too long | |
| 428 | pub const ENSRCNAMELOOP = 177; |
lib/std/os/bits/linux/errno-mips.zig created+134| ... | ... | @@ -0,0 +1,134 @@ |
| 1 | pub const EPERM = 1; | |
| 2 | pub const ENOENT = 2; | |
| 3 | pub const ESRCH = 3; | |
| 4 | pub const EINTR = 4; | |
| 5 | pub const EIO = 5; | |
| 6 | pub const ENXIO = 6; | |
| 7 | pub const E2BIG = 7; | |
| 8 | pub const ENOEXEC = 8; | |
| 9 | pub const EBADF = 9; | |
| 10 | pub const ECHILD = 10; | |
| 11 | pub const EAGAIN = 11; | |
| 12 | pub const ENOMEM = 12; | |
| 13 | pub const EACCES = 13; | |
| 14 | pub const EFAULT = 14; | |
| 15 | pub const ENOTBLK = 15; | |
| 16 | pub const EBUSY = 16; | |
| 17 | pub const EEXIST = 17; | |
| 18 | pub const EXDEV = 18; | |
| 19 | pub const ENODEV = 19; | |
| 20 | pub const ENOTDIR = 20; | |
| 21 | pub const EISDIR = 21; | |
| 22 | pub const EINVAL = 22; | |
| 23 | pub const ENFILE = 23; | |
| 24 | pub const EMFILE = 24; | |
| 25 | pub const ENOTTY = 25; | |
| 26 | pub const ETXTBSY = 26; | |
| 27 | pub const EFBIG = 27; | |
| 28 | pub const ENOSPC = 28; | |
| 29 | pub const ESPIPE = 29; | |
| 30 | pub const EROFS = 30; | |
| 31 | pub const EMLINK = 31; | |
| 32 | pub const EPIPE = 32; | |
| 33 | pub const EDOM = 33; | |
| 34 | pub const ERANGE = 34; | |
| 35 | pub const ENOMSG = 35; | |
| 36 | pub const EIDRM = 36; | |
| 37 | pub const ECHRNG = 37; | |
| 38 | pub const EL2NSYNC = 38; | |
| 39 | pub const EL3HLT = 39; | |
| 40 | pub const EL3RST = 40; | |
| 41 | pub const ELNRNG = 41; | |
| 42 | pub const EUNATCH = 42; | |
| 43 | pub const ENOCSI = 43; | |
| 44 | pub const EL2HLT = 44; | |
| 45 | pub const EDEADLK = 45; | |
| 46 | pub const ENOLCK = 46; | |
| 47 | pub const EBADE = 50; | |
| 48 | pub const EBADR = 51; | |
| 49 | pub const EXFULL = 52; | |
| 50 | pub const ENOANO = 53; | |
| 51 | pub const EBADRQC = 54; | |
| 52 | pub const EBADSLT = 55; | |
| 53 | pub const EDEADLOCK = 56; | |
| 54 | pub const EBFONT = 59; | |
| 55 | pub const ENOSTR = 60; | |
| 56 | pub const ENODATA = 61; | |
| 57 | pub const ETIME = 62; | |
| 58 | pub const ENOSR = 63; | |
| 59 | pub const ENONET = 64; | |
| 60 | pub const ENOPKG = 65; | |
| 61 | pub const EREMOTE = 66; | |
| 62 | pub const ENOLINK = 67; | |
| 63 | pub const EADV = 68; | |
| 64 | pub const ESRMNT = 69; | |
| 65 | pub const ECOMM = 70; | |
| 66 | pub const EPROTO = 71; | |
| 67 | pub const EDOTDOT = 73; | |
| 68 | pub const EMULTIHOP = 74; | |
| 69 | pub const EBADMSG = 77; | |
| 70 | pub const ENAMETOOLONG = 78; | |
| 71 | pub const EOVERFLOW = 79; | |
| 72 | pub const ENOTUNIQ = 80; | |
| 73 | pub const EBADFD = 81; | |
| 74 | pub const EREMCHG = 82; | |
| 75 | pub const ELIBACC = 83; | |
| 76 | pub const ELIBBAD = 84; | |
| 77 | pub const ELIBSCN = 85; | |
| 78 | pub const ELIBMAX = 86; | |
| 79 | pub const ELIBEXEC = 87; | |
| 80 | pub const EILSEQ = 88; | |
| 81 | pub const ENOSYS = 89; | |
| 82 | pub const ELOOP = 90; | |
| 83 | pub const ERESTART = 91; | |
| 84 | pub const ESTRPIPE = 92; | |
| 85 | pub const ENOTEMPTY = 93; | |
| 86 | pub const EUSERS = 94; | |
| 87 | pub const ENOTSOCK = 95; | |
| 88 | pub const EDESTADDRREQ = 96; | |
| 89 | pub const EMSGSIZE = 97; | |
| 90 | pub const EPROTOTYPE = 98; | |
| 91 | pub const ENOPROTOOPT = 99; | |
| 92 | pub const EPROTONOSUPPORT = 120; | |
| 93 | pub const ESOCKTNOSUPPORT = 121; | |
| 94 | pub const EOPNOTSUPP = 122; | |
| 95 | pub const ENOTSUP = EOPNOTSUPP; | |
| 96 | pub const EPFNOSUPPORT = 123; | |
| 97 | pub const EAFNOSUPPORT = 124; | |
| 98 | pub const EADDRINUSE = 125; | |
| 99 | pub const EADDRNOTAVAIL = 126; | |
| 100 | pub const ENETDOWN = 127; | |
| 101 | pub const ENETUNREACH = 128; | |
| 102 | pub const ENETRESET = 129; | |
| 103 | pub const ECONNABORTED = 130; | |
| 104 | pub const ECONNRESET = 131; | |
| 105 | pub const ENOBUFS = 132; | |
| 106 | pub const EISCONN = 133; | |
| 107 | pub const ENOTCONN = 134; | |
| 108 | pub const EUCLEAN = 135; | |
| 109 | pub const ENOTNAM = 137; | |
| 110 | pub const ENAVAIL = 138; | |
| 111 | pub const EISNAM = 139; | |
| 112 | pub const EREMOTEIO = 140; | |
| 113 | pub const ESHUTDOWN = 143; | |
| 114 | pub const ETOOMANYREFS = 144; | |
| 115 | pub const ETIMEDOUT = 145; | |
| 116 | pub const ECONNREFUSED = 146; | |
| 117 | pub const EHOSTDOWN = 147; | |
| 118 | pub const EHOSTUNREACH = 148; | |
| 119 | pub const EWOULDBLOCK = EAGAIN; | |
| 120 | pub const EALREADY = 149; | |
| 121 | pub const EINPROGRESS = 150; | |
| 122 | pub const ESTALE = 151; | |
| 123 | pub const ECANCELED = 158; | |
| 124 | pub const ENOMEDIUM = 159; | |
| 125 | pub const EMEDIUMTYPE = 160; | |
| 126 | pub const ENOKEY = 161; | |
| 127 | pub const EKEYEXPIRED = 162; | |
| 128 | pub const EKEYREVOKED = 163; | |
| 129 | pub const EKEYREJECTED = 164; | |
| 130 | pub const EOWNERDEAD = 165; | |
| 131 | pub const ENOTRECOVERABLE = 166; | |
| 132 | pub const ERFKILL = 167; | |
| 133 | pub const EHWPOISON = 168; | |
| 134 | pub const EDQUOT = 1133; |
lib/std/os/bits/linux/errno.zig deleted-428| ... | ... | @@ -1,428 +0,0 @@ |
| 1 | /// Operation not permitted | |
| 2 | pub const EPERM = 1; | |
| 3 | ||
| 4 | /// No such file or directory | |
| 5 | pub const ENOENT = 2; | |
| 6 | ||
| 7 | /// No such process | |
| 8 | pub const ESRCH = 3; | |
| 9 | ||
| 10 | /// Interrupted system call | |
| 11 | pub const EINTR = 4; | |
| 12 | ||
| 13 | /// I/O error | |
| 14 | pub const EIO = 5; | |
| 15 | ||
| 16 | /// No such device or address | |
| 17 | pub const ENXIO = 6; | |
| 18 | ||
| 19 | /// Arg list too long | |
| 20 | pub const E2BIG = 7; | |
| 21 | ||
| 22 | /// Exec format error | |
| 23 | pub const ENOEXEC = 8; | |
| 24 | ||
| 25 | /// Bad file number | |
| 26 | pub const EBADF = 9; | |
| 27 | ||
| 28 | /// No child processes | |
| 29 | pub const ECHILD = 10; | |
| 30 | ||
| 31 | /// Try again | |
| 32 | pub const EAGAIN = 11; | |
| 33 | ||
| 34 | /// Out of memory | |
| 35 | pub const ENOMEM = 12; | |
| 36 | ||
| 37 | /// Permission denied | |
| 38 | pub const EACCES = 13; | |
| 39 | ||
| 40 | /// Bad address | |
| 41 | pub const EFAULT = 14; | |
| 42 | ||
| 43 | /// Block device required | |
| 44 | pub const ENOTBLK = 15; | |
| 45 | ||
| 46 | /// Device or resource busy | |
| 47 | pub const EBUSY = 16; | |
| 48 | ||
| 49 | /// File exists | |
| 50 | pub const EEXIST = 17; | |
| 51 | ||
| 52 | /// Cross-device link | |
| 53 | pub const EXDEV = 18; | |
| 54 | ||
| 55 | /// No such device | |
| 56 | pub const ENODEV = 19; | |
| 57 | ||
| 58 | /// Not a directory | |
| 59 | pub const ENOTDIR = 20; | |
| 60 | ||
| 61 | /// Is a directory | |
| 62 | pub const EISDIR = 21; | |
| 63 | ||
| 64 | /// Invalid argument | |
| 65 | pub const EINVAL = 22; | |
| 66 | ||
| 67 | /// File table overflow | |
| 68 | pub const ENFILE = 23; | |
| 69 | ||
| 70 | /// Too many open files | |
| 71 | pub const EMFILE = 24; | |
| 72 | ||
| 73 | /// Not a typewriter | |
| 74 | pub const ENOTTY = 25; | |
| 75 | ||
| 76 | /// Text file busy | |
| 77 | pub const ETXTBSY = 26; | |
| 78 | ||
| 79 | /// File too large | |
| 80 | pub const EFBIG = 27; | |
| 81 | ||
| 82 | /// No space left on device | |
| 83 | pub const ENOSPC = 28; | |
| 84 | ||
| 85 | /// Illegal seek | |
| 86 | pub const ESPIPE = 29; | |
| 87 | ||
| 88 | /// Read-only file system | |
| 89 | pub const EROFS = 30; | |
| 90 | ||
| 91 | /// Too many links | |
| 92 | pub const EMLINK = 31; | |
| 93 | ||
| 94 | /// Broken pipe | |
| 95 | pub const EPIPE = 32; | |
| 96 | ||
| 97 | /// Math argument out of domain of func | |
| 98 | pub const EDOM = 33; | |
| 99 | ||
| 100 | /// Math result not representable | |
| 101 | pub const ERANGE = 34; | |
| 102 | ||
| 103 | /// Resource deadlock would occur | |
| 104 | pub const EDEADLK = 35; | |
| 105 | ||
| 106 | /// File name too long | |
| 107 | pub const ENAMETOOLONG = 36; | |
| 108 | ||
| 109 | /// No record locks available | |
| 110 | pub const ENOLCK = 37; | |
| 111 | ||
| 112 | /// Function not implemented | |
| 113 | pub const ENOSYS = 38; | |
| 114 | ||
| 115 | /// Directory not empty | |
| 116 | pub const ENOTEMPTY = 39; | |
| 117 | ||
| 118 | /// Too many symbolic links encountered | |
| 119 | pub const ELOOP = 40; | |
| 120 | ||
| 121 | /// Operation would block | |
| 122 | pub const EWOULDBLOCK = EAGAIN; | |
| 123 | ||
| 124 | /// No message of desired type | |
| 125 | pub const ENOMSG = 42; | |
| 126 | ||
| 127 | /// Identifier removed | |
| 128 | pub const EIDRM = 43; | |
| 129 | ||
| 130 | /// Channel number out of range | |
| 131 | pub const ECHRNG = 44; | |
| 132 | ||
| 133 | /// Level 2 not synchronized | |
| 134 | pub const EL2NSYNC = 45; | |
| 135 | ||
| 136 | /// Level 3 halted | |
| 137 | pub const EL3HLT = 46; | |
| 138 | ||
| 139 | /// Level 3 reset | |
| 140 | pub const EL3RST = 47; | |
| 141 | ||
| 142 | /// Link number out of range | |
| 143 | pub const ELNRNG = 48; | |
| 144 | ||
| 145 | /// Protocol driver not attached | |
| 146 | pub const EUNATCH = 49; | |
| 147 | ||
| 148 | /// No CSI structure available | |
| 149 | pub const ENOCSI = 50; | |
| 150 | ||
| 151 | /// Level 2 halted | |
| 152 | pub const EL2HLT = 51; | |
| 153 | ||
| 154 | /// Invalid exchange | |
| 155 | pub const EBADE = 52; | |
| 156 | ||
| 157 | /// Invalid request descriptor | |
| 158 | pub const EBADR = 53; | |
| 159 | ||
| 160 | /// Exchange full | |
| 161 | pub const EXFULL = 54; | |
| 162 | ||
| 163 | /// No anode | |
| 164 | pub const ENOANO = 55; | |
| 165 | ||
| 166 | /// Invalid request code | |
| 167 | pub const EBADRQC = 56; | |
| 168 | ||
| 169 | /// Invalid slot | |
| 170 | pub const EBADSLT = 57; | |
| 171 | ||
| 172 | /// Bad font file format | |
| 173 | pub const EBFONT = 59; | |
| 174 | ||
| 175 | /// Device not a stream | |
| 176 | pub const ENOSTR = 60; | |
| 177 | ||
| 178 | /// No data available | |
| 179 | pub const ENODATA = 61; | |
| 180 | ||
| 181 | /// Timer expired | |
| 182 | pub const ETIME = 62; | |
| 183 | ||
| 184 | /// Out of streams resources | |
| 185 | pub const ENOSR = 63; | |
| 186 | ||
| 187 | /// Machine is not on the network | |
| 188 | pub const ENONET = 64; | |
| 189 | ||
| 190 | /// Package not installed | |
| 191 | pub const ENOPKG = 65; | |
| 192 | ||
| 193 | /// Object is remote | |
| 194 | pub const EREMOTE = 66; | |
| 195 | ||
| 196 | /// Link has been severed | |
| 197 | pub const ENOLINK = 67; | |
| 198 | ||
| 199 | /// Advertise error | |
| 200 | pub const EADV = 68; | |
| 201 | ||
| 202 | /// Srmount error | |
| 203 | pub const ESRMNT = 69; | |
| 204 | ||
| 205 | /// Communication error on send | |
| 206 | pub const ECOMM = 70; | |
| 207 | ||
| 208 | /// Protocol error | |
| 209 | pub const EPROTO = 71; | |
| 210 | ||
| 211 | /// Multihop attempted | |
| 212 | pub const EMULTIHOP = 72; | |
| 213 | ||
| 214 | /// RFS specific error | |
| 215 | pub const EDOTDOT = 73; | |
| 216 | ||
| 217 | /// Not a data message | |
| 218 | pub const EBADMSG = 74; | |
| 219 | ||
| 220 | /// Value too large for defined data type | |
| 221 | pub const EOVERFLOW = 75; | |
| 222 | ||
| 223 | /// Name not unique on network | |
| 224 | pub const ENOTUNIQ = 76; | |
| 225 | ||
| 226 | /// File descriptor in bad state | |
| 227 | pub const EBADFD = 77; | |
| 228 | ||
| 229 | /// Remote address changed | |
| 230 | pub const EREMCHG = 78; | |
| 231 | ||
| 232 | /// Can not access a needed shared library | |
| 233 | pub const ELIBACC = 79; | |
| 234 | ||
| 235 | /// Accessing a corrupted shared library | |
| 236 | pub const ELIBBAD = 80; | |
| 237 | ||
| 238 | /// .lib section in a.out corrupted | |
| 239 | pub const ELIBSCN = 81; | |
| 240 | ||
| 241 | /// Attempting to link in too many shared libraries | |
| 242 | pub const ELIBMAX = 82; | |
| 243 | ||
| 244 | /// Cannot exec a shared library directly | |
| 245 | pub const ELIBEXEC = 83; | |
| 246 | ||
| 247 | /// Illegal byte sequence | |
| 248 | pub const EILSEQ = 84; | |
| 249 | ||
| 250 | /// Interrupted system call should be restarted | |
| 251 | pub const ERESTART = 85; | |
| 252 | ||
| 253 | /// Streams pipe error | |
| 254 | pub const ESTRPIPE = 86; | |
| 255 | ||
| 256 | /// Too many users | |
| 257 | pub const EUSERS = 87; | |
| 258 | ||
| 259 | /// Socket operation on non-socket | |
| 260 | pub const ENOTSOCK = 88; | |
| 261 | ||
| 262 | /// Destination address required | |
| 263 | pub const EDESTADDRREQ = 89; | |
| 264 | ||
| 265 | /// Message too long | |
| 266 | pub const EMSGSIZE = 90; | |
| 267 | ||
| 268 | /// Protocol wrong type for socket | |
| 269 | pub const EPROTOTYPE = 91; | |
| 270 | ||
| 271 | /// Protocol not available | |
| 272 | pub const ENOPROTOOPT = 92; | |
| 273 | ||
| 274 | /// Protocol not supported | |
| 275 | pub const EPROTONOSUPPORT = 93; | |
| 276 | ||
| 277 | /// Socket type not supported | |
| 278 | pub const ESOCKTNOSUPPORT = 94; | |
| 279 | ||
| 280 | /// Operation not supported on transport endpoint | |
| 281 | pub const EOPNOTSUPP = 95; | |
| 282 | pub const ENOTSUP = EOPNOTSUPP; | |
| 283 | ||
| 284 | /// Protocol family not supported | |
| 285 | pub const EPFNOSUPPORT = 96; | |
| 286 | ||
| 287 | /// Address family not supported by protocol | |
| 288 | pub const EAFNOSUPPORT = 97; | |
| 289 | ||
| 290 | /// Address already in use | |
| 291 | pub const EADDRINUSE = 98; | |
| 292 | ||
| 293 | /// Cannot assign requested address | |
| 294 | pub const EADDRNOTAVAIL = 99; | |
| 295 | ||
| 296 | /// Network is down | |
| 297 | pub const ENETDOWN = 100; | |
| 298 | ||
| 299 | /// Network is unreachable | |
| 300 | pub const ENETUNREACH = 101; | |
| 301 | ||
| 302 | /// Network dropped connection because of reset | |
| 303 | pub const ENETRESET = 102; | |
| 304 | ||
| 305 | /// Software caused connection abort | |
| 306 | pub const ECONNABORTED = 103; | |
| 307 | ||
| 308 | /// Connection reset by peer | |
| 309 | pub const ECONNRESET = 104; | |
| 310 | ||
| 311 | /// No buffer space available | |
| 312 | pub const ENOBUFS = 105; | |
| 313 | ||
| 314 | /// Transport endpoint is already connected | |
| 315 | pub const EISCONN = 106; | |
| 316 | ||
| 317 | /// Transport endpoint is not connected | |
| 318 | pub const ENOTCONN = 107; | |
| 319 | ||
| 320 | /// Cannot send after transport endpoint shutdown | |
| 321 | pub const ESHUTDOWN = 108; | |
| 322 | ||
| 323 | /// Too many references: cannot splice | |
| 324 | pub const ETOOMANYREFS = 109; | |
| 325 | ||
| 326 | /// Connection timed out | |
| 327 | pub const ETIMEDOUT = 110; | |
| 328 | ||
| 329 | /// Connection refused | |
| 330 | pub const ECONNREFUSED = 111; | |
| 331 | ||
| 332 | /// Host is down | |
| 333 | pub const EHOSTDOWN = 112; | |
| 334 | ||
| 335 | /// No route to host | |
| 336 | pub const EHOSTUNREACH = 113; | |
| 337 | ||
| 338 | /// Operation already in progress | |
| 339 | pub const EALREADY = 114; | |
| 340 | ||
| 341 | /// Operation now in progress | |
| 342 | pub const EINPROGRESS = 115; | |
| 343 | ||
| 344 | /// Stale NFS file handle | |
| 345 | pub const ESTALE = 116; | |
| 346 | ||
| 347 | /// Structure needs cleaning | |
| 348 | pub const EUCLEAN = 117; | |
| 349 | ||
| 350 | /// Not a XENIX named type file | |
| 351 | pub const ENOTNAM = 118; | |
| 352 | ||
| 353 | /// No XENIX semaphores available | |
| 354 | pub const ENAVAIL = 119; | |
| 355 | ||
| 356 | /// Is a named type file | |
| 357 | pub const EISNAM = 120; | |
| 358 | ||
| 359 | /// Remote I/O error | |
| 360 | pub const EREMOTEIO = 121; | |
| 361 | ||
| 362 | /// Quota exceeded | |
| 363 | pub const EDQUOT = 122; | |
| 364 | ||
| 365 | /// No medium found | |
| 366 | pub const ENOMEDIUM = 123; | |
| 367 | ||
| 368 | /// Wrong medium type | |
| 369 | pub const EMEDIUMTYPE = 124; | |
| 370 | ||
| 371 | // nameserver query return codes | |
| 372 | ||
| 373 | /// DNS server returned answer with no data | |
| 374 | pub const ENSROK = 0; | |
| 375 | ||
| 376 | /// DNS server returned answer with no data | |
| 377 | pub const ENSRNODATA = 160; | |
| 378 | ||
| 379 | /// DNS server claims query was misformatted | |
| 380 | pub const ENSRFORMERR = 161; | |
| 381 | ||
| 382 | /// DNS server returned general failure | |
| 383 | pub const ENSRSERVFAIL = 162; | |
| 384 | ||
| 385 | /// Domain name not found | |
| 386 | pub const ENSRNOTFOUND = 163; | |
| 387 | ||
| 388 | /// DNS server does not implement requested operation | |
| 389 | pub const ENSRNOTIMP = 164; | |
| 390 | ||
| 391 | /// DNS server refused query | |
| 392 | pub const ENSRREFUSED = 165; | |
| 393 | ||
| 394 | /// Misformatted DNS query | |
| 395 | pub const ENSRBADQUERY = 166; | |
| 396 | ||
| 397 | /// Misformatted domain name | |
| 398 | pub const ENSRBADNAME = 167; | |
| 399 | ||
| 400 | /// Unsupported address family | |
| 401 | pub const ENSRBADFAMILY = 168; | |
| 402 | ||
| 403 | /// Misformatted DNS reply | |
| 404 | pub const ENSRBADRESP = 169; | |
| 405 | ||
| 406 | /// Could not contact DNS servers | |
| 407 | pub const ENSRCONNREFUSED = 170; | |
| 408 | ||
| 409 | /// Timeout while contacting DNS servers | |
| 410 | pub const ENSRTIMEOUT = 171; | |
| 411 | ||
| 412 | /// End of file | |
| 413 | pub const ENSROF = 172; | |
| 414 | ||
| 415 | /// Error reading file | |
| 416 | pub const ENSRFILE = 173; | |
| 417 | ||
| 418 | /// Out of memory | |
| 419 | pub const ENSRNOMEM = 174; | |
| 420 | ||
| 421 | /// Application terminated lookup | |
| 422 | pub const ENSRDESTRUCTION = 175; | |
| 423 | ||
| 424 | /// Domain name is too long | |
| 425 | pub const ENSRQUERYDOMAINTOOLONG = 176; | |
| 426 | ||
| 427 | /// Domain name is too long | |
| 428 | pub const ENSRCNAMELOOP = 177; |
lib/std/os/bits/linux/mipsel.zig created+516| ... | ... | @@ -0,0 +1,516 @@ |
| 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 | ||
| 9 | pub const SYS_Linux = 4000; | |
| 10 | pub const SYS_syscall = (SYS_Linux + 0); | |
| 11 | pub const SYS_exit = (SYS_Linux + 1); | |
| 12 | pub const SYS_fork = (SYS_Linux + 2); | |
| 13 | pub const SYS_read = (SYS_Linux + 3); | |
| 14 | pub const SYS_write = (SYS_Linux + 4); | |
| 15 | pub const SYS_open = (SYS_Linux + 5); | |
| 16 | pub const SYS_close = (SYS_Linux + 6); | |
| 17 | pub const SYS_waitpid = (SYS_Linux + 7); | |
| 18 | pub const SYS_creat = (SYS_Linux + 8); | |
| 19 | pub const SYS_link = (SYS_Linux + 9); | |
| 20 | pub const SYS_unlink = (SYS_Linux + 10); | |
| 21 | pub const SYS_execve = (SYS_Linux + 11); | |
| 22 | pub const SYS_chdir = (SYS_Linux + 12); | |
| 23 | pub const SYS_time = (SYS_Linux + 13); | |
| 24 | pub const SYS_mknod = (SYS_Linux + 14); | |
| 25 | pub const SYS_chmod = (SYS_Linux + 15); | |
| 26 | pub const SYS_lchown = (SYS_Linux + 16); | |
| 27 | pub const SYS_break = (SYS_Linux + 17); | |
| 28 | pub const SYS_unused18 = (SYS_Linux + 18); | |
| 29 | pub const SYS_lseek = (SYS_Linux + 19); | |
| 30 | pub const SYS_getpid = (SYS_Linux + 20); | |
| 31 | pub const SYS_mount = (SYS_Linux + 21); | |
| 32 | pub const SYS_umount = (SYS_Linux + 22); | |
| 33 | pub const SYS_setuid = (SYS_Linux + 23); | |
| 34 | pub const SYS_getuid = (SYS_Linux + 24); | |
| 35 | pub const SYS_stime = (SYS_Linux + 25); | |
| 36 | pub const SYS_ptrace = (SYS_Linux + 26); | |
| 37 | pub const SYS_alarm = (SYS_Linux + 27); | |
| 38 | pub const SYS_unused28 = (SYS_Linux + 28); | |
| 39 | pub const SYS_pause = (SYS_Linux + 29); | |
| 40 | pub const SYS_utime = (SYS_Linux + 30); | |
| 41 | pub const SYS_stty = (SYS_Linux + 31); | |
| 42 | pub const SYS_gtty = (SYS_Linux + 32); | |
| 43 | pub const SYS_access = (SYS_Linux + 33); | |
| 44 | pub const SYS_nice = (SYS_Linux + 34); | |
| 45 | pub const SYS_ftime = (SYS_Linux + 35); | |
| 46 | pub const SYS_sync = (SYS_Linux + 36); | |
| 47 | pub const SYS_kill = (SYS_Linux + 37); | |
| 48 | pub const SYS_rename = (SYS_Linux + 38); | |
| 49 | pub const SYS_mkdir = (SYS_Linux + 39); | |
| 50 | pub const SYS_rmdir = (SYS_Linux + 40); | |
| 51 | pub const SYS_dup = (SYS_Linux + 41); | |
| 52 | pub const SYS_pipe = (SYS_Linux + 42); | |
| 53 | pub const SYS_times = (SYS_Linux + 43); | |
| 54 | pub const SYS_prof = (SYS_Linux + 44); | |
| 55 | pub const SYS_brk = (SYS_Linux + 45); | |
| 56 | pub const SYS_setgid = (SYS_Linux + 46); | |
| 57 | pub const SYS_getgid = (SYS_Linux + 47); | |
| 58 | pub const SYS_signal = (SYS_Linux + 48); | |
| 59 | pub const SYS_geteuid = (SYS_Linux + 49); | |
| 60 | pub const SYS_getegid = (SYS_Linux + 50); | |
| 61 | pub const SYS_acct = (SYS_Linux + 51); | |
| 62 | pub const SYS_umount2 = (SYS_Linux + 52); | |
| 63 | pub const SYS_lock = (SYS_Linux + 53); | |
| 64 | pub const SYS_ioctl = (SYS_Linux + 54); | |
| 65 | pub const SYS_fcntl = (SYS_Linux + 55); | |
| 66 | pub const SYS_mpx = (SYS_Linux + 56); | |
| 67 | pub const SYS_setpgid = (SYS_Linux + 57); | |
| 68 | pub const SYS_ulimit = (SYS_Linux + 58); | |
| 69 | pub const SYS_unused59 = (SYS_Linux + 59); | |
| 70 | pub const SYS_umask = (SYS_Linux + 60); | |
| 71 | pub const SYS_chroot = (SYS_Linux + 61); | |
| 72 | pub const SYS_ustat = (SYS_Linux + 62); | |
| 73 | pub const SYS_dup2 = (SYS_Linux + 63); | |
| 74 | pub const SYS_getppid = (SYS_Linux + 64); | |
| 75 | pub const SYS_getpgrp = (SYS_Linux + 65); | |
| 76 | pub const SYS_setsid = (SYS_Linux + 66); | |
| 77 | pub const SYS_sigaction = (SYS_Linux + 67); | |
| 78 | pub const SYS_sgetmask = (SYS_Linux + 68); | |
| 79 | pub const SYS_ssetmask = (SYS_Linux + 69); | |
| 80 | pub const SYS_setreuid = (SYS_Linux + 70); | |
| 81 | pub const SYS_setregid = (SYS_Linux + 71); | |
| 82 | pub const SYS_sigsuspend = (SYS_Linux + 72); | |
| 83 | pub const SYS_sigpending = (SYS_Linux + 73); | |
| 84 | pub const SYS_sethostname = (SYS_Linux + 74); | |
| 85 | pub const SYS_setrlimit = (SYS_Linux + 75); | |
| 86 | pub const SYS_getrlimit = (SYS_Linux + 76); | |
| 87 | pub const SYS_getrusage = (SYS_Linux + 77); | |
| 88 | pub const SYS_gettimeofday = (SYS_Linux + 78); | |
| 89 | pub const SYS_settimeofday = (SYS_Linux + 79); | |
| 90 | pub const SYS_getgroups = (SYS_Linux + 80); | |
| 91 | pub const SYS_setgroups = (SYS_Linux + 81); | |
| 92 | pub const SYS_reserved82 = (SYS_Linux + 82); | |
| 93 | pub const SYS_symlink = (SYS_Linux + 83); | |
| 94 | pub const SYS_unused84 = (SYS_Linux + 84); | |
| 95 | pub const SYS_readlink = (SYS_Linux + 85); | |
| 96 | pub const SYS_uselib = (SYS_Linux + 86); | |
| 97 | pub const SYS_swapon = (SYS_Linux + 87); | |
| 98 | pub const SYS_reboot = (SYS_Linux + 88); | |
| 99 | pub const SYS_readdir = (SYS_Linux + 89); | |
| 100 | pub const SYS_mmap = (SYS_Linux + 90); | |
| 101 | pub const SYS_munmap = (SYS_Linux + 91); | |
| 102 | pub const SYS_truncate = (SYS_Linux + 92); | |
| 103 | pub const SYS_ftruncate = (SYS_Linux + 93); | |
| 104 | pub const SYS_fchmod = (SYS_Linux + 94); | |
| 105 | pub const SYS_fchown = (SYS_Linux + 95); | |
| 106 | pub const SYS_getpriority = (SYS_Linux + 96); | |
| 107 | pub const SYS_setpriority = (SYS_Linux + 97); | |
| 108 | pub const SYS_profil = (SYS_Linux + 98); | |
| 109 | pub const SYS_statfs = (SYS_Linux + 99); | |
| 110 | pub const SYS_fstatfs = (SYS_Linux + 100); | |
| 111 | pub const SYS_ioperm = (SYS_Linux + 101); | |
| 112 | pub const SYS_socketcall = (SYS_Linux + 102); | |
| 113 | pub const SYS_syslog = (SYS_Linux + 103); | |
| 114 | pub const SYS_setitimer = (SYS_Linux + 104); | |
| 115 | pub const SYS_getitimer = (SYS_Linux + 105); | |
| 116 | pub const SYS_stat = (SYS_Linux + 106); | |
| 117 | pub const SYS_lstat = (SYS_Linux + 107); | |
| 118 | pub const SYS_fstat = (SYS_Linux + 108); | |
| 119 | pub const SYS_unused109 = (SYS_Linux + 109); | |
| 120 | pub const SYS_iopl = (SYS_Linux + 110); | |
| 121 | pub const SYS_vhangup = (SYS_Linux + 111); | |
| 122 | pub const SYS_idle = (SYS_Linux + 112); | |
| 123 | pub const SYS_vm86 = (SYS_Linux + 113); | |
| 124 | pub const SYS_wait4 = (SYS_Linux + 114); | |
| 125 | pub const SYS_swapoff = (SYS_Linux + 115); | |
| 126 | pub const SYS_sysinfo = (SYS_Linux + 116); | |
| 127 | pub const SYS_ipc = (SYS_Linux + 117); | |
| 128 | pub const SYS_fsync = (SYS_Linux + 118); | |
| 129 | pub const SYS_sigreturn = (SYS_Linux + 119); | |
| 130 | pub const SYS_clone = (SYS_Linux + 120); | |
| 131 | pub const SYS_setdomainname = (SYS_Linux + 121); | |
| 132 | pub const SYS_uname = (SYS_Linux + 122); | |
| 133 | pub const SYS_modify_ldt = (SYS_Linux + 123); | |
| 134 | pub const SYS_adjtimex = (SYS_Linux + 124); | |
| 135 | pub const SYS_mprotect = (SYS_Linux + 125); | |
| 136 | pub const SYS_sigprocmask = (SYS_Linux + 126); | |
| 137 | pub const SYS_create_module = (SYS_Linux + 127); | |
| 138 | pub const SYS_init_module = (SYS_Linux + 128); | |
| 139 | pub const SYS_delete_module = (SYS_Linux + 129); | |
| 140 | pub const SYS_get_kernel_syms = (SYS_Linux + 130); | |
| 141 | pub const SYS_quotactl = (SYS_Linux + 131); | |
| 142 | pub const SYS_getpgid = (SYS_Linux + 132); | |
| 143 | pub const SYS_fchdir = (SYS_Linux + 133); | |
| 144 | pub const SYS_bdflush = (SYS_Linux + 134); | |
| 145 | pub const SYS_sysfs = (SYS_Linux + 135); | |
| 146 | pub const SYS_personality = (SYS_Linux + 136); | |
| 147 | pub const SYS_afs_syscall = (SYS_Linux + 137); | |
| 148 | pub const SYS_setfsuid = (SYS_Linux + 138); | |
| 149 | pub const SYS_setfsgid = (SYS_Linux + 139); | |
| 150 | pub const SYS__llseek = (SYS_Linux + 140); | |
| 151 | pub const SYS_getdents = (SYS_Linux + 141); | |
| 152 | pub const SYS__newselect = (SYS_Linux + 142); | |
| 153 | pub const SYS_flock = (SYS_Linux + 143); | |
| 154 | pub const SYS_msync = (SYS_Linux + 144); | |
| 155 | pub const SYS_readv = (SYS_Linux + 145); | |
| 156 | pub const SYS_writev = (SYS_Linux + 146); | |
| 157 | pub const SYS_cacheflush = (SYS_Linux + 147); | |
| 158 | pub const SYS_cachectl = (SYS_Linux + 148); | |
| 159 | pub const SYS_sysmips = (SYS_Linux + 149); | |
| 160 | pub const SYS_unused150 = (SYS_Linux + 150); | |
| 161 | pub const SYS_getsid = (SYS_Linux + 151); | |
| 162 | pub const SYS_fdatasync = (SYS_Linux + 152); | |
| 163 | pub const SYS__sysctl = (SYS_Linux + 153); | |
| 164 | pub const SYS_mlock = (SYS_Linux + 154); | |
| 165 | pub const SYS_munlock = (SYS_Linux + 155); | |
| 166 | pub const SYS_mlockall = (SYS_Linux + 156); | |
| 167 | pub const SYS_munlockall = (SYS_Linux + 157); | |
| 168 | pub const SYS_sched_setparam = (SYS_Linux + 158); | |
| 169 | pub const SYS_sched_getparam = (SYS_Linux + 159); | |
| 170 | pub const SYS_sched_setscheduler = (SYS_Linux + 160); | |
| 171 | pub const SYS_sched_getscheduler = (SYS_Linux + 161); | |
| 172 | pub const SYS_sched_yield = (SYS_Linux + 162); | |
| 173 | pub const SYS_sched_get_priority_max = (SYS_Linux + 163); | |
| 174 | pub const SYS_sched_get_priority_min = (SYS_Linux + 164); | |
| 175 | pub const SYS_sched_rr_get_interval = (SYS_Linux + 165); | |
| 176 | pub const SYS_nanosleep = (SYS_Linux + 166); | |
| 177 | pub const SYS_mremap = (SYS_Linux + 167); | |
| 178 | pub const SYS_accept = (SYS_Linux + 168); | |
| 179 | pub const SYS_bind = (SYS_Linux + 169); | |
| 180 | pub const SYS_connect = (SYS_Linux + 170); | |
| 181 | pub const SYS_getpeername = (SYS_Linux + 171); | |
| 182 | pub const SYS_getsockname = (SYS_Linux + 172); | |
| 183 | pub const SYS_getsockopt = (SYS_Linux + 173); | |
| 184 | pub const SYS_listen = (SYS_Linux + 174); | |
| 185 | pub const SYS_recv = (SYS_Linux + 175); | |
| 186 | pub const SYS_recvfrom = (SYS_Linux + 176); | |
| 187 | pub const SYS_recvmsg = (SYS_Linux + 177); | |
| 188 | pub const SYS_send = (SYS_Linux + 178); | |
| 189 | pub const SYS_sendmsg = (SYS_Linux + 179); | |
| 190 | pub const SYS_sendto = (SYS_Linux + 180); | |
| 191 | pub const SYS_setsockopt = (SYS_Linux + 181); | |
| 192 | pub const SYS_shutdown = (SYS_Linux + 182); | |
| 193 | pub const SYS_socket = (SYS_Linux + 183); | |
| 194 | pub const SYS_socketpair = (SYS_Linux + 184); | |
| 195 | pub const SYS_setresuid = (SYS_Linux + 185); | |
| 196 | pub const SYS_getresuid = (SYS_Linux + 186); | |
| 197 | pub const SYS_query_module = (SYS_Linux + 187); | |
| 198 | pub const SYS_poll = (SYS_Linux + 188); | |
| 199 | pub const SYS_nfsservctl = (SYS_Linux + 189); | |
| 200 | pub const SYS_setresgid = (SYS_Linux + 190); | |
| 201 | pub const SYS_getresgid = (SYS_Linux + 191); | |
| 202 | pub const SYS_prctl = (SYS_Linux + 192); | |
| 203 | pub const SYS_rt_sigreturn = (SYS_Linux + 193); | |
| 204 | pub const SYS_rt_sigaction = (SYS_Linux + 194); | |
| 205 | pub const SYS_rt_sigprocmask = (SYS_Linux + 195); | |
| 206 | pub const SYS_rt_sigpending = (SYS_Linux + 196); | |
| 207 | pub const SYS_rt_sigtimedwait = (SYS_Linux + 197); | |
| 208 | pub const SYS_rt_sigqueueinfo = (SYS_Linux + 198); | |
| 209 | pub const SYS_rt_sigsuspend = (SYS_Linux + 199); | |
| 210 | pub const SYS_pread64 = (SYS_Linux + 200); | |
| 211 | pub const SYS_pwrite64 = (SYS_Linux + 201); | |
| 212 | pub const SYS_chown = (SYS_Linux + 202); | |
| 213 | pub const SYS_getcwd = (SYS_Linux + 203); | |
| 214 | pub const SYS_capget = (SYS_Linux + 204); | |
| 215 | pub const SYS_capset = (SYS_Linux + 205); | |
| 216 | pub const SYS_sigaltstack = (SYS_Linux + 206); | |
| 217 | pub const SYS_sendfile = (SYS_Linux + 207); | |
| 218 | pub const SYS_getpmsg = (SYS_Linux + 208); | |
| 219 | pub const SYS_putpmsg = (SYS_Linux + 209); | |
| 220 | pub const SYS_mmap2 = (SYS_Linux + 210); | |
| 221 | pub const SYS_truncate64 = (SYS_Linux + 211); | |
| 222 | pub const SYS_ftruncate64 = (SYS_Linux + 212); | |
| 223 | pub const SYS_stat64 = (SYS_Linux + 213); | |
| 224 | pub const SYS_lstat64 = (SYS_Linux + 214); | |
| 225 | pub const SYS_fstat64 = (SYS_Linux + 215); | |
| 226 | pub const SYS_pivot_root = (SYS_Linux + 216); | |
| 227 | pub const SYS_mincore = (SYS_Linux + 217); | |
| 228 | pub const SYS_madvise = (SYS_Linux + 218); | |
| 229 | pub const SYS_getdents64 = (SYS_Linux + 219); | |
| 230 | pub const SYS_fcntl64 = (SYS_Linux + 220); | |
| 231 | pub const SYS_reserved221 = (SYS_Linux + 221); | |
| 232 | pub const SYS_gettid = (SYS_Linux + 222); | |
| 233 | pub const SYS_readahead = (SYS_Linux + 223); | |
| 234 | pub const SYS_setxattr = (SYS_Linux + 224); | |
| 235 | pub const SYS_lsetxattr = (SYS_Linux + 225); | |
| 236 | pub const SYS_fsetxattr = (SYS_Linux + 226); | |
| 237 | pub const SYS_getxattr = (SYS_Linux + 227); | |
| 238 | pub const SYS_lgetxattr = (SYS_Linux + 228); | |
| 239 | pub const SYS_fgetxattr = (SYS_Linux + 229); | |
| 240 | pub const SYS_listxattr = (SYS_Linux + 230); | |
| 241 | pub const SYS_llistxattr = (SYS_Linux + 231); | |
| 242 | pub const SYS_flistxattr = (SYS_Linux + 232); | |
| 243 | pub const SYS_removexattr = (SYS_Linux + 233); | |
| 244 | pub const SYS_lremovexattr = (SYS_Linux + 234); | |
| 245 | pub const SYS_fremovexattr = (SYS_Linux + 235); | |
| 246 | pub const SYS_tkill = (SYS_Linux + 236); | |
| 247 | pub const SYS_sendfile64 = (SYS_Linux + 237); | |
| 248 | pub const SYS_futex = (SYS_Linux + 238); | |
| 249 | pub const SYS_sched_setaffinity = (SYS_Linux + 239); | |
| 250 | pub const SYS_sched_getaffinity = (SYS_Linux + 240); | |
| 251 | pub const SYS_io_setup = (SYS_Linux + 241); | |
| 252 | pub const SYS_io_destroy = (SYS_Linux + 242); | |
| 253 | pub const SYS_io_getevents = (SYS_Linux + 243); | |
| 254 | pub const SYS_io_submit = (SYS_Linux + 244); | |
| 255 | pub const SYS_io_cancel = (SYS_Linux + 245); | |
| 256 | pub const SYS_exit_group = (SYS_Linux + 246); | |
| 257 | pub const SYS_lookup_dcookie = (SYS_Linux + 247); | |
| 258 | pub const SYS_epoll_create = (SYS_Linux + 248); | |
| 259 | pub const SYS_epoll_ctl = (SYS_Linux + 249); | |
| 260 | pub const SYS_epoll_wait = (SYS_Linux + 250); | |
| 261 | pub const SYS_remap_file_pages = (SYS_Linux + 251); | |
| 262 | pub const SYS_set_tid_address = (SYS_Linux + 252); | |
| 263 | pub const SYS_restart_syscall = (SYS_Linux + 253); | |
| 264 | pub const SYS_fadvise64 = (SYS_Linux + 254); | |
| 265 | pub const SYS_statfs64 = (SYS_Linux + 255); | |
| 266 | pub const SYS_fstatfs64 = (SYS_Linux + 256); | |
| 267 | pub const SYS_timer_create = (SYS_Linux + 257); | |
| 268 | pub const SYS_timer_settime = (SYS_Linux + 258); | |
| 269 | pub const SYS_timer_gettime = (SYS_Linux + 259); | |
| 270 | pub const SYS_timer_getoverrun = (SYS_Linux + 260); | |
| 271 | pub const SYS_timer_delete = (SYS_Linux + 261); | |
| 272 | pub const SYS_clock_settime = (SYS_Linux + 262); | |
| 273 | pub const SYS_clock_gettime = (SYS_Linux + 263); | |
| 274 | pub const SYS_clock_getres = (SYS_Linux + 264); | |
| 275 | pub const SYS_clock_nanosleep = (SYS_Linux + 265); | |
| 276 | pub const SYS_tgkill = (SYS_Linux + 266); | |
| 277 | pub const SYS_utimes = (SYS_Linux + 267); | |
| 278 | pub const SYS_mbind = (SYS_Linux + 268); | |
| 279 | pub const SYS_get_mempolicy = (SYS_Linux + 269); | |
| 280 | pub const SYS_set_mempolicy = (SYS_Linux + 270); | |
| 281 | pub const SYS_mq_open = (SYS_Linux + 271); | |
| 282 | pub const SYS_mq_unlink = (SYS_Linux + 272); | |
| 283 | pub const SYS_mq_timedsend = (SYS_Linux + 273); | |
| 284 | pub const SYS_mq_timedreceive = (SYS_Linux + 274); | |
| 285 | pub const SYS_mq_notify = (SYS_Linux + 275); | |
| 286 | pub const SYS_mq_getsetattr = (SYS_Linux + 276); | |
| 287 | pub const SYS_vserver = (SYS_Linux + 277); | |
| 288 | pub const SYS_waitid = (SYS_Linux + 278); | |
| 289 | pub const SYS_add_key = (SYS_Linux + 280); | |
| 290 | pub const SYS_request_key = (SYS_Linux + 281); | |
| 291 | pub const SYS_keyctl = (SYS_Linux + 282); | |
| 292 | pub const SYS_set_thread_area = (SYS_Linux + 283); | |
| 293 | pub const SYS_inotify_init = (SYS_Linux + 284); | |
| 294 | pub const SYS_inotify_add_watch = (SYS_Linux + 285); | |
| 295 | pub const SYS_inotify_rm_watch = (SYS_Linux + 286); | |
| 296 | pub const SYS_migrate_pages = (SYS_Linux + 287); | |
| 297 | pub const SYS_openat = (SYS_Linux + 288); | |
| 298 | pub const SYS_mkdirat = (SYS_Linux + 289); | |
| 299 | pub const SYS_mknodat = (SYS_Linux + 290); | |
| 300 | pub const SYS_fchownat = (SYS_Linux + 291); | |
| 301 | pub const SYS_futimesat = (SYS_Linux + 292); | |
| 302 | pub const SYS_fstatat64 = (SYS_Linux + 293); | |
| 303 | pub const SYS_unlinkat = (SYS_Linux + 294); | |
| 304 | pub const SYS_renameat = (SYS_Linux + 295); | |
| 305 | pub const SYS_linkat = (SYS_Linux + 296); | |
| 306 | pub const SYS_symlinkat = (SYS_Linux + 297); | |
| 307 | pub const SYS_readlinkat = (SYS_Linux + 298); | |
| 308 | pub const SYS_fchmodat = (SYS_Linux + 299); | |
| 309 | pub const SYS_faccessat = (SYS_Linux + 300); | |
| 310 | pub const SYS_pselect6 = (SYS_Linux + 301); | |
| 311 | pub const SYS_ppoll = (SYS_Linux + 302); | |
| 312 | pub const SYS_unshare = (SYS_Linux + 303); | |
| 313 | pub const SYS_splice = (SYS_Linux + 304); | |
| 314 | pub const SYS_sync_file_range = (SYS_Linux + 305); | |
| 315 | pub const SYS_tee = (SYS_Linux + 306); | |
| 316 | pub const SYS_vmsplice = (SYS_Linux + 307); | |
| 317 | pub const SYS_move_pages = (SYS_Linux + 308); | |
| 318 | pub const SYS_set_robust_list = (SYS_Linux + 309); | |
| 319 | pub const SYS_get_robust_list = (SYS_Linux + 310); | |
| 320 | pub const SYS_kexec_load = (SYS_Linux + 311); | |
| 321 | pub const SYS_getcpu = (SYS_Linux + 312); | |
| 322 | pub const SYS_epoll_pwait = (SYS_Linux + 313); | |
| 323 | pub const SYS_ioprio_set = (SYS_Linux + 314); | |
| 324 | pub const SYS_ioprio_get = (SYS_Linux + 315); | |
| 325 | pub const SYS_utimensat = (SYS_Linux + 316); | |
| 326 | pub const SYS_signalfd = (SYS_Linux + 317); | |
| 327 | pub const SYS_timerfd = (SYS_Linux + 318); | |
| 328 | pub const SYS_eventfd = (SYS_Linux + 319); | |
| 329 | pub const SYS_fallocate = (SYS_Linux + 320); | |
| 330 | pub const SYS_timerfd_create = (SYS_Linux + 321); | |
| 331 | pub const SYS_timerfd_gettime = (SYS_Linux + 322); | |
| 332 | pub const SYS_timerfd_settime = (SYS_Linux + 323); | |
| 333 | pub const SYS_signalfd4 = (SYS_Linux + 324); | |
| 334 | pub const SYS_eventfd2 = (SYS_Linux + 325); | |
| 335 | pub const SYS_epoll_create1 = (SYS_Linux + 326); | |
| 336 | pub const SYS_dup3 = (SYS_Linux + 327); | |
| 337 | pub const SYS_pipe2 = (SYS_Linux + 328); | |
| 338 | pub const SYS_inotify_init1 = (SYS_Linux + 329); | |
| 339 | pub const SYS_preadv = (SYS_Linux + 330); | |
| 340 | pub const SYS_pwritev = (SYS_Linux + 331); | |
| 341 | pub const SYS_rt_tgsigqueueinfo = (SYS_Linux + 332); | |
| 342 | pub const SYS_perf_event_open = (SYS_Linux + 333); | |
| 343 | pub const SYS_accept4 = (SYS_Linux + 334); | |
| 344 | pub const SYS_recvmmsg = (SYS_Linux + 335); | |
| 345 | pub const SYS_fanotify_init = (SYS_Linux + 336); | |
| 346 | pub const SYS_fanotify_mark = (SYS_Linux + 337); | |
| 347 | pub const SYS_prlimit64 = (SYS_Linux + 338); | |
| 348 | pub const SYS_name_to_handle_at = (SYS_Linux + 339); | |
| 349 | pub const SYS_open_by_handle_at = (SYS_Linux + 340); | |
| 350 | pub const SYS_clock_adjtime = (SYS_Linux + 341); | |
| 351 | pub const SYS_syncfs = (SYS_Linux + 342); | |
| 352 | pub const SYS_sendmmsg = (SYS_Linux + 343); | |
| 353 | pub const SYS_setns = (SYS_Linux + 344); | |
| 354 | pub const SYS_process_vm_readv = (SYS_Linux + 345); | |
| 355 | pub const SYS_process_vm_writev = (SYS_Linux + 346); | |
| 356 | pub const SYS_kcmp = (SYS_Linux + 347); | |
| 357 | pub const SYS_finit_module = (SYS_Linux + 348); | |
| 358 | pub const SYS_sched_setattr = (SYS_Linux + 349); | |
| 359 | pub const SYS_sched_getattr = (SYS_Linux + 350); | |
| 360 | pub const SYS_renameat2 = (SYS_Linux + 351); | |
| 361 | pub const SYS_seccomp = (SYS_Linux + 352); | |
| 362 | pub const SYS_getrandom = (SYS_Linux + 353); | |
| 363 | pub const SYS_memfd_create = (SYS_Linux + 354); | |
| 364 | pub const SYS_bpf = (SYS_Linux + 355); | |
| 365 | pub const SYS_execveat = (SYS_Linux + 356); | |
| 366 | pub const SYS_userfaultfd = (SYS_Linux + 357); | |
| 367 | pub const SYS_membarrier = (SYS_Linux + 358); | |
| 368 | pub const SYS_mlock2 = (SYS_Linux + 359); | |
| 369 | pub const SYS_copy_file_range = (SYS_Linux + 360); | |
| 370 | pub const SYS_preadv2 = (SYS_Linux + 361); | |
| 371 | pub const SYS_pwritev2 = (SYS_Linux + 362); | |
| 372 | pub const SYS_pkey_mprotect = (SYS_Linux + 363); | |
| 373 | pub const SYS_pkey_alloc = (SYS_Linux + 364); | |
| 374 | pub const SYS_pkey_free = (SYS_Linux + 365); | |
| 375 | pub const SYS_statx = (SYS_Linux + 366); | |
| 376 | pub const SYS_rseq = (SYS_Linux + 367); | |
| 377 | pub const SYS_io_pgetevents = (SYS_Linux + 368); | |
| 378 | ||
| 379 | pub const O_CREAT = 0o0400; | |
| 380 | pub const O_EXCL = 0o02000; | |
| 381 | pub const O_NOCTTY = 0o04000; | |
| 382 | pub const O_TRUNC = 0o01000; | |
| 383 | pub const O_APPEND = 0o0010; | |
| 384 | pub const O_NONBLOCK = 0o0200; | |
| 385 | pub const O_DSYNC = 0o0020; | |
| 386 | pub const O_SYNC = 0o040020; | |
| 387 | pub const O_RSYNC = 0o040020; | |
| 388 | pub const O_DIRECTORY = 0o0200000; | |
| 389 | pub const O_NOFOLLOW = 0o0400000; | |
| 390 | pub const O_CLOEXEC = 0o02000000; | |
| 391 | ||
| 392 | pub const O_ASYNC = 0o010000; | |
| 393 | pub const O_DIRECT = 0o0100000; | |
| 394 | pub const O_LARGEFILE = 0o020000; | |
| 395 | pub const O_NOATIME = 0o01000000; | |
| 396 | pub const O_PATH = 0o010000000; | |
| 397 | pub const O_TMPFILE = 0o020200000; | |
| 398 | pub const O_NDELAY = O_NONBLOCK; | |
| 399 | ||
| 400 | pub const F_DUPFD = 0; | |
| 401 | pub const F_GETFD = 1; | |
| 402 | pub const F_SETFD = 2; | |
| 403 | pub const F_GETFL = 3; | |
| 404 | pub const F_SETFL = 4; | |
| 405 | ||
| 406 | pub const F_SETOWN = 24; | |
| 407 | pub const F_GETOWN = 23; | |
| 408 | pub const F_SETSIG = 10; | |
| 409 | pub const F_GETSIG = 11; | |
| 410 | ||
| 411 | pub const F_GETLK = 33; | |
| 412 | pub const F_SETLK = 34; | |
| 413 | pub const F_SETLKW = 35; | |
| 414 | ||
| 415 | pub const F_SETOWN_EX = 15; | |
| 416 | pub const F_GETOWN_EX = 16; | |
| 417 | ||
| 418 | pub const F_GETOWNER_UIDS = 17; | |
| 419 | ||
| 420 | pub const MMAP2_UNIT = 4096; | |
| 421 | ||
| 422 | pub const MAP_NORESERVE = 0x0400; | |
| 423 | pub const MAP_GROWSDOWN = 0x1000; | |
| 424 | pub const MAP_DENYWRITE = 0x2000; | |
| 425 | pub const MAP_EXECUTABLE = 0x4000; | |
| 426 | pub const MAP_LOCKED = 0x8000; | |
| 427 | pub const MAP_32BIT = 0x40; | |
| 428 | ||
| 429 | pub const SO_DEBUG = 1; | |
| 430 | pub const SO_REUSEADDR = 0x0004; | |
| 431 | pub const SO_KEEPALIVE = 0x0008; | |
| 432 | pub const SO_DONTROUTE = 0x0010; | |
| 433 | pub const SO_BROADCAST = 0x0020; | |
| 434 | pub const SO_LINGER = 0x0080; | |
| 435 | pub const SO_OOBINLINE = 0x0100; | |
| 436 | pub const SO_REUSEPORT = 0x0200; | |
| 437 | pub const SO_SNDBUF = 0x1001; | |
| 438 | pub const SO_RCVBUF = 0x1002; | |
| 439 | pub const SO_SNDLOWAT = 0x1003; | |
| 440 | pub const SO_RCVLOWAT = 0x1004; | |
| 441 | pub const SO_RCVTIMEO = 0x1006; | |
| 442 | pub const SO_SNDTIMEO = 0x1005; | |
| 443 | pub const SO_ERROR = 0x1007; | |
| 444 | pub const SO_TYPE = 0x1008; | |
| 445 | pub const SO_ACCEPTCONN = 0x1009; | |
| 446 | pub const SO_PROTOCOL = 0x1028; | |
| 447 | pub const SO_DOMAIN = 0x1029; | |
| 448 | pub const SO_NO_CHECK = 11; | |
| 449 | pub const SO_PRIORITY = 12; | |
| 450 | pub const SO_BSDCOMPAT = 14; | |
| 451 | pub const SO_PASSCRED = 17; | |
| 452 | pub const SO_PEERCRED = 18; | |
| 453 | pub const SO_PEERSEC = 30; | |
| 454 | pub const SO_SNDBUFFORCE = 31; | |
| 455 | pub const SO_RCVBUFFORCE = 33; | |
| 456 | ||
| 457 | pub const VDSO_USEFUL = true; | |
| 458 | pub const VDSO_CGT_SYM = "__kernel_clock_gettime"; | |
| 459 | pub const VDSO_CGT_VER = "LINUX_2.6.39"; | |
| 460 | ||
| 461 | pub const blksize_t = i32; | |
| 462 | pub const nlink_t = u32; | |
| 463 | pub const time_t = isize; | |
| 464 | pub const mode_t = u32; | |
| 465 | pub const off_t = i64; | |
| 466 | pub const ino_t = u64; | |
| 467 | pub const dev_t = usize; | |
| 468 | pub const blkcnt_t = i64; | |
| 469 | ||
| 470 | pub const Stat = extern struct { | |
| 471 | dev: u32, | |
| 472 | __pad0: [3]u32, | |
| 473 | ino: ino_t, | |
| 474 | mode: mode_t, | |
| 475 | nlink: nlink_t, | |
| 476 | uid: uid_t, | |
| 477 | gid: gid_t, | |
| 478 | rdev: dev_t, | |
| 479 | __pad1: [3]u32, | |
| 480 | size: off_t, | |
| 481 | atim: timespec, | |
| 482 | mtim: timespec, | |
| 483 | ctim: timespec, | |
| 484 | blksize: blksize_t, | |
| 485 | __pad3: [1]u32, | |
| 486 | blocks: blkcnt_t, | |
| 487 | ||
| 488 | pub fn atime(self: Stat) timespec { | |
| 489 | return self.atim; | |
| 490 | } | |
| 491 | ||
| 492 | pub fn mtime(self: Stat) timespec { | |
| 493 | return self.mtim; | |
| 494 | } | |
| 495 | ||
| 496 | pub fn ctime(self: Stat) timespec { | |
| 497 | return self.ctim; | |
| 498 | } | |
| 499 | }; | |
| 500 | ||
| 501 | pub const timespec = extern struct { | |
| 502 | tv_sec: isize, | |
| 503 | tv_nsec: isize, | |
| 504 | }; | |
| 505 | ||
| 506 | pub const timeval = extern struct { | |
| 507 | tv_sec: isize, | |
| 508 | tv_usec: isize, | |
| 509 | }; | |
| 510 | ||
| 511 | pub const timezone = extern struct { | |
| 512 | tz_minuteswest: i32, | |
| 513 | tz_dsttime: i32, | |
| 514 | }; | |
| 515 | ||
| 516 | pub const Elf_Symndx = u32; |
lib/std/os/linux.zig+1| ... | ... | @@ -19,6 +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 | 23 | else => struct {}, |
| 23 | 24 | }; |
| 24 | 25 | pub usingnamespace @import("bits.zig"); |
lib/std/os/linux/mipsel.zig created+124| ... | ... | @@ -0,0 +1,124 @@ |
| 1 | pub fn syscall0(number: usize) usize { | |
| 2 | return asm volatile ( | |
| 3 | \\ syscall | |
| 4 | \\ blez $7, 1f | |
| 5 | \\ subu $2, $0, $2 | |
| 6 | \\ 1: | |
| 7 | : [ret] "={$2}" (-> usize) | |
| 8 | : [number] "{$2}" (number) | |
| 9 | : "memory", "cc", "$7" | |
| 10 | ); | |
| 11 | } | |
| 12 | ||
| 13 | pub fn syscall1(number: usize, arg1: usize) usize { | |
| 14 | return asm volatile ( | |
| 15 | \\ syscall | |
| 16 | \\ blez $7, 1f | |
| 17 | \\ subu $2, $0, $2 | |
| 18 | \\ 1: | |
| 19 | : [ret] "={$2}" (-> usize) | |
| 20 | : [number] "{$2}" (number), | |
| 21 | [arg1] "{$4}" (arg1) | |
| 22 | : "memory", "cc", "$7" | |
| 23 | ); | |
| 24 | } | |
| 25 | ||
| 26 | pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize { | |
| 27 | return asm volatile ( | |
| 28 | \\ syscall | |
| 29 | \\ blez $7, 1f | |
| 30 | \\ subu $2, $0, $2 | |
| 31 | \\ 1: | |
| 32 | : [ret] "={$2}" (-> usize) | |
| 33 | : [number] "{$2}" (number), | |
| 34 | [arg1] "{$4}" (arg1), | |
| 35 | [arg2] "{$5}" (arg2) | |
| 36 | : "memory", "cc", "$7" | |
| 37 | ); | |
| 38 | } | |
| 39 | ||
| 40 | pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize { | |
| 41 | return asm volatile ( | |
| 42 | \\ syscall | |
| 43 | \\ blez $7, 1f | |
| 44 | \\ subu $2, $0, $2 | |
| 45 | \\ 1: | |
| 46 | : [ret] "={$2}" (-> usize) | |
| 47 | : [number] "{$2}" (number), | |
| 48 | [arg1] "{$4}" (arg1), | |
| 49 | [arg2] "{$5}" (arg2), | |
| 50 | [arg3] "{$6}" (arg3) | |
| 51 | : "memory", "cc", "$7" | |
| 52 | ); | |
| 53 | } | |
| 54 | ||
| 55 | pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize { | |
| 56 | return asm volatile ( | |
| 57 | \\ syscall | |
| 58 | \\ blez $7, 1f | |
| 59 | \\ subu $2, $0, $2 | |
| 60 | \\ 1: | |
| 61 | : [ret] "={$2}" (-> usize) | |
| 62 | : [number] "{$2}" (number), | |
| 63 | [arg1] "{$4}" (arg1), | |
| 64 | [arg2] "{$5}" (arg2), | |
| 65 | [arg3] "{$6}" (arg3), | |
| 66 | [arg4] "{$7}" (arg4) | |
| 67 | : "memory", "cc", "$7" | |
| 68 | ); | |
| 69 | } | |
| 70 | ||
| 71 | pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize { | |
| 72 | return asm volatile ( | |
| 73 | \\ .set noat | |
| 74 | \\ subu $sp, $sp, 24 | |
| 75 | \\ sw %[arg5], 16($sp) | |
| 76 | \\ syscall | |
| 77 | \\ addu $sp, $sp, 24 | |
| 78 | \\ blez $7, 1f | |
| 79 | \\ subu $2, $0, $2 | |
| 80 | \\ 1: | |
| 81 | : [ret] "={$2}" (-> usize) | |
| 82 | : [number] "{$2}" (number), | |
| 83 | [arg1] "{$4}" (arg1), | |
| 84 | [arg2] "{$5}" (arg2), | |
| 85 | [arg3] "{$6}" (arg3), | |
| 86 | [arg4] "{$7}" (arg4), | |
| 87 | [arg5] "r" (arg5) | |
| 88 | : "memory", "cc", "$7" | |
| 89 | ); | |
| 90 | } | |
| 91 | ||
| 92 | pub fn syscall6( | |
| 93 | number: usize, | |
| 94 | arg1: usize, | |
| 95 | arg2: usize, | |
| 96 | arg3: usize, | |
| 97 | arg4: usize, | |
| 98 | arg5: usize, | |
| 99 | arg6: usize, | |
| 100 | ) usize { | |
| 101 | return asm volatile ( | |
| 102 | \\ .set noat | |
| 103 | \\ subu $sp, $sp, 24 | |
| 104 | \\ sw %[arg5], 16($sp) | |
| 105 | \\ sw %[arg6], 20($sp) | |
| 106 | \\ syscall | |
| 107 | \\ addu $sp, $sp, 24 | |
| 108 | \\ blez $7, 1f | |
| 109 | \\ subu $2, $0, $2 | |
| 110 | \\ 1: | |
| 111 | : [ret] "={$2}" (-> usize) | |
| 112 | : [number] "{$2}" (number), | |
| 113 | [arg1] "{$4}" (arg1), | |
| 114 | [arg2] "{$5}" (arg2), | |
| 115 | [arg3] "{$6}" (arg3), | |
| 116 | [arg4] "{$7}" (arg4), | |
| 117 | [arg5] "r" (arg5), | |
| 118 | [arg6] "r" (arg6) | |
| 119 | : "memory", "cc", "$7" | |
| 120 | ); | |
| 121 | } | |
| 122 | ||
| 123 | /// This matches the libc clone function. | |
| 124 | pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, arg: usize, ptid: *i32, tls: usize, ctid: *i32) usize; |
lib/std/os/linux/tls.zig+4| ... | ... | @@ -137,6 +137,10 @@ pub fn setThreadPointer(addr: usize) void { |
| 137 | 137 | : [addr] "r" (addr) |
| 138 | 138 | ); |
| 139 | 139 | }, |
| 140 | .mipsel => { | |
| 141 | const rc = std.os.linux.syscall1(std.os.linux.SYS_set_thread_area, addr); | |
| 142 | assert(rc == 0); | |
| 143 | }, | |
| 140 | 144 | else => @compileError("Unsupported architecture"), |
| 141 | 145 | } |
| 142 | 146 | } |
lib/std/os/zen.zig+1-1| ... | ... | @@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1; |
| 80 | 80 | pub const STDERR_FILENO = 2; |
| 81 | 81 | |
| 82 | 82 | // FIXME: let's borrow Linux's error numbers for now. |
| 83 | usingnamespace @import("bits/linux/errno.zig"); | |
| 83 | usingnamespace @import("bits/linux/errno-generic.zig"); | |
| 84 | 84 | // Get the errno from a syscall return value, or 0 for no error. |
| 85 | 85 | pub fn getErrno(r: usize) usize { |
| 86 | 86 | const signed_r = @bitCast(isize, r); |
lib/std/special/c.zig+35| ... | ... | @@ -310,6 +310,41 @@ nakedcc fn clone() void { |
| 310 | 310 | \\ ecall |
| 311 | 311 | ); |
| 312 | 312 | }, |
| 313 | .mipsel => { | |
| 314 | asm volatile ( | |
| 315 | \\ # Save function pointer and argument pointer on new thread stack | |
| 316 | \\ and $5, $5, -8 | |
| 317 | \\ subu $5, $5, 16 | |
| 318 | \\ sw $4, 0($5) | |
| 319 | \\ sw $7, 4($5) | |
| 320 | \\ # Shuffle (fn,sp,fl,arg,ptid,tls,ctid) to (fl,sp,ptid,tls,ctid) | |
| 321 | \\ move $4, $6 | |
| 322 | \\ lw $6, 16($sp) | |
| 323 | \\ lw $7, 20($sp) | |
| 324 | \\ lw $9, 24($sp) | |
| 325 | \\ subu $sp, $sp, 16 | |
| 326 | \\ sw $9, 16($sp) | |
| 327 | \\ li $2, 4120 | |
| 328 | \\ syscall | |
| 329 | \\ beq $7, $0, 1f | |
| 330 | \\ nop | |
| 331 | \\ addu $sp, $sp, 16 | |
| 332 | \\ jr $ra | |
| 333 | \\ subu $2, $0, $2 | |
| 334 | \\1: beq $2, $0, 1f | |
| 335 | \\ nop | |
| 336 | \\ addu $sp, $sp, 16 | |
| 337 | \\ jr $ra | |
| 338 | \\ nop | |
| 339 | \\1: lw $25, 0($sp) | |
| 340 | \\ lw $4, 4($sp) | |
| 341 | \\ jalr $25 | |
| 342 | \\ nop | |
| 343 | \\ move $4, $2 | |
| 344 | \\ li $2, 4001 | |
| 345 | \\ syscall | |
| 346 | ); | |
| 347 | }, | |
| 313 | 348 | else => @compileError("Implement clone() for this arch."), |
| 314 | 349 | } |
| 315 | 350 | } |
lib/std/special/start.zig+15| ... | ... | @@ -13,6 +13,11 @@ const is_wasm = switch (builtin.arch) { |
| 13 | 13 | else => false, |
| 14 | 14 | }; |
| 15 | 15 | |
| 16 | const is_mips = switch (builtin.arch) { | |
| 17 | .mips, .mipsel, .mips64, .mips64el => true, | |
| 18 | else => false, | |
| 19 | }; | |
| 20 | ||
| 16 | 21 | comptime { |
| 17 | 22 | if (builtin.link_libc) { |
| 18 | 23 | @export("main", main, .Strong); |
| ... | ... | @@ -22,6 +27,8 @@ comptime { |
| 22 | 27 | @export("_start", wasm_freestanding_start, .Strong); |
| 23 | 28 | } else if (builtin.os == .uefi) { |
| 24 | 29 | @export("EfiMain", EfiMain, .Strong); |
| 30 | } else if (is_mips) { | |
| 31 | if (!@hasDecl(root, "__start")) @export("__start", _start, .Strong); | |
| 25 | 32 | } else { |
| 26 | 33 | if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong); |
| 27 | 34 | } |
| ... | ... | @@ -80,6 +87,14 @@ nakedcc fn _start() noreturn { |
| 80 | 87 | : [argc] "=r" (-> [*]usize) |
| 81 | 88 | ); |
| 82 | 89 | }, |
| 90 | .mipsel => { | |
| 91 | // Need noat here because LLVM is free to pick any register | |
| 92 | starting_stack_ptr = asm ( | |
| 93 | \\ .set noat | |
| 94 | \\ move %[argc], $sp | |
| 95 | : [argc] "=r" (-> [*]usize) | |
| 96 | ); | |
| 97 | }, | |
| 83 | 98 | else => @compileError("unsupported arch"), |
| 84 | 99 | } |
| 85 | 100 | // If LLVM inlines stack variables into _start, they will overwrite |
src/analyze.cpp+2| ... | ... | @@ -918,6 +918,8 @@ bool want_first_arg_sret(CodeGen *g, FnTypeId *fn_type_id) { |
| 918 | 918 | return abi_class == X64CABIClass_MEMORY; |
| 919 | 919 | } else if (target_is_arm(g->zig_target)) { |
| 920 | 920 | return type_size(g, fn_type_id->return_type) > 16; |
| 921 | } else if (g->zig_target->arch == ZigLLVM_mipsel) { | |
| 922 | return false; | |
| 921 | 923 | } |
| 922 | 924 | zig_panic("TODO implement C ABI for this architecture. See https://github.com/ziglang/zig/issues/1481"); |
| 923 | 925 | } |
src/link.cpp-1| ... | ... | @@ -1816,7 +1816,6 @@ static void construct_linker_job_elf(LinkJob *lj) { |
| 1816 | 1816 | if (g->zig_target->os == OsZen) { |
| 1817 | 1817 | lj->args.append("-e"); |
| 1818 | 1818 | lj->args.append("_start"); |
| 1819 | ||
| 1820 | 1819 | lj->args.append("--image-base=0x10000000"); |
| 1821 | 1820 | } |
| 1822 | 1821 | } |
src/target.cpp+6-1| ... | ... | @@ -1450,6 +1450,7 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) { |
| 1450 | 1450 | case ZigLLVM_aarch64_32: |
| 1451 | 1451 | case ZigLLVM_riscv32: |
| 1452 | 1452 | case ZigLLVM_riscv64: |
| 1453 | case ZigLLVM_mipsel: | |
| 1453 | 1454 | return "sp"; |
| 1454 | 1455 | |
| 1455 | 1456 | case ZigLLVM_amdgcn: |
| ... | ... | @@ -1469,7 +1470,6 @@ const char *arch_stack_pointer_register_name(ZigLLVM_ArchType arch) { |
| 1469 | 1470 | case ZigLLVM_mips: |
| 1470 | 1471 | case ZigLLVM_mips64: |
| 1471 | 1472 | case ZigLLVM_mips64el: |
| 1472 | case ZigLLVM_mipsel: | |
| 1473 | 1473 | case ZigLLVM_msp430: |
| 1474 | 1474 | case ZigLLVM_nvptx: |
| 1475 | 1475 | case ZigLLVM_nvptx64: |
| ... | ... | @@ -1886,6 +1886,11 @@ bool target_is_riscv(const ZigTarget *target) { |
| 1886 | 1886 | return target->arch == ZigLLVM_riscv32 || target->arch == ZigLLVM_riscv64; |
| 1887 | 1887 | } |
| 1888 | 1888 | |
| 1889 | bool target_is_mips(const ZigTarget *target) { | |
| 1890 | return target->arch == ZigLLVM_mips || target->arch == ZigLLVM_mipsel || | |
| 1891 | target->arch == ZigLLVM_mips64 || target->arch == ZigLLVM_mips64el; | |
| 1892 | } | |
| 1893 | ||
| 1889 | 1894 | unsigned target_fn_align(const ZigTarget *target) { |
| 1890 | 1895 | return 16; |
| 1891 | 1896 | } |
src/target.hpp+1| ... | ... | @@ -172,6 +172,7 @@ bool target_can_exec(const ZigTarget *host_target, const ZigTarget *guest_target |
| 172 | 172 | ZigLLVM_OSType get_llvm_os_type(Os os_type); |
| 173 | 173 | |
| 174 | 174 | bool target_is_arm(const ZigTarget *target); |
| 175 | bool target_is_mips(const ZigTarget *target); | |
| 175 | 176 | bool target_allows_addr_zero(const ZigTarget *target); |
| 176 | 177 | bool target_has_valgrind_support(const ZigTarget *target); |
| 177 | 178 | bool target_os_is_darwin(Os os); |
test/stage1/behavior/byteswap.zig+3| ... | ... | @@ -39,6 +39,9 @@ test "@byteSwap integers" { |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | test "@byteSwap vectors" { |
| 42 | // Disabled because of #3317 | |
| 43 | if (@import("builtin").arch == .mipsel) return error.SkipZigTest; | |
| 44 | ||
| 42 | 45 | const ByteSwapVectorTest = struct { |
| 43 | 46 | fn run() void { |
| 44 | 47 | t(u8, 2, [_]u8{ 0x12, 0x13 }, [_]u8{ 0x12, 0x13 }); |
test/stage1/behavior/new_stack_call.zig+1| ... | ... | @@ -6,6 +6,7 @@ var new_stack_bytes: [1024]u8 align(16) = undefined; |
| 6 | 6 | test "calling a function with a new stack" { |
| 7 | 7 | // TODO: https://github.com/ziglang/zig/issues/3268 |
| 8 | 8 | if (@import("builtin").arch == .aarch64) return error.SkipZigTest; |
| 9 | if (@import("builtin").arch == .mipsel) return error.SkipZigTest; | |
| 9 | 10 | |
| 10 | 11 | const arg = 1234; |
| 11 | 12 |
test/stage1/behavior/shuffle.zig+2-1| ... | ... | @@ -33,7 +33,8 @@ test "@shuffle" { |
| 33 | 33 | expect(mem.eql(i32, ([4]i32)(res), [4]i32{ 2147483647, 3, -2, 4 })); |
| 34 | 34 | |
| 35 | 35 | // bool |
| 36 | { | |
| 36 | // Disabled because of #3317 | |
| 37 | if (@import("builtin").arch != .mipsel) { | |
| 37 | 38 | var x2: @Vector(4, bool) = [4]bool{ false, true, false, true }; |
| 38 | 39 | var v4: @Vector(2, bool) = [2]bool{ true, false }; |
| 39 | 40 | const mask5: @Vector(4, i32) = [4]i32{ 0, ~i32(1), 1, 2 }; |
test/tests.zig+10| ... | ... | @@ -131,6 +131,16 @@ const test_targets = [_]TestTarget{ |
| 131 | 131 | // .link_libc = true, |
| 132 | 132 | //}, |
| 133 | 133 | |
| 134 | TestTarget{ | |
| 135 | .target = Target{ | |
| 136 | .Cross = CrossTarget{ | |
| 137 | .os = .linux, | |
| 138 | .arch = .mipsel, | |
| 139 | .abi = .none, | |
| 140 | }, | |
| 141 | }, | |
| 142 | }, | |
| 143 | ||
| 134 | 144 | TestTarget{ |
| 135 | 145 | .target = Target{ |
| 136 | 146 | .Cross = CrossTarget{ |