STRUCT TEE_PROTMEM_POOL_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the pool, an sgt, a size, and an offs pointer, and it returns an int like a good little function.
  • free β€” called when freeing protected memory. the cleanup era 🧹 takes the pool and the sgt, returns void, 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 the parent_shm of the memory pool πŸ‘‘ this one's got two jobs and honestly? it's handling both. takes pool, sgt, offs, shm, and the parent_shm double-pointer, returns int.
  • destroy_pool β€” called when destroying the pool πŸ’€ the final boss. takes the pool, returns void. 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:


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