Skip to content

Commit 470d783

Browse files
Cyanoxygensunfishcode
authored andcommitted
Add 32/64-bit MIPS R6 as separate target architectures (#73)
* gen: add 32/64 MIPS Release 6 as separate target arch - This is a part of the MCP rust-lang/compiler-team#632, that MIPS release 6 being migrated as target_arch instead of target features of MIPS. * Introduce generated bindings for mipsr6 targets
1 parent 51e6614 commit 470d783

20 files changed

+22370
-1
lines changed

gen/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ fn rust_arches(linux_arch: &str) -> &[&str] {
289289
// hexagon gets build errors; disable it for now
290290
"hexagon" => &[],
291291
"loongarch" => &["loongarch64"],
292-
"mips" => &["mips", "mips64"],
292+
"mips" => &["mips", "mips64", "mips32r6", "mips64r6"],
293293
"powerpc" => &["powerpc", "powerpc64"],
294294
"riscv" => &["riscv32", "riscv64"],
295295
"s390" => &["s390x"],
@@ -384,6 +384,10 @@ fn compute_clang_target(rust_arch: &str) -> String {
384384
format!("i686-unknown-linux")
385385
} else if rust_arch == "x32" {
386386
format!("x86_64-unknown-linux-gnux32")
387+
} else if rust_arch == "mips32r6" {
388+
format!("mipsisa32r6-unknown-linux-gnu")
389+
} else if rust_arch == "mips64r6" {
390+
format!("mipsisa64r6-unknown-linux-gnuabi64")
387391
} else {
388392
format!("{}-unknown-linux", rust_arch)
389393
}

src/lib.rs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,78 @@ pub mod prctl;
368368
#[path = "mips64/system.rs"]
369369
pub mod system;
370370
#[cfg(feature = "errno")]
371+
#[cfg(target_arch = "mips32r6")]
372+
#[path = "mips32r6/errno.rs"]
373+
pub mod errno;
374+
#[cfg(feature = "general")]
375+
#[cfg(target_arch = "mips32r6")]
376+
#[path = "mips32r6/general.rs"]
377+
pub mod general;
378+
#[cfg(feature = "if_ether")]
379+
#[cfg(target_arch = "mips32r6")]
380+
#[path = "mips32r6/if_ether.rs"]
381+
pub mod if_ether;
382+
#[cfg(feature = "io_uring")]
383+
#[cfg(target_arch = "mips32r6")]
384+
#[path = "mips32r6/io_uring.rs"]
385+
pub mod io_uring;
386+
#[cfg(feature = "ioctl")]
387+
#[cfg(target_arch = "mips32r6")]
388+
#[path = "mips32r6/ioctl.rs"]
389+
pub mod ioctl;
390+
#[cfg(feature = "net")]
391+
#[cfg(target_arch = "mips32r6")]
392+
#[path = "mips32r6/net.rs"]
393+
pub mod net;
394+
#[cfg(feature = "netlink")]
395+
#[cfg(target_arch = "mips32r6")]
396+
#[path = "mips32r6/netlink.rs"]
397+
pub mod netlink;
398+
#[cfg(feature = "prctl")]
399+
#[cfg(target_arch = "mips32r6")]
400+
#[path = "mips32r6/prctl.rs"]
401+
pub mod prctl;
402+
#[cfg(feature = "system")]
403+
#[cfg(target_arch = "mips32r6")]
404+
#[path = "mips32r6/system.rs"]
405+
pub mod system;
406+
#[cfg(feature = "errno")]
407+
#[cfg(target_arch = "mips64r6")]
408+
#[path = "mips64r6/errno.rs"]
409+
pub mod errno;
410+
#[cfg(feature = "general")]
411+
#[cfg(target_arch = "mips64r6")]
412+
#[path = "mips64r6/general.rs"]
413+
pub mod general;
414+
#[cfg(feature = "if_ether")]
415+
#[cfg(target_arch = "mips64r6")]
416+
#[path = "mips64r6/if_ether.rs"]
417+
pub mod if_ether;
418+
#[cfg(feature = "io_uring")]
419+
#[cfg(target_arch = "mips64r6")]
420+
#[path = "mips64r6/io_uring.rs"]
421+
pub mod io_uring;
422+
#[cfg(feature = "ioctl")]
423+
#[cfg(target_arch = "mips64r6")]
424+
#[path = "mips64r6/ioctl.rs"]
425+
pub mod ioctl;
426+
#[cfg(feature = "net")]
427+
#[cfg(target_arch = "mips64r6")]
428+
#[path = "mips64r6/net.rs"]
429+
pub mod net;
430+
#[cfg(feature = "netlink")]
431+
#[cfg(target_arch = "mips64r6")]
432+
#[path = "mips64r6/netlink.rs"]
433+
pub mod netlink;
434+
#[cfg(feature = "prctl")]
435+
#[cfg(target_arch = "mips64r6")]
436+
#[path = "mips64r6/prctl.rs"]
437+
pub mod prctl;
438+
#[cfg(feature = "system")]
439+
#[cfg(target_arch = "mips64r6")]
440+
#[path = "mips64r6/system.rs"]
441+
pub mod system;
442+
#[cfg(feature = "errno")]
371443
#[cfg(target_arch = "powerpc")]
372444
#[path = "powerpc/errno.rs"]
373445
pub mod errno;

src/mips32r6/errno.rs

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/* automatically generated by rust-bindgen 0.66.1 */
2+
3+
pub const EPERM: u32 = 1;
4+
pub const ENOENT: u32 = 2;
5+
pub const ESRCH: u32 = 3;
6+
pub const EINTR: u32 = 4;
7+
pub const EIO: u32 = 5;
8+
pub const ENXIO: u32 = 6;
9+
pub const E2BIG: u32 = 7;
10+
pub const ENOEXEC: u32 = 8;
11+
pub const EBADF: u32 = 9;
12+
pub const ECHILD: u32 = 10;
13+
pub const EAGAIN: u32 = 11;
14+
pub const ENOMEM: u32 = 12;
15+
pub const EACCES: u32 = 13;
16+
pub const EFAULT: u32 = 14;
17+
pub const ENOTBLK: u32 = 15;
18+
pub const EBUSY: u32 = 16;
19+
pub const EEXIST: u32 = 17;
20+
pub const EXDEV: u32 = 18;
21+
pub const ENODEV: u32 = 19;
22+
pub const ENOTDIR: u32 = 20;
23+
pub const EISDIR: u32 = 21;
24+
pub const EINVAL: u32 = 22;
25+
pub const ENFILE: u32 = 23;
26+
pub const EMFILE: u32 = 24;
27+
pub const ENOTTY: u32 = 25;
28+
pub const ETXTBSY: u32 = 26;
29+
pub const EFBIG: u32 = 27;
30+
pub const ENOSPC: u32 = 28;
31+
pub const ESPIPE: u32 = 29;
32+
pub const EROFS: u32 = 30;
33+
pub const EMLINK: u32 = 31;
34+
pub const EPIPE: u32 = 32;
35+
pub const EDOM: u32 = 33;
36+
pub const ERANGE: u32 = 34;
37+
pub const ENOMSG: u32 = 35;
38+
pub const EIDRM: u32 = 36;
39+
pub const ECHRNG: u32 = 37;
40+
pub const EL2NSYNC: u32 = 38;
41+
pub const EL3HLT: u32 = 39;
42+
pub const EL3RST: u32 = 40;
43+
pub const ELNRNG: u32 = 41;
44+
pub const EUNATCH: u32 = 42;
45+
pub const ENOCSI: u32 = 43;
46+
pub const EL2HLT: u32 = 44;
47+
pub const EDEADLK: u32 = 45;
48+
pub const ENOLCK: u32 = 46;
49+
pub const EBADE: u32 = 50;
50+
pub const EBADR: u32 = 51;
51+
pub const EXFULL: u32 = 52;
52+
pub const ENOANO: u32 = 53;
53+
pub const EBADRQC: u32 = 54;
54+
pub const EBADSLT: u32 = 55;
55+
pub const EDEADLOCK: u32 = 56;
56+
pub const EBFONT: u32 = 59;
57+
pub const ENOSTR: u32 = 60;
58+
pub const ENODATA: u32 = 61;
59+
pub const ETIME: u32 = 62;
60+
pub const ENOSR: u32 = 63;
61+
pub const ENONET: u32 = 64;
62+
pub const ENOPKG: u32 = 65;
63+
pub const EREMOTE: u32 = 66;
64+
pub const ENOLINK: u32 = 67;
65+
pub const EADV: u32 = 68;
66+
pub const ESRMNT: u32 = 69;
67+
pub const ECOMM: u32 = 70;
68+
pub const EPROTO: u32 = 71;
69+
pub const EDOTDOT: u32 = 73;
70+
pub const EMULTIHOP: u32 = 74;
71+
pub const EBADMSG: u32 = 77;
72+
pub const ENAMETOOLONG: u32 = 78;
73+
pub const EOVERFLOW: u32 = 79;
74+
pub const ENOTUNIQ: u32 = 80;
75+
pub const EBADFD: u32 = 81;
76+
pub const EREMCHG: u32 = 82;
77+
pub const ELIBACC: u32 = 83;
78+
pub const ELIBBAD: u32 = 84;
79+
pub const ELIBSCN: u32 = 85;
80+
pub const ELIBMAX: u32 = 86;
81+
pub const ELIBEXEC: u32 = 87;
82+
pub const EILSEQ: u32 = 88;
83+
pub const ENOSYS: u32 = 89;
84+
pub const ELOOP: u32 = 90;
85+
pub const ERESTART: u32 = 91;
86+
pub const ESTRPIPE: u32 = 92;
87+
pub const ENOTEMPTY: u32 = 93;
88+
pub const EUSERS: u32 = 94;
89+
pub const ENOTSOCK: u32 = 95;
90+
pub const EDESTADDRREQ: u32 = 96;
91+
pub const EMSGSIZE: u32 = 97;
92+
pub const EPROTOTYPE: u32 = 98;
93+
pub const ENOPROTOOPT: u32 = 99;
94+
pub const EPROTONOSUPPORT: u32 = 120;
95+
pub const ESOCKTNOSUPPORT: u32 = 121;
96+
pub const EOPNOTSUPP: u32 = 122;
97+
pub const EPFNOSUPPORT: u32 = 123;
98+
pub const EAFNOSUPPORT: u32 = 124;
99+
pub const EADDRINUSE: u32 = 125;
100+
pub const EADDRNOTAVAIL: u32 = 126;
101+
pub const ENETDOWN: u32 = 127;
102+
pub const ENETUNREACH: u32 = 128;
103+
pub const ENETRESET: u32 = 129;
104+
pub const ECONNABORTED: u32 = 130;
105+
pub const ECONNRESET: u32 = 131;
106+
pub const ENOBUFS: u32 = 132;
107+
pub const EISCONN: u32 = 133;
108+
pub const ENOTCONN: u32 = 134;
109+
pub const EUCLEAN: u32 = 135;
110+
pub const ENOTNAM: u32 = 137;
111+
pub const ENAVAIL: u32 = 138;
112+
pub const EISNAM: u32 = 139;
113+
pub const EREMOTEIO: u32 = 140;
114+
pub const EINIT: u32 = 141;
115+
pub const EREMDEV: u32 = 142;
116+
pub const ESHUTDOWN: u32 = 143;
117+
pub const ETOOMANYREFS: u32 = 144;
118+
pub const ETIMEDOUT: u32 = 145;
119+
pub const ECONNREFUSED: u32 = 146;
120+
pub const EHOSTDOWN: u32 = 147;
121+
pub const EHOSTUNREACH: u32 = 148;
122+
pub const EWOULDBLOCK: u32 = 11;
123+
pub const EALREADY: u32 = 149;
124+
pub const EINPROGRESS: u32 = 150;
125+
pub const ESTALE: u32 = 151;
126+
pub const ECANCELED: u32 = 158;
127+
pub const ENOMEDIUM: u32 = 159;
128+
pub const EMEDIUMTYPE: u32 = 160;
129+
pub const ENOKEY: u32 = 161;
130+
pub const EKEYEXPIRED: u32 = 162;
131+
pub const EKEYREVOKED: u32 = 163;
132+
pub const EKEYREJECTED: u32 = 164;
133+
pub const EOWNERDEAD: u32 = 165;
134+
pub const ENOTRECOVERABLE: u32 = 166;
135+
pub const ERFKILL: u32 = 167;
136+
pub const EHWPOISON: u32 = 168;
137+
pub const EDQUOT: u32 = 1133;

0 commit comments

Comments
 (0)