drivers/tee/amdtee/amdtee_if.h
Source file repositories/reference/linux-study-clean/drivers/tee/amdtee/amdtee_if.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/tee/amdtee/amdtee_if.h- Extension
.h- Size
- 5161 bytes
- Lines
- 186
- 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/types.h
Detected Declarations
struct memrefstruct valuestruct tee_operationstruct tee_sg_descstruct tee_sg_liststruct tee_cmd_map_shared_memstruct tee_cmd_unmap_shared_memstruct tee_cmd_load_tastruct tee_cmd_unload_tastruct tee_cmd_open_sessionstruct tee_cmd_close_sessionstruct tee_cmd_invoke_cmd
Annotated Snippet
struct memref {
u32 buf_id;
u32 offset;
u32 size;
};
struct value {
u32 a;
u32 b;
};
/*
* Parameters passed to open_session or invoke_command
*/
union tee_op_param {
struct memref mref;
struct value val;
};
struct tee_operation {
u32 param_types;
union tee_op_param params[TEE_MAX_PARAMS];
};
/* Must be same as in GP TEE specification */
#define TEE_OP_PARAM_TYPE_NONE 0
#define TEE_OP_PARAM_TYPE_VALUE_INPUT 1
#define TEE_OP_PARAM_TYPE_VALUE_OUTPUT 2
#define TEE_OP_PARAM_TYPE_VALUE_INOUT 3
#define TEE_OP_PARAM_TYPE_INVALID 4
#define TEE_OP_PARAM_TYPE_MEMREF_INPUT 5
#define TEE_OP_PARAM_TYPE_MEMREF_OUTPUT 6
#define TEE_OP_PARAM_TYPE_MEMREF_INOUT 7
#define TEE_PARAM_TYPE_GET(t, i) (((t) >> ((i) * 4)) & 0xF)
#define TEE_PARAM_TYPES(t0, t1, t2, t3) \
((t0) | ((t1) << 4) | ((t2) << 8) | ((t3) << 12))
/*****************************************************************************
** TEE Commands
*****************************************************************************/
/*
* The shared memory between rich world and secure world may be physically
* non-contiguous. Below structures are meant to describe a shared memory region
* via scatter/gather (sg) list
*/
/**
* struct tee_sg_desc - sg descriptor for a physically contiguous buffer
* @low_addr: [in] bits[31:0] of buffer's physical address. Must be 4KB aligned
* @hi_addr: [in] bits[63:32] of the buffer's physical address
* @size: [in] size in bytes (must be multiple of 4KB)
*/
struct tee_sg_desc {
u32 low_addr;
u32 hi_addr;
u32 size;
};
/**
* struct tee_sg_list - structure describing a scatter/gather list
* @count: [in] number of sg descriptors
* @size: [in] total size of all buffers in the list. Must be multiple of 4KB
* @buf: [in] list of sg buffer descriptors
*/
#define TEE_MAX_SG_DESC 64
struct tee_sg_list {
u32 count;
u32 size;
struct tee_sg_desc buf[TEE_MAX_SG_DESC];
};
/**
* struct tee_cmd_map_shared_mem - command to map shared memory
* @buf_id: [out] return buffer ID value
* @sg_list: [in] list describing memory to be mapped
*/
struct tee_cmd_map_shared_mem {
u32 buf_id;
struct tee_sg_list sg_list;
};
/**
* struct tee_cmd_unmap_shared_mem - command to unmap shared memory
* @buf_id: [in] buffer ID of memory to be unmapped
*/
struct tee_cmd_unmap_shared_mem {
u32 buf_id;
};
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct memref`, `struct value`, `struct tee_operation`, `struct tee_sg_desc`, `struct tee_sg_list`, `struct tee_cmd_map_shared_mem`, `struct tee_cmd_unmap_shared_mem`, `struct tee_cmd_load_ta`, `struct tee_cmd_unload_ta`, `struct tee_cmd_open_session`.
- 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.