/* * For some calls it is necessary to use SMC64 to pass or return 64-bit values. * For such calls FFA_FN_NATIVE(name) will choose the appropriate * (native-width) function ID.
*/ #ifdef CONFIG_64BIT #define FFA_FN_NATIVE(name) FFA_FN64_##name #else #define FFA_FN_NATIVE(name) FFA_##name #endif
/** * FF-A specification mentions explicitly about '4K pages'. This should * not be confused with the kernel PAGE_SIZE, which is the translation * granule kernel is configured and may be one among 4K, 16K and 64K.
*/ #define FFA_PAGE_SIZE SZ_4K
/* * Minimum buffer size/alignment encodings returned by an FFA_FEATURES * query for FFA_RXTX_MAP.
*/ #define FFA_FEAT_RXTX_MIN_SZ_4K 0 #define FFA_FEAT_RXTX_MIN_SZ_64K 1 #define FFA_FEAT_RXTX_MIN_SZ_16K 2
/** * module_ffa_driver() - Helper macro for registering a psa_ffa driver * @__ffa_driver: ffa_driver structure * * Helper macro for psa_ffa drivers to set up proper module init / exit * functions. Replaces module_init() and module_exit() and keeps people from * printing pointless things to the kernel log when their driver is loaded.
*/ #define module_ffa_driver(__ffa_driver) \
module_driver(__ffa_driver, ffa_register, ffa_unregister)
externconststruct bus_type ffa_bus_type;
/* The FF-A 1.0 partition structure lacks the uuid[4] */ #define FFA_1_0_PARTITON_INFO_SZ (8)
/* FFA transport related */ struct ffa_partition_info {
u16 id;
u16 exec_ctxt; /* partition supports receipt of direct requests */ #define FFA_PARTITION_DIRECT_RECV BIT(0) /* partition can send direct requests. */ #define FFA_PARTITION_DIRECT_SEND BIT(1) /* partition can send and receive indirect messages. */ #define FFA_PARTITION_INDIRECT_MSG BIT(2) /* partition can receive notifications */ #define FFA_PARTITION_NOTIFICATION_RECV BIT(3) /* partition runs in the AArch64 execution state. */ #define FFA_PARTITION_AARCH64_EXEC BIT(8) /* partition supports receipt of direct request2 */ #define FFA_PARTITION_DIRECT_REQ2_RECV BIT(9) /* partition can send direct request2. */ #define FFA_PARTITION_DIRECT_REQ2_SEND BIT(10)
u32 properties;
uuid_t uuid;
};
/* For use with FFA_MSG_SEND_DIRECT_{REQ,RESP}2 which pass data via registers */ struct ffa_send_direct_data2 { unsignedlong data[14]; /* x4-x17 */
};
struct ffa_mem_region_addr_range { /* The base IPA of the constituent memory region, aligned to 4 kiB */
u64 address; /* The number of 4 kiB pages in the constituent memory region. */
u32 pg_cnt;
u32 reserved;
};
struct ffa_composite_mem_region { /* * The total number of 4 kiB pages included in this memory region. This * must be equal to the sum of page counts specified in each * `struct ffa_mem_region_addr_range`.
*/
u32 total_pg_cnt; /* The number of constituents included in this memory region range */
u32 addr_range_cnt;
u64 reserved; /** An array of `addr_range_cnt` memory region constituents. */ struct ffa_mem_region_addr_range constituents[];
};
struct ffa_mem_region_attributes { /* The ID of the VM to which the memory is being given or shared. */
u16 receiver; /* * The permissions with which the memory region should be mapped in the * receiver's page table.
*/ #define FFA_MEM_EXEC BIT(3) #define FFA_MEM_NO_EXEC BIT(2) #define FFA_MEM_RW BIT(1) #define FFA_MEM_RO BIT(0)
u8 attrs; /* * Flags used during FFA_MEM_RETRIEVE_REQ and FFA_MEM_RETRIEVE_RESP * for memory regions with multiple borrowers.
*/ #define FFA_MEM_RETRIEVE_SELF_BORROWER BIT(0)
u8 flag; /* * Offset in bytes from the start of the outer `ffa_memory_region` to * an `struct ffa_mem_region_addr_range`.
*/
u32 composite_off;
u8 impdef_val[16];
u64 reserved;
};
struct ffa_mem_region { /* The ID of the VM/owner which originally sent the memory region */
u16 sender_id; #define FFA_MEM_NORMAL BIT(5) #define FFA_MEM_DEVICE BIT(4)
#define FFA_MEM_NON_SHAREABLE (0) #define FFA_MEM_OUTER_SHAREABLE (2) #define FFA_MEM_INNER_SHAREABLE (3) /* Memory region attributes, upper byte MBZ pre v1.1 */
u16 attributes; /* * Clear memory region contents after unmapping it from the sender and * before mapping it for any receiver.
*/ #define FFA_MEM_CLEAR BIT(0) /* * Whether the hypervisor may time slice the memory sharing or retrieval * operation.
*/ #define FFA_TIME_SLICE_ENABLE BIT(1)
#define FFA_MEM_RETRIEVE_ADDR_ALIGN_HINT BIT(9) #define FFA_MEM_RETRIEVE_ADDR_ALIGN(x) ((x) << 5) /* Flags to control behaviour of the transaction. */
u32 flags; #define HANDLE_LOW_MASK GENMASK_ULL(31, 0) #define HANDLE_HIGH_MASK GENMASK_ULL(63, 32) #define HANDLE_LOW(x) ((u32)(FIELD_GET(HANDLE_LOW_MASK, (x)))) #define HANDLE_HIGH(x) ((u32)(FIELD_GET(HANDLE_HIGH_MASK, (x))))
#define PACK_HANDLE(l, h) \
(FIELD_PREP(HANDLE_LOW_MASK, (l)) | FIELD_PREP(HANDLE_HIGH_MASK, (h))) /* * A globally-unique ID assigned by the hypervisor for a region * of memory being sent between VMs.
*/
u64 handle; /* * An implementation defined value associated with the receiver and the * memory region.
*/
u64 tag; /* Size of each endpoint memory access descriptor, MBZ pre v1.1 */
u32 ep_mem_size; /* * The number of `ffa_mem_region_attributes` entries included in this * transaction.
*/
u32 ep_count; /* * 16-byte aligned offset from the base address of this descriptor * to the first element of the endpoint memory access descriptor array * Valid only from v1.1
*/
u32 ep_mem_offset; /* MBZ, valid only from v1.1 */
u32 reserved[3];
};
struct ffa_notifier_ops { int (*sched_recv_cb_register)(struct ffa_device *dev,
ffa_sched_recv_cb cb, void *cb_data); int (*sched_recv_cb_unregister)(struct ffa_device *dev); int (*notify_request)(struct ffa_device *dev, bool per_vcpu,
ffa_notifier_cb cb, void *cb_data, int notify_id); int (*notify_relinquish)(struct ffa_device *dev, int notify_id); int (*fwk_notify_request)(struct ffa_device *dev,
ffa_fwk_notifier_cb cb, void *cb_data, int notify_id); int (*fwk_notify_relinquish)(struct ffa_device *dev, int notify_id); int (*notify_send)(struct ffa_device *dev, int notify_id, bool per_vcpu,
u16 vcpu);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.