#include <mach/arm/vm_param.h>

mach/arm/vm_param.h Kernel.framework

FILE_ID: vm_param.h
23 macros · 1 variable

variablePAGE_SHIFT_CONST

extern int PAGE_SHIFT_CONST

macroPAGE_SHIFT

#define PAGE_SHIFT PAGE_SHIFT_CONST

macroPAGE_SIZE

#define PAGE_SIZE (1 << PAGE_SHIFT)

macroPAGE_MASK

#define PAGE_MASK (PAGE_SIZE-1)

macroVM_PAGE_SIZE

#define VM_PAGE_SIZE PAGE_SIZE

macroTEST_PAGE_SIZE_16K

Defined for the purpose of testing the pmap advertised page size; this does not necessarily match the hardware page size.
#define TEST_PAGE_SIZE_16K ((PAGE_SHIFT_CONST == 14))

macroTEST_PAGE_SIZE_4K

#define TEST_PAGE_SIZE_4K ((PAGE_SHIFT_CONST == 12))

macroTiB

kalloc() parameters: Historically kalloc's underlying zones were power-of-2 sizes, with a KALLOC_MINSIZE of 16 bytes. Thus the allocator ensured that (sizeof == alignof) >= 16 for all kalloc allocations. Today kalloc may use zones with intermediate (small) sizes, constrained by KALLOC_MINSIZE and a minimum alignment, expressed by KALLOC_LOG2_MINALIGN. Note that most dynamically allocated data structures contain more than one int/long/pointer member, so KALLOC_MINSIZE should probably start at 8.
#define TiB(x) ((0ULL + (x)) << 40)

macroGiB

#define GiB(x) ((0ULL + (x)) << 30)

macroKALLOC_MINSIZE

#define KALLOC_MINSIZE 16
minimum allocation size

macroKALLOC_LOG2_MINALIGN

#define KALLOC_LOG2_MINALIGN 4
log2 minimum alignment

macroVM_KERNEL_POINTER_SIGNIFICANT_BITS

Inform kexts about largest possible kernel address space
#define VM_KERNEL_POINTER_SIGNIFICANT_BITS 41

macroVM_MIN_KERNEL_ADDRESS

#define VM_MIN_KERNEL_ADDRESS ((vm_address_t) (0ULL - TiB(2)))

macroVM_MAX_KERNEL_ADDRESS

#define VM_MAX_KERNEL_ADDRESS ((vm_address_t) 0xfffffffbffffffffULL)

macroVM_MIN_KERNEL_AND_KEXT_ADDRESS

#define VM_MIN_KERNEL_AND_KEXT_ADDRESS VM_MIN_KERNEL_ADDRESS

macroARM_TBI_USER_MASK

Top-Byte-Ignore
#define ARM_TBI_USER_MASK (0xFF00000000000000ULL)

macroVM_USER_STRIP_TBI

#define VM_USER_STRIP_TBI(_v) ((typeof (_v))(((uintptr_t)(_v)) &~ (ARM_TBI_USER_MASK)))

macroVM_KERNEL_STRIP_PAC

#define VM_KERNEL_STRIP_PAC(_v) (_v)

macro_VM_KERNEL_STRIP_PTR

For KEXT, just blow away TBI bits, even if only used for KASAN.
#define _VM_KERNEL_STRIP_PTR(_v) (VM_KERNEL_STRIP_PAC(_v) | (0xFF00000000000000ULL))

macroVM_KERNEL_STRIP_PTR

#define VM_KERNEL_STRIP_PTR(_va) (_VM_KERNEL_STRIP_PTR((uintptr_t)(_va)))

macroVM_KERNEL_STRIP_UPTR

Vestige from the past, kept for retro-compatibility.
#define VM_KERNEL_STRIP_UPTR(_va) (VM_KERNEL_STRIP_PTR(_va))

macroVM_USER_STRIP_PTR

#define VM_USER_STRIP_PTR(_v) (VM_USER_STRIP_TBI(_v))

macroML_ADDRPERM

#define ML_ADDRPERM(addr, slide) ((addr) + (slide))