atcwdt_get_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 be TMR_RST, TMR_INT_16, or TMR_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 your timer_type, so clock that TMR_INT_32 is the one with the 16-sized array and therefore the 0-15 range. the other two are 8 and 0-7. don't mix them up, i'm begging πŸ™ˆ

🌈 SEE ALSO 🌈

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