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 DEVICE_OPERATING_POINT_P0: u32 = 0;
12
13pub const FREQUENCY_UNKNOWN: i64 = -1;
17
18pub const VOLTAGE_UNKNOWN: i64 = -1;
19
20#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22#[repr(C)]
23pub struct CpuOperatingPointInfo {
24 pub frequency_hz: i64,
25 pub voltage_uv: i64,
26}
27
28impl fidl::Persistable for CpuOperatingPointInfo {}
29
30#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31#[repr(C)]
32pub struct DeviceGetCurrentOperatingPointResponse {
33 pub out_opp: u32,
34}
35
36impl fidl::Persistable for DeviceGetCurrentOperatingPointResponse {}
37
38#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39#[repr(C)]
40pub struct DeviceGetDomainIdResponse {
41 pub domain_id: u32,
42}
43
44impl fidl::Persistable for DeviceGetDomainIdResponse {}
45
46#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47#[repr(C)]
48pub struct DeviceGetLogicalCoreIdRequest {
49 pub index: u64,
50}
51
52impl fidl::Persistable for DeviceGetLogicalCoreIdRequest {}
53
54#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55#[repr(C)]
56pub struct DeviceGetLogicalCoreIdResponse {
57 pub id: u64,
58}
59
60impl fidl::Persistable for DeviceGetLogicalCoreIdResponse {}
61
62#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63#[repr(C)]
64pub struct DeviceGetNumLogicalCoresResponse {
65 pub count: u64,
66}
67
68impl fidl::Persistable for DeviceGetNumLogicalCoresResponse {}
69
70#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
71#[repr(C)]
72pub struct DeviceGetOperatingPointInfoRequest {
73 pub opp: u32,
74}
75
76impl fidl::Persistable for DeviceGetOperatingPointInfoRequest {}
77
78#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79#[repr(C)]
80pub struct DeviceSetCurrentOperatingPointRequest {
81 pub requested_opp: u32,
82}
83
84impl fidl::Persistable for DeviceSetCurrentOperatingPointRequest {}
85
86#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87#[repr(C)]
88pub struct DeviceGetOperatingPointCountResponse {
89 pub count: u32,
90}
91
92impl fidl::Persistable for DeviceGetOperatingPointCountResponse {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct DeviceGetOperatingPointInfoResponse {
97 pub info: CpuOperatingPointInfo,
98}
99
100impl fidl::Persistable for DeviceGetOperatingPointInfoResponse {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct DeviceGetRelativePerformanceResponse {
105 pub relative_performance: u8,
106}
107
108impl fidl::Persistable for DeviceGetRelativePerformanceResponse {}
109
110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111#[repr(C)]
112pub struct DeviceSetCurrentOperatingPointResponse {
113 pub out_opp: u32,
114}
115
116impl fidl::Persistable for DeviceSetCurrentOperatingPointResponse {}
117
118pub mod device_ordinals {
119 pub const GET_OPERATING_POINT_INFO: u64 = 0x6594a9234fc958e2;
120 pub const GET_CURRENT_OPERATING_POINT: u64 = 0x52de67a5993f5fe1;
121 pub const SET_CURRENT_OPERATING_POINT: u64 = 0x34a7828b5ca53fd;
122 pub const GET_OPERATING_POINT_COUNT: u64 = 0x13e70ec7131889ba;
123 pub const GET_NUM_LOGICAL_CORES: u64 = 0x74e304c90ca165c5;
124 pub const GET_LOGICAL_CORE_ID: u64 = 0x7168f98ddbd26058;
125 pub const GET_DOMAIN_ID: u64 = 0x3030f85bdc1ef321;
126 pub const GET_RELATIVE_PERFORMANCE: u64 = 0x41c37eaf0c26a3d3;
127}
128
129mod internal {
130 use super::*;
131
132 impl fidl::encoding::ValueTypeMarker for CpuOperatingPointInfo {
133 type Borrowed<'a> = &'a Self;
134 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
135 value
136 }
137 }
138
139 unsafe impl fidl::encoding::TypeMarker for CpuOperatingPointInfo {
140 type Owned = Self;
141
142 #[inline(always)]
143 fn inline_align(_context: fidl::encoding::Context) -> usize {
144 8
145 }
146
147 #[inline(always)]
148 fn inline_size(_context: fidl::encoding::Context) -> usize {
149 16
150 }
151 #[inline(always)]
152 fn encode_is_copy() -> bool {
153 true
154 }
155
156 #[inline(always)]
157 fn decode_is_copy() -> bool {
158 true
159 }
160 }
161
162 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuOperatingPointInfo, D>
163 for &CpuOperatingPointInfo
164 {
165 #[inline]
166 unsafe fn encode(
167 self,
168 encoder: &mut fidl::encoding::Encoder<'_, D>,
169 offset: usize,
170 _depth: fidl::encoding::Depth,
171 ) -> fidl::Result<()> {
172 encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
173 unsafe {
174 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
176 (buf_ptr as *mut CpuOperatingPointInfo)
177 .write_unaligned((self as *const CpuOperatingPointInfo).read());
178 }
181 Ok(())
182 }
183 }
184 unsafe impl<
185 D: fidl::encoding::ResourceDialect,
186 T0: fidl::encoding::Encode<i64, D>,
187 T1: fidl::encoding::Encode<i64, D>,
188 > fidl::encoding::Encode<CpuOperatingPointInfo, D> for (T0, T1)
189 {
190 #[inline]
191 unsafe fn encode(
192 self,
193 encoder: &mut fidl::encoding::Encoder<'_, D>,
194 offset: usize,
195 depth: fidl::encoding::Depth,
196 ) -> fidl::Result<()> {
197 encoder.debug_check_bounds::<CpuOperatingPointInfo>(offset);
198 self.0.encode(encoder, offset + 0, depth)?;
202 self.1.encode(encoder, offset + 8, depth)?;
203 Ok(())
204 }
205 }
206
207 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuOperatingPointInfo {
208 #[inline(always)]
209 fn new_empty() -> Self {
210 Self { frequency_hz: fidl::new_empty!(i64, D), voltage_uv: fidl::new_empty!(i64, D) }
211 }
212
213 #[inline]
214 unsafe fn decode(
215 &mut self,
216 decoder: &mut fidl::encoding::Decoder<'_, D>,
217 offset: usize,
218 _depth: fidl::encoding::Depth,
219 ) -> fidl::Result<()> {
220 decoder.debug_check_bounds::<Self>(offset);
221 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
222 unsafe {
225 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
226 }
227 Ok(())
228 }
229 }
230
231 impl fidl::encoding::ValueTypeMarker for DeviceGetCurrentOperatingPointResponse {
232 type Borrowed<'a> = &'a Self;
233 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
234 value
235 }
236 }
237
238 unsafe impl fidl::encoding::TypeMarker for DeviceGetCurrentOperatingPointResponse {
239 type Owned = Self;
240
241 #[inline(always)]
242 fn inline_align(_context: fidl::encoding::Context) -> usize {
243 4
244 }
245
246 #[inline(always)]
247 fn inline_size(_context: fidl::encoding::Context) -> usize {
248 4
249 }
250 #[inline(always)]
251 fn encode_is_copy() -> bool {
252 true
253 }
254
255 #[inline(always)]
256 fn decode_is_copy() -> bool {
257 true
258 }
259 }
260
261 unsafe impl<D: fidl::encoding::ResourceDialect>
262 fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D>
263 for &DeviceGetCurrentOperatingPointResponse
264 {
265 #[inline]
266 unsafe fn encode(
267 self,
268 encoder: &mut fidl::encoding::Encoder<'_, D>,
269 offset: usize,
270 _depth: fidl::encoding::Depth,
271 ) -> fidl::Result<()> {
272 encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
273 unsafe {
274 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
276 (buf_ptr as *mut DeviceGetCurrentOperatingPointResponse).write_unaligned(
277 (self as *const DeviceGetCurrentOperatingPointResponse).read(),
278 );
279 }
282 Ok(())
283 }
284 }
285 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
286 fidl::encoding::Encode<DeviceGetCurrentOperatingPointResponse, D> for (T0,)
287 {
288 #[inline]
289 unsafe fn encode(
290 self,
291 encoder: &mut fidl::encoding::Encoder<'_, D>,
292 offset: usize,
293 depth: fidl::encoding::Depth,
294 ) -> fidl::Result<()> {
295 encoder.debug_check_bounds::<DeviceGetCurrentOperatingPointResponse>(offset);
296 self.0.encode(encoder, offset + 0, depth)?;
300 Ok(())
301 }
302 }
303
304 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
305 for DeviceGetCurrentOperatingPointResponse
306 {
307 #[inline(always)]
308 fn new_empty() -> Self {
309 Self { out_opp: fidl::new_empty!(u32, D) }
310 }
311
312 #[inline]
313 unsafe fn decode(
314 &mut self,
315 decoder: &mut fidl::encoding::Decoder<'_, D>,
316 offset: usize,
317 _depth: fidl::encoding::Depth,
318 ) -> fidl::Result<()> {
319 decoder.debug_check_bounds::<Self>(offset);
320 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
321 unsafe {
324 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
325 }
326 Ok(())
327 }
328 }
329
330 impl fidl::encoding::ValueTypeMarker for DeviceGetDomainIdResponse {
331 type Borrowed<'a> = &'a Self;
332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
333 value
334 }
335 }
336
337 unsafe impl fidl::encoding::TypeMarker for DeviceGetDomainIdResponse {
338 type Owned = Self;
339
340 #[inline(always)]
341 fn inline_align(_context: fidl::encoding::Context) -> usize {
342 4
343 }
344
345 #[inline(always)]
346 fn inline_size(_context: fidl::encoding::Context) -> usize {
347 4
348 }
349 #[inline(always)]
350 fn encode_is_copy() -> bool {
351 true
352 }
353
354 #[inline(always)]
355 fn decode_is_copy() -> bool {
356 true
357 }
358 }
359
360 unsafe impl<D: fidl::encoding::ResourceDialect>
361 fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for &DeviceGetDomainIdResponse
362 {
363 #[inline]
364 unsafe fn encode(
365 self,
366 encoder: &mut fidl::encoding::Encoder<'_, D>,
367 offset: usize,
368 _depth: fidl::encoding::Depth,
369 ) -> fidl::Result<()> {
370 encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
371 unsafe {
372 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
374 (buf_ptr as *mut DeviceGetDomainIdResponse)
375 .write_unaligned((self as *const DeviceGetDomainIdResponse).read());
376 }
379 Ok(())
380 }
381 }
382 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
383 fidl::encoding::Encode<DeviceGetDomainIdResponse, D> for (T0,)
384 {
385 #[inline]
386 unsafe fn encode(
387 self,
388 encoder: &mut fidl::encoding::Encoder<'_, D>,
389 offset: usize,
390 depth: fidl::encoding::Depth,
391 ) -> fidl::Result<()> {
392 encoder.debug_check_bounds::<DeviceGetDomainIdResponse>(offset);
393 self.0.encode(encoder, offset + 0, depth)?;
397 Ok(())
398 }
399 }
400
401 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
402 for DeviceGetDomainIdResponse
403 {
404 #[inline(always)]
405 fn new_empty() -> Self {
406 Self { domain_id: fidl::new_empty!(u32, D) }
407 }
408
409 #[inline]
410 unsafe fn decode(
411 &mut self,
412 decoder: &mut fidl::encoding::Decoder<'_, D>,
413 offset: usize,
414 _depth: fidl::encoding::Depth,
415 ) -> fidl::Result<()> {
416 decoder.debug_check_bounds::<Self>(offset);
417 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
418 unsafe {
421 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
422 }
423 Ok(())
424 }
425 }
426
427 impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdRequest {
428 type Borrowed<'a> = &'a Self;
429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
430 value
431 }
432 }
433
434 unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdRequest {
435 type Owned = Self;
436
437 #[inline(always)]
438 fn inline_align(_context: fidl::encoding::Context) -> usize {
439 8
440 }
441
442 #[inline(always)]
443 fn inline_size(_context: fidl::encoding::Context) -> usize {
444 8
445 }
446 #[inline(always)]
447 fn encode_is_copy() -> bool {
448 true
449 }
450
451 #[inline(always)]
452 fn decode_is_copy() -> bool {
453 true
454 }
455 }
456
457 unsafe impl<D: fidl::encoding::ResourceDialect>
458 fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D>
459 for &DeviceGetLogicalCoreIdRequest
460 {
461 #[inline]
462 unsafe fn encode(
463 self,
464 encoder: &mut fidl::encoding::Encoder<'_, D>,
465 offset: usize,
466 _depth: fidl::encoding::Depth,
467 ) -> fidl::Result<()> {
468 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
469 unsafe {
470 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
472 (buf_ptr as *mut DeviceGetLogicalCoreIdRequest)
473 .write_unaligned((self as *const DeviceGetLogicalCoreIdRequest).read());
474 }
477 Ok(())
478 }
479 }
480 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
481 fidl::encoding::Encode<DeviceGetLogicalCoreIdRequest, D> for (T0,)
482 {
483 #[inline]
484 unsafe fn encode(
485 self,
486 encoder: &mut fidl::encoding::Encoder<'_, D>,
487 offset: usize,
488 depth: fidl::encoding::Depth,
489 ) -> fidl::Result<()> {
490 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdRequest>(offset);
491 self.0.encode(encoder, offset + 0, depth)?;
495 Ok(())
496 }
497 }
498
499 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
500 for DeviceGetLogicalCoreIdRequest
501 {
502 #[inline(always)]
503 fn new_empty() -> Self {
504 Self { index: fidl::new_empty!(u64, D) }
505 }
506
507 #[inline]
508 unsafe fn decode(
509 &mut self,
510 decoder: &mut fidl::encoding::Decoder<'_, D>,
511 offset: usize,
512 _depth: fidl::encoding::Depth,
513 ) -> fidl::Result<()> {
514 decoder.debug_check_bounds::<Self>(offset);
515 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
516 unsafe {
519 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
520 }
521 Ok(())
522 }
523 }
524
525 impl fidl::encoding::ValueTypeMarker for DeviceGetLogicalCoreIdResponse {
526 type Borrowed<'a> = &'a Self;
527 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
528 value
529 }
530 }
531
532 unsafe impl fidl::encoding::TypeMarker for DeviceGetLogicalCoreIdResponse {
533 type Owned = Self;
534
535 #[inline(always)]
536 fn inline_align(_context: fidl::encoding::Context) -> usize {
537 8
538 }
539
540 #[inline(always)]
541 fn inline_size(_context: fidl::encoding::Context) -> usize {
542 8
543 }
544 #[inline(always)]
545 fn encode_is_copy() -> bool {
546 true
547 }
548
549 #[inline(always)]
550 fn decode_is_copy() -> bool {
551 true
552 }
553 }
554
555 unsafe impl<D: fidl::encoding::ResourceDialect>
556 fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D>
557 for &DeviceGetLogicalCoreIdResponse
558 {
559 #[inline]
560 unsafe fn encode(
561 self,
562 encoder: &mut fidl::encoding::Encoder<'_, D>,
563 offset: usize,
564 _depth: fidl::encoding::Depth,
565 ) -> fidl::Result<()> {
566 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
567 unsafe {
568 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
570 (buf_ptr as *mut DeviceGetLogicalCoreIdResponse)
571 .write_unaligned((self as *const DeviceGetLogicalCoreIdResponse).read());
572 }
575 Ok(())
576 }
577 }
578 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
579 fidl::encoding::Encode<DeviceGetLogicalCoreIdResponse, D> for (T0,)
580 {
581 #[inline]
582 unsafe fn encode(
583 self,
584 encoder: &mut fidl::encoding::Encoder<'_, D>,
585 offset: usize,
586 depth: fidl::encoding::Depth,
587 ) -> fidl::Result<()> {
588 encoder.debug_check_bounds::<DeviceGetLogicalCoreIdResponse>(offset);
589 self.0.encode(encoder, offset + 0, depth)?;
593 Ok(())
594 }
595 }
596
597 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
598 for DeviceGetLogicalCoreIdResponse
599 {
600 #[inline(always)]
601 fn new_empty() -> Self {
602 Self { id: fidl::new_empty!(u64, D) }
603 }
604
605 #[inline]
606 unsafe fn decode(
607 &mut self,
608 decoder: &mut fidl::encoding::Decoder<'_, D>,
609 offset: usize,
610 _depth: fidl::encoding::Depth,
611 ) -> fidl::Result<()> {
612 decoder.debug_check_bounds::<Self>(offset);
613 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
614 unsafe {
617 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
618 }
619 Ok(())
620 }
621 }
622
623 impl fidl::encoding::ValueTypeMarker for DeviceGetNumLogicalCoresResponse {
624 type Borrowed<'a> = &'a Self;
625 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
626 value
627 }
628 }
629
630 unsafe impl fidl::encoding::TypeMarker for DeviceGetNumLogicalCoresResponse {
631 type Owned = Self;
632
633 #[inline(always)]
634 fn inline_align(_context: fidl::encoding::Context) -> usize {
635 8
636 }
637
638 #[inline(always)]
639 fn inline_size(_context: fidl::encoding::Context) -> usize {
640 8
641 }
642 #[inline(always)]
643 fn encode_is_copy() -> bool {
644 true
645 }
646
647 #[inline(always)]
648 fn decode_is_copy() -> bool {
649 true
650 }
651 }
652
653 unsafe impl<D: fidl::encoding::ResourceDialect>
654 fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D>
655 for &DeviceGetNumLogicalCoresResponse
656 {
657 #[inline]
658 unsafe fn encode(
659 self,
660 encoder: &mut fidl::encoding::Encoder<'_, D>,
661 offset: usize,
662 _depth: fidl::encoding::Depth,
663 ) -> fidl::Result<()> {
664 encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
665 unsafe {
666 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
668 (buf_ptr as *mut DeviceGetNumLogicalCoresResponse)
669 .write_unaligned((self as *const DeviceGetNumLogicalCoresResponse).read());
670 }
673 Ok(())
674 }
675 }
676 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
677 fidl::encoding::Encode<DeviceGetNumLogicalCoresResponse, D> for (T0,)
678 {
679 #[inline]
680 unsafe fn encode(
681 self,
682 encoder: &mut fidl::encoding::Encoder<'_, D>,
683 offset: usize,
684 depth: fidl::encoding::Depth,
685 ) -> fidl::Result<()> {
686 encoder.debug_check_bounds::<DeviceGetNumLogicalCoresResponse>(offset);
687 self.0.encode(encoder, offset + 0, depth)?;
691 Ok(())
692 }
693 }
694
695 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
696 for DeviceGetNumLogicalCoresResponse
697 {
698 #[inline(always)]
699 fn new_empty() -> Self {
700 Self { count: fidl::new_empty!(u64, D) }
701 }
702
703 #[inline]
704 unsafe fn decode(
705 &mut self,
706 decoder: &mut fidl::encoding::Decoder<'_, D>,
707 offset: usize,
708 _depth: fidl::encoding::Depth,
709 ) -> fidl::Result<()> {
710 decoder.debug_check_bounds::<Self>(offset);
711 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
712 unsafe {
715 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
716 }
717 Ok(())
718 }
719 }
720
721 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoRequest {
722 type Borrowed<'a> = &'a Self;
723 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
724 value
725 }
726 }
727
728 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoRequest {
729 type Owned = Self;
730
731 #[inline(always)]
732 fn inline_align(_context: fidl::encoding::Context) -> usize {
733 4
734 }
735
736 #[inline(always)]
737 fn inline_size(_context: fidl::encoding::Context) -> usize {
738 4
739 }
740 #[inline(always)]
741 fn encode_is_copy() -> bool {
742 true
743 }
744
745 #[inline(always)]
746 fn decode_is_copy() -> bool {
747 true
748 }
749 }
750
751 unsafe impl<D: fidl::encoding::ResourceDialect>
752 fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D>
753 for &DeviceGetOperatingPointInfoRequest
754 {
755 #[inline]
756 unsafe fn encode(
757 self,
758 encoder: &mut fidl::encoding::Encoder<'_, D>,
759 offset: usize,
760 _depth: fidl::encoding::Depth,
761 ) -> fidl::Result<()> {
762 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
763 unsafe {
764 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
766 (buf_ptr as *mut DeviceGetOperatingPointInfoRequest)
767 .write_unaligned((self as *const DeviceGetOperatingPointInfoRequest).read());
768 }
771 Ok(())
772 }
773 }
774 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
775 fidl::encoding::Encode<DeviceGetOperatingPointInfoRequest, D> for (T0,)
776 {
777 #[inline]
778 unsafe fn encode(
779 self,
780 encoder: &mut fidl::encoding::Encoder<'_, D>,
781 offset: usize,
782 depth: fidl::encoding::Depth,
783 ) -> fidl::Result<()> {
784 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoRequest>(offset);
785 self.0.encode(encoder, offset + 0, depth)?;
789 Ok(())
790 }
791 }
792
793 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
794 for DeviceGetOperatingPointInfoRequest
795 {
796 #[inline(always)]
797 fn new_empty() -> Self {
798 Self { opp: fidl::new_empty!(u32, D) }
799 }
800
801 #[inline]
802 unsafe fn decode(
803 &mut self,
804 decoder: &mut fidl::encoding::Decoder<'_, D>,
805 offset: usize,
806 _depth: fidl::encoding::Depth,
807 ) -> fidl::Result<()> {
808 decoder.debug_check_bounds::<Self>(offset);
809 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
810 unsafe {
813 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
814 }
815 Ok(())
816 }
817 }
818
819 impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointRequest {
820 type Borrowed<'a> = &'a Self;
821 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
822 value
823 }
824 }
825
826 unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointRequest {
827 type Owned = Self;
828
829 #[inline(always)]
830 fn inline_align(_context: fidl::encoding::Context) -> usize {
831 4
832 }
833
834 #[inline(always)]
835 fn inline_size(_context: fidl::encoding::Context) -> usize {
836 4
837 }
838 #[inline(always)]
839 fn encode_is_copy() -> bool {
840 true
841 }
842
843 #[inline(always)]
844 fn decode_is_copy() -> bool {
845 true
846 }
847 }
848
849 unsafe impl<D: fidl::encoding::ResourceDialect>
850 fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D>
851 for &DeviceSetCurrentOperatingPointRequest
852 {
853 #[inline]
854 unsafe fn encode(
855 self,
856 encoder: &mut fidl::encoding::Encoder<'_, D>,
857 offset: usize,
858 _depth: fidl::encoding::Depth,
859 ) -> fidl::Result<()> {
860 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
861 unsafe {
862 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
864 (buf_ptr as *mut DeviceSetCurrentOperatingPointRequest)
865 .write_unaligned((self as *const DeviceSetCurrentOperatingPointRequest).read());
866 }
869 Ok(())
870 }
871 }
872 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
873 fidl::encoding::Encode<DeviceSetCurrentOperatingPointRequest, D> for (T0,)
874 {
875 #[inline]
876 unsafe fn encode(
877 self,
878 encoder: &mut fidl::encoding::Encoder<'_, D>,
879 offset: usize,
880 depth: fidl::encoding::Depth,
881 ) -> fidl::Result<()> {
882 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointRequest>(offset);
883 self.0.encode(encoder, offset + 0, depth)?;
887 Ok(())
888 }
889 }
890
891 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
892 for DeviceSetCurrentOperatingPointRequest
893 {
894 #[inline(always)]
895 fn new_empty() -> Self {
896 Self { requested_opp: fidl::new_empty!(u32, D) }
897 }
898
899 #[inline]
900 unsafe fn decode(
901 &mut self,
902 decoder: &mut fidl::encoding::Decoder<'_, D>,
903 offset: usize,
904 _depth: fidl::encoding::Depth,
905 ) -> fidl::Result<()> {
906 decoder.debug_check_bounds::<Self>(offset);
907 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
908 unsafe {
911 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
912 }
913 Ok(())
914 }
915 }
916
917 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointCountResponse {
918 type Borrowed<'a> = &'a Self;
919 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
920 value
921 }
922 }
923
924 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointCountResponse {
925 type Owned = Self;
926
927 #[inline(always)]
928 fn inline_align(_context: fidl::encoding::Context) -> usize {
929 4
930 }
931
932 #[inline(always)]
933 fn inline_size(_context: fidl::encoding::Context) -> usize {
934 4
935 }
936 #[inline(always)]
937 fn encode_is_copy() -> bool {
938 true
939 }
940
941 #[inline(always)]
942 fn decode_is_copy() -> bool {
943 true
944 }
945 }
946
947 unsafe impl<D: fidl::encoding::ResourceDialect>
948 fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D>
949 for &DeviceGetOperatingPointCountResponse
950 {
951 #[inline]
952 unsafe fn encode(
953 self,
954 encoder: &mut fidl::encoding::Encoder<'_, D>,
955 offset: usize,
956 _depth: fidl::encoding::Depth,
957 ) -> fidl::Result<()> {
958 encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
959 unsafe {
960 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
962 (buf_ptr as *mut DeviceGetOperatingPointCountResponse)
963 .write_unaligned((self as *const DeviceGetOperatingPointCountResponse).read());
964 }
967 Ok(())
968 }
969 }
970 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
971 fidl::encoding::Encode<DeviceGetOperatingPointCountResponse, D> for (T0,)
972 {
973 #[inline]
974 unsafe fn encode(
975 self,
976 encoder: &mut fidl::encoding::Encoder<'_, D>,
977 offset: usize,
978 depth: fidl::encoding::Depth,
979 ) -> fidl::Result<()> {
980 encoder.debug_check_bounds::<DeviceGetOperatingPointCountResponse>(offset);
981 self.0.encode(encoder, offset + 0, depth)?;
985 Ok(())
986 }
987 }
988
989 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
990 for DeviceGetOperatingPointCountResponse
991 {
992 #[inline(always)]
993 fn new_empty() -> Self {
994 Self { count: fidl::new_empty!(u32, D) }
995 }
996
997 #[inline]
998 unsafe fn decode(
999 &mut self,
1000 decoder: &mut fidl::encoding::Decoder<'_, D>,
1001 offset: usize,
1002 _depth: fidl::encoding::Depth,
1003 ) -> fidl::Result<()> {
1004 decoder.debug_check_bounds::<Self>(offset);
1005 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1006 unsafe {
1009 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1010 }
1011 Ok(())
1012 }
1013 }
1014
1015 impl fidl::encoding::ValueTypeMarker for DeviceGetOperatingPointInfoResponse {
1016 type Borrowed<'a> = &'a Self;
1017 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1018 value
1019 }
1020 }
1021
1022 unsafe impl fidl::encoding::TypeMarker for DeviceGetOperatingPointInfoResponse {
1023 type Owned = Self;
1024
1025 #[inline(always)]
1026 fn inline_align(_context: fidl::encoding::Context) -> usize {
1027 8
1028 }
1029
1030 #[inline(always)]
1031 fn inline_size(_context: fidl::encoding::Context) -> usize {
1032 16
1033 }
1034 #[inline(always)]
1035 fn encode_is_copy() -> bool {
1036 true
1037 }
1038
1039 #[inline(always)]
1040 fn decode_is_copy() -> bool {
1041 true
1042 }
1043 }
1044
1045 unsafe impl<D: fidl::encoding::ResourceDialect>
1046 fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D>
1047 for &DeviceGetOperatingPointInfoResponse
1048 {
1049 #[inline]
1050 unsafe fn encode(
1051 self,
1052 encoder: &mut fidl::encoding::Encoder<'_, D>,
1053 offset: usize,
1054 _depth: fidl::encoding::Depth,
1055 ) -> fidl::Result<()> {
1056 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1057 unsafe {
1058 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1060 (buf_ptr as *mut DeviceGetOperatingPointInfoResponse)
1061 .write_unaligned((self as *const DeviceGetOperatingPointInfoResponse).read());
1062 }
1065 Ok(())
1066 }
1067 }
1068 unsafe impl<
1069 D: fidl::encoding::ResourceDialect,
1070 T0: fidl::encoding::Encode<CpuOperatingPointInfo, D>,
1071 > fidl::encoding::Encode<DeviceGetOperatingPointInfoResponse, D> for (T0,)
1072 {
1073 #[inline]
1074 unsafe fn encode(
1075 self,
1076 encoder: &mut fidl::encoding::Encoder<'_, D>,
1077 offset: usize,
1078 depth: fidl::encoding::Depth,
1079 ) -> fidl::Result<()> {
1080 encoder.debug_check_bounds::<DeviceGetOperatingPointInfoResponse>(offset);
1081 self.0.encode(encoder, offset + 0, depth)?;
1085 Ok(())
1086 }
1087 }
1088
1089 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1090 for DeviceGetOperatingPointInfoResponse
1091 {
1092 #[inline(always)]
1093 fn new_empty() -> Self {
1094 Self { info: fidl::new_empty!(CpuOperatingPointInfo, D) }
1095 }
1096
1097 #[inline]
1098 unsafe fn decode(
1099 &mut self,
1100 decoder: &mut fidl::encoding::Decoder<'_, D>,
1101 offset: usize,
1102 _depth: fidl::encoding::Depth,
1103 ) -> fidl::Result<()> {
1104 decoder.debug_check_bounds::<Self>(offset);
1105 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1106 unsafe {
1109 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1110 }
1111 Ok(())
1112 }
1113 }
1114
1115 impl fidl::encoding::ValueTypeMarker for DeviceGetRelativePerformanceResponse {
1116 type Borrowed<'a> = &'a Self;
1117 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1118 value
1119 }
1120 }
1121
1122 unsafe impl fidl::encoding::TypeMarker for DeviceGetRelativePerformanceResponse {
1123 type Owned = Self;
1124
1125 #[inline(always)]
1126 fn inline_align(_context: fidl::encoding::Context) -> usize {
1127 1
1128 }
1129
1130 #[inline(always)]
1131 fn inline_size(_context: fidl::encoding::Context) -> usize {
1132 1
1133 }
1134 #[inline(always)]
1135 fn encode_is_copy() -> bool {
1136 true
1137 }
1138
1139 #[inline(always)]
1140 fn decode_is_copy() -> bool {
1141 true
1142 }
1143 }
1144
1145 unsafe impl<D: fidl::encoding::ResourceDialect>
1146 fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D>
1147 for &DeviceGetRelativePerformanceResponse
1148 {
1149 #[inline]
1150 unsafe fn encode(
1151 self,
1152 encoder: &mut fidl::encoding::Encoder<'_, D>,
1153 offset: usize,
1154 _depth: fidl::encoding::Depth,
1155 ) -> fidl::Result<()> {
1156 encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1157 unsafe {
1158 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1160 (buf_ptr as *mut DeviceGetRelativePerformanceResponse)
1161 .write_unaligned((self as *const DeviceGetRelativePerformanceResponse).read());
1162 }
1165 Ok(())
1166 }
1167 }
1168 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1169 fidl::encoding::Encode<DeviceGetRelativePerformanceResponse, D> for (T0,)
1170 {
1171 #[inline]
1172 unsafe fn encode(
1173 self,
1174 encoder: &mut fidl::encoding::Encoder<'_, D>,
1175 offset: usize,
1176 depth: fidl::encoding::Depth,
1177 ) -> fidl::Result<()> {
1178 encoder.debug_check_bounds::<DeviceGetRelativePerformanceResponse>(offset);
1179 self.0.encode(encoder, offset + 0, depth)?;
1183 Ok(())
1184 }
1185 }
1186
1187 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1188 for DeviceGetRelativePerformanceResponse
1189 {
1190 #[inline(always)]
1191 fn new_empty() -> Self {
1192 Self { relative_performance: fidl::new_empty!(u8, D) }
1193 }
1194
1195 #[inline]
1196 unsafe fn decode(
1197 &mut self,
1198 decoder: &mut fidl::encoding::Decoder<'_, D>,
1199 offset: usize,
1200 _depth: fidl::encoding::Depth,
1201 ) -> fidl::Result<()> {
1202 decoder.debug_check_bounds::<Self>(offset);
1203 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1204 unsafe {
1207 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1208 }
1209 Ok(())
1210 }
1211 }
1212
1213 impl fidl::encoding::ValueTypeMarker for DeviceSetCurrentOperatingPointResponse {
1214 type Borrowed<'a> = &'a Self;
1215 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1216 value
1217 }
1218 }
1219
1220 unsafe impl fidl::encoding::TypeMarker for DeviceSetCurrentOperatingPointResponse {
1221 type Owned = Self;
1222
1223 #[inline(always)]
1224 fn inline_align(_context: fidl::encoding::Context) -> usize {
1225 4
1226 }
1227
1228 #[inline(always)]
1229 fn inline_size(_context: fidl::encoding::Context) -> usize {
1230 4
1231 }
1232 #[inline(always)]
1233 fn encode_is_copy() -> bool {
1234 true
1235 }
1236
1237 #[inline(always)]
1238 fn decode_is_copy() -> bool {
1239 true
1240 }
1241 }
1242
1243 unsafe impl<D: fidl::encoding::ResourceDialect>
1244 fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D>
1245 for &DeviceSetCurrentOperatingPointResponse
1246 {
1247 #[inline]
1248 unsafe fn encode(
1249 self,
1250 encoder: &mut fidl::encoding::Encoder<'_, D>,
1251 offset: usize,
1252 _depth: fidl::encoding::Depth,
1253 ) -> fidl::Result<()> {
1254 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1255 unsafe {
1256 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1258 (buf_ptr as *mut DeviceSetCurrentOperatingPointResponse).write_unaligned(
1259 (self as *const DeviceSetCurrentOperatingPointResponse).read(),
1260 );
1261 }
1264 Ok(())
1265 }
1266 }
1267 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1268 fidl::encoding::Encode<DeviceSetCurrentOperatingPointResponse, D> for (T0,)
1269 {
1270 #[inline]
1271 unsafe fn encode(
1272 self,
1273 encoder: &mut fidl::encoding::Encoder<'_, D>,
1274 offset: usize,
1275 depth: fidl::encoding::Depth,
1276 ) -> fidl::Result<()> {
1277 encoder.debug_check_bounds::<DeviceSetCurrentOperatingPointResponse>(offset);
1278 self.0.encode(encoder, offset + 0, depth)?;
1282 Ok(())
1283 }
1284 }
1285
1286 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1287 for DeviceSetCurrentOperatingPointResponse
1288 {
1289 #[inline(always)]
1290 fn new_empty() -> Self {
1291 Self { out_opp: fidl::new_empty!(u32, D) }
1292 }
1293
1294 #[inline]
1295 unsafe fn decode(
1296 &mut self,
1297 decoder: &mut fidl::encoding::Decoder<'_, D>,
1298 offset: usize,
1299 _depth: fidl::encoding::Depth,
1300 ) -> fidl::Result<()> {
1301 decoder.debug_check_bounds::<Self>(offset);
1302 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1303 unsafe {
1306 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1307 }
1308 Ok(())
1309 }
1310 }
1311}