find_slots(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« find_slots(9) β€” a Kernel API Manual moment πŸ’«

okay bestie, so this is a page from the Kernel API Manual, and it's literally called find_slots πŸŽ€ and honestly? the name ate. it does exactly what it says on the tin. let's get into it.


✨ NAME ✨

find_slots β€” find a place to write the given message. that's it. that's the whole vibe. 🫢


🌸 SYNOPSIS 🌸

int find_slots (struct tcs_group *tcs , const struct tcs_request *msg ,
int *tcs_id , int *cmd_id );

like look at that signature. four args, one int coming back at you. no cap, it's giving "small function, big responsibility". πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tcs β€” the tcs group we're gonna search. this is the friend group we're checking for a spare seat. πŸ‘€
  • msg β€” the message we want to find room for. the actual thing that needs a home. 🏠
  • tcs_id β€” if we return 0 from the function, we drop the global ID of the TCS to write to right here. so this is the "where you're going" address, but only on a 0 return. ✨
  • cmd_id β€” if we return 0 from the function, we give you the index of the command array of the returned TCS where the client should start writing the message. so, like, the exact seat number within the right TCS. literally the most helpful little pointer. 🎯
note the pattern bestie: both tcs_id and cmd_id only get filled in when the function returns 0. if it doesn't return 0, don't go reading those, okay? πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

okay so real talk β€” this one is only for use on sleep/wake TCSes, because those are the only ones where we maintain tcs->slots for. like, those are the only ones with slots tracked. so if you're trying to use it anywhere else, that's not the move, that's not the era. periodt. πŸ’€


πŸ”₯ RETURN πŸ”₯

  • -ENOMEM if there was no room 😭 (no seat, no slots, no vibes)
  • else 0 β€” slay, we found a spot πŸ‘‘

🌈 SEE ALSO 🌈

all of this lives in the Kernel file ./drivers/soc/qcom/rpmh-rsc.c β€” go read the whole friend group, they're all connected:


and that's the page, bestie 🧚 go find those slots, iykyk. πŸ’–

signed, sealed, delivered from ./drivers/soc/qcom, dated October 2026 β€” mwah, xoxo πŸ’…πŸŽ€

πŸ“¦ where this page comes from