STRUCT APPLE_SMC(9)
π NAME π
okay so welcome to struct apple_smc(9) from the Kernel API Manual β literally the main character struct of this whole page. bestie, the original NAME line is kinda shy and gives us no description at all (it's just the name and a dash), so all the actual tea is down in the synopsis and the members list. no cap. π
β¨ SYNOPSIS β¨
here's the whole vibe, copied exactly so you can trust me:
struct apple_smc {
struct device *dev;
u32 key_count;
smc_key first_key;
smc_key last_key;
struct blocking_notifier_head event_handlers;
struct apple_rtkit *rtk;
struct completion init_done;
enum apple_smc_boot_stage boot_stage;
struct resource *sram;
void __iomem *sram_base;
struct apple_rtkit_shmem shmem;
unsigned int msg_id;
bool atomic_mode;
bool atomic_pending;
struct completion cmd_done;
u64 cmd_ret;
struct mutex mutex;
spinlock_t lock;
};
like, look at her. she's structured. she's organized. she contains multitudes. π«Ά
π MEMBERS π
every single field, explained, no gatekeeping:
devβ the underlyingstruct devicefor the physical backend device. like, whose struct even is this? this one. πkey_countβ how many SMC keys are available. the headcount, basically. πfirst_keyβ the first valid SMC key. the beginning of the alphabet era. β¨last_keyβ the last valid SMC key. the end of an era. πevent_handlersβ the notifier call chain for events received from SMC. she's got a whole group chat for events. π¦rtkβ pointer to the Apple RTKit instance. lowkey essential. π₯init_doneβ a completion for initialization. she'll text you when she's ready, fr. πboot_stageβ the current boot stage of SMC. where is she in her life rn. π±sramβ pointer to the SRAM resource. β¨sram_baseβ the SRAM base address. the literal starting point, iykyk. πshmemβ the RTKit shared memory structure for SRAM. sharing is caring bestie. π«Άmsg_idβ the current message id for commands β and heads up, it gets incremented for each command. number go up. π’atomic_modeβ flag set when atomic mode is entered. she's in her atomic era. πatomic_pendingβ flag indicating a pending atomic command. the "seen at 3:14" of flags. πcmd_doneβ completion for command execution in non-atomic mode. πcmd_retβ return value from SMC for the last command. the receipts. π§Ύmutexβ mutex for non-atomic mode. one at a time, bestie. πlockβ spinlock for atomic mode. spin spin spin, iconic. π
notice howmutexis for non-atomic andlockis for atomic? don't mix them up, that's the whole point of having both. periodt. π
πΈ SEE ALSO πΈ
go read these next, they're all linked up and everything:
- the kernel file
./include/linux/mfd/macsmc.hπ smc_key(9)SMC_KEY(9)struct apple_smc_key_info(9)enum apple_smc_boot_stage(9)apple_smc_read(9)apple_smc_write(9)apple_smc_enter_atomic(9)apple_smc_write_atomic(9)apple_smc_rw(9)apple_smc_get_key_by_index(9)apple_smc_get_key_info(9)apple_smc_key_exists(9)
okay that's the whole page, go be a kernel dev now π
sign-off moment: this icon lives in ./include/linux/mfd, dated October 2026, and she's filed under struct apple_smc(9). slay. πβ¨
π¦ 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