Balint Dobszay | de0dc80 | 2025-02-28 14:16:52 +0100 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> |
| 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 |
| 3 | |
| 4 | #![allow(non_camel_case_types)] |
| 5 | |
| 6 | use crate::ffa_v1_1; |
| 7 | use zerocopy_derive::*; |
| 8 | |
| 9 | /// Table 6.1: Partition information descriptor |
| 10 | /// Table 6.2: Partition properties descriptor |
| 11 | /// The following changes are introduced by FF-A v1.2 to the partition properties field: |
| 12 | /// - bit\[10:9\]: Has the following encoding if Bits\[5:4\] = b’00. Reserved (MBZ) otherwise. |
| 13 | /// + bit\[9\] has the following encoding: |
| 14 | /// * b’0: Cannot receive Direct requests via the FFA_MSG_SEND_DIRECT_REQ2 ABI. |
| 15 | /// * b’1: Can receive Direct requests via the FFA_MSG_SEND_DIRECT_REQ2 ABI. |
| 16 | /// + bit\[10\] has the following encoding: |
| 17 | /// * b’0: Cannot send Direct requests via the FFA_MSG_SEND_DIRECT_REQ2 ABI. |
| 18 | /// * b’1: Can send Direct requests via the FFA_MSG_SEND_DIRECT_REQ2 ABI. |
| 19 | /// - bit\[31:11\]: Reserved (MBZ). |
| 20 | /// |
| 21 | /// This doesn't change the descriptor format so we can just use an alias. |
| 22 | #[allow(unused)] |
| 23 | pub(crate) type partition_info_descriptor = ffa_v1_1::partition_info_descriptor; |
| 24 | |
| 25 | /// FF-A Memory Management Protocol Table 1.16: Endpoint memory access descriptor |
| 26 | #[derive(Default, FromBytes, IntoBytes, KnownLayout, Immutable)] |
| 27 | #[repr(C, packed)] |
| 28 | pub(crate) struct endpoint_memory_access_descriptor { |
| 29 | /// Offset 0, length 4: Memory access permissions descriptor as specified in Table 10.15 |
| 30 | pub(crate) access_perm_desc: ffa_v1_1::memory_access_permission_descriptor, |
| 31 | /// Offset 4, length 4: Offset to the composite memory region descriptor to which the endpoint |
| 32 | /// access permissions apply. Offset must be calculated from the base address of the data |
| 33 | /// structure this descriptor is included in. An offset value of 0 indicates that the endpoint |
| 34 | /// access permissions apply to a memory region description identified by the Handle parameter |
| 35 | /// specified in the data structure that includes this one. |
| 36 | pub(crate) composite_offset: u32, |
| 37 | /// Offset 8, length 16: Implementation defined information |
| 38 | pub(crate) impdef_info: [u8; 16], |
| 39 | /// Offset 24, length 8: Reserved (MBZ) |
| 40 | pub(crate) reserved: u64, |
| 41 | } |