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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/arm-smccc.hlinux/notifier.hlinux/rhashtable.hlinux/rpmb.hlinux/semaphore.hlinux/tee_core.hlinux/types.hoptee_msg.h
Detected Declarations
struct optee_call_waiterstruct optee_call_queuestruct optee_notifstruct optee_shm_arg_entrystruct optee_shm_arg_cachestruct optee_suppstruct optee_pcpustruct optee_smcstruct optee_ffastruct opteestruct optee_revisionstruct optee_opsstruct opteestruct optee_sessionstruct optee_context_datastruct optee_rpc_paramstruct optee_call_ctxfunction optee_from_msg_param_valuefunction optee_to_msg_param_valuefunction reg_pair_from_64
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
- Immediate include surface: `linux/arm-smccc.h`, `linux/notifier.h`, `linux/rhashtable.h`, `linux/rpmb.h`, `linux/semaphore.h`, `linux/tee_core.h`, `linux/types.h`, `optee_msg.h`.
- Detected declarations: `struct optee_call_waiter`, `struct optee_call_queue`, `struct optee_notif`, `struct optee_shm_arg_entry`, `struct optee_shm_arg_cache`, `struct optee_supp`, `struct optee_pcpu`, `struct optee_smc`, `struct optee_ffa`, `struct optee`.
- Atlas domain: Driver Families / drivers/tee.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.