add_registry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the gsp pointer. 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 where data ends, 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 πŸ’œ

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