apple_smc_rw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the apple_smc struct. your main character struct fr fr, you gotta hand her over.
  • key β€” the smc_key that the data gets written to. this is the address, the destination, the moment. 🌈
  • wbuf β€” buffer to pull from: size bytes 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: size bytes 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 both wbuf and rbuf, and it means the corresponding wsize / 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:

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