#include <IOKit/IOPlatformExpert.h>
IOKit/IOPlatformExpert.h
enumcoprocessor_type_t
| kCoprocessorVersionNone | 0 | |
| kCoprocessorVersion1 | 65536 | |
| kCoprocessorVersion2 | 131072 |
typedefcoprocessor_type_t
typedef enum coprocessor_type_t coprocessor_type_t;
functionPEGetMachineName
extern boolean_t PEGetMachineName(char * name, int maxLength)
PEGetMachineName() and PEGetModelName() are inconsistent across
architectures, and considered deprecated.
PEGetTargetName() and PEGetProductName() instead.
functionPEGetModelName
extern boolean_t PEGetModelName(char * name, int maxLength)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Deprecated; PEGetModelName and PEGetMachineName are inconsistent across architectures. Use PEGetTargetName and PEGetProductName instead. Copies the platform model string into name (at most maxLength bytes including the terminator) by asking the registered platform expert. On device tree platforms the string is derived from the device tree "compatible" property, with any "AAPL," prefix stripped and '/' and ' ' characters replaced by '-'. Returns TRUE on success, FALSE if no platform expert is registered or the property is unavailable.
functionPEGetTargetName
extern boolean_t PEGetTargetName(char * name, int maxLength)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Copies the platform target name into name (at most maxLength bytes) by asking the registered platform expert. On x86_64 this is the bridge (coprocessor) model from the device tree, or an empty string when no bridge is present; on other architectures it is the same string PEGetModelName returns. With PEGetProductName, replaces the deprecated PEGetMachineName/PEGetModelName pair. Returns FALSE if no platform expert is registered.
functionPEGetProductName
extern boolean_t PEGetProductName(char * name, int maxLength)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Copies the platform product name into name (at most maxLength bytes) by asking the registered platform expert. On x86_64 this is the model string (device tree "compatible" based); on other architectures it is the machine name from the device tree. With PEGetTargetName, replaces the deprecated PEGetMachineName/PEGetModelName pair. Returns FALSE if no platform expert is registered.
functionPEGetPlatformEpoch
extern int PEGetPlatformEpoch(void)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Returns the platform epoch, the boot ROM type value the platform expert recorded at initialization (IOPlatformExpert::getBootROMType). Returns -1 if no platform expert is registered.
enum(anonymous)
| kPEHaltCPU | 0 | |
| kPERestartCPU | 1 | |
| kPEHangCPU | 2 | |
| kPEUPSDelayHaltCPU | 3 | |
| kPEPanicRestartCPU | 4 | |
| kPEPanicSync | 5 | |
| kPEPagingOff | 6 | |
| kPEPanicBegin | 7 | |
| kPEPanicEnd | 8 | |
| kPEPanicRestartCPUNoCallouts | 9 | |
| kPEPanicDiagnosticsDone | 10 | |
| kPEPanicDiagnosticsInProgress | 11 |
macrokPanicDetailsForcePowerOff
Bitmask of details related to panic callouts
#define kPanicDetailsForcePowerOff 0x1
variablePE_halt_restart
extern int (*PE_halt_restart)(unsigned int type)
functionPEHaltRestart
extern int PEHaltRestart(unsigned int type)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Initiates a platform halt, restart, or panic-time platform action. For kPEHaltCPU, kPERestartCPU and kPEUPSDelayHaltCPU, notifies power management clients registered via IOService::registerInterest (synchronously, through the PM root domain's handlePlatformHaltRestart), after arming a watchdog timer (default 30 seconds, overridable by the device tree halt-restart-timeout property) that panics or forces the shutdown to proceed if notification hangs. For kPEPanicBegin, kPEPanicSync, kPEPanicRestartCPU, kPEPanicRestartCPUNoCallouts, kPEPanicDiagnosticsDone and kPEPanicDiagnosticsInProgress, runs the registered platform panic actions (IOCPURunPlatformPanicActions) and syncs the panic buffers. Finally calls the platform expert's haltRestart method with the type; the platform decides what action to take. Returns -1 if no platform expert is registered.
functionPESavePanicInfo
extern UInt32 PESavePanicInfo(UInt8 *buffer, UInt32 length)
Save the Panic Info. Returns the number of bytes saved.
functionPESavePanicInfoAction
extern void PESavePanicInfoAction(void *buffer, UInt32 offset, UInt32 length)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Runs the registered platform panic sync actions (IOCPURunPlatformPanicSyncAction) for the given region of the panic buffer. Called during panic to flush length bytes at offset within buffer out to platform panic storage.
macroPANIC_FLUSH_BOUNDARY
SMC requires that all data is flushed in multiples of 16 bytes at 16 byte
boundaries.
#define PANIC_FLUSH_BOUNDARY 16
functionPEGetGMTTimeOfDay
extern long PEGetGMTTimeOfDay(void)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Returns the current time of day, in seconds since the epoch, from the platform calendar clock (RTC). Wrapper for PEGetUTCTimeOfDay that discards the microseconds; returns 0 if no platform expert is registered.
functionPESetGMTTimeOfDay
extern void PESetGMTTimeOfDay(long secs)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Sets the platform calendar clock (RTC) to secs seconds since the epoch. Equivalent to PESetUTCTimeOfDay(secs, 0).
functionPEGetUTCTimeOfDay
extern void PEGetUTCTimeOfDay(clock_sec_t * secs, clock_usec_t * usecs)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Returns the current time of day from the platform calendar clock (RTC) in *secs (seconds since the epoch) and *usecs (microseconds), by way of the platform expert's getUTCTimeOfDay. *secs is 0 if no platform expert is registered.
functionPESetUTCTimeOfDay
extern void PESetUTCTimeOfDay(clock_sec_t secs, clock_usec_t usecs)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Sets the platform calendar clock (RTC) to secs seconds plus usecs microseconds since the epoch, by way of the platform expert's setUTCTimeOfDay. usecs must be less than USEC_PER_SEC. Does nothing if no platform expert is registered.
functionPEWriteNVRAMBooleanProperty
extern boolean_t PEWriteNVRAMBooleanProperty(const char *symbol, boolean_t value)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
functionPEWriteNVRAMProperty
extern boolean_t PEWriteNVRAMProperty( const char *symbol, const void *value, const unsigned int len )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Stores len bytes at value as an OSData property named symbol in NVRAM (the /options entry of the device tree plane), then syncs NVRAM to force the write out. The symbol string is referenced without being copied (OSSymbol::withCStringNoCopy), so it must remain valid, e.g. a string constant; use PEWriteNVRAMPropertyWithCopy for a transient name. Returns TRUE on success; FALSE if any argument is NULL or zero or NVRAM is unavailable.
functionPEWriteNVRAMPropertyWithCopy
extern boolean_t PEWriteNVRAMPropertyWithCopy( const char *symbol, const void *value, const unsigned int len )
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Identical to PEWriteNVRAMProperty except that the symbol string is copied (OSSymbol::withCString), so the caller's name buffer need not remain valid after the call. Stores len bytes at value under symbol in NVRAM and syncs; returns TRUE on success.
functionPEReadNVRAMProperty
extern boolean_t PEReadNVRAMProperty(const char *symbol, void *value, unsigned int *len)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Copies the value of the NVRAM property named symbol (from the /options entry of the device tree plane) into value. On entry *len is the size of the caller's buffer; on success *len is set to the property's actual length and at most the lesser of the two is copied. value may be NULL to query the length only. Returns TRUE if the property exists as an OSData object; FALSE if symbol or len is NULL, NVRAM is unavailable, or the property is missing or not data.
functionPEReadNVRAMBooleanProperty
extern boolean_t PEReadNVRAMBooleanProperty(const char *symbol, boolean_t *value)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
functionPERemoveNVRAMProperty
extern boolean_t PERemoveNVRAMProperty(const char *symbol)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
functionPESyncNVRAM
extern boolean_t PESyncNVRAM(void)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Forces pending NVRAM changes to be flushed to the backing store by syncing the /options registry entry, if NVRAM has been initialized. Always returns TRUE.
functionPEGetCoprocessorVersion
extern coprocessor_type_t PEGetCoprocessorVersion(void)
▾
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu iokit/Kernel/IOPlatformExpert.cpp
Returns the version of the platform coprocessor (bridge) on Intel Macs, read from the apple-coprocessor-version property of the device tree :/efi/platform entry: kCoprocessorVersionNone, kCoprocessorVersion1, or kCoprocessorVersion2 (e.g. Apple T2). Always returns kCoprocessorVersionNone on non-x86_64 kernels. The value gates coprocessor-aware behavior such as cross panics and shutdown handling.
macrokIOPlatformMapperPresentKey
#define kIOPlatformMapperPresentKey "IOPlatformMapperPresent"
variablegPlatformInterruptControllerName
extern OSSymbol * gPlatformInterruptControllerName
variablegIOPlatformSleepActionKey
IOPlatformSleepAction
Sleep is called after power management has finished all of the power plane
driver power management notifications and state transitions and has
committed to sleep, but before the other CPUs are powered off.
The scheduler is still active.
extern const OSSymbol *gIOPlatformSleepActionKey
variablegIOPlatformWakeActionKey
IOPlatformWakeAction
Wake is called with the scheduler enabled, but before
powering on other CPUs, so try to minimize work done in this path to speed
up wake time.
extern const OSSymbol *gIOPlatformWakeActionKey
variablegIOPlatformQuiesceActionKey
IOPlatformQuiesceAction
Quiesce is called after all CPUs are off, scheduling is disabled,
and the boot CPU is about to pull the plug.
Mutexes and blocking are disallowed in this context and will panic.
Do not pass this action to super() (incl. IOService, IOPlatformExpert)
extern const OSSymbol *gIOPlatformQuiesceActionKey
variablegIOPlatformActiveActionKey
IOPlatformActiveAction
Active is called very early in the wake path before enabling the scheduler
on the boot CPU.
Mutexes and blocking are disallowed in this context and will panic.
Do not pass this action to super() (incl. IOService, IOPlatformExpert)
extern const OSSymbol *gIOPlatformActiveActionKey
variablegIOPlatformHaltRestartActionKey
IOPlatformHaltRestartAction
Halt/Restart is called after the kernel finishes shutting down the
system and is ready to power off or reboot.
It is not guaranteed to be called in non-graceful shutdown scenarios.
extern const OSSymbol *gIOPlatformHaltRestartActionKey
variablegIOPlatformPanicActionKey
IOPlatformPanicAction
Panic is called when the system is panicking before it records a core file
(if it is configured to do so)
It can be called at any time, in any context, in any state. Don't depend
on anything being powered on in a useful state.
Mutexes and blocking are disallowed in this context and will fail.
If you hang or panic again in this callout, the panic log may not be recorded,
leading to the loss of field reports about customer issues.
extern const OSSymbol *gIOPlatformPanicActionKey