master
  1/*
  2 * Copyright (c) 2000-2020 Apple Inc. All rights reserved.
  3 *
  4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  5 *
  6 * This file contains Original Code and/or Modifications of Original Code
  7 * as defined in and that are subject to the Apple Public Source License
  8 * Version 2.0 (the 'License'). You may not use this file except in
  9 * compliance with the License. The rights granted to you under the License
 10 * may not be used to create, or enable the creation or redistribution of,
 11 * unlawful or unlicensed copies of an Apple operating system, or to
 12 * circumvent, violate, or enable the circumvention or violation of, any
 13 * terms of an Apple operating system software license agreement.
 14 *
 15 * Please obtain a copy of the License at
 16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 17 *
 18 * The Original Code and all software distributed under the License are
 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 23 * Please see the License for the specific language governing rights and
 24 * limitations under the License.
 25 *
 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 27 */
 28/*
 29 * @OSF_COPYRIGHT@
 30 */
 31/*
 32 * Mach Operating System
 33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
 34 * All Rights Reserved.
 35 *
 36 * Permission to use, copy, modify and distribute this software and its
 37 * documentation is hereby granted, provided that both the copyright
 38 * notice and this permission notice appear in all copies of the
 39 * software, derivative works or modified versions, and any portions
 40 * thereof, and that both notices appear in supporting documentation.
 41 *
 42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 43 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 45 *
 46 * Carnegie Mellon requests users of this software to return to
 47 *
 48 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 49 *  School of Computer Science
 50 *  Carnegie Mellon University
 51 *  Pittsburgh PA 15213-3890
 52 *
 53 * any improvements or extensions that they make and grant Carnegie Mellon
 54 * the rights to redistribute these changes.
 55 */
 56/*
 57 */
 58/*
 59 *	File:	mach/vm_statistics.h
 60 *	Author:	Avadis Tevanian, Jr., Michael Wayne Young, David Golub
 61 *
 62 *	Virtual memory statistics structure.
 63 *
 64 */
 65
 66#ifndef _MACH_VM_STATISTICS_H_
 67#define _MACH_VM_STATISTICS_H_
 68
 69
 70#include <Availability.h>
 71#include <os/base.h>
 72#include <stdbool.h>
 73#include <sys/cdefs.h>
 74
 75#include <mach/machine/vm_types.h>
 76#include <mach/machine/kern_return.h>
 77
 78__BEGIN_DECLS
 79
 80#pragma mark VM Statistics
 81
 82/*
 83 * vm_statistics
 84 *
 85 * History:
 86 *	rev0 -  original structure.
 87 *	rev1 -  added purgable info (purgable_count and purges).
 88 *	rev2 -  added speculative_count.
 89 *
 90 * Note: you cannot add any new fields to this structure. Add them below in
 91 *       vm_statistics64.
 92 */
 93
 94struct vm_statistics {
 95	natural_t       free_count;             /* # of pages free */
 96	natural_t       active_count;           /* # of pages active */
 97	natural_t       inactive_count;         /* # of pages inactive */
 98	natural_t       wire_count;             /* # of pages wired down */
 99	natural_t       zero_fill_count;        /* # of zero fill pages */
100	natural_t       reactivations;          /* # of pages reactivated */
101	natural_t       pageins;                /* # of pageins */
102	natural_t       pageouts;               /* # of pageouts */
103	natural_t       faults;                 /* # of faults */
104	natural_t       cow_faults;             /* # of copy-on-writes */
105	natural_t       lookups;                /* object cache lookups */
106	natural_t       hits;                   /* object cache hits */
107
108	/* added for rev1 */
109	natural_t       purgeable_count;        /* # of pages purgeable */
110	natural_t       purges;                 /* # of pages purged */
111
112	/* added for rev2 */
113	/*
114	 * NB: speculative pages are already accounted for in "free_count",
115	 * so "speculative_count" is the number of "free" pages that are
116	 * used to hold data that was read speculatively from disk but
117	 * haven't actually been used by anyone so far.
118	 */
119	natural_t       speculative_count;      /* # of pages speculative */
120};
121
122/* Used by all architectures */
123typedef struct vm_statistics    *vm_statistics_t;
124typedef struct vm_statistics    vm_statistics_data_t;
125
126/*
127 * vm_statistics64
128 *
129 * History:
130 *	rev0 -  original structure.
131 *	rev1 -  added purgable info (purgable_count and purges).
132 *	rev2 -  added speculative_count.
133 *	   ----
134 *	rev3 -  changed name to vm_statistics64.
135 *		changed some fields in structure to 64-bit on
136 *		arm, i386 and x86_64 architectures.
137 *	rev4 -  require 64-bit alignment for efficient access
138 *		in the kernel. No change to reported data.
139 *
140 */
141
142struct vm_statistics64 {
143	natural_t       free_count;             /* # of pages free */
144	natural_t       active_count;           /* # of pages active */
145	natural_t       inactive_count;         /* # of pages inactive */
146	natural_t       wire_count;             /* # of pages wired down */
147	uint64_t        zero_fill_count;        /* # of zero fill pages */
148	uint64_t        reactivations;          /* # of pages reactivated */
149	uint64_t        pageins;                /* # of pageins (lifetime) */
150	uint64_t        pageouts;               /* # of pageouts */
151	uint64_t        faults;                 /* # of faults */
152	uint64_t        cow_faults;             /* # of copy-on-writes */
153	uint64_t        lookups;                /* object cache lookups */
154	uint64_t        hits;                   /* object cache hits */
155	uint64_t        purges;                 /* # of pages purged */
156	natural_t       purgeable_count;        /* # of pages purgeable */
157	/*
158	 * NB: speculative pages are already accounted for in "free_count",
159	 * so "speculative_count" is the number of "free" pages that are
160	 * used to hold data that was read speculatively from disk but
161	 * haven't actually been used by anyone so far.
162	 */
163	natural_t       speculative_count;      /* # of pages speculative */
164
165	/* added for rev1 */
166	uint64_t        decompressions;         /* # of pages decompressed (lifetime) */
167	uint64_t        compressions;           /* # of pages compressed (lifetime) */
168	uint64_t        swapins;                /* # of pages swapped in via compressor segments (lifetime) */
169	uint64_t        swapouts;               /* # of pages swapped out via compressor segments (lifetime) */
170	natural_t       compressor_page_count;  /* # of pages used by the compressed pager to hold all the compressed data */
171	natural_t       throttled_count;        /* # of pages throttled */
172	natural_t       external_page_count;    /* # of pages that are file-backed (non-swap) */
173	natural_t       internal_page_count;    /* # of pages that are anonymous */
174	uint64_t        total_uncompressed_pages_in_compressor; /* # of pages (uncompressed) held within the compressor. */
175	/* added for rev2 */
176	uint64_t        swapped_count;          /* # of compressor-stored pages currently stored in swap */
177} __attribute__((aligned(8)));
178
179typedef struct vm_statistics64  *vm_statistics64_t;
180typedef struct vm_statistics64  vm_statistics64_data_t;
181
182kern_return_t vm_stats(void *info, unsigned int *count);
183
184/*
185 * VM_STATISTICS_TRUNCATE_TO_32_BIT
186 *
187 * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from
188 * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics).
189 */
190#define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value)))
191
192/*
193 * vm_extmod_statistics
194 *
195 * Structure to record modifications to a task by an
196 * external agent.
197 *
198 * History:
199 *	rev0 -  original structure.
200 */
201
202struct vm_extmod_statistics {
203	int64_t task_for_pid_count;                     /* # of times task port was looked up */
204	int64_t task_for_pid_caller_count;      /* # of times this task called task_for_pid */
205	int64_t thread_creation_count;          /* # of threads created in task */
206	int64_t thread_creation_caller_count;   /* # of threads created by task */
207	int64_t thread_set_state_count;         /* # of register state sets in task */
208	int64_t thread_set_state_caller_count;  /* # of register state sets by task */
209} __attribute__((aligned(8)));
210
211typedef struct vm_extmod_statistics *vm_extmod_statistics_t;
212typedef struct vm_extmod_statistics vm_extmod_statistics_data_t;
213
214typedef struct vm_purgeable_stat {
215	uint64_t        count;
216	uint64_t        size;
217}vm_purgeable_stat_t;
218
219struct vm_purgeable_info {
220	vm_purgeable_stat_t fifo_data[8];
221	vm_purgeable_stat_t obsolete_data;
222	vm_purgeable_stat_t lifo_data[8];
223};
224
225typedef struct vm_purgeable_info        *vm_purgeable_info_t;
226
227/* included for the vm_map_page_query call */
228
229#define VM_PAGE_QUERY_PAGE_PRESENT      0x1
230#define VM_PAGE_QUERY_PAGE_FICTITIOUS   0x2
231#define VM_PAGE_QUERY_PAGE_REF          0x4
232#define VM_PAGE_QUERY_PAGE_DIRTY        0x8
233#define VM_PAGE_QUERY_PAGE_PAGED_OUT    0x10
234#define VM_PAGE_QUERY_PAGE_COPIED       0x20
235#define VM_PAGE_QUERY_PAGE_SPECULATIVE  0x40
236#define VM_PAGE_QUERY_PAGE_EXTERNAL     0x80
237#define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100
238#define VM_PAGE_QUERY_PAGE_CS_TAINTED   0x200
239#define VM_PAGE_QUERY_PAGE_CS_NX        0x400
240#define VM_PAGE_QUERY_PAGE_REUSABLE     0x800
241
242#pragma mark User Flags
243
244/*
245 * VM allocation flags:
246 *
247 * VM_FLAGS_FIXED
248 *      (really the absence of VM_FLAGS_ANYWHERE)
249 *	Allocate new VM region at the specified virtual address, if possible.
250 *
251 * VM_FLAGS_ANYWHERE
252 *	Allocate new VM region anywhere it would fit in the address space.
253 *
254 * VM_FLAGS_PURGABLE
255 *	Create a purgable VM object for that new VM region.
256 *
257 * VM_FLAGS_4GB_CHUNK
258 *	The new VM region will be chunked up into 4GB sized pieces.
259 *
260 * VM_FLAGS_NO_PMAP_CHECK
261 *	(for DEBUG kernel config only, ignored for other configs)
262 *	Do not check that there is no stale pmap mapping for the new VM region.
263 *	This is useful for kernel memory allocations at bootstrap when building
264 *	the initial kernel address space while some memory is already in use.
265 *
266 * VM_FLAGS_OVERWRITE
267 *	The new VM region can replace existing VM regions if necessary
268 *	(to be used in combination with VM_FLAGS_FIXED).
269 *
270 * VM_FLAGS_NO_CACHE
271 *	Pages brought in to this VM region are placed on the speculative
272 *	queue instead of the active queue.  In other words, they are not
273 *	cached so that they will be stolen first if memory runs low.
274 */
275
276#define VM_FLAGS_FIXED                  0x00000000
277#define VM_FLAGS_ANYWHERE               0x00000001
278#define VM_FLAGS_PURGABLE               0x00000002
279#define VM_FLAGS_4GB_CHUNK              0x00000004
280#define VM_FLAGS_RANDOM_ADDR            0x00000008
281#define VM_FLAGS_NO_CACHE               0x00000010
282#define VM_FLAGS_RESILIENT_CODESIGN     0x00000020
283#define VM_FLAGS_RESILIENT_MEDIA        0x00000040
284#define VM_FLAGS_PERMANENT              0x00000080
285#define VM_FLAGS_TPRO                   0x00001000
286#define VM_FLAGS_MTE                    0x00002000
287#define VM_FLAGS_OVERWRITE              0x00004000  /* delete any existing mappings first */
288/*
289 * VM_FLAGS_SUPERPAGE_MASK
290 *	3 bits that specify whether large pages should be used instead of
291 *	base pages (!=0), as well as the requested page size.
292 */
293#define VM_FLAGS_SUPERPAGE_MASK         0x00070000 /* bits 0x10000, 0x20000, 0x40000 */
294#define VM_FLAGS_RETURN_DATA_ADDR       0x00100000 /* Return address of target data, rather than base of page */
295#define VM_FLAGS_RETURN_4K_DATA_ADDR    0x00800000 /* Return 4K aligned address of target data */
296#define VM_FLAGS_ALIAS_MASK             0xFF000000
297#define VM_GET_FLAGS_ALIAS(flags, alias)                        \
298	        (alias) = (((flags) >> 24) & 0xff)
299#define VM_SET_FLAGS_ALIAS(flags, alias)                        \
300	        (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) |   \
301	        (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
302
303#define VM_FLAGS_HW     (VM_FLAGS_TPRO | VM_FLAGS_MTE)
304
305/* These are the flags that we accept from user-space */
306#define VM_FLAGS_USER_ALLOCATE  (VM_FLAGS_FIXED |               \
307	                         VM_FLAGS_ANYWHERE |            \
308	                         VM_FLAGS_PURGABLE |            \
309	                         VM_FLAGS_4GB_CHUNK |           \
310	                         VM_FLAGS_RANDOM_ADDR |         \
311	                         VM_FLAGS_NO_CACHE |            \
312	                         VM_FLAGS_PERMANENT |           \
313	                         VM_FLAGS_OVERWRITE |           \
314	                         VM_FLAGS_SUPERPAGE_MASK |      \
315	                         VM_FLAGS_HW |                  \
316	                         VM_FLAGS_ALIAS_MASK)
317
318#define VM_FLAGS_USER_MAP       (VM_FLAGS_USER_ALLOCATE |       \
319	                         VM_FLAGS_RETURN_4K_DATA_ADDR | \
320	                         VM_FLAGS_RETURN_DATA_ADDR)
321
322#define VM_FLAGS_USER_REMAP     (VM_FLAGS_FIXED |               \
323	                         VM_FLAGS_ANYWHERE |            \
324	                         VM_FLAGS_RANDOM_ADDR |         \
325	                         VM_FLAGS_OVERWRITE|            \
326	                         VM_FLAGS_RETURN_DATA_ADDR |    \
327	                         VM_FLAGS_RESILIENT_CODESIGN |  \
328	                         VM_FLAGS_RESILIENT_MEDIA)
329
330#define VM_FLAGS_SUPERPAGE_SHIFT 16
331#define SUPERPAGE_NONE                  0       /* no superpages, if all bits are 0 */
332#define SUPERPAGE_SIZE_ANY              1
333#define VM_FLAGS_SUPERPAGE_NONE     (SUPERPAGE_NONE     << VM_FLAGS_SUPERPAGE_SHIFT)
334#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT)
335#define SUPERPAGE_SIZE_2MB              2
336#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
337
338/*
339 * EXC_GUARD definitions for virtual memory.
340 */
341#define GUARD_TYPE_VIRT_MEMORY  0x5
342
343/* Reasons for exception for virtual memory */
344__enum_decl(virtual_memory_guard_exception_code_t, uint32_t, {
345	kGUARD_EXC_DEALLOC_GAP  = 1,
346	kGUARD_EXC_RECLAIM_COPYIO_FAILURE = 2,
347	kGUARD_EXC_RECLAIM_INDEX_FAILURE = 4,
348	kGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE = 8,
349	kGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE = 9,
350	kGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE = 10,
351	kGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE = 11,
352	kGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION = 12,
353	/*
354	 * rdar://151450801 (Remove spurious kGUARD_EXC_SEC_ACCESS_FAULT and kGUARD_EXC_SEC_ASYNC_ACCESS_FAULT once CrashReporter is aligned)
355	 */
356	kGUARD_EXC_SEC_ACCESS_FAULT = 98,
357	kGUARD_EXC_SEC_ASYNC_ACCESS_FAULT = 99,
358	/* VM policy decisions */
359	kGUARD_EXC_SEC_COPY_DENIED = 100,
360	kGUARD_EXC_SEC_SHARING_DENIED = 101,
361
362	/* Fault-related exceptions. */
363	kGUARD_EXC_MTE_SYNC_FAULT = 200,
364	kGUARD_EXC_MTE_ASYNC_USER_FAULT = 201,
365	kGUARD_EXC_MTE_ASYNC_KERN_FAULT = 202
366});
367
368#define kGUARD_EXC_MTE_SOFT_MODE       0x100000
369
370
371#pragma mark Ledger Tags
372
373/* current accounting postmark */
374#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
375
376/*
377 *  When making a new VM_LEDGER_TAG_* or VM_LEDGER_FLAG_*, update tests
378 *  vm_parameter_validation_[user|kern] and their expected results; they
379 *  deliberately call VM functions with invalid ledger values and you may
380 *  be turning one of those invalid tags/flags valid.
381 */
382/* discrete values: */
383#define VM_LEDGER_TAG_NONE      0x00000000
384#define VM_LEDGER_TAG_DEFAULT   0x00000001
385#define VM_LEDGER_TAG_NETWORK   0x00000002
386#define VM_LEDGER_TAG_MEDIA     0x00000003
387#define VM_LEDGER_TAG_GRAPHICS  0x00000004
388#define VM_LEDGER_TAG_NEURAL    0x00000005
389#define VM_LEDGER_TAG_MAX       0x00000005
390#define VM_LEDGER_TAG_UNCHANGED ((int)-1)
391
392/* individual bits: */
393#define VM_LEDGER_FLAG_NO_FOOTPRINT              (1 << 0)
394#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG    (1 << 1)
395#define VM_LEDGER_FLAG_FROM_KERNEL               (1 << 2)
396
397#define VM_LEDGER_FLAGS_USER (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
398#define VM_LEDGER_FLAGS_ALL (VM_LEDGER_FLAGS_USER | VM_LEDGER_FLAG_FROM_KERNEL)
399
400#pragma mark User Memory Tags
401
402/*
403 * These tags may be used to identify memory regions created with
404 * `mach_vm_map()` or `mach_vm_allocate()` via the top 8 bits of the `flags`
405 * parameter. Users should pass `VM_MAKE_TAG(tag) | flags` (see section
406 * "User Flags").
407 */
408#define VM_MEMORY_MALLOC 1
409#define VM_MEMORY_MALLOC_SMALL 2
410#define VM_MEMORY_MALLOC_LARGE 3
411#define VM_MEMORY_MALLOC_HUGE 4
412#define VM_MEMORY_SBRK 5// uninteresting -- no one should call
413#define VM_MEMORY_REALLOC 6
414#define VM_MEMORY_MALLOC_TINY 7
415#define VM_MEMORY_MALLOC_LARGE_REUSABLE 8
416#define VM_MEMORY_MALLOC_LARGE_REUSED 9
417
418#define VM_MEMORY_ANALYSIS_TOOL 10
419
420#define VM_MEMORY_MALLOC_NANO 11
421#define VM_MEMORY_MALLOC_MEDIUM 12
422#define VM_MEMORY_MALLOC_PROB_GUARD 13
423
424#define VM_MEMORY_MACH_MSG 20
425#define VM_MEMORY_IOKIT 21
426#define VM_MEMORY_STACK  30
427#define VM_MEMORY_GUARD  31
428#define VM_MEMORY_SHARED_PMAP 32
429/* memory containing a dylib */
430#define VM_MEMORY_DYLIB 33
431#define VM_MEMORY_OBJC_DISPATCHERS 34
432
433/* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */
434#define VM_MEMORY_UNSHARED_PMAP 35
435
436/* for libchannel memory, mostly used on visionOS for communication with realtime threads */
437#define VM_MEMORY_LIBCHANNEL 36
438
439// Placeholders for now -- as we analyze the libraries and find how they
440// use memory, we can make these labels more specific.
441#define VM_MEMORY_APPKIT 40
442#define VM_MEMORY_FOUNDATION 41
443#define VM_MEMORY_COREGRAPHICS 42
444#define VM_MEMORY_CORESERVICES 43
445#define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES
446#define VM_MEMORY_JAVA 44
447#define VM_MEMORY_COREDATA 45
448#define VM_MEMORY_COREDATA_OBJECTIDS 46
449
450#define VM_MEMORY_ATS 50
451#define VM_MEMORY_LAYERKIT 51
452#define VM_MEMORY_CGIMAGE 52
453#define VM_MEMORY_TCMALLOC 53
454
455/* private raster data (i.e. layers, some images, QGL allocator) */
456#define VM_MEMORY_COREGRAPHICS_DATA     54
457
458/* shared image and font caches */
459#define VM_MEMORY_COREGRAPHICS_SHARED   55
460
461/* Memory used for virtual framebuffers, shadowing buffers, etc... */
462#define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS     56
463
464/* Window backing stores, custom shadow data, and compressed backing stores */
465#define VM_MEMORY_COREGRAPHICS_BACKINGSTORES    57
466
467/* x-alloc'd memory */
468#define VM_MEMORY_COREGRAPHICS_XALLOC 58
469
470/* catch-all for other uses, such as the read-only shared data page */
471#define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
472
473/* memory allocated by the dynamic loader for itself */
474#define VM_MEMORY_DYLD 60
475/* malloc'd memory created by dyld */
476#define VM_MEMORY_DYLD_MALLOC 61
477
478/* Used for sqlite page cache */
479#define VM_MEMORY_SQLITE 62
480
481/* JavaScriptCore heaps */
482#define VM_MEMORY_JAVASCRIPT_CORE 63
483#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
484/* memory allocated for the JIT */
485#define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
486#define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
487
488/* memory allocated for GLSL */
489#define VM_MEMORY_GLSL  66
490
491/* memory allocated for OpenCL.framework */
492#define VM_MEMORY_OPENCL    67
493
494/* memory allocated for QuartzCore.framework */
495#define VM_MEMORY_COREIMAGE 68
496
497/* memory allocated for WebCore Purgeable Buffers */
498#define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69
499
500/* ImageIO memory */
501#define VM_MEMORY_IMAGEIO       70
502
503/* CoreProfile memory */
504#define VM_MEMORY_COREPROFILE   71
505
506/* assetsd / MobileSlideShow memory */
507#define VM_MEMORY_ASSETSD       72
508
509/* libsystem_kernel os_once_alloc */
510#define VM_MEMORY_OS_ALLOC_ONCE 73
511
512/* libdispatch internal allocator */
513#define VM_MEMORY_LIBDISPATCH 74
514
515/* Accelerate.framework image backing stores */
516#define VM_MEMORY_ACCELERATE 75
517
518/* CoreUI image block data */
519#define VM_MEMORY_COREUI 76
520
521/* CoreUI image file */
522#define VM_MEMORY_COREUIFILE 77
523
524/* Genealogy buffers */
525#define VM_MEMORY_GENEALOGY 78
526
527/* RawCamera VM allocated memory */
528#define VM_MEMORY_RAWCAMERA 79
529
530/* corpse info for dead process */
531#define VM_MEMORY_CORPSEINFO 80
532
533/* Apple System Logger (ASL) messages */
534#define VM_MEMORY_ASL 81
535
536/* Swift runtime */
537#define VM_MEMORY_SWIFT_RUNTIME 82
538
539/* Swift metadata */
540#define VM_MEMORY_SWIFT_METADATA 83
541
542/* DHMM data */
543#define VM_MEMORY_DHMM 84
544
545/* memory needed for DFR related actions */
546#define VM_MEMORY_DFR 85
547
548/* memory allocated by SceneKit.framework */
549#define VM_MEMORY_SCENEKIT 86
550
551/* memory allocated by skywalk networking */
552#define VM_MEMORY_SKYWALK 87
553
554#define VM_MEMORY_IOSURFACE 88
555
556#define VM_MEMORY_LIBNETWORK 89
557
558#define VM_MEMORY_AUDIO 90
559
560#define VM_MEMORY_VIDEOBITSTREAM 91
561
562/* memory allocated by CoreMedia */
563#define VM_MEMORY_CM_XPC 92
564
565#define VM_MEMORY_CM_RPC 93
566
567#define VM_MEMORY_CM_MEMORYPOOL 94
568
569#define VM_MEMORY_CM_READCACHE 95
570
571#define VM_MEMORY_CM_CRABS 96
572
573/* memory allocated for QuickLookThumbnailing */
574#define VM_MEMORY_QUICKLOOK_THUMBNAILS 97
575
576/* memory allocated by Accounts framework */
577#define VM_MEMORY_ACCOUNTS 98
578
579/* memory allocated by Sanitizer runtime libraries */
580#define VM_MEMORY_SANITIZER 99
581
582/* Differentiate memory needed by GPU drivers and frameworks from generic IOKit allocations */
583#define VM_MEMORY_IOACCELERATOR 100
584
585/* memory allocated by CoreMedia for global image registration of frames */
586#define VM_MEMORY_CM_REGWARP 101
587
588/* memory allocated by EmbeddedAcousticRecognition for speech decoder */
589#define VM_MEMORY_EAR_DECODER 102
590
591/* CoreUI cached image data */
592#define VM_MEMORY_COREUI_CACHED_IMAGE_DATA 103
593
594/* ColorSync is using mmap for read-only copies of ICC profile data */
595#define VM_MEMORY_COLORSYNC 104
596
597/* backtrace info for simulated crashes */
598#define VM_MEMORY_BTINFO 105
599
600/* memory allocated by CoreMedia */
601#define VM_MEMORY_CM_HLS 106
602
603/* memory allocated for CompositorServices */
604#define VM_MEMORY_COMPOSITOR_SERVICES 107
605
606/* Reserve 230-239 for Rosetta */
607#define VM_MEMORY_ROSETTA 230
608#define VM_MEMORY_ROSETTA_THREAD_CONTEXT 231
609#define VM_MEMORY_ROSETTA_INDIRECT_BRANCH_MAP 232
610#define VM_MEMORY_ROSETTA_RETURN_STACK 233
611#define VM_MEMORY_ROSETTA_EXECUTABLE_HEAP 234
612#define VM_MEMORY_ROSETTA_USER_LDT 235
613#define VM_MEMORY_ROSETTA_ARENA 236
614#define VM_MEMORY_ROSETTA_10 239
615
616/* Reserve 240-255 for application */
617#define VM_MEMORY_APPLICATION_SPECIFIC_1  240
618#define VM_MEMORY_APPLICATION_SPECIFIC_2  241
619#define VM_MEMORY_APPLICATION_SPECIFIC_3  242
620#define VM_MEMORY_APPLICATION_SPECIFIC_4  243
621#define VM_MEMORY_APPLICATION_SPECIFIC_5  244
622#define VM_MEMORY_APPLICATION_SPECIFIC_6  245
623#define VM_MEMORY_APPLICATION_SPECIFIC_7  246
624#define VM_MEMORY_APPLICATION_SPECIFIC_8  247
625#define VM_MEMORY_APPLICATION_SPECIFIC_9  248
626#define VM_MEMORY_APPLICATION_SPECIFIC_10 249
627#define VM_MEMORY_APPLICATION_SPECIFIC_11 250
628#define VM_MEMORY_APPLICATION_SPECIFIC_12 251
629#define VM_MEMORY_APPLICATION_SPECIFIC_13 252
630#define VM_MEMORY_APPLICATION_SPECIFIC_14 253
631#define VM_MEMORY_APPLICATION_SPECIFIC_15 254
632#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
633
634#define VM_MEMORY_COUNT 256
635
636#define VM_MAKE_TAG(tag) ((tag) << 24)
637
638
639
640__END_DECLS
641
642#endif  /* _MACH_VM_STATISTICS_H_ */