add_registry(9)
π
add_registry(9) β bestie's guide to the add_registry kernel API β¨
okay so real talk, this is a page from the Kernel API Manual, and it's about add_registry(9). yes we're doing kernel internals today and yes you're gonna slay it π«Ά
β¨ NAME β¨
add_registry β adds a registry entry π
like, that's literally it. that's the whole vibe. a registry entry gets added. iconic behavior honestly π
πΈ SYNOPSIS πΈ
int add_registry (struct nvkm_gsp *gsp , const char *key , enum
registry_type type , const void *data , size_t length );
not me writing out the whole signature exactly how it is, because details are everything π
π¦ ARGUMENTS π¦
gspβ thegsppointer. that's the whole description bestie, don't come for me, that's what the page says π«Άkeyβ name of the registry key. this is what you're calling it, so choose wisely β¨typeβ type of data. because the function does need to know what it's holding. main character energy from this parameter ngl πdataβ pointer to value. like, the actual goods π¦lengthβ size of data, in bytes. so it knows wheredataends, obviously π§
π₯ DESCRIPTION π₯
okay so what does it do. add_registry adds a registry key/value pair to the registry database. that's the whole thing. key goes in, value goes in, they're a pair, they live in the database now. periodt π
here's the β¨ behind the scenes β¨ though: this function collects the registry information in a linked list. so it's not just yeeting your data into the void, it's building a list. and after all the registry keys have been added, build_registry is used to create the RPC data structure. so like, the actual final form comes later, this is the collecting phase. no cap π¦
also super important detail: registry_rpc_size is a running total of the size of all registry keys. why do we care? because it's used to avoid an O(n) calculation of the size when the RPC is built. so we're doing the math as we go instead of recounting everything at the end. efficient queen behavior, honestly π
β¨
and the return situation: it returns 0 on success, or a negative error code on error. so if you get something negative back, that's not a vibe, that's an error π
π SEE ALSO π
grab a snack, this list is long but we're getting through it together π
- Kernel file
./drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.cβ go read the source, iykyk π₯ nvkm_gsp_mem_ctor(9)struct registry_list_entry(9)build_registry(9)clean_registry(9)strip(9)r535_gsp_rpc_set_registry(9)r535_gsp_msg_run_cpu_sequencer(9)struct rpc_ucode_libos_print_v1e_08(9)r535_gsp_msg_libos_print(9)create_debugfs(9)r535_gsp_libos_debugfs_init(9)create_pte_array(9)r535_gsp_libos_init(9)nvkm_gsp_radix3_sg(9)r535_debugfs_shutdown(9)is_empty(9)r535_gsp_copy_log(9)r535_gsp_retain_logging(9)r535_gsp_libos_debugfs_fini(9)
that's all nineteen of them, in order, nothing skipped, because we do not leave a single reference behind in this group chat πΈπ
and that's the page!! mwah π this one lives at ./drivers/gpu/drm/nouveau/nvkm... and it's dated October 2026. go forth and add those registry entries, bestie β you're literally the main character of the registry database now πππ
π¦ 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