STRUCT TEE_PROTMEM_POOL_OPS(9)
π struct tee_protmem_pool_ops(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for struct tee_protmem_pool_ops, and it is literally the blueprint for how your protected memory pool does its whole job. no cap, it's giving "job description for a memory pool" and we're obsessed π«Ά
πΈ NAME πΈ
struct tee_protmem_pool_ops β protected memory pool operations π
like. the operations. for the protected memory pool. that's the vibe check and it passed π
β¨ SYNOPSIS β¨
struct tee_protmem_pool_ops {
int (*alloc)(struct tee_protmem_pool *pool, struct sg_table *sgt,
size_t size, size_t *offs);
void (*free)(struct tee_protmem_pool *pool, struct sg_table *sgt);
int (*update_shm)(struct tee_protmem_pool *pool, struct sg_table
*sgt, size_t offs, struct tee_shm *shm, struct tee_shm **parent_shm);
void (*destroy_pool)(struct tee_protmem_pool *pool);
};
four function pointers, one iconic little struct, and a whole lot of responsibility π copy it exactly bestie, the compiler is not forgiving and neither is the kernel π₯
π Members π
okay so this is the part where each function pointer gets its moment in the spotlight. main character energy for all four, fr fr π
allocβ called when allocating protected memory. this is the "gimme the goods" callback π it takes thepool, ansgt, asize, and anoffspointer, and it returns anintlike a good little function.freeβ called when freeing protected memory. the cleanup era π§Ή takes thepooland thesgt, returnsvoid, no drama, no return value, just vibes πupdate_shmβ called when registering a dma-buf to update the shm with physical address of the buffer, or to return theparent_shmof the memory pool π this one's got two jobs and honestly? it's handling both. takespool,sgt,offs,shm, and theparent_shmdouble-pointer, returnsint.destroy_poolβ called when destroying the pool π the final boss. takes thepool, returnsvoid. pour one out π
π¦ SEE ALSO π¦
everything below lives in the kernel file ./include/linux/tee_core.h β go read it, iykyk πβ¨ and then go read literally all of these:
struct tee_device(9)struct tee_driver_ops(9)struct tee_desc(9)struct tee_protmem_pool(9)tee_device_alloc(9)tee_device_register(9)tee_device_unregister(9)tee_device_get(9)tee_device_put(9)tee_device_set_dev_groups(9)tee_session_calc_client_uuid(9)struct tee_shm_pool(9)struct tee_shm_pool_ops(9)tee_shm_pool_free(9)tee_protmem_static_pool_alloc(9)tee_get_drvdata(9)tee_shm_alloc_priv_buf(9)tee_shm_is_dynamic(9)tee_shm_put(9)tee_shm_get_id(9)tee_shm_get_from_id(9)teedev_open(9)teedev_close_context(9)teedev_ctx_get(9)teedev_ctx_put(9)
bestie pls don't skip the SEE ALSO list, it's literally 25 whole pages of lore and you will need them ππ
and that's the page!! π it lives down in ./include/linux, dated October 2026, and it's filed under struct tee_protmem_pool_ops(9) in the Kernel API Manual π slay, you read the whole thing, i'm so proud of you π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms