include/linux/tee_core.h
Source file repositories/reference/linux-study-clean/include/linux/tee_core.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/tee_core.h- Extension
.h- Size
- 14384 bytes
- Lines
- 439
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cdev.hlinux/device.hlinux/dma-buf.hlinux/idr.hlinux/kref.hlinux/list.hlinux/scatterlist.hlinux/tee.hlinux/tee_drv.hlinux/types.hlinux/uuid.h
Detected Declarations
struct tee_devicestruct tee_driver_opsstruct tee_descstruct tee_protmem_poolstruct tee_protmem_pool_opsstruct tee_shm_poolstruct tee_shm_pool_opsenum tee_dma_heap_idfunction tee_shm_pool_freefunction tee_shm_is_dynamicfunction tee_shm_get_idfunction tee_param_is_memref
Annotated Snippet
struct tee_device {
char name[TEE_MAX_DEV_NAME_LEN];
const struct tee_desc *desc;
int id;
unsigned int flags;
struct device dev;
struct cdev cdev;
size_t num_users;
struct completion c_no_users;
struct mutex mutex; /* protects num_users and idr */
struct idr idr;
struct tee_shm_pool *pool;
};
/**
* struct tee_driver_ops - driver operations vtable
* @get_version: returns version of driver
* @get_tee_revision: returns revision string (diagnostic only);
* do not infer feature support from this, use
* TEE_IOC_VERSION instead
* @open: called for a context when the device file is opened
* @close_context: called when the device file is closed
* @release: called to release the context
* @open_session: open a new session
* @close_session: close a session
* @system_session: declare session as a system session
* @invoke_func: invoke a trusted function
* @object_invoke_func: invoke a TEE object
* @cancel_req: request cancel of an ongoing invoke or open
* @supp_recv: called for supplicant to get a command
* @supp_send: called for supplicant to send a response
* @shm_register: register shared memory buffer in TEE
* @shm_unregister: unregister shared memory buffer in TEE
*
* The context given to @open might last longer than the device file if it is
* tied to other resources in the TEE driver. @close_context is called when the
* client closes the device file, even if there are existing references to the
* context. The TEE driver can use @close_context to start cleaning up.
*/
struct tee_driver_ops {
void (*get_version)(struct tee_device *teedev,
struct tee_ioctl_version_data *vers);
int (*get_tee_revision)(struct tee_device *teedev,
char *buf, size_t len);
int (*open)(struct tee_context *ctx);
void (*close_context)(struct tee_context *ctx);
void (*release)(struct tee_context *ctx);
int (*open_session)(struct tee_context *ctx,
struct tee_ioctl_open_session_arg *arg,
struct tee_param *param);
int (*close_session)(struct tee_context *ctx, u32 session);
int (*system_session)(struct tee_context *ctx, u32 session);
int (*invoke_func)(struct tee_context *ctx,
struct tee_ioctl_invoke_arg *arg,
struct tee_param *param);
int (*object_invoke_func)(struct tee_context *ctx,
struct tee_ioctl_object_invoke_arg *arg,
struct tee_param *param);
int (*cancel_req)(struct tee_context *ctx, u32 cancel_id, u32 session);
int (*supp_recv)(struct tee_context *ctx, u32 *func, u32 *num_params,
struct tee_param *param);
int (*supp_send)(struct tee_context *ctx, u32 ret, u32 num_params,
struct tee_param *param);
int (*shm_register)(struct tee_context *ctx, struct tee_shm *shm,
struct page **pages, size_t num_pages,
unsigned long start);
int (*shm_unregister)(struct tee_context *ctx, struct tee_shm *shm);
};
/* Size for TEE revision string buffer used by get_tee_revision(). */
#define TEE_REVISION_STR_SIZE 128
#define TEE_DESC_PRIVILEGED 0x1
/**
* struct tee_desc - Describes the TEE driver to the subsystem
* @name: name of driver
* @ops: driver operations vtable
* @owner: module providing the driver
* @flags: Extra properties of driver, defined by TEE_DESC_* below
*/
struct tee_desc {
const char *name;
const struct tee_driver_ops *ops;
struct module *owner;
u32 flags;
};
Annotation
- Immediate include surface: `linux/cdev.h`, `linux/device.h`, `linux/dma-buf.h`, `linux/idr.h`, `linux/kref.h`, `linux/list.h`, `linux/scatterlist.h`, `linux/tee.h`.
- Detected declarations: `struct tee_device`, `struct tee_driver_ops`, `struct tee_desc`, `struct tee_protmem_pool`, `struct tee_protmem_pool_ops`, `struct tee_shm_pool`, `struct tee_shm_pool_ops`, `enum tee_dma_heap_id`, `function tee_shm_pool_free`, `function tee_shm_is_dynamic`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.