drivers/tee/optee/optee_private.h

Source file repositories/reference/linux-study-clean/drivers/tee/optee/optee_private.h

File Facts

System
Linux kernel
Corpus path
drivers/tee/optee/optee_private.h
Extension
.h
Size
13957 bytes
Lines
431
Domain
Driver Families
Bucket
drivers/tee
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct optee_call_waiter {
	struct list_head list_node;
	struct completion c;
	bool sys_thread;
};

/**
 * struct optee_call_queue - OP-TEE call queue management
 * @mutex:			serializes access to this struct
 * @waiters:			list of threads waiting to enter OP-TEE
 * @total_thread_count:		overall number of thread context in OP-TEE or 0
 * @free_thread_count:		number of threads context free in OP-TEE
 * @sys_thread_req_count:	number of registered system thread sessions
 */
struct optee_call_queue {
	/* Serializes access to this struct */
	struct mutex mutex;
	struct list_head waiters;
	int total_thread_count;
	int free_thread_count;
	int sys_thread_req_count;
};

struct optee_notif {
	u_int max_key;
	/* Serializes access to the elements below in this struct */
	spinlock_t lock;
	struct list_head db;
	u_long *bitmap;
};

#define OPTEE_SHM_ARG_ALLOC_PRIV	BIT(0)
#define OPTEE_SHM_ARG_SHARED		BIT(1)
struct optee_shm_arg_entry;
struct optee_shm_arg_cache {
	u32 flags;
	/* Serializes access to this struct */
	struct mutex mutex;
	struct list_head shm_args;
};

/**
 * struct optee_supp - supplicant synchronization struct
 * @mutex:	held while accessing content of this struct
 * @ctx:	the context of current connected supplicant.
 *		if !NULL the supplicant device is available for use,
 *		else busy
 * @req_id:	current request id if supplicant is doing synchronous
 *		communication, else -1
 * @reqs:	queued request not yet retrieved by supplicant
 * @idr:	IDR holding all requests currently being processed
 *		by supplicant
 * @reqs_c:	completion used by supplicant when waiting for a
 *		request to be queued.
 */
struct optee_supp {
	/* Serializes access to this struct */
	struct mutex mutex;
	struct tee_context *ctx;

	int req_id;
	struct list_head reqs;
	struct idr idr;
	struct completion reqs_c;
};

/**
 * struct optee_pcpu - per cpu notif private struct passed to work functions
 * @optee:	optee device reference
 */
struct optee_pcpu {
	struct optee *optee;
};

/**
 * struct optee_smc - optee smc communication struct
 * @invoke_fn:		handler function to invoke secure monitor
 * @memremaped_shm:	virtual address of memory in shared memory pool
 * @sec_caps:		secure world capabilities defined by
 *			OPTEE_SMC_SEC_CAP_* in optee_smc.h
 * @notif_irq:		interrupt used as async notification by OP-TEE or 0
 * @optee_pcpu:		per_cpu optee instance for per cpu work or NULL
 * @notif_pcpu_wq:	workqueue for per cpu asynchronous notification or NULL
 * @notif_pcpu_work:	work for per cpu asynchronous notification
 * @notif_cpuhp_state:	CPU hotplug state assigned for pcpu interrupt management
 */
struct optee_smc {
	optee_invoke_fn *invoke_fn;
	void *memremaped_shm;
	u32 sec_caps;

Annotation

Implementation Notes