1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const BOARD_NAME_LEN: u8 = 32;
12
13pub const BOOTLOADER_VENDOR_LEN: u8 = 32;
14
15pub const SERIAL_NUMBER_LEN: u8 = 32;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
18pub enum InterruptControllerType {
19 Unknown,
20 Apic,
21 GicV2,
22 GicV3,
23 Plic,
24 #[doc(hidden)]
25 __SourceBreaking {
26 unknown_ordinal: u32,
27 },
28}
29
30#[macro_export]
32macro_rules! InterruptControllerTypeUnknown {
33 () => {
34 _
35 };
36}
37
38impl InterruptControllerType {
39 #[inline]
40 pub fn from_primitive(prim: u32) -> Option<Self> {
41 match prim {
42 0 => Some(Self::Unknown),
43 1 => Some(Self::Apic),
44 2 => Some(Self::GicV2),
45 3 => Some(Self::GicV3),
46 4 => Some(Self::Plic),
47 _ => None,
48 }
49 }
50
51 #[inline]
52 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
53 match prim {
54 0 => Self::Unknown,
55 1 => Self::Apic,
56 2 => Self::GicV2,
57 3 => Self::GicV3,
58 4 => Self::Plic,
59 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
60 }
61 }
62
63 #[inline]
64 pub fn unknown() -> Self {
65 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
66 }
67
68 #[inline]
69 pub const fn into_primitive(self) -> u32 {
70 match self {
71 Self::Unknown => 0,
72 Self::Apic => 1,
73 Self::GicV2 => 2,
74 Self::GicV3 => 3,
75 Self::Plic => 4,
76 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
77 }
78 }
79
80 #[inline]
81 pub fn is_unknown(&self) -> bool {
82 match self {
83 Self::__SourceBreaking { unknown_ordinal: _ } => true,
84 _ => false,
85 }
86 }
87}
88
89#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct InterruptControllerInfo {
91 pub type_: InterruptControllerType,
92}
93
94impl fidl::Persistable for InterruptControllerInfo {}
95
96#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97pub struct SysInfoGetBoardNameResponse {
98 pub status: i32,
99 pub name: Option<String>,
100}
101
102impl fidl::Persistable for SysInfoGetBoardNameResponse {}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105#[repr(C)]
106pub struct SysInfoGetBoardRevisionResponse {
107 pub status: i32,
108 pub revision: u32,
109}
110
111impl fidl::Persistable for SysInfoGetBoardRevisionResponse {}
112
113#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114pub struct SysInfoGetBootloaderVendorResponse {
115 pub status: i32,
116 pub vendor: Option<String>,
117}
118
119impl fidl::Persistable for SysInfoGetBootloaderVendorResponse {}
120
121#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct SysInfoGetInterruptControllerInfoResponse {
123 pub status: i32,
124 pub info: Option<Box<InterruptControllerInfo>>,
125}
126
127impl fidl::Persistable for SysInfoGetInterruptControllerInfoResponse {}
128
129#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
130pub struct SysInfoGetSerialNumberResponse {
131 pub serial: String,
132}
133
134impl fidl::Persistable for SysInfoGetSerialNumberResponse {}
135
136mod internal {
137 use super::*;
138 unsafe impl fidl::encoding::TypeMarker for InterruptControllerType {
139 type Owned = Self;
140
141 #[inline(always)]
142 fn inline_align(_context: fidl::encoding::Context) -> usize {
143 std::mem::align_of::<u32>()
144 }
145
146 #[inline(always)]
147 fn inline_size(_context: fidl::encoding::Context) -> usize {
148 std::mem::size_of::<u32>()
149 }
150
151 #[inline(always)]
152 fn encode_is_copy() -> bool {
153 false
154 }
155
156 #[inline(always)]
157 fn decode_is_copy() -> bool {
158 false
159 }
160 }
161
162 impl fidl::encoding::ValueTypeMarker for InterruptControllerType {
163 type Borrowed<'a> = Self;
164 #[inline(always)]
165 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
166 *value
167 }
168 }
169
170 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
171 for InterruptControllerType
172 {
173 #[inline]
174 unsafe fn encode(
175 self,
176 encoder: &mut fidl::encoding::Encoder<'_, D>,
177 offset: usize,
178 _depth: fidl::encoding::Depth,
179 ) -> fidl::Result<()> {
180 encoder.debug_check_bounds::<Self>(offset);
181 encoder.write_num(self.into_primitive(), offset);
182 Ok(())
183 }
184 }
185
186 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
187 for InterruptControllerType
188 {
189 #[inline(always)]
190 fn new_empty() -> Self {
191 Self::unknown()
192 }
193
194 #[inline]
195 unsafe fn decode(
196 &mut self,
197 decoder: &mut fidl::encoding::Decoder<'_, D>,
198 offset: usize,
199 _depth: fidl::encoding::Depth,
200 ) -> fidl::Result<()> {
201 decoder.debug_check_bounds::<Self>(offset);
202 let prim = decoder.read_num::<u32>(offset);
203
204 *self = Self::from_primitive_allow_unknown(prim);
205 Ok(())
206 }
207 }
208
209 impl fidl::encoding::ValueTypeMarker for InterruptControllerInfo {
210 type Borrowed<'a> = &'a Self;
211 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
212 value
213 }
214 }
215
216 unsafe impl fidl::encoding::TypeMarker for InterruptControllerInfo {
217 type Owned = Self;
218
219 #[inline(always)]
220 fn inline_align(_context: fidl::encoding::Context) -> usize {
221 4
222 }
223
224 #[inline(always)]
225 fn inline_size(_context: fidl::encoding::Context) -> usize {
226 4
227 }
228 }
229
230 unsafe impl<D: fidl::encoding::ResourceDialect>
231 fidl::encoding::Encode<InterruptControllerInfo, D> for &InterruptControllerInfo
232 {
233 #[inline]
234 unsafe fn encode(
235 self,
236 encoder: &mut fidl::encoding::Encoder<'_, D>,
237 offset: usize,
238 _depth: fidl::encoding::Depth,
239 ) -> fidl::Result<()> {
240 encoder.debug_check_bounds::<InterruptControllerInfo>(offset);
241 fidl::encoding::Encode::<InterruptControllerInfo, D>::encode(
243 (<InterruptControllerType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
244 encoder,
245 offset,
246 _depth,
247 )
248 }
249 }
250 unsafe impl<
251 D: fidl::encoding::ResourceDialect,
252 T0: fidl::encoding::Encode<InterruptControllerType, D>,
253 > fidl::encoding::Encode<InterruptControllerInfo, D> for (T0,)
254 {
255 #[inline]
256 unsafe fn encode(
257 self,
258 encoder: &mut fidl::encoding::Encoder<'_, D>,
259 offset: usize,
260 depth: fidl::encoding::Depth,
261 ) -> fidl::Result<()> {
262 encoder.debug_check_bounds::<InterruptControllerInfo>(offset);
263 self.0.encode(encoder, offset + 0, depth)?;
267 Ok(())
268 }
269 }
270
271 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
272 for InterruptControllerInfo
273 {
274 #[inline(always)]
275 fn new_empty() -> Self {
276 Self { type_: fidl::new_empty!(InterruptControllerType, D) }
277 }
278
279 #[inline]
280 unsafe fn decode(
281 &mut self,
282 decoder: &mut fidl::encoding::Decoder<'_, D>,
283 offset: usize,
284 _depth: fidl::encoding::Depth,
285 ) -> fidl::Result<()> {
286 decoder.debug_check_bounds::<Self>(offset);
287 fidl::decode!(
289 InterruptControllerType,
290 D,
291 &mut self.type_,
292 decoder,
293 offset + 0,
294 _depth
295 )?;
296 Ok(())
297 }
298 }
299
300 impl fidl::encoding::ValueTypeMarker for SysInfoGetBoardNameResponse {
301 type Borrowed<'a> = &'a Self;
302 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
303 value
304 }
305 }
306
307 unsafe impl fidl::encoding::TypeMarker for SysInfoGetBoardNameResponse {
308 type Owned = Self;
309
310 #[inline(always)]
311 fn inline_align(_context: fidl::encoding::Context) -> usize {
312 8
313 }
314
315 #[inline(always)]
316 fn inline_size(_context: fidl::encoding::Context) -> usize {
317 24
318 }
319 }
320
321 unsafe impl<D: fidl::encoding::ResourceDialect>
322 fidl::encoding::Encode<SysInfoGetBoardNameResponse, D> for &SysInfoGetBoardNameResponse
323 {
324 #[inline]
325 unsafe fn encode(
326 self,
327 encoder: &mut fidl::encoding::Encoder<'_, D>,
328 offset: usize,
329 _depth: fidl::encoding::Depth,
330 ) -> fidl::Result<()> {
331 encoder.debug_check_bounds::<SysInfoGetBoardNameResponse>(offset);
332 fidl::encoding::Encode::<SysInfoGetBoardNameResponse, D>::encode(
334 (
335 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
336 <fidl::encoding::Optional<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
337 ),
338 encoder, offset, _depth
339 )
340 }
341 }
342 unsafe impl<
343 D: fidl::encoding::ResourceDialect,
344 T0: fidl::encoding::Encode<i32, D>,
345 T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<32>>, D>,
346 > fidl::encoding::Encode<SysInfoGetBoardNameResponse, D> for (T0, T1)
347 {
348 #[inline]
349 unsafe fn encode(
350 self,
351 encoder: &mut fidl::encoding::Encoder<'_, D>,
352 offset: usize,
353 depth: fidl::encoding::Depth,
354 ) -> fidl::Result<()> {
355 encoder.debug_check_bounds::<SysInfoGetBoardNameResponse>(offset);
356 unsafe {
359 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
360 (ptr as *mut u64).write_unaligned(0);
361 }
362 self.0.encode(encoder, offset + 0, depth)?;
364 self.1.encode(encoder, offset + 8, depth)?;
365 Ok(())
366 }
367 }
368
369 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
370 for SysInfoGetBoardNameResponse
371 {
372 #[inline(always)]
373 fn new_empty() -> Self {
374 Self {
375 status: fidl::new_empty!(i32, D),
376 name: fidl::new_empty!(
377 fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
378 D
379 ),
380 }
381 }
382
383 #[inline]
384 unsafe fn decode(
385 &mut self,
386 decoder: &mut fidl::encoding::Decoder<'_, D>,
387 offset: usize,
388 _depth: fidl::encoding::Depth,
389 ) -> fidl::Result<()> {
390 decoder.debug_check_bounds::<Self>(offset);
391 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
393 let padval = unsafe { (ptr as *const u64).read_unaligned() };
394 let mask = 0xffffffff00000000u64;
395 let maskedval = padval & mask;
396 if maskedval != 0 {
397 return Err(fidl::Error::NonZeroPadding {
398 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
399 });
400 }
401 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
402 fidl::decode!(
403 fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
404 D,
405 &mut self.name,
406 decoder,
407 offset + 8,
408 _depth
409 )?;
410 Ok(())
411 }
412 }
413
414 impl fidl::encoding::ValueTypeMarker for SysInfoGetBoardRevisionResponse {
415 type Borrowed<'a> = &'a Self;
416 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
417 value
418 }
419 }
420
421 unsafe impl fidl::encoding::TypeMarker for SysInfoGetBoardRevisionResponse {
422 type Owned = Self;
423
424 #[inline(always)]
425 fn inline_align(_context: fidl::encoding::Context) -> usize {
426 4
427 }
428
429 #[inline(always)]
430 fn inline_size(_context: fidl::encoding::Context) -> usize {
431 8
432 }
433 #[inline(always)]
434 fn encode_is_copy() -> bool {
435 true
436 }
437
438 #[inline(always)]
439 fn decode_is_copy() -> bool {
440 true
441 }
442 }
443
444 unsafe impl<D: fidl::encoding::ResourceDialect>
445 fidl::encoding::Encode<SysInfoGetBoardRevisionResponse, D>
446 for &SysInfoGetBoardRevisionResponse
447 {
448 #[inline]
449 unsafe fn encode(
450 self,
451 encoder: &mut fidl::encoding::Encoder<'_, D>,
452 offset: usize,
453 _depth: fidl::encoding::Depth,
454 ) -> fidl::Result<()> {
455 encoder.debug_check_bounds::<SysInfoGetBoardRevisionResponse>(offset);
456 unsafe {
457 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
459 (buf_ptr as *mut SysInfoGetBoardRevisionResponse)
460 .write_unaligned((self as *const SysInfoGetBoardRevisionResponse).read());
461 }
464 Ok(())
465 }
466 }
467 unsafe impl<
468 D: fidl::encoding::ResourceDialect,
469 T0: fidl::encoding::Encode<i32, D>,
470 T1: fidl::encoding::Encode<u32, D>,
471 > fidl::encoding::Encode<SysInfoGetBoardRevisionResponse, D> for (T0, T1)
472 {
473 #[inline]
474 unsafe fn encode(
475 self,
476 encoder: &mut fidl::encoding::Encoder<'_, D>,
477 offset: usize,
478 depth: fidl::encoding::Depth,
479 ) -> fidl::Result<()> {
480 encoder.debug_check_bounds::<SysInfoGetBoardRevisionResponse>(offset);
481 self.0.encode(encoder, offset + 0, depth)?;
485 self.1.encode(encoder, offset + 4, depth)?;
486 Ok(())
487 }
488 }
489
490 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
491 for SysInfoGetBoardRevisionResponse
492 {
493 #[inline(always)]
494 fn new_empty() -> Self {
495 Self { status: fidl::new_empty!(i32, D), revision: fidl::new_empty!(u32, D) }
496 }
497
498 #[inline]
499 unsafe fn decode(
500 &mut self,
501 decoder: &mut fidl::encoding::Decoder<'_, D>,
502 offset: usize,
503 _depth: fidl::encoding::Depth,
504 ) -> fidl::Result<()> {
505 decoder.debug_check_bounds::<Self>(offset);
506 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
507 unsafe {
510 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
511 }
512 Ok(())
513 }
514 }
515
516 impl fidl::encoding::ValueTypeMarker for SysInfoGetBootloaderVendorResponse {
517 type Borrowed<'a> = &'a Self;
518 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
519 value
520 }
521 }
522
523 unsafe impl fidl::encoding::TypeMarker for SysInfoGetBootloaderVendorResponse {
524 type Owned = Self;
525
526 #[inline(always)]
527 fn inline_align(_context: fidl::encoding::Context) -> usize {
528 8
529 }
530
531 #[inline(always)]
532 fn inline_size(_context: fidl::encoding::Context) -> usize {
533 24
534 }
535 }
536
537 unsafe impl<D: fidl::encoding::ResourceDialect>
538 fidl::encoding::Encode<SysInfoGetBootloaderVendorResponse, D>
539 for &SysInfoGetBootloaderVendorResponse
540 {
541 #[inline]
542 unsafe fn encode(
543 self,
544 encoder: &mut fidl::encoding::Encoder<'_, D>,
545 offset: usize,
546 _depth: fidl::encoding::Depth,
547 ) -> fidl::Result<()> {
548 encoder.debug_check_bounds::<SysInfoGetBootloaderVendorResponse>(offset);
549 fidl::encoding::Encode::<SysInfoGetBootloaderVendorResponse, D>::encode(
551 (
552 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
553 <fidl::encoding::Optional<fidl::encoding::BoundedString<32>> as fidl::encoding::ValueTypeMarker>::borrow(&self.vendor),
554 ),
555 encoder, offset, _depth
556 )
557 }
558 }
559 unsafe impl<
560 D: fidl::encoding::ResourceDialect,
561 T0: fidl::encoding::Encode<i32, D>,
562 T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<32>>, D>,
563 > fidl::encoding::Encode<SysInfoGetBootloaderVendorResponse, D> for (T0, T1)
564 {
565 #[inline]
566 unsafe fn encode(
567 self,
568 encoder: &mut fidl::encoding::Encoder<'_, D>,
569 offset: usize,
570 depth: fidl::encoding::Depth,
571 ) -> fidl::Result<()> {
572 encoder.debug_check_bounds::<SysInfoGetBootloaderVendorResponse>(offset);
573 unsafe {
576 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
577 (ptr as *mut u64).write_unaligned(0);
578 }
579 self.0.encode(encoder, offset + 0, depth)?;
581 self.1.encode(encoder, offset + 8, depth)?;
582 Ok(())
583 }
584 }
585
586 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
587 for SysInfoGetBootloaderVendorResponse
588 {
589 #[inline(always)]
590 fn new_empty() -> Self {
591 Self {
592 status: fidl::new_empty!(i32, D),
593 vendor: fidl::new_empty!(
594 fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
595 D
596 ),
597 }
598 }
599
600 #[inline]
601 unsafe fn decode(
602 &mut self,
603 decoder: &mut fidl::encoding::Decoder<'_, D>,
604 offset: usize,
605 _depth: fidl::encoding::Depth,
606 ) -> fidl::Result<()> {
607 decoder.debug_check_bounds::<Self>(offset);
608 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
610 let padval = unsafe { (ptr as *const u64).read_unaligned() };
611 let mask = 0xffffffff00000000u64;
612 let maskedval = padval & mask;
613 if maskedval != 0 {
614 return Err(fidl::Error::NonZeroPadding {
615 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
616 });
617 }
618 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
619 fidl::decode!(
620 fidl::encoding::Optional<fidl::encoding::BoundedString<32>>,
621 D,
622 &mut self.vendor,
623 decoder,
624 offset + 8,
625 _depth
626 )?;
627 Ok(())
628 }
629 }
630
631 impl fidl::encoding::ValueTypeMarker for SysInfoGetInterruptControllerInfoResponse {
632 type Borrowed<'a> = &'a Self;
633 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
634 value
635 }
636 }
637
638 unsafe impl fidl::encoding::TypeMarker for SysInfoGetInterruptControllerInfoResponse {
639 type Owned = Self;
640
641 #[inline(always)]
642 fn inline_align(_context: fidl::encoding::Context) -> usize {
643 8
644 }
645
646 #[inline(always)]
647 fn inline_size(_context: fidl::encoding::Context) -> usize {
648 16
649 }
650 }
651
652 unsafe impl<D: fidl::encoding::ResourceDialect>
653 fidl::encoding::Encode<SysInfoGetInterruptControllerInfoResponse, D>
654 for &SysInfoGetInterruptControllerInfoResponse
655 {
656 #[inline]
657 unsafe fn encode(
658 self,
659 encoder: &mut fidl::encoding::Encoder<'_, D>,
660 offset: usize,
661 _depth: fidl::encoding::Depth,
662 ) -> fidl::Result<()> {
663 encoder.debug_check_bounds::<SysInfoGetInterruptControllerInfoResponse>(offset);
664 fidl::encoding::Encode::<SysInfoGetInterruptControllerInfoResponse, D>::encode(
666 (
667 <i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
668 <fidl::encoding::Boxed<InterruptControllerInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
669 ),
670 encoder, offset, _depth
671 )
672 }
673 }
674 unsafe impl<
675 D: fidl::encoding::ResourceDialect,
676 T0: fidl::encoding::Encode<i32, D>,
677 T1: fidl::encoding::Encode<fidl::encoding::Boxed<InterruptControllerInfo>, D>,
678 > fidl::encoding::Encode<SysInfoGetInterruptControllerInfoResponse, D> for (T0, T1)
679 {
680 #[inline]
681 unsafe fn encode(
682 self,
683 encoder: &mut fidl::encoding::Encoder<'_, D>,
684 offset: usize,
685 depth: fidl::encoding::Depth,
686 ) -> fidl::Result<()> {
687 encoder.debug_check_bounds::<SysInfoGetInterruptControllerInfoResponse>(offset);
688 unsafe {
691 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
692 (ptr as *mut u64).write_unaligned(0);
693 }
694 self.0.encode(encoder, offset + 0, depth)?;
696 self.1.encode(encoder, offset + 8, depth)?;
697 Ok(())
698 }
699 }
700
701 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
702 for SysInfoGetInterruptControllerInfoResponse
703 {
704 #[inline(always)]
705 fn new_empty() -> Self {
706 Self {
707 status: fidl::new_empty!(i32, D),
708 info: fidl::new_empty!(fidl::encoding::Boxed<InterruptControllerInfo>, D),
709 }
710 }
711
712 #[inline]
713 unsafe fn decode(
714 &mut self,
715 decoder: &mut fidl::encoding::Decoder<'_, D>,
716 offset: usize,
717 _depth: fidl::encoding::Depth,
718 ) -> fidl::Result<()> {
719 decoder.debug_check_bounds::<Self>(offset);
720 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
722 let padval = unsafe { (ptr as *const u64).read_unaligned() };
723 let mask = 0xffffffff00000000u64;
724 let maskedval = padval & mask;
725 if maskedval != 0 {
726 return Err(fidl::Error::NonZeroPadding {
727 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
728 });
729 }
730 fidl::decode!(i32, D, &mut self.status, decoder, offset + 0, _depth)?;
731 fidl::decode!(
732 fidl::encoding::Boxed<InterruptControllerInfo>,
733 D,
734 &mut self.info,
735 decoder,
736 offset + 8,
737 _depth
738 )?;
739 Ok(())
740 }
741 }
742
743 impl fidl::encoding::ValueTypeMarker for SysInfoGetSerialNumberResponse {
744 type Borrowed<'a> = &'a Self;
745 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
746 value
747 }
748 }
749
750 unsafe impl fidl::encoding::TypeMarker for SysInfoGetSerialNumberResponse {
751 type Owned = Self;
752
753 #[inline(always)]
754 fn inline_align(_context: fidl::encoding::Context) -> usize {
755 8
756 }
757
758 #[inline(always)]
759 fn inline_size(_context: fidl::encoding::Context) -> usize {
760 16
761 }
762 }
763
764 unsafe impl<D: fidl::encoding::ResourceDialect>
765 fidl::encoding::Encode<SysInfoGetSerialNumberResponse, D>
766 for &SysInfoGetSerialNumberResponse
767 {
768 #[inline]
769 unsafe fn encode(
770 self,
771 encoder: &mut fidl::encoding::Encoder<'_, D>,
772 offset: usize,
773 _depth: fidl::encoding::Depth,
774 ) -> fidl::Result<()> {
775 encoder.debug_check_bounds::<SysInfoGetSerialNumberResponse>(offset);
776 fidl::encoding::Encode::<SysInfoGetSerialNumberResponse, D>::encode(
778 (<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
779 &self.serial,
780 ),),
781 encoder,
782 offset,
783 _depth,
784 )
785 }
786 }
787 unsafe impl<
788 D: fidl::encoding::ResourceDialect,
789 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
790 > fidl::encoding::Encode<SysInfoGetSerialNumberResponse, D> for (T0,)
791 {
792 #[inline]
793 unsafe fn encode(
794 self,
795 encoder: &mut fidl::encoding::Encoder<'_, D>,
796 offset: usize,
797 depth: fidl::encoding::Depth,
798 ) -> fidl::Result<()> {
799 encoder.debug_check_bounds::<SysInfoGetSerialNumberResponse>(offset);
800 self.0.encode(encoder, offset + 0, depth)?;
804 Ok(())
805 }
806 }
807
808 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
809 for SysInfoGetSerialNumberResponse
810 {
811 #[inline(always)]
812 fn new_empty() -> Self {
813 Self { serial: fidl::new_empty!(fidl::encoding::BoundedString<32>, D) }
814 }
815
816 #[inline]
817 unsafe fn decode(
818 &mut self,
819 decoder: &mut fidl::encoding::Decoder<'_, D>,
820 offset: usize,
821 _depth: fidl::encoding::Depth,
822 ) -> fidl::Result<()> {
823 decoder.debug_check_bounds::<Self>(offset);
824 fidl::decode!(
826 fidl::encoding::BoundedString<32>,
827 D,
828 &mut self.serial,
829 decoder,
830 offset + 0,
831 _depth
832 )?;
833 Ok(())
834 }
835 }
836}