find_slots(9)
π« 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 return0from 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 a0return. β¨cmd_idβ if we return0from 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: bothtcs_idandcmd_idonly get filled in when the function returns0. if it doesn't return0, 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 π₯
-ENOMEMif 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:
tcs_invalidate(9)rpmh_rsc_invalidate(9)get_tcs_for_msg(9)get_req_from_tcs(9)__tcs_set_trigger(9)enable_tcs_irq(9)tcs_tx_done(9)__tcs_buffer_write(9)check_for_req_inflight(9)find_free_tcs(9)claim_tcs_for_req(9)rpmh_rsc_send_data(9)rpmh_rsc_write_ctrl_data(9)rpmh_rsc_ctrlr_is_busy(9)rpmh_rsc_write_next_wakeup(9)rpmh_rsc_cpu_pm_callback(9)rpmh_rsc_pd_callback(9)
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
- 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