Kernel (KEXT)

Kernel.framework is the API surface a kernel extension compiles against: kern/ synchronization and scheduling primitives, kernel-side Mach and BSD interfaces, network and filesystem KPIs, libkern, and IOKit. Compiled with KERNEL defined, arm64. Kexts are deprecated in favor of DriverKit, but this remains the definitive description of the in-kernel C surface.

kern/ primitives

kern/arithmetic_128.hCode duplicated from Libc/gen/nanosleep.c
kern/circle_queue.hCircle Queue Management APIs
kern/coalition.honly kernel-private interfaces
kern/energy_perf.hInterfaces for non-kernel managed devices to inform the kernel of their
kern/exc_guard.hEXC_GUARD related macros, namespace etc.
kern/exc_resource.hEXC_RESOURCE related macros, namespace etc.
kern/extmod_statistics.hkern/extmod_statistics.h
kern/host.hkern/host.h
kern/hv_support_kern.hhv_support_kern.h: machine-independent hypervisor helpers for kernel use
kern/hvg_hypercall.hArchitecture-independent definitions (exported to userland)
kern/ipc_mig.hSend a message from the kernel
kern/kcdata.h THE KCDATA MANIFESTO
kern/ledger.hledger_t, ledger_entry_id_t
kern/percpu.hFor PAGE_MASK
kern/policy_internal.hInterfaces for functionality implemented in task_ or thread_policy subsystem
kern/priority_queue.hA generic priorty ordered queue implementation based on pairing heaps.
kern/thread_call.h@header thread_call.h
kern/thread_group.hThread group support routines.
kern/timer_call.hThe timer_call system is responsible for manipulating timers that call
kern/trustcache.hVersion 1 trust caches: Always sorted by cdhash, added hash type and flags field.

Mach (kernel)

mach/arm/sdt_isa.hOnly define when testing. This makes the calls into actual calls to
mach/arm/syscall_sw.hFILE_ID: syscall_sw.h
mach/arm/thread_status.hFILE_ID: thread_status.h
mach/arm/vm_param.hFILE_ID: vm_param.h
mach/mach_host.hModule mach_host
mach/mach_port.hModule mach_port
mach/mach_vm.hModule mach_vm
mach/machine/sdt.hInclude arch specific macro definitions for SDT probes.
mach/port.hNOTICE: This file was modified by McAfee Research in 2004 to introduce
mach/semaphore.hForward Declarations
mach/shared_memory_server.hFile: mach/shared_memory_server.h
mach/shared_region.hFile: mach/shared_region.h
mach/task.hModule task
mach/task_info.hMachine-independent task information structures and definitions.
mach/thread_act.hModule thread_act
mach/vm_map.hModule vm_map
mach/vm_types.h(err_vm | err_sub(2)) reserved: vm_map_lock

BSD (kernel)

sys/_types.hType definitions; takes common type definitions that must be used
sys/_types/_fd_def.h__int32_t and uintptr_t
sys/_types/_user_timespec.hLP64 version of struct timespec. time_t is a long and must grow when
sys/_types/_va_list.h__darwin_va_list
sys/constrained_ctypes.hConstraining pointer types based on contracts.
sys/disk.hDefinitions
sys/imgact.hNOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
sys/kauth.hNOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
sys/kern_control.h@header kern_control.h
sys/kern_event.h@header kern_event.h
sys/kernel_types.hMacros(?) to clear/set/test flags.
sys/kpi_mbuf.h@header kpi_mbuf.h
sys/kpi_socket.h@header kpi_socket.h
sys/kpi_socketfilter.h@header kpi_socketfilter.h
sys/md5.hWarn developers that this header file is kept for legacy reasons.
sys/msg.h$NetBSD: msg.h,v 1.4 1994/06/29 06:44:43 cgd Exp $
sys/sem.h$NetBSD: sem.h,v 1.5 1994/06/29 06:45:15 cgd Exp $
sys/shm.h$NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $
sys/ubc.hHeader file for Unified Buffer Cache.
sys/ucontext.huser_addr_t, user_size_t

Networking KPIs

net/ethernet.hFundamental constants relating to ethernet.
net/init.h@header init.h
net/kpi_interface.h@header kpi_interface.h
net/kpi_interfacefilter.h@header kpi_interfacefilter.h
net/kpi_protocol.h@header kpi_protocol.h
netinet6/ah.h$FreeBSD: src/sys/netinet6/ah.h,v 1.3.2.2 2001/07/03 11:01:49 ume Exp $
netinet6/esp.h$FreeBSD: src/sys/netinet6/esp.h,v 1.2.2.2 2001/07/03 11:01:49 ume Exp $
netinet6/ipcomp.h$FreeBSD: src/sys/netinet6/ipcomp.h,v 1.1.2.2 2001/07/03 11:01:54 ume Exp $
netinet6/ipsec.h$FreeBSD: src/sys/netinet6/ipsec.h,v 1.4.2.2 2001/07/03 11:01:54 ume Exp $
netinet6/raw_ip6.h$FreeBSD: src/sys/netinet6/raw_ip6.h,v 1.1.2.1 2001/07/03 11:01:55 ume Exp $
netinet/icmp6.h$KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $
netinet/kpi_ipfilter.h@header kpi_ipfilter.h

libkern & os

libkern/_OSByteOrder.hMacros for swapping constant values in the preprocessing stage.
libkern/arm/_OSByteOrder.hGeneric byte swapping functions.
libkern/c++/OSArray.hIOArray.h created by rsulack on Thu 11-Sep-1997
libkern/c++/OSBoolean.hOSBoolean.cpp created by rsulack on Tue Oct 12 1999
libkern/c++/OSCollection.hIOCollection.h created by gvdl on Thu 1998-10-22
libkern/c++/OSCollectionIterator.hIOCollectionIterator.h created by gvdl on Fri 1998-10-30
libkern/c++/OSContainers.hIOContainers.h created by rsulack on Fri 26-Jun-1998
libkern/c++/OSData.hIOData.h created by rsulack on Wed 17-Sep-1997
libkern/c++/OSEndianTypes.hxx-review: are these even used anywhere? Grep turns up squat.
libkern/c++/OSMetaClass.hLIBKERN_ macros below can be used to describe the ownership semantics
libkern/c++/OSNumber.hIOOffset.h created by rsulack on Wed 17-Sep-1997
libkern/c++/OSSerialize.hOSSerialize.h created by rsulack on Wen 25-Nov-1998
libkern/c++/OSSet.hIOSet.h created by rsulack on Thu 11-Jun-1998
libkern/c++/OSString.hIOString.h created by rsulack on Wed 17-Sep-1997
libkern/c++/OSSymbol.hIOSymbol.h created by gvdl on Fri 1998-10-30
libkern/c++/OSUnserialize.hOSUnserialize.h created by rsulack on Mon 23-Nov-1998
libkern/crypto/md5.hMD5.H - header file for MD5.C
libkern/machine/OSByteOrder.hGeneric byte swapping functions.
libkern/tree.h$NetBSD: tree.h,v 1.13 2006/08/27 22:32:38 christos Exp $
mach-o/fat.hThis header file describes the structures of the file format for "fat"
mach-o/fixup-chains.h#define LC_DYLD_EXPORTS_TRIE 0x80000033 // used with linkedit_data_command
mach-o/loader.hThis file describes the format of mach object files.
mach-o/nlist.h$NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $
os/alloc_util.h@macro os_is_ptr_like
os/atomic.h@file <os/atomic.h>
os/base.h<sys/_types/_os_inline.h>

IOKit

IOKit/IOBSD.hbsd-related registry properties
IOKit/IOCircularDataQueueImplementation.h@header IOCircularDataQueueMemory
IOKit/IOCommand.h@header IOCommand
IOKit/IOCommandPool.h@header IOCommandPool
IOKit/IODeviceMemory.h@class IODeviceMemory
IOKit/IOGuardPageMemoryDescriptor.h@class IOGuardPageMemoryDescriptor
IOKit/IOInterleavedMemoryDescriptor.h@class IOInterleavedMemoryDescriptor : public IOMemoryDescriptor
IOKit/IOKernelReportStructs.hInternal data structures to be used by IOReporters and User Space Observers
IOKit/IOKitServer.hInternal definitions used between the iokit user library and
IOKit/IOLib.hIOMin/IOMax macros.
IOKit/IOMemoryCursor.h************************** class IOMemoryCursor **************************
IOKit/IOMessage.h@header IOMessage.h
IOKit/IOMultiMemoryDescriptor.h@class IOMultiMemoryDescriptor : public IOMemoryDescriptor
IOKit/IONVRAM.h__cplusplus
IOKit/IONotifier.h@class IONotifier : public OSObject
IOKit/IOServicePM.h!_IOKIT_IOSERVICEPM_H
IOKit/IOServiceStateNotificationEventSource.h@class IOServiceStateNotificationEventSource : public IOEventSource
IOKit/IOSubMemoryDescriptor.h@class IOSubMemoryDescriptor : public IOMemoryDescriptor
IOKit/IOUserClient.hChanges to this API are expected.
IOKit/PassthruInterruptController.h@class PassthruInterruptController
IOKit/acpi/IOACPIPlatformDevice.hThis structure will be used to expand the capablilties
IOKit/ata/ATADeviceNub.h@header ATADeviceNub.h
IOKit/ata/ATATimerEventSource.h@class ATATimerEventSource
IOKit/ata/IOATABusInfo.h@class IOATABusInfo
IOKit/ata/IOATAController.h@class IOATAController
IOKit/ata/IOATADevConfig.h@class IOATADevConfig
IOKit/ata/IOPCIATA.h@class IOPCIATA
IOKit/audio/IOAudioBlitterLibDispatch.h@header IOAudioBlitterLibDispatch
IOKit/audio/IOAudioControl.h@class IOAudioControl
IOKit/audio/IOAudioControlUserClient.hOSMetaClassDeclareReservedUsed(IOAudioControlUserClient, 1);
IOKit/audio/IOAudioDebug.h<rdar://problem/9725460>
IOKit/audio/IOAudioDevice.h@header IOAudioDevice
IOKit/audio/IOAudioEngine.h@header IOAudioEngine
IOKit/audio/IOAudioLevelControl.h@class IOAudioLevelControl
IOKit/audio/IOAudioPort.h@class IOAudioPort
IOKit/audio/IOAudioStream.h@class IOAudioStream
IOKit/audio/IOAudioTimeIntervalFilter.h@class IOAudioTimeIntervalFilter
IOKit/audio/IOAudioToggleControl.h@class IOAudioToggleControl
IOKit/avc/IOFireWireAVCTargetSpace.hIOFireWireAVCTargetSpace.h
IOKit/avc/IOFireWirePCRSpace.hIOFireWirePCRSpace.h
IOKit/bluetooth/Bluetooth.h---------------------------------------------------------------------------------------------------------------------------
IOKit/bluetooth/BluetoothAssignedNumbers.h==================================================================================================================
IOKit/firewire/IOConfigDirectory.h@class IOConfigDirectory
IOKit/firewire/IOFWIsochPort.h@class IOFWIsochPort
IOKit/firewire/IOFWLocalIsochPort.h@class IOFWLocalIsochPort
IOKit/firewire/IOFWPhysicalAddressSpace.hDirect physical memory <-> FireWire address.
IOKit/firewire/IOFWSimpleContiguousPhysicalAddressSpace.h@class IOFWSimpleContiguousPhysicalAddressSpace
IOKit/firewire/IOFWSimplePhysicalAddressSpace.h@class IOFWSimplePhysicalAddressSpace
IOKit/firewire/IOFWSyncer.hThe spin lock that is used to guard the 'threadMustStop' variable.
IOKit/firewire/IOFWUserObjectExporter.h@class IOFWUserObjectExporter
IOKit/firewire/IOFireWireFamilyCommon.h$Log: not supported by cvs2svn $
IOKit/firewire/IOFireWireIRMAllocation.h#include <IOKit/firewire/IOFireWireController.h>
IOKit/firewire/IOFireWireLocalNode.h$Log: not supported by cvs2svn $
IOKit/firewire/IOFireWirePowerManager.h@class IOFireWirePowerManager
IOKit/firewire/IOLocalConfigDirectory.h@class IOLocalConfigDirectory
IOKit/graphics/IOFramebufferShared.h@header IOFramebufferShared
IOKit/graphics/IOGraphicsDevice.h! _IOKIT_IOGRAPHICSDEVICE_H
IOKit/hidsystem/IOHIDDescriptorParser.h!defined(KERNEL) || defined(KERNEL_PRIVATE)
IOKit/hidsystem/IOHIDParameter.hPublic type definitions.
IOKit/hidsystem/IOHIDSystem.hFor NX_NUM_SCANNED_SPECIALKEYS
IOKit/hidsystem/IOHIDTypes.hThis should be removed, but is being used by others
IOKit/hidsystem/IOHIDUsageTables.h*****************************************************************************************
IOKit/hidsystem/IOHIKeyboard.hStart Action Definitions
IOKit/hidsystem/IOHIKeyboardMapper.hKey ip/down state is tracked in a bit list. Bits are set
IOKit/hidsystem/IOHIPointing.hStart Action Definitions
IOKit/hidsystem/IOLLEvent.hInterlock with dpsclient/event.h
IOKit/network/IOBasicOutputQueue.h@class IOBasicOutputQueue
IOKit/network/IOEthernetInterface.h@defined kIOEthernetInterfaceClass
IOKit/network/IOEthernetStats.hIOEthernetStats.h - Ethernet MIB statistics definitions.
IOKit/network/IOGatedOutputQueue.h@class IOGatedOutputQueue
IOKit/network/IOKernelDebugger.h@typedef IODebuggerRxHandler
IOKit/network/IOMbufMemoryCursor.h@class IOMbufMemoryCursor
IOKit/network/IONetworkController.h@defined kIONetworkControllerClass
IOKit/network/IONetworkInterface.h@defined kIONetworkInterfaceClass
IOKit/network/IONetworkMedium.h@typedef IOMediumType
IOKit/network/IONetworkStats.h@header IONetworkStats.h
IOKit/network/IOOutputQueue.hForward declarations.
IOKit/network/IOPacketQueue.hForward declarations.
IOKit/nvram/IONVRAMController.h!_IOKIT_IONVRAMCONTROLLER_H
IOKit/pci/IOPCIBridge.h* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
IOKit/platform/AppleMacIODevice.h! _IOKIT_APPLEMACIODEVICE_H
IOKit/power/IOPwrController.h24 Nov 1998 suurballe Created.
IOKit/pwr_mgt/IOPM.h@header IOPM.h
IOKit/pwr_mgt/IOPMPowerSourceList.hpointer to first power source in list
IOKit/pwr_mgt/IOPMpowerState.h@header IOPMpowerState.h
IOKit/pwr_mgt/IOPowerConnection.h@class IOPowerConnection
IOKit/pwr_mgt/RootDomain.hTypes for PM Assertions
IOKit/rtc/IORTCController.h24 Nov 1998 suurballe Created.
IOKit/sbp2/IOFireWireSBP2LSIWorkaroundDescriptor.h@header IOFireWireSBP2LSIWorkaroundDescriptor
IOKit/sbp2/IOFireWireSBP2LUN.h@header IOFireWireSBP2LUN
IOKit/sbp2/IOFireWireSBP2Login.h@header IOFireWireSBP2Login
IOKit/sbp2/IOFireWireSBP2ManagementORB.h@header IOFireWireSBP2ManagementORB
IOKit/sbp2/IOFireWireSBP2ORB.h@header IOFireWireSBP2ORB
IOKit/sbp2/IOFireWireSBP2Target.h@header IOFireWireSBP2Target
IOKit/sbp2/IOFireWireSerialBusProtocolTransport.h@header IOFireWireSerialBusProtocolTransport
IOKit/scsi/IOBDServices.h-----------------------------------------------------------------------------
IOKit/scsi/IOBlockStorageServices.h-----------------------------------------------------------------------------
IOKit/scsi/IOCompactDiscServices.h-----------------------------------------------------------------------------
IOKit/scsi/IODVDServices.h-----------------------------------------------------------------------------
IOKit/scsi/IOReducedBlockServices.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIBlockCommandsDevice.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPeripheralDeviceNub.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPeripheralDeviceType00.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPeripheralDeviceType05.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPeripheralDeviceType07.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPeripheralDeviceType0E.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIPrimaryCommandsDevice.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIProtocolInterface.h@header SCSI Protocol Interface
IOKit/scsi/IOSCSIProtocolServices.h-----------------------------------------------------------------------------
IOKit/scsi/IOSCSIReducedBlockCommandsDevice.h@header SCSI Reduced Block Commands Device
IOKit/scsi/SCSICmds_INQUIRY_Definitions.h-----------------------------------------------------------------------------
IOKit/scsi/SCSICmds_MODE_Definitions.h-----------------------------------------------------------------------------
IOKit/scsi/SCSICmds_READ_CAPACITY_Definitions.h@header SCSI Request Sense Definitions
IOKit/scsi/SCSICmds_REPORT_LUNS_Definitions.h@header SCSI Request Sense Definitions
IOKit/scsi/SCSICmds_REQUEST_SENSE_Defs.h@header SCSI Request Sense Definitions
IOKit/scsi/SCSICommandDefinitions.h@header SCSICommandDefinitions
IOKit/scsi/SCSICommandOperationCodes.hThis file contains the operation code definitions for all commands defined
IOKit/scsi/SCSIPort.h@header SCSIPort
IOKit/scsi/SCSITask.h@header SCSITask
IOKit/scsi/spi/IOSCSIParallelControllerCharacteristics.h@header IOSCSIParallelControllerCharacteristics
IOKit/scsi/spi/IOSCSIParallelInterfaceController.h@header IOSCSIParallelInterfaceController
IOKit/storage/IOAppleLabelScheme.hThis header contains the IOAppleLabelScheme class definition.
IOKit/storage/IOApplePartitionScheme.hThis header contains the IOApplePartitionScheme class definition.
IOKit/storage/IOBDBlockStorageDevice.h@header IOBDBlockStorageDevice
IOKit/storage/IOBDBlockStorageDriver.h@header IOBDBlockStorageDriver
IOKit/storage/IOBDMedia.h@header IOBDMedia
IOKit/storage/IOBDTypes.h(enable 8-bit struct packing)
IOKit/storage/IOBlockStorageDevice.h@header IOBlockStorageDevice
IOKit/storage/IOBlockStorageDriver.h@header IOBlockStorageDriver
IOKit/storage/IOCDBlockStorageDevice.h@header IOCDBlockStorageDevice
IOKit/storage/IOCDMedia.h@header IOCDMedia
IOKit/storage/IOCDPartitionScheme.h@header IOCDPartitionScheme
IOKit/storage/IOCDTypes.h(enable 8-bit struct packing)
IOKit/storage/IODVDBlockStorageDevice.h@header IODVDBlockStorageDevice
IOKit/storage/IODVDMedia.h@header IODVDMedia
IOKit/storage/IODVDTypes.h(enable 8-bit struct packing)
IOKit/storage/IOFDiskPartitionScheme.hThis header contains the IOFDiskPartitionScheme class definition.
IOKit/storage/IOFilterScheme.h@header IOFilterScheme
IOKit/storage/IOGUIDPartitionScheme.hThis header contains the IOGUIDPartitionScheme class definition.
IOKit/storage/IOPartitionScheme.h@header IOPartitionScheme
IOKit/storage/IOStorage.h@header IOStorage
IOKit/storage/IOStorageCardCharacteristics.hCard Characteristics - Characteristics defined for cards.
IOKit/storage/IOStorageControllerCharacteristics.hController Characteristics - Characteristics defined for controllers.
IOKit/storage/IOStorageDeviceCharacteristics.hDevice Characteristics - Characteristics defined for devices.
IOKit/storage/IOStorageProtocolCharacteristics.hProtocol Characteristics - Characteristics defined for protocols.
IOKit/storage/ata/IOATAPIProtocolTransport.h@header IOATAPIProtocolTransport
IOKit/storage/ata/IOATAStorageDefines.hImportant word offsets in device identify data as
IOKit/stream/IOStream.h@header IOStream.h
IOKit/stream/IOStreamFamily.h!__IOKIT_IOSTREAMFAMILY_H
IOKit/stream/IOStreamShared.h@header IOStreamShared.h
IOKit/system.hMust be before other includes of kern/assert.h
IOKit/usb/IOUSBHostDevice.h@header IOUSBHostDevice.h
IOKit/usb/IOUSBHostFamily.h@header IOUSBHostFamily.h
IOKit/usb/IOUSBHostFamilyDefinitions.h@header IOUSBHostFamilyDefinitions.h
IOKit/usb/IOUSBHostIOSource.h@header IOUSBHostIOSource.h
IOKit/usb/IOUSBHostInterface.h@header IOUSBHostInterface.h
IOKit/usb/IOUSBHostPipe.h@header IOUSBHostPipe.h
IOKit/usb/IOUSBHostStream.h@header IOUSBHostStream.h
IOKit/usb/StandardUSB.h@header StandardUSB.h
IOKit/usb/USB.hNothing to define
IOKit/usb/USBSpec.hConstants that both OS9 and OSX want to define, and whose values are
IOKit/video/IOVideoDevice.h@class IOVideoDevice
IOKit/video/IOVideoDeviceShared.h@header IOVideoDeviceShared.h
IOKit/video/IOVideoStream.h@class IOVideoStream

VM & pexpert

pexpert/machine/boot.hThis file is DEPRECATED for arm architectures preceeding version 8.
vm/WKdm_new.hdirect-mapped partial matching compressor with simple 22/10 split
vm/lz4_assembly_select.hCommon header to enable/disable the assembly code paths
vm/vm_dyld_pager.hFile: vm/vm_dyld_pager.h
vm/vm_shared_region.hFile: vm/vm_shared_region.h

Architecture

arm/_limits.hticks per second
arm/_param.hRound p (pointer or byte index) up to a correctly-aligned value for all
arm/_types.hThis header file contains integer types. It's intended to also contain
arm/arch.hCollect the __ARM_ARCH_*__ compiler flags into something easier to use.
arm/cpu_capabilities_public.hIn order to reduce the number of sysctls require for a process to get
arm/endian.hDefine _NOQUAD if the compiler does NOT support 64-bit integers.
arm/machine_cpuid.hCPU feature identification
arm/machine_routines.hInterrupt handling
arm/param.hMachine dependent constants for ARM
arm/profile.hBlock interrupts during mcount so that those interrupts can also be
arm/types.hBasic integral types. Omit the typedef if
machine/limits.hThis is the `system' limits.h, independent of any particular