atcwdt_get_index(9)
π atcwdt_get_index(9) π
okay so this is a page from the Kernel API Manual, bestie β atcwdt_get_index(9), yes the whole manual is literally named after it, main character energy fr fr. sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
atcwdt_get_index β get the interval value for the specified timer type π
πΈ SYNOPSIS πΈ
unsigned char atcwdt_get_index (unsigned char index , enum timer_type
timer_type );
like, look at her. she takes two things and gives you back an unsigned char. iconic π
π¦ ARGUMENTS π¦
indexβ the index of the interval in the array. that's it, that's the whole vibe.timer_typeβ the type of timer you're asking about. it can beTMR_RST,TMR_INT_16, orTMR_INT_32. those three, no others, periodt.
π DESCRIPTION π
so what she does π: this function retrieves the interval value based on the timer type, and it also makes sure your index stays inside the valid range for that specific timer type. very much a vibe-check-on-your-index situation. here's the breakdown, bestie, per timer type:
for TMR_RST:
- the maximum array size is
8(index range:0-7).
for TMR_INT_16:
- the maximum array size is
8(index range:0-7).
for TMR_INT_32:
- the maximum array size is
16(index range:0-15).
and now the plot twist π«’ β if your index exceeds the maximum array size, the function will return the last element of the respective array. so it doesn't explode, it doesn't yell at you, it just quietly hands you the last one. no cap. π
heads up bestie: that clamp is the last element of the respective array β which array depends on yourtimer_type, so clock thatTMR_INT_32is the one with the16-sized array and therefore the0-15range. the other two are8and0-7. don't mix them up, i'm begging π
π SEE ALSO π
- kernel file
./drivers/watchdog/atcwdt200_wdt.cβ yes, the whole file, she's linking the file itself, we stan π«Ά enum timer_type(9)struct atcwdt_drv(9)atcwdt_get_clock_period(9)atcwdt_get_timeout_params(9)atcwdt_get_int_timer_type(9)
go read those next, iykyk πβ¨
okay that's the whole page, you ate that π
this lore lives in ./drivers/watchdog, dated October 2026 β so when you're reading this in the future, remember: she was serving kernel watchdog realness before it was cool π₯π mwah, bye bestie π
π¦ 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