#include <mach/memory_object_types.h>

mach/memory_object_types.h Kernel.framework

includes: mach/port.h, mach/message.h, Kernel/mach/vm_prot.h, Kernel/mach/vm_sync.h, mach/vm_types.h, Kernel/mach/machine/vm_types.h, sys/cdefs.h
77 macros · 7 functions · 6 typedefs · 1 struct

structupl_page_info

size 8, align 4
unsigned int[2]opaqueuse upl_page_xxx() accessor funcs

typedefupl_page_info_t

typedef struct upl_page_info upl_page_info_t

typedefupl_page_info_array_t

typedef upl_page_info_t *upl_page_info_array_t

typedefupl_page_list_ptr_t

typedef upl_page_info_array_t upl_page_list_ptr_t

typedefupl_offset_t

typedef uint32_t upl_offset_t
page-aligned byte offset

typedefupl_size_t

typedef uint32_t upl_size_t
page-aligned byte size

macroUPL_SIZE_MAX

#define UPL_SIZE_MAX (UINT32_MAX & ~PAGE_MASK)

typedefupl_control_flags_t

typedef uint64_t upl_control_flags_t

macroUPL_FLAGS_NONE

#define UPL_FLAGS_NONE 0x00000000ULL

macroUPL_COPYOUT_FROM

#define UPL_COPYOUT_FROM 0x00000001ULL

macroUPL_PRECIOUS

#define UPL_PRECIOUS 0x00000002ULL

macroUPL_NO_SYNC

#define UPL_NO_SYNC 0x00000004ULL

macroUPL_CLEAN_IN_PLACE

#define UPL_CLEAN_IN_PLACE 0x00000008ULL

macroUPL_NOBLOCK

#define UPL_NOBLOCK 0x00000010ULL

macroUPL_RET_ONLY_DIRTY

#define UPL_RET_ONLY_DIRTY 0x00000020ULL

macroUPL_SET_INTERNAL

#define UPL_SET_INTERNAL 0x00000040ULL

macroUPL_QUERY_OBJECT_TYPE

#define UPL_QUERY_OBJECT_TYPE 0x00000080ULL

macroUPL_RET_ONLY_ABSENT

#define UPL_RET_ONLY_ABSENT 0x00000100ULL
used only for COPY_FROM = FALSE

macroUPL_FILE_IO

#define UPL_FILE_IO 0x00000200ULL

macroUPL_SET_LITE

#define UPL_SET_LITE 0x00000400ULL

macroUPL_SET_INTERRUPTIBLE

#define UPL_SET_INTERRUPTIBLE 0x00000800ULL

macroUPL_SET_IO_WIRE

#define UPL_SET_IO_WIRE 0x00001000ULL

macroUPL_FOR_PAGEOUT

#define UPL_FOR_PAGEOUT 0x00002000ULL

macroUPL_WILL_BE_DUMPED

#define UPL_WILL_BE_DUMPED 0x00004000ULL

macroUPL_FORCE_DATA_SYNC

#define UPL_FORCE_DATA_SYNC 0x00008000ULL

macroUPL_PAGE_TICKET_MASK

#define UPL_PAGE_TICKET_MASK 0x000F0000ULL

macroUPL_PAGE_TICKET_SHIFT

#define UPL_PAGE_TICKET_SHIFT 16

macroUPL_BLOCK_ACCESS

... flags resume here
#define UPL_BLOCK_ACCESS 0x00100000ULL

macroUPL_ENCRYPT

#define UPL_ENCRYPT 0x00200000ULL

macroUPL_NOZEROFILL

#define UPL_NOZEROFILL 0x00400000ULL

macroUPL_WILL_MODIFY

#define UPL_WILL_MODIFY 0x00800000ULL
caller will modify the pages

macroUPL_NEED_32BIT_ADDR

#define UPL_NEED_32BIT_ADDR 0x01000000ULL

macroUPL_UBC_MSYNC

#define UPL_UBC_MSYNC 0x02000000ULL

macroUPL_UBC_PAGEOUT

#define UPL_UBC_PAGEOUT 0x04000000ULL

macroUPL_UBC_PAGEIN

#define UPL_UBC_PAGEIN 0x08000000ULL

macroUPL_REQUEST_SET_DIRTY

#define UPL_REQUEST_SET_DIRTY 0x10000000ULL

macroUPL_REQUEST_NO_FAULT

#define UPL_REQUEST_NO_FAULT 0x20000000ULL
fail if pages not all resident

macroUPL_NOZEROFILLIO

#define UPL_NOZEROFILLIO 0x40000000ULL
allow non zerofill pages present

macroUPL_REQUEST_FORCE_COHERENCY

#define UPL_REQUEST_FORCE_COHERENCY 0x80000000ULL

macroUPL_CARRY_VA_TAG

#define UPL_CARRY_VA_TAG 0x10000000000ULL

macroUPL_VALID_FLAGS

UPL flags known by this kernel
#define UPL_VALID_FLAGS 0x1FFFFFFFFFFULL

macroUPL_ABORT_RESTART

upl abort error flags
#define UPL_ABORT_RESTART 0x1

macroUPL_ABORT_UNAVAILABLE

#define UPL_ABORT_UNAVAILABLE 0x2

macroUPL_ABORT_ERROR

#define UPL_ABORT_ERROR 0x4

macroUPL_ABORT_FREE_ON_EMPTY

#define UPL_ABORT_FREE_ON_EMPTY 0x8
only implemented in wrappers

macroUPL_ABORT_DUMP_PAGES

#define UPL_ABORT_DUMP_PAGES 0x10

macroUPL_ABORT_NOTIFY_EMPTY

#define UPL_ABORT_NOTIFY_EMPTY 0x20

macroUPL_ABORT_REFERENCE

deprecated: #define UPL_ABORT_ALLOW_ACCESS 0x40
#define UPL_ABORT_REFERENCE 0x80

macroUPL_CHECK_DIRTY

upl pages check flags
#define UPL_CHECK_DIRTY 0x1

macroUPL_IOSYNC

upl pagein/pageout flags when I/O is issued from this UPL it should be done synchronously
#define UPL_IOSYNC 0x1

macroUPL_NOCOMMIT

the passed in UPL should not have either a commit or abort applied to it by the underlying layers... the site that created the UPL is responsible for cleaning it up.
#define UPL_NOCOMMIT 0x2

macroUPL_NORDAHEAD

turn off any speculative read-ahead applied at the I/O layer
#define UPL_NORDAHEAD 0x4

macroUPL_VNODE_PAGER

#define UPL_VNODE_PAGER 0x8

macroUPL_MSYNC

this pageout is being originated as part of an explicit memory synchronization operation... no speculative clustering should be applied, only the range specified should be pushed.
#define UPL_MSYNC 0x10

macroUPL_PAGING_ENCRYPTED

#define UPL_PAGING_ENCRYPTED 0x20

macroUPL_KEEPCACHED

this pageout is being originated as part of an explicit memory synchronization operation that is checking for I/O errors and taking it's own action... if an error occurs, just abort the pages back into the cache unchanged
#define UPL_KEEPCACHED 0x40

macroUPL_NESTED_PAGEOUT

this pageout originated from within cluster_io to deal with a dirty page that hasn't yet been seen by the FS that backs it... tag it so that the FS can take the appropriate action w/r to its locking model since the pageout will reenter the FS for the same file currently being handled in this context.
#define UPL_NESTED_PAGEOUT 0x80

macroUPL_IOSTREAMING

we've detected a sequential access pattern and we are speculatively and aggressively pulling pages in... do not count these as real PAGEINs w/r to our hard throttle maintenance
#define UPL_IOSTREAMING 0x100

macroUPL_IGNORE_VALID_PAGE_CHECK

Currently, it's only used for the swap pagein path. Since the swap + compressed pager layer manage their pages, these pages are not marked "absent" i.e. these are "valid" pages. The pagein path will _not_ issue an I/O (correctly) for valid pages. So, this flag is used to override that logic in the vnode I/O path.
#define UPL_IGNORE_VALID_PAGE_CHECK 0x200

macroUPL_COMMIT_FREE_ON_EMPTY

upl commit flags
#define UPL_COMMIT_FREE_ON_EMPTY 0x1
only implemented in wrappers

macroUPL_COMMIT_CLEAR_DIRTY

#define UPL_COMMIT_CLEAR_DIRTY 0x2

macroUPL_COMMIT_SET_DIRTY

#define UPL_COMMIT_SET_DIRTY 0x4

macroUPL_COMMIT_INACTIVATE

#define UPL_COMMIT_INACTIVATE 0x8

macroUPL_COMMIT_NOTIFY_EMPTY

#define UPL_COMMIT_NOTIFY_EMPTY 0x10

macroUPL_COMMIT_CS_VALIDATED

deprecated: #define UPL_COMMIT_ALLOW_ACCESS 0x20
#define UPL_COMMIT_CS_VALIDATED 0x40

macroUPL_COMMIT_CLEAR_PRECIOUS

#define UPL_COMMIT_CLEAR_PRECIOUS 0x80

macroUPL_COMMIT_SPECULATE

#define UPL_COMMIT_SPECULATE 0x100

macroUPL_COMMIT_FREE_ABSENT

#define UPL_COMMIT_FREE_ABSENT 0x200

macroUPL_COMMIT_WRITTEN_BY_KERNEL

#define UPL_COMMIT_WRITTEN_BY_KERNEL 0x400

macroUPL_DEV_MEMORY

flags for return of state from vm_map_get_upl, vm_upl address space based call
#define UPL_DEV_MEMORY 0x1

macroUPL_PHYS_CONTIG

#define UPL_PHYS_CONTIG 0x2

macroUPL_POP_DIRTY

Flags for the UPL page ops routine. This routine is not exported out of the kernel at the moment and so the defs live here.
#define UPL_POP_DIRTY 0x1

macroUPL_POP_PAGEOUT

#define UPL_POP_PAGEOUT 0x2

macroUPL_POP_PRECIOUS

#define UPL_POP_PRECIOUS 0x4

macroUPL_POP_ABSENT

#define UPL_POP_ABSENT 0x8

macroUPL_POP_BUSY

#define UPL_POP_BUSY 0x10

macroUPL_POP_PHYSICAL

#define UPL_POP_PHYSICAL 0x10000000

macroUPL_POP_DUMP

#define UPL_POP_DUMP 0x20000000

macroUPL_POP_SET

#define UPL_POP_SET 0x40000000

macroUPL_POP_CLR

#define UPL_POP_CLR 0x80000000

macroUPL_ROP_ABSENT

Flags for the UPL range op routine. This routine is not exported out of the kernel at the moemet and so the defs live here. UPL_ROP_ABSENT: Returns the extent of the range presented which is absent, starting with the start address presented
#define UPL_ROP_ABSENT 0x01

macroUPL_ROP_PRESENT

UPL_ROP_PRESENT: Returns the extent of the range presented which is present (i.e. resident), starting with the start address presented
#define UPL_ROP_PRESENT 0x02

macroUPL_ROP_DUMP

UPL_ROP_DUMP: Dump the pages which are found in the target object for the target range.
#define UPL_ROP_DUMP 0x04

functionupl_page_present

extern boolean_t upl_page_present(upl_page_info_t *upl, int index)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Returns TRUE if the page at the given index of the UPL page-info array is present (UPL_PAGE_PRESENT); trivial accessor over upl_page_info_t.

functionupl_dirty_page

extern boolean_t upl_dirty_page(upl_page_info_t *upl, int index)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Returns TRUE if the page at the given index of the UPL page-info array is marked dirty (UPL_DIRTY_PAGE), i.e. must be cleaned before being freed.

functionupl_valid_page

extern boolean_t upl_valid_page(upl_page_info_t *upl, int index)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Returns TRUE if the page at the given index of the UPL page-info array holds valid data (UPL_VALID_PAGE).

functionupl_deallocate

extern void upl_deallocate(upl_t upl)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Releases a reference on the UPL. When the last reference is dropped, any vector sub-UPLs are deallocated, a pending upl_iodone callout is delivered, and the UPL and its page-info list are destroyed. Pages covered by the UPL must already have been committed or aborted.

functionupl_mark_decmp

extern void upl_mark_decmp(upl_t upl)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Marks the UPL as having a decompression request in flight: sets UPL_DECMP_REQ and records the UPL in its creating thread as the active decompression UPL, so the I/O scheduler can find it. Effective only for UPLs tracked by their object (UPL_TRACKED_BY_OBJECT) on kernels built with CONFIG_IOSCHED.

functionupl_unmark_decmp

extern void upl_unmark_decmp(upl_t upl)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Clears the association established by upl_mark_decmp, removing the UPL as its creating thread's active decompression UPL. CONFIG_IOSCHED kernels only.

functionupl_has_wired_pages

extern boolean_t upl_has_wired_pages(upl_t upl)
claude-fable-5, 2026-08-24 · not from Apple sources · verified against xnu osfmk/vm/vm_pageout.c
Returns TRUE if the UPL contains wired pages (UPL_HAS_WIRED flag set).