apple_smc_rw(9)
π apple_smc_rw(9) β the Kernel API Manual, but make it cute
okay so real talk, bestie: this page lives in the Kernel API Manual and it's called apple_smc_rw(9), which ngl sounds like a rare PokΓ©mon but is actually a kernel function for talking to the SMC. let's get into it π
β¨ NAME β¨
apple_smc_rw β write and then read using the given SMC key
like, in that order. write first, read second. it's giving two-for-one. π
π¦ SYNOPSIS π¦
int apple_smc_rw (struct apple_smc *smc , smc_key key , const void *wbuf
, size_t wsize , void *rbuf , size_t rsize );
yeah she's a long one, but honestly? iconic. returns an int, takes six args, no notes. β¨
π ARGUMENTS π
smcβ pointer to theapple_smcstruct. your main character struct fr fr, you gotta hand her over.keyβ thesmc_keythat the data gets written to. this is the address, the destination, the moment. πwbufβ buffer to pull from:sizebytes of data get written from here into the SMC. lowkey the source of truth.wsizeβ how many bytes get written. literally a number. count 'em. π₯rbufβ buffer where the data lands:sizebytes get read from the SMC into it. the comeback arc.rsizeβ how many bytes get read. again, just a number, but she matters. π
bestie reminder: the original says "size bytes" for bothwbufandrbuf, and it means the correspondingwsize/rsize. don't come for me, I'm just the messenger. π
β RETURN β
0(zero) on success β slay π- negative errno on error β not slay π
that's it. no in-between. binary queen.
π SEE ALSO π
kernel file ./include/linux/mfd/macsmc.h plus the whole friend group:
smc_key(9)SMC_KEY(9)struct apple_smc_key_info(9)enum apple_smc_boot_stage(9)struct apple_smc(9)apple_smc_read(9)apple_smc_write(9)apple_smc_enter_atomic(9)apple_smc_write_atomic(9)apple_smc_get_key_by_index(9)apple_smc_get_key_info(9)apple_smc_key_exists(9)
go read all of them, iykyk π§
one thing though: this is a kernel manpage, so if you're out here in userspace trying to call apple_smc_rw directly β no. this is for kernel drivers using the macsmc MFD stuff. respect the layer, bestie. π«Ά
and that's the whole page!! tysm for reading to the end, you're literally the best. this one ships from the path ./include/linux/mfd and was dated October 2026 β so mark your calendars, she's from the future πΈβ¨π
π¦ 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