sel4_sys/build/target/x86_64-sel4/debug/build/sel4-sys-7a5588c4d8b74673/out/
shared_types.rs1#[repr(transparent)]
2#[derive(Clone, Eq, PartialEq)]
3pub struct seL4_MessageInfo(pub SeL4Bitfield<u64, 1usize>);
4pub type seL4_MessageInfo_t = seL4_MessageInfo;
5impl seL4_MessageInfo {
6 pub fn new(label: u64, capsUnwrapped: u64, extraCaps: u64, length: u64) -> Self {
7 let mut this = Self(Bitfield::zeroed());
8 this.set_label(label);
9 this.set_capsUnwrapped(capsUnwrapped);
10 this.set_extraCaps(extraCaps);
11 this.set_length(length);
12 this
13 }
14 pub fn unpack(&self) -> seL4_MessageInfo_Unpacked {
15 seL4_MessageInfo_Unpacked {
16 label: self.get_label(),
17 capsUnwrapped: self.get_capsUnwrapped(),
18 extraCaps: self.get_extraCaps(),
19 length: self.get_length(),
20 }
21 }
22 #[allow(dead_code)]
23 pub fn get_label(&self) -> u64 {
24 self.0.get_bits(12usize..64usize)
25 }
26 pub fn set_label(&mut self, label: u64) {
27 self.0.set_bits(12usize..64usize, label)
28 }
29 #[allow(dead_code)]
30 pub const fn width_of_label() -> usize {
31 64usize - 12usize
32 }
33 #[allow(dead_code)]
34 pub fn get_capsUnwrapped(&self) -> u64 {
35 self.0.get_bits(9usize..12usize)
36 }
37 pub fn set_capsUnwrapped(&mut self, capsUnwrapped: u64) {
38 self.0.set_bits(9usize..12usize, capsUnwrapped)
39 }
40 #[allow(dead_code)]
41 pub const fn width_of_capsUnwrapped() -> usize {
42 12usize - 9usize
43 }
44 #[allow(dead_code)]
45 pub fn get_extraCaps(&self) -> u64 {
46 self.0.get_bits(7usize..9usize)
47 }
48 pub fn set_extraCaps(&mut self, extraCaps: u64) {
49 self.0.set_bits(7usize..9usize, extraCaps)
50 }
51 #[allow(dead_code)]
52 pub const fn width_of_extraCaps() -> usize {
53 9usize - 7usize
54 }
55 #[allow(dead_code)]
56 pub fn get_length(&self) -> u64 {
57 self.0.get_bits(0usize..7usize)
58 }
59 pub fn set_length(&mut self, length: u64) {
60 self.0.set_bits(0usize..7usize, length)
61 }
62 #[allow(dead_code)]
63 pub const fn width_of_length() -> usize {
64 7usize - 0usize
65 }
66}
67impl fmt::Debug for seL4_MessageInfo {
68 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
69 self.unpack().fmt(f)?;
70 write!(f, ".pack()")?;
71 Ok(())
72 }
73}
74#[derive(Debug, Clone, PartialEq, Eq)]
75pub struct seL4_MessageInfo_Unpacked {
76 pub label: u64,
77 pub capsUnwrapped: u64,
78 pub extraCaps: u64,
79 pub length: u64,
80}
81impl seL4_MessageInfo_Unpacked {
82 pub fn pack(self) -> seL4_MessageInfo {
83 match self {
84 Self { label, capsUnwrapped, extraCaps, length } => {
85 seL4_MessageInfo::new(label, capsUnwrapped, extraCaps, length)
86 }
87 }
88 }
89}
90#[repr(transparent)]
91#[derive(Clone, Eq, PartialEq)]
92pub struct seL4_CapRights(pub SeL4Bitfield<u64, 1usize>);
93pub type seL4_CapRights_t = seL4_CapRights;
94impl seL4_CapRights {
95 pub fn new(
96 capAllowGrantReply: u64,
97 capAllowGrant: u64,
98 capAllowRead: u64,
99 capAllowWrite: u64,
100 ) -> Self {
101 let mut this = Self(Bitfield::zeroed());
102 this.set_capAllowGrantReply(capAllowGrantReply);
103 this.set_capAllowGrant(capAllowGrant);
104 this.set_capAllowRead(capAllowRead);
105 this.set_capAllowWrite(capAllowWrite);
106 this
107 }
108 pub fn unpack(&self) -> seL4_CapRights_Unpacked {
109 seL4_CapRights_Unpacked {
110 capAllowGrantReply: self.get_capAllowGrantReply(),
111 capAllowGrant: self.get_capAllowGrant(),
112 capAllowRead: self.get_capAllowRead(),
113 capAllowWrite: self.get_capAllowWrite(),
114 }
115 }
116 #[allow(dead_code)]
117 pub fn get_capAllowGrantReply(&self) -> u64 {
118 self.0.get_bits(3usize..4usize)
119 }
120 pub fn set_capAllowGrantReply(&mut self, capAllowGrantReply: u64) {
121 self.0.set_bits(3usize..4usize, capAllowGrantReply)
122 }
123 #[allow(dead_code)]
124 pub const fn width_of_capAllowGrantReply() -> usize {
125 4usize - 3usize
126 }
127 #[allow(dead_code)]
128 pub fn get_capAllowGrant(&self) -> u64 {
129 self.0.get_bits(2usize..3usize)
130 }
131 pub fn set_capAllowGrant(&mut self, capAllowGrant: u64) {
132 self.0.set_bits(2usize..3usize, capAllowGrant)
133 }
134 #[allow(dead_code)]
135 pub const fn width_of_capAllowGrant() -> usize {
136 3usize - 2usize
137 }
138 #[allow(dead_code)]
139 pub fn get_capAllowRead(&self) -> u64 {
140 self.0.get_bits(1usize..2usize)
141 }
142 pub fn set_capAllowRead(&mut self, capAllowRead: u64) {
143 self.0.set_bits(1usize..2usize, capAllowRead)
144 }
145 #[allow(dead_code)]
146 pub const fn width_of_capAllowRead() -> usize {
147 2usize - 1usize
148 }
149 #[allow(dead_code)]
150 pub fn get_capAllowWrite(&self) -> u64 {
151 self.0.get_bits(0usize..1usize)
152 }
153 pub fn set_capAllowWrite(&mut self, capAllowWrite: u64) {
154 self.0.set_bits(0usize..1usize, capAllowWrite)
155 }
156 #[allow(dead_code)]
157 pub const fn width_of_capAllowWrite() -> usize {
158 1usize - 0usize
159 }
160}
161impl fmt::Debug for seL4_CapRights {
162 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163 self.unpack().fmt(f)?;
164 write!(f, ".pack()")?;
165 Ok(())
166 }
167}
168#[derive(Debug, Clone, PartialEq, Eq)]
169pub struct seL4_CapRights_Unpacked {
170 pub capAllowGrantReply: u64,
171 pub capAllowGrant: u64,
172 pub capAllowRead: u64,
173 pub capAllowWrite: u64,
174}
175impl seL4_CapRights_Unpacked {
176 pub fn pack(self) -> seL4_CapRights {
177 match self {
178 Self { capAllowGrantReply, capAllowGrant, capAllowRead, capAllowWrite } => {
179 seL4_CapRights::new(
180 capAllowGrantReply,
181 capAllowGrant,
182 capAllowRead,
183 capAllowWrite,
184 )
185 }
186 }
187 }
188}
189#[repr(transparent)]
190#[derive(Clone, Eq, PartialEq)]
191pub struct seL4_CNode_CapData(pub SeL4Bitfield<u64, 1usize>);
192pub type seL4_CNode_CapData_t = seL4_CNode_CapData;
193impl seL4_CNode_CapData {
194 pub fn new(guard: u64, guardSize: u64) -> Self {
195 let mut this = Self(Bitfield::zeroed());
196 this.set_guard(guard);
197 this.set_guardSize(guardSize);
198 this
199 }
200 pub fn unpack(&self) -> seL4_CNode_CapData_Unpacked {
201 seL4_CNode_CapData_Unpacked {
202 guard: self.get_guard(),
203 guardSize: self.get_guardSize(),
204 }
205 }
206 #[allow(dead_code)]
207 pub fn get_guard(&self) -> u64 {
208 self.0.get_bits(6usize..64usize)
209 }
210 pub fn set_guard(&mut self, guard: u64) {
211 self.0.set_bits(6usize..64usize, guard)
212 }
213 #[allow(dead_code)]
214 pub const fn width_of_guard() -> usize {
215 64usize - 6usize
216 }
217 #[allow(dead_code)]
218 pub fn get_guardSize(&self) -> u64 {
219 self.0.get_bits(0usize..6usize)
220 }
221 pub fn set_guardSize(&mut self, guardSize: u64) {
222 self.0.set_bits(0usize..6usize, guardSize)
223 }
224 #[allow(dead_code)]
225 pub const fn width_of_guardSize() -> usize {
226 6usize - 0usize
227 }
228}
229impl fmt::Debug for seL4_CNode_CapData {
230 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
231 self.unpack().fmt(f)?;
232 write!(f, ".pack()")?;
233 Ok(())
234 }
235}
236#[derive(Debug, Clone, PartialEq, Eq)]
237pub struct seL4_CNode_CapData_Unpacked {
238 pub guard: u64,
239 pub guardSize: u64,
240}
241impl seL4_CNode_CapData_Unpacked {
242 pub fn pack(self) -> seL4_CNode_CapData {
243 match self {
244 Self { guard, guardSize } => seL4_CNode_CapData::new(guard, guardSize),
245 }
246 }
247}