drivers/tee/optee/optee_msg.h
Source file repositories/reference/linux-study-clean/drivers/tee/optee/optee_msg.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/tee/optee/optee_msg.h- Extension
.h- Size
- 15416 bytes
- Lines
- 418
- 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/bitops.hlinux/types.h
Detected Declarations
struct optee_msg_param_tmemstruct optee_msg_param_rmemstruct optee_msg_param_fmemstruct optee_msg_param_valuestruct optee_msg_paramstruct optee_msg_arg
Annotated Snippet
struct optee_msg_param_tmem {
u64 buf_ptr;
u64 size;
u64 shm_ref;
};
/**
* struct optee_msg_param_rmem - registered memory reference parameter
* @offs: offset into shared memory reference
* @size: size of the buffer
* @shm_ref: shared memory reference, pointer to a struct tee_shm
*/
struct optee_msg_param_rmem {
u64 offs;
u64 size;
u64 shm_ref;
};
/**
* struct optee_msg_param_fmem - FF-A memory reference parameter
* @offs_low: lower bits of offset into shared memory reference
* @offs_high: higher bits of offset into shared memory reference
* @internal_offs: internal offset into the first page of shared memory
* reference
* @size: size of the buffer
* @global_id: global identifier of the shared memory
*/
struct optee_msg_param_fmem {
u32 offs_low;
u16 offs_high;
u16 internal_offs;
u64 size;
u64 global_id;
};
/**
* struct optee_msg_param_value - opaque value parameter
* @a: first opaque value
* @b: second opaque value
* @c: third opaque value
*
* Value parameters are passed unchecked between normal and secure world.
*/
struct optee_msg_param_value {
u64 a;
u64 b;
u64 c;
};
/**
* struct optee_msg_param - parameter used together with struct optee_msg_arg
* @attr: attributes
* @tmem: parameter by temporary memory reference
* @rmem: parameter by registered memory reference
* @fmem: parameter by FF-A registered memory reference
* @value: parameter by opaque value
* @octets: parameter by octet string
* @u: union holding OP-TEE msg parameter
*
* @attr & OPTEE_MSG_ATTR_TYPE_MASK indicates if tmem, rmem or value is used in
* the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value or octets,
* OPTEE_MSG_ATTR_TYPE_TMEM_* indicates @tmem and
* OPTEE_MSG_ATTR_TYPE_RMEM_* or the alias PTEE_MSG_ATTR_TYPE_FMEM_* indicates
* @rmem or @fmem depending on the conduit.
* OPTEE_MSG_ATTR_TYPE_NONE indicates that none of the members are used.
*/
struct optee_msg_param {
u64 attr;
union {
struct optee_msg_param_tmem tmem;
struct optee_msg_param_rmem rmem;
struct optee_msg_param_fmem fmem;
struct optee_msg_param_value value;
u8 octets[24];
} u;
};
/**
* struct optee_msg_arg - call argument
* @cmd: command, one of OPTEE_MSG_CMD_* or OPTEE_MSG_RPC_CMD_*
* @func: Trusted Application function, specific to the Trusted
* Application, used if cmd == OPTEE_MSG_CMD_INVOKE_COMMAND
* @session: in parameter for all OPTEE_MSG_CMD_* except
* OPTEE_MSG_CMD_OPEN_SESSION where it's an output parameter
* instead
* @cancel_id: cancellation id, a unique value to identify this request
* @pad: padding for alignment
* @ret: return value
* @ret_origin: origin of the return value
* @num_params: number of parameters supplied to the OS Command
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/types.h`.
- Detected declarations: `struct optee_msg_param_tmem`, `struct optee_msg_param_rmem`, `struct optee_msg_param_fmem`, `struct optee_msg_param_value`, `struct optee_msg_param`, `struct optee_msg_arg`.
- 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.