cadmus_core/framebuffer/
ion_sys.rs1use nix::ioctl_readwrite;
2
3const MAGIC: u8 = b'I';
4
5ioctl_readwrite!(ion_alloc, MAGIC, 0, IonAllocationData);
6ioctl_readwrite!(ion_free, MAGIC, 1, IonHandleData);
7ioctl_readwrite!(ion_map, MAGIC, 2, IonFdData);
8
9pub const ION_HEAP_MASK_CARVEOUT: libc::c_uint = 4;
10
11type IonUserHandle = libc::c_int;
12
13#[repr(C)]
14pub struct IonAllocationData {
15 pub len: libc::size_t,
16 pub align: libc::size_t,
17 pub heap_id_mask: libc::c_uint,
18 pub flags: libc::c_uint,
19 pub handle: IonUserHandle,
20}
21
22#[repr(C)]
23pub struct IonHandleData {
24 pub handle: IonUserHandle,
25}
26
27#[repr(C)]
28pub struct IonFdData {
29 pub handle: IonUserHandle,
30 pub fd: libc::c_int,
31}