tee_shm_alloc_dma_mem(9)
π tee_shm_alloc_dma_mem π
okay so bestie, welcome to the Kernel API Manual entry for tee_shm_alloc_dma_mem(9) β yes that (9) means it's a kernel-internals thing, iykyk β¨
πΈ NAME πΈ
tee_shm_alloc_dma_mem β Allocate DMA memory as shared memory object π
β¨ SYNOPSIS β¨
struct tee_shm * tee_shm_alloc_dma_mem (struct tee_context *ctx , size_t
page_count );
like, it hands you back a struct tee_shm *, no cap π«Ά
π¦ ARGUMENTS π¦
ctxβ the Context that allocates the shared memory, bestie. it's the one doing the allocating πpage_countβ the Number of pages. literally just how many pages we're talking about π
π DESCRIPTION π
so here's the vibe: the memory you allocate here is expected to be lent β like, made inaccessible to the kernel β to the TEE while it's being used, and then returned (accessible to the kernel again) before it's freed. the way that order matters π don't skip the giving-it-back step, fr fr.
also important: this function should normally only be used internally in the TEE drivers. it's giving backstage-pass energy, not front-of-house π
and yeah β it returns a pointer to 'struct tee_shm' π
π SEE ALSO π
Kernel file ./drivers/tee/tee_shm.c β and the whole friend group π
tee_shm_alloc_user_buf(9)tee_shm_alloc_kernel_buf(9)tee_shm_alloc_priv_buf(9)tee_shm_register_user_buf(9)tee_shm_register_kernel_buf(9)tee_shm_get_fd(9)tee_shm_free(9)tee_shm_get_va(9)tee_shm_get_pa(9)tee_shm_get_from_id(9)tee_shm_put(9)
mwah π this page lives under ./drivers/tee and it's dated October 2026 β go read the source, bestie, it slays βπ¦π
π¦ 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