/** * struct amdtee - main service struct * @teedev: client device * @pool: shared memory pool
*/ struct amdtee { struct tee_device *teedev; struct tee_shm_pool *pool;
};
/** * struct amdtee_session - Trusted Application (TA) session related information. * @ta_handle: handle to Trusted Application (TA) loaded in TEE environment * @refcount: counter to keep track of sessions opened for the TA instance * @session_info: an array pointing to TA allocated session data. * @sess_mask: session usage bit-mask. If a particular bit is set, then the * corresponding @session_info entry is in use or valid. * * Session structure is updated on open_session and this information is used for * subsequent operations with the Trusted Application.
*/ struct amdtee_session { struct list_head list_node;
u32 ta_handle; struct kref refcount;
u32 session_info[TEE_NUM_SESSIONS];
DECLARE_BITMAP(sess_mask, TEE_NUM_SESSIONS);
spinlock_t lock; /* synchronizes access to @sess_mask */
};
/** * struct amdtee_context_data - AMD-TEE driver context data * @sess_list: Keeps track of sessions opened in current TEE context * @shm_list: Keeps track of buffers allocated and mapped in current TEE * context
*/ struct amdtee_context_data { struct list_head sess_list; struct list_head shm_list; struct mutex shm_mutex; /* synchronizes access to @shm_list */
};
/** * struct amdtee_shm_data - Shared memory data * @kaddr: Kernel virtual address of shared memory * @buf_id: Buffer id of memory mapped by TEE_CMD_ID_MAP_SHARED_MEM
*/ struct amdtee_shm_data { struct list_head shm_node; void *kaddr;
u32 buf_id;
};
/** * struct amdtee_ta_data - Keeps track of all TAs loaded in AMD Secure * Processor * @ta_handle: Handle to TA loaded in TEE * @refcount: Reference count for the loaded TA
*/ struct amdtee_ta_data { struct list_head list_node;
u32 ta_handle;
u32 refcount;
};
#define LOWER_TWO_BYTE_MASK 0x0000FFFF
/** * set_session_id() - Sets the session identifier. * @ta_handle: [in] handle of the loaded Trusted Application (TA) * @session_index: [in] Session index. Range: 0 to (TEE_NUM_SESSIONS - 1). * @session: [out] Pointer to session id * * Lower two bytes of the session identifier represents the TA handle and the * upper two bytes is session index.
*/ staticinlinevoid set_session_id(u32 ta_handle, u32 session_index,
u32 *session)
{
*session = (session_index << 16) | (LOWER_TWO_BYTE_MASK & ta_handle);
}
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 und die Messung sind noch experimentell.