acpi_count_levels(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ acpi_count_levels(9) ✨

okay so bestie, welcome to the acpi_count_levels page β€” it lives in the Kernel API Manual and honestly? it's giving "little function, big job" πŸ’…


πŸŽ€ NAME πŸŽ€

acpi_count_levels β€” given a PPTT table and a CPU node, this one counts the total number of levels and the split cache levels (data/instruction). yes, both. she's multitasking, we love that for her 🫢


🌸 SYNOPSIS 🌸

int acpi_count_levels (struct acpi_table_header *table_hdr , struct
acpi_pptt_processor *cpu_node , unsigned int *split_levels );

three arguments, returns an int, no drama. iconic behavior ngl ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • table_hdr β€” pointer to the head of the PPTT table. literally the starting point of the whole vibe check 🧚
  • cpu_node β€” the processor node we wish to count caches for. this is the main character of the operation πŸ‘‘
  • split_levels β€” number of split cache levels (data/instruction) if success. and listen β€” this can be NULL. yep, she's optional, no cap πŸ’€

πŸ’œ RETURN πŸ’œ

returns the number of levels. here's the tea though, bestie β€” how it actually gets there is kinda cute:

given a processor node containing a processing unit, it walks into it and counts how many levels exist solely for it, and then walks up each level until we hit the root node. (it ignores the package level, because it may be possible to have caches that exist across packages β€” so like, not relevant to this count, we don't claim her 🚫)

and on the way up? it counts the number of cache levels and the split cache levels (data/instruction) that exist at each level. so it's counting the whole way, both directions. obsessed with the dedication tbh 🌈⭐


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/acpi/pptt.c β€” go read her, she's the source of truth πŸ“

and the whole friend group 🫢:


and that's the whole page, bestie πŸ’–βœ¨

cute lil sign-off: this one's filed under ./drivers/acpi and stamped October 2026 β€” so like, future-coded but make it kernel πŸŒΈπŸŽ€ go count some levels, you got this fr fr πŸ’…

πŸ“¦ where this page comes from