BUILD_PERCPU_HELPER(9)
π BUILD_PERCPU_HELPER β like, the kernel API manual, section 9, bestie β¨
Okay so this is the page for BUILD_PERCPU_HELPER(9) β yes, all caps, yes it's a macro, and yes it's giving "tiny macro, huge responsibility" energy. It lives in the Kernel API Manual (section 9, iykyk) and honestly? Underrated. Let's get into it π«Ά
πΈ NAME πΈ
BUILD_PERCPU_HELPER β literally the helper that calls a CDMM driver callback on the right CPU. That's the whole vibe check: right CPU, no cap π
β¨ SYNOPSIS β¨
BUILD_PERCPU_HELPER (_ret , _name );
That's it. Two args. She's lowkey minimal and I respect it so much π
π ARGUMENTS π
_retβ the return type, and listen, it's literally justvoidorint. That's the whole list. Pick one, bestie β¨_nameβ the name of the CDMM driver callback function. Yep, you're handing over the name and the macro does its little magic with it πͺ
π DESCRIPTION π
So what does it actually do? It generates a specific device callback function for you β one that calls a CDMM driver callback function on the appropriate CPU for the device. And if that applies, it returns the result too. Basically it's the matchmaker: device β‘οΈ correct CPU, no awkward misdirected calls ππ₯
Like, you don't write the per-CPU wrapper by hand. BUILD_PERCPU_HELPER builds it. Main character energy fr fr π
π¦ SEE ALSO π¦
Everything is connected, bestie, and this page is a whole friend group. Go meet them:
- Kernel file
./drivers/bus/mips_cdmm.c(the source, the origin story π) struct mips_cdmm_work_dev(9)mips_cdmm_void_work(9)mips_cdmm_int_work(9)mips_cdmm_driver_register(9)mips_cdmm_driver_unregister(9)struct mips_cdmm_bus(9)mips_cdmm_get_bus(9)mips_cdmm_cur_base(9)mips_cdmm_phys_base(9)mips_cdmm_setup(9)mips_cdmm_early_probe(9)mips_cdmm_release(9)mips_cdmm_bus_discover(9)BUILD_PERDEV_HELPER(9)β this one's the sibling macro, obsessed πmips_cdmm_cpu_down_prep(9)mips_cdmm_cpu_online(9)mips_cdmm_init(9)
Pro tip from me to you: the manpage lists all of these as plain references β I'm not adding lore that isn't there. Go read them if you want the full tea β
Okay that's the page!! Sending you off with the little footer deets so nothing gets lost: this one's from ./drivers/bus, dated October 2026, and it's filed under BUILD_PERCPU_HELPER(9). Slay, go build your per-CPU helper πβ¨π
π¦ 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