Debian Codegraph @

third_party/rust/libc/src/unix/bsd/freebsdlike/freebsd/aarch64.rs

raw
1 use crate::prelude::*;
2
3 pub type clock_t = i32;
4 pub type wchar_t = u32;
5 pub type time_t = i64;
6 pub type suseconds_t = i64;
7 pub type register_t = i64;
8
9 s_no_extra_traits! {
10 pub struct gpregs {
11 pub gp_x: [crate::register_t; 30],
12 pub gp_lr: crate::register_t,
13 pub gp_sp: crate::register_t,
14 pub gp_elr: crate::register_t,
15 pub gp_spsr: u32,
16 pub gp_pad: c_int,
17 }
18
19 pub struct fpregs {
20 pub fp_q: u128,
21 pub fp_sr: u32,
22 pub fp_cr: u32,
23 pub fp_flags: c_int,
24 pub fp_pad: c_int,
25 }
26
27 pub struct mcontext_t {
28 pub mc_gpregs: gpregs,
29 pub mc_fpregs: fpregs,
30 pub mc_flags: c_int,
31 pub mc_pad: c_int,
32 pub mc_spare: [u64; 8],
33 }
34 }
35
36 pub(crate) const _ALIGNBYTES: usize = mem::size_of::<c_longlong>() - 1;
37
38 cfg_if! {
39 if #[cfg(feature = "extra_traits")] {
40 impl PartialEq for gpregs {
41 fn eq(&self, other: &gpregs) -> bool {
42 self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b)
43 && self.gp_lr == other.gp_lr
44 && self.gp_sp == other.gp_sp
45 && self.gp_elr == other.gp_elr
46 && self.gp_spsr == other.gp_spsr
47 && self.gp_pad == other.gp_pad
48 }
49 }
50 impl Eq for gpregs {}
51 impl fmt::Debug for gpregs {
52 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
53 f.debug_struct("gpregs")
54 .field("gp_x", &self.gp_x)
55 .field("gp_lr", &self.gp_lr)
56 .field("gp_sp", &self.gp_sp)
57 .field("gp_elr", &self.gp_elr)
58 .field("gp_spsr", &self.gp_spsr)
59 .field("gp_pad", &self.gp_pad)
60 .finish()
61 }
62 }
63 impl hash::Hash for gpregs {
64 fn hash<H: hash::Hasher>(&self, state: &mut H) {
65 self.gp_x.hash(state);
66 self.gp_lr.hash(state);
67 self.gp_sp.hash(state);
68 self.gp_elr.hash(state);
69 self.gp_spsr.hash(state);
70 self.gp_pad.hash(state);
71 }
72 }
73 impl PartialEq for fpregs {
74 fn eq(&self, other: &fpregs) -> bool {
75 self.fp_q == other.fp_q
76 && self.fp_sr == other.fp_sr
77 && self.fp_cr == other.fp_cr
78 && self.fp_flags == other.fp_flags
79 && self.fp_pad == other.fp_pad
80 }
81 }
82 impl Eq for fpregs {}
83 impl fmt::Debug for fpregs {
84 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
85 f.debug_struct("fpregs")
86 .field("fp_q", &self.fp_q)
87 .field("fp_sr", &self.fp_sr)
88 .field("fp_cr", &self.fp_cr)
89 .field("fp_flags", &self.fp_flags)
90 .field("fp_pad", &self.fp_pad)
91 .finish()
92 }
93 }
94 impl hash::Hash for fpregs {
95 fn hash<H: hash::Hasher>(&self, state: &mut H) {
96 self.fp_q.hash(state);
97 self.fp_sr.hash(state);
98 self.fp_cr.hash(state);
99 self.fp_flags.hash(state);
100 self.fp_pad.hash(state);
101 }
102 }
103 impl PartialEq for mcontext_t {
104 fn eq(&self, other: &mcontext_t) -> bool {
105 self.mc_gpregs == other.mc_gpregs
106 && self.mc_fpregs == other.mc_fpregs
107 && self.mc_flags == other.mc_flags
108 && self.mc_pad == other.mc_pad
109 && self
110 .mc_spare
111 .iter()
112 .zip(other.mc_spare.iter())
113 .all(|(a, b)| a == b)
114 }
115 }
116 impl Eq for mcontext_t {}
117 impl fmt::Debug for mcontext_t {
118 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
119 f.debug_struct("mcontext_t")
120 .field("mc_gpregs", &self.mc_gpregs)
121 .field("mc_fpregs", &self.mc_fpregs)
122 .field("mc_flags", &self.mc_flags)
123 .field("mc_pad", &self.mc_pad)
124 .field("mc_spare", &self.mc_spare)
125 .finish()
126 }
127 }
128 impl hash::Hash for mcontext_t {
129 fn hash<H: hash::Hasher>(&self, state: &mut H) {
130 self.mc_gpregs.hash(state);
131 self.mc_fpregs.hash(state);
132 self.mc_flags.hash(state);
133 self.mc_pad.hash(state);
134 self.mc_spare.hash(state);
135 }
136 }
137 }
138 }
139
140 pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d;
141 pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e;
142 pub const MAP_32BIT: c_int = 0x00080000;
143 pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4
144 pub const TIOCTIMESTAMP: c_ulong = 0x40107459;