Mach

The Mach layer is the lowest userspace-visible interface of the Darwin kernel: tasks and threads, port-based IPC, virtual memory control, clocks, and exception handling. Most calls are MIG-generated RPC stubs that operate on port rights; the .defs descriptions shown on these pages are the closest thing to official documentation the interface has. Include <mach/mach.h> for the common surface.

see also: MIG routines

Tasks & threads

mach/semaphore.hForward Declarations
mach/sync.h* This file contains compatibilty wrapper header for things that used
mach/task_info.hMachine-independent task information structures and definitions.
mach/task_policy.hThese are the calls for accessing the policy parameters
mach/thread_policy.hThese are the calls for accessing the policy parameters

Ports & messages

mach/bootstrap.hMach bootstrap interfaces (obsolete: header included only for compatibility)
mach/mach.hIncludes all the types that a normal user
mach/mach_init.hItems provided by the Mach environment initialization.
mach/mach_interface.hThis file represents the interfaces that used to come
mach/mig.hMach MIG Subsystem Interfaces
mach/mig_strncpy_zerofill_support.hThis dummy header file is created for mig to check when to call mig_strncpy_zerofill.
mach/mig_voucher_support.hThis dummy header file is created for mig to check when to include voucher code.
mach/port.hNOTICE: This file was modified by McAfee Research in 2004 to introduce
mach/port_obj.hDefine a service to map from a kernel-generated port name
mach/rpc.hMach RPC Subsystem Interfaces

Virtual memory

mach/dyld_kernel.hThese definitions must be kept in sync with the ones in
mach/dyld_pager.hFile: mach/dyld_pager.h
mach/shared_memory_server.hFile: mach/shared_memory_server.h
mach/shared_region.hFile: mach/shared_region.h
mach/vm_behavior.hFile: mach/vm_behavior.h
mach/vm_purgable.hVirtual memory map purgeable object definitions.
mach/vm_region.hFile: mach/vm_region.h
mach/vm_sync.hFile: mach/vm_sync.h
mach/vm_task.h* This file contains compatibilty wrapper header for things that are

Host & processors

mach/clock_types.hFile: clock_types.h
mach/host_info.hFile: mach/host_info.h
mach/kmod.hNOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
mach/mach_error.hFile: mach_error.h
mach/machine.hFile: machine.h

Exceptions

Vouchers & misc

Architecture

mach/arm/ndr_def.hNDR record for Intel x86s
mach/arm/rpc.hdefined (__arm__) || defined (__arm64__)
mach/arm/sdt_isa.hOnly define when testing. This makes the calls into actual calls to
mach/arm/thread_status.hFILE_ID: thread_status.h
mach/arm/vm_param.hFILE_ID: vm_param.h