1 // Copyright 2020 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 /*
5 * generated from files in sound-open-firmware-private/src/include:
6 * kernel/header.h
7 * ipc/control.h
8 */
9
10 /* automatically generated by rust-bindgen */
11
12 #[repr(C)]
13 #[derive(Default)]
14 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
15 impl<T> __IncompleteArrayField<T> {
16 #[inline]
new() -> Self17 pub fn new() -> Self {
18 __IncompleteArrayField(::std::marker::PhantomData)
19 }
20 #[inline]
as_ptr(&self) -> *const T21 pub unsafe fn as_ptr(&self) -> *const T {
22 ::std::mem::transmute(self)
23 }
24 #[inline]
as_mut_ptr(&mut self) -> *mut T25 pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
26 ::std::mem::transmute(self)
27 }
28 #[inline]
as_slice(&self, len: usize) -> &[T]29 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
30 ::std::slice::from_raw_parts(self.as_ptr(), len)
31 }
32 #[inline]
as_mut_slice(&mut self, len: usize) -> &mut [T]33 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
34 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
35 }
36 }
37 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result38 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
39 fmt.write_str("__IncompleteArrayField")
40 }
41 }
42 impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
43 #[inline]
clone(&self) -> Self44 fn clone(&self) -> Self {
45 Self::new()
46 }
47 }
48 impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
49 pub type __uint32_t = ::std::os::raw::c_uint;
50 /// \brief Header for all non IPC ABI data.
51 ///
52 /// Identifies data type, size and ABI.
53 /// Data header used for all component data structures and binary blobs sent to
54 /// firmware as runtime data. This data is typically sent by userspace
55 /// applications and tunnelled through any OS kernel (via binary kcontrol on
56 /// Linux) to the firmware.
57 #[repr(C, packed)]
58 pub struct sof_abi_hdr {
59 ///< 'S', 'O', 'F', '\0'
60 pub magic: u32,
61 ///< component specific type
62 pub type_: u32,
63 ///< size in bytes of data excl. this struct
64 pub size: u32,
65 ///< SOF ABI version
66 pub abi: u32,
67 ///< reserved for future use
68 pub reserved: [u32; 4usize],
69 ///< Component data - opaque to core
70 pub data: __IncompleteArrayField<u32>,
71 }
72 #[test]
bindgen_test_layout_sof_abi_hdr()73 fn bindgen_test_layout_sof_abi_hdr() {
74 assert_eq!(
75 ::std::mem::size_of::<sof_abi_hdr>(),
76 32usize,
77 concat!("Size of: ", stringify!(sof_abi_hdr))
78 );
79 assert_eq!(
80 ::std::mem::align_of::<sof_abi_hdr>(),
81 1usize,
82 concat!("Alignment of ", stringify!(sof_abi_hdr))
83 );
84 assert_eq!(
85 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).magic as *const _ as usize },
86 0usize,
87 concat!(
88 "Offset of field: ",
89 stringify!(sof_abi_hdr),
90 "::",
91 stringify!(magic)
92 )
93 );
94 assert_eq!(
95 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).type_ as *const _ as usize },
96 4usize,
97 concat!(
98 "Offset of field: ",
99 stringify!(sof_abi_hdr),
100 "::",
101 stringify!(type_)
102 )
103 );
104 assert_eq!(
105 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).size as *const _ as usize },
106 8usize,
107 concat!(
108 "Offset of field: ",
109 stringify!(sof_abi_hdr),
110 "::",
111 stringify!(size)
112 )
113 );
114 assert_eq!(
115 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).abi as *const _ as usize },
116 12usize,
117 concat!(
118 "Offset of field: ",
119 stringify!(sof_abi_hdr),
120 "::",
121 stringify!(abi)
122 )
123 );
124 assert_eq!(
125 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).reserved as *const _ as usize },
126 16usize,
127 concat!(
128 "Offset of field: ",
129 stringify!(sof_abi_hdr),
130 "::",
131 stringify!(reserved)
132 )
133 );
134 assert_eq!(
135 unsafe { &(*(::std::ptr::null::<sof_abi_hdr>())).data as *const _ as usize },
136 32usize,
137 concat!(
138 "Offset of field: ",
139 stringify!(sof_abi_hdr),
140 "::",
141 stringify!(data)
142 )
143 );
144 }
145 ///< maps to ALSA volume style controls
146 pub const sof_ipc_ctrl_cmd_SOF_CTRL_CMD_VOLUME: sof_ipc_ctrl_cmd = 0;
147 ///< maps to ALSA enum style controls
148 pub const sof_ipc_ctrl_cmd_SOF_CTRL_CMD_ENUM: sof_ipc_ctrl_cmd = 1;
149 ///< maps to ALSA switch style controls
150 pub const sof_ipc_ctrl_cmd_SOF_CTRL_CMD_SWITCH: sof_ipc_ctrl_cmd = 2;
151 ///< maps to ALSA binary style controls
152 pub const sof_ipc_ctrl_cmd_SOF_CTRL_CMD_BINARY: sof_ipc_ctrl_cmd = 3;
153 /// Control command type.
154 pub type sof_ipc_ctrl_cmd = u32;
155