tee_shm_get_from_id(9)
π tee_shm_get_from_id(9) π
okay so bestie, we're in the Kernel API Manual today and this one is genuinely such a cute little lookup function. no cap, it's short but it matters. let's get into it π«Ά
β¨ NAME β¨
tee_shm_get_from_id β find a shared memory object and bump its reference count π
like, you give it an id, it finds your shm, and it also increases the refcount so nobody snatches it out from under you. main character behaviour fr.
πΈ SYNOPSIS πΈ
struct tee_shm * tee_shm_get_from_id (struct tee_context *ctx , int id );
look at that signature. iconic. two args, one pointer back. π
π¦ ARGUMENTS π¦
ctxβ the context that owns the shared memory, iykyk. it's giving "whose shm is this anyway" energy πidβ the id of the shared memory object. the little name tag. the π on top.
π RETURN π
on success you get a pointer to struct tee_shm β slay, you found it π
on failure you get an ERR_PTR. not NULL, bestie, ERR_PTR. use your IS_ERR() checks, don't come crying to me π
π SEE ALSO π
literally the whole friend group. all of these live in the kernel file ./include/linux/tee_core.h:
struct tee_device(9)struct tee_driver_ops(9)struct tee_desc(9)struct tee_protmem_pool(9)struct tee_protmem_pool_ops(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)teedev_open(9)teedev_close_context(9)teedev_ctx_get(9)teedev_ctx_put(9)
psst β notice tee_shm_put(9) sitting right there in the list? that's your cleanup bestie. refcount goes up, refcount gotta come down. balance. π§
and that's the whole vibe π this page lives in ./include/linux, it's dated October 2026, and it's filed under tee_shm_get_from_id(9). go forth and get your shm, bestie β responsibly, with matching tee_shm_put() πβ¨
π¦ 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