check_acpi_cpu_flag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… check_acpi_cpu_flag(9) β€” the kernel API manual, bestie edition πŸŽ€

okay so this is a page from the Kernel API Manual, and the star of the show is check_acpi_cpu_flag(9). she's a little function, she answers one question, and she ate. periodt. ✨


🌸 NAME 🌸

check_acpi_cpu_flag β€” Determine if CPU node has a flag set

like, literally just checking whether a CPU node's got a specific flag turned on. that's the whole vibe check. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

int check_acpi_cpu_flag (unsigned int cpu , int rev , u32 flag );

three arguments, all passed in, no cap. 🫢


πŸ“ ARGUMENTS πŸ“

  • cpu β€” Kernel logical CPU number. which CPU are we talking about, bestie? this one. πŸ”₯
  • rev β€” The minimum PPTT revision defining the flag. i.e. the flag only exists from this PPTT revision onward β€” if the table's too old, it's giving ✨nothing✨.
  • flag β€” The flag itself. the actual thing you're checking for. iconic.

πŸ’œ DESCRIPTION πŸ’œ

Check the node representing a CPU for a given flag.

that's it. that's the whole description. she's concise, she's efficient, she's main character energy. 🌈 you hand her a CPU, a minimum PPTT revision, and a flag, and she goes and looks at the node representing that CPU to see if the flag's set. lowkey obsessed with how simple this is. πŸ’…


⭐ RETURN ⭐

so here's what you get back β€” and ngl, the returns are a whole personality:

  • -ENOENT β€” returned if any of these lil situations happen:
    • can't get the CPU's ACPI Processor UID 😭
    • the PPTT doesn't exist πŸ™ˆ
    • the CPU cannot be found πŸ’€
    • the table revision isn't new enough πŸ‘‘
  • 1 β€” any passed flag set. slay, the flag is on. πŸ”₯
  • 0 β€” flag unset. no flag, no problem. πŸ’–
bestie pls note: that negative -ENOENT is a real error code, not a count. don't go treating it like a number of flags, i'm begging. 😭

🌟 SEE ALSO 🌟

the kernel file lives at ./drivers/acpi/pptt.c β€” that's the home base, iykyk. πŸŽ€

and here's the whole friend group, all in (9):

go read them. they're all serving. πŸ§šπŸ’œ


and that's the page, bestie!! 🫢 this whole thing ships out of ./drivers/acpi, dated October 2026, and it's filed under check_acpi_cpu_flag(9) β€” so if you ever forget where you read it, that's the ⭐ header ⭐ right there. bye bye, go check those flags, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from