Skip to content

Commit 9d22625

Browse files
authored
Merge pull request rust-lang#4131 from tgross35/backport-eggplant
[0.2] Backports
2 parents 979575b + 2435829 commit 9d22625

File tree

4 files changed

+79
-11
lines changed

4 files changed

+79
-11
lines changed

src/unix/bsd/freebsdlike/freebsd/riscv64.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ s_no_extra_traits! {
2121
}
2222

2323
pub struct fpregs {
24-
pub fp_x: [[::register_t; 2]; 32],
25-
pub fp_fcsr: ::register_t,
24+
pub fp_x: [[u64; 2]; 32],
25+
pub fp_fcsr: u64,
2626
pub fp_flags: ::c_int,
27-
pub fp_pad: ::c_int,
27+
pub pad: ::c_int,
2828
}
2929

3030
pub struct mcontext_t {
@@ -85,7 +85,7 @@ cfg_if! {
8585
self.fp_x == other.fp_x
8686
&& self.fp_fcsr == other.fp_fcsr
8787
&& self.fp_flags == other.fp_flags
88-
&& self.fp_pad == other.fp_pad
88+
&& self.pad == other.pad
8989
}
9090
}
9191
impl Eq for fpregs {}
@@ -95,7 +95,7 @@ cfg_if! {
9595
.field("fp_x", &self.fp_x)
9696
.field("fp_fcsr", &self.fp_fcsr)
9797
.field("fp_flags", &self.fp_flags)
98-
.field("fp_pad", &self.fp_pad)
98+
.field("pad", &self.pad)
9999
.finish()
100100
}
101101
}
@@ -104,7 +104,7 @@ cfg_if! {
104104
self.fp_x.hash(state);
105105
self.fp_fcsr.hash(state);
106106
self.fp_flags.hash(state);
107-
self.fp_pad.hash(state);
107+
self.pad.hash(state);
108108
}
109109
}
110110
impl PartialEq for mcontext_t {

src/unix/bsd/netbsdlike/netbsd/riscv64.rs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,77 @@ use PT_FIRSTMACH;
33
pub type c_long = i64;
44
pub type c_ulong = u64;
55
pub type c_char = u8;
6+
pub type __greg_t = u64;
67
pub type __cpu_simple_lock_nv_t = ::c_int;
8+
pub type __gregset = [__greg_t; _NGREG];
9+
pub type __fregset = [__freg; _NFREG];
10+
11+
s! {
12+
pub struct mcontext_t {
13+
pub __gregs: __gregset,
14+
pub __fregs: __fpregset,
15+
__spare: [::__greg_t; 7],
16+
}
17+
}
18+
19+
s_no_extra_traits! {
20+
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
21+
pub union __fpreg {
22+
pub u_u64: u64,
23+
pub u_d: ::c_double,
24+
}
25+
}
726

827
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
928

1029
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
1130
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
1231
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
1332
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
33+
34+
pub const _NGREG: usize = 32;
35+
pub const _NFREG: usize = 33;
36+
37+
pub const _REG_X1: ::c_int = 0;
38+
pub const _REG_X2: ::c_int = 1;
39+
pub const _REG_X3: ::c_int = 2;
40+
pub const _REG_X4: ::c_int = 3;
41+
pub const _REG_X5: ::c_int = 4;
42+
pub const _REG_X6: ::c_int = 5;
43+
pub const _REG_X7: ::c_int = 6;
44+
pub const _REG_X8: ::c_int = 7;
45+
pub const _REG_X9: ::c_int = 8;
46+
pub const _REG_X10: ::c_int = 9;
47+
pub const _REG_X11: ::c_int = 10;
48+
pub const _REG_X12: ::c_int = 11;
49+
pub const _REG_X13: ::c_int = 12;
50+
pub const _REG_X14: ::c_int = 13;
51+
pub const _REG_X15: ::c_int = 14;
52+
pub const _REG_X16: ::c_int = 15;
53+
pub const _REG_X17: ::c_int = 16;
54+
pub const _REG_X18: ::c_int = 17;
55+
pub const _REG_X19: ::c_int = 18;
56+
pub const _REG_X20: ::c_int = 19;
57+
pub const _REG_X21: ::c_int = 20;
58+
pub const _REG_X22: ::c_int = 21;
59+
pub const _REG_X23: ::c_int = 22;
60+
pub const _REG_X24: ::c_int = 23;
61+
pub const _REG_X25: ::c_int = 24;
62+
pub const _REG_X26: ::c_int = 25;
63+
pub const _REG_X27: ::c_int = 26;
64+
pub const _REG_X28: ::c_int = 27;
65+
pub const _REG_X29: ::c_int = 28;
66+
pub const _REG_X30: ::c_int = 29;
67+
pub const _REG_X31: ::c_int = 30;
68+
pub const _REG_PC: ::c_int = 31;
69+
70+
pub const _REG_RA: ::c_int = _REG_X1;
71+
pub const _REG_SP: ::c_int = _REG_X2;
72+
pub const _REG_GP: ::c_int = _REG_X3;
73+
pub const _REG_TP: ::c_int = _REG_X4;
74+
pub const _REG_S0: ::c_int = _REG_X8;
75+
pub const _REG_RV: ::c_int = _REG_X10;
76+
pub const _REG_A0: ::c_int = _REG_X10;
77+
78+
pub const _REG_F0: ::c_int = 0;
79+
pub const _REG_FPCSR: ::c_int = 32;

src/unix/hurd/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2732,8 +2732,10 @@ pub const MAP_SHARED: ::c_int = 16;
27322732
pub const MAP_PRIVATE: ::c_int = 0;
27332733
pub const MAP_FIXED: ::c_int = 256;
27342734
pub const MAP_NOEXTEND: ::c_int = 512;
2735-
pub const MAP_HASSEMPHORE: ::c_int = 1024;
2735+
pub const MAP_HASSEMAPHORE: ::c_int = 1024;
27362736
pub const MAP_INHERIT: ::c_int = 2048;
2737+
pub const MAP_32BIT: ::c_int = 4096;
2738+
pub const MAP_EXCL: ::c_int = 16384;
27372739
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
27382740
pub const MADV_NORMAL: ::c_int = 0;
27392741
pub const MADV_RANDOM: ::c_int = 1;

src/unix/linux_like/linux/uclibc/mips/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ pub const ECOMM: ::c_int = 70;
2323
pub const EPROTO: ::c_int = 71;
2424
pub const EDOTDOT: ::c_int = 73;
2525

26-
pub const SA_NODEFER: ::c_int = 0x40000000;
27-
pub const SA_RESETHAND: ::c_int = 0x80000000;
28-
pub const SA_RESTART: ::c_int = 0x10000000;
29-
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
26+
pub const SA_NODEFER: ::c_uint = 0x40000000;
27+
pub const SA_RESETHAND: ::c_uint = 0x80000000;
28+
pub const SA_RESTART: ::c_uint = 0x10000000;
29+
pub const SA_NOCLDSTOP: ::c_uint = 0x00000001;
3030

3131
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
3232

0 commit comments

Comments
 (0)