]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
39037602 | 2 | * Copyright (c) 2000-2016 Apple Inc. All rights reserved. |
1c79356b | 3 | * |
2d21ac55 | 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ |
8f6c56a5 | 5 | * |
2d21ac55 A |
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. | |
8f6c56a5 | 14 | * |
2d21ac55 A |
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 | |
8f6c56a5 A |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
2d21ac55 A |
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. | |
8f6c56a5 | 25 | * |
2d21ac55 | 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
1c79356b A |
27 | */ |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
1c79356b A |
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 | ||
91447636 A |
66 | #ifndef _MACH_VM_STATISTICS_H_ |
67 | #define _MACH_VM_STATISTICS_H_ | |
1c79356b A |
68 | |
69 | #include <mach/machine/vm_types.h> | |
70 | ||
b0d623f7 A |
71 | |
72 | /* | |
73 | * vm_statistics | |
74 | * | |
75 | * History: | |
76 | * rev0 - original structure. | |
77 | * rev1 - added purgable info (purgable_count and purges). | |
78 | * rev2 - added speculative_count. | |
79 | * | |
80 | * Note: you cannot add any new fields to this structure. Add them below in | |
81 | * vm_statistics64. | |
82 | */ | |
83 | ||
1c79356b | 84 | struct vm_statistics { |
91447636 A |
85 | natural_t free_count; /* # of pages free */ |
86 | natural_t active_count; /* # of pages active */ | |
87 | natural_t inactive_count; /* # of pages inactive */ | |
88 | natural_t wire_count; /* # of pages wired down */ | |
89 | natural_t zero_fill_count; /* # of zero fill pages */ | |
90 | natural_t reactivations; /* # of pages reactivated */ | |
91 | natural_t pageins; /* # of pageins */ | |
92 | natural_t pageouts; /* # of pageouts */ | |
93 | natural_t faults; /* # of faults */ | |
94 | natural_t cow_faults; /* # of copy-on-writes */ | |
95 | natural_t lookups; /* object cache lookups */ | |
96 | natural_t hits; /* object cache hits */ | |
97 | ||
2d21ac55 | 98 | /* added for rev1 */ |
91447636 A |
99 | natural_t purgeable_count; /* # of pages purgeable */ |
100 | natural_t purges; /* # of pages purged */ | |
2d21ac55 A |
101 | |
102 | /* added for rev2 */ | |
103 | /* | |
104 | * NB: speculative pages are already accounted for in "free_count", | |
105 | * so "speculative_count" is the number of "free" pages that are | |
106 | * used to hold data that was read speculatively from disk but | |
107 | * haven't actually been used by anyone so far. | |
108 | */ | |
109 | natural_t speculative_count; /* # of pages speculative */ | |
1c79356b A |
110 | }; |
111 | ||
b0d623f7 | 112 | /* Used by all architectures */ |
1c79356b A |
113 | typedef struct vm_statistics *vm_statistics_t; |
114 | typedef struct vm_statistics vm_statistics_data_t; | |
115 | ||
b0d623f7 A |
116 | /* |
117 | * vm_statistics64 | |
118 | * | |
119 | * History: | |
120 | * rev0 - original structure. | |
121 | * rev1 - added purgable info (purgable_count and purges). | |
122 | * rev2 - added speculative_count. | |
123 | * ---- | |
124 | * rev3 - changed name to vm_statistics64. | |
125 | * changed some fields in structure to 64-bit on | |
126 | * arm, i386 and x86_64 architectures. | |
6d2010ae A |
127 | * rev4 - require 64-bit alignment for efficient access |
128 | * in the kernel. No change to reported data. | |
b0d623f7 A |
129 | * |
130 | */ | |
131 | ||
132 | struct vm_statistics64 { | |
133 | natural_t free_count; /* # of pages free */ | |
134 | natural_t active_count; /* # of pages active */ | |
135 | natural_t inactive_count; /* # of pages inactive */ | |
136 | natural_t wire_count; /* # of pages wired down */ | |
137 | uint64_t zero_fill_count; /* # of zero fill pages */ | |
138 | uint64_t reactivations; /* # of pages reactivated */ | |
139 | uint64_t pageins; /* # of pageins */ | |
140 | uint64_t pageouts; /* # of pageouts */ | |
141 | uint64_t faults; /* # of faults */ | |
142 | uint64_t cow_faults; /* # of copy-on-writes */ | |
143 | uint64_t lookups; /* object cache lookups */ | |
144 | uint64_t hits; /* object cache hits */ | |
b0d623f7 A |
145 | uint64_t purges; /* # of pages purged */ |
146 | natural_t purgeable_count; /* # of pages purgeable */ | |
b0d623f7 A |
147 | /* |
148 | * NB: speculative pages are already accounted for in "free_count", | |
149 | * so "speculative_count" is the number of "free" pages that are | |
150 | * used to hold data that was read speculatively from disk but | |
151 | * haven't actually been used by anyone so far. | |
152 | */ | |
153 | natural_t speculative_count; /* # of pages speculative */ | |
154 | ||
39236c6e A |
155 | /* added for rev1 */ |
156 | uint64_t decompressions; /* # of pages decompressed */ | |
157 | uint64_t compressions; /* # of pages compressed */ | |
158 | uint64_t swapins; /* # of pages swapped in (via compression segments) */ | |
159 | uint64_t swapouts; /* # of pages swapped out (via compression segments) */ | |
160 | natural_t compressor_page_count; /* # of pages used by the compressed pager to hold all the compressed data */ | |
161 | natural_t throttled_count; /* # of pages throttled */ | |
162 | natural_t external_page_count; /* # of pages that are file-backed (non-swap) */ | |
163 | natural_t internal_page_count; /* # of pages that are anonymous */ | |
164 | uint64_t total_uncompressed_pages_in_compressor; /* # of pages (uncompressed) held within the compressor. */ | |
6d2010ae | 165 | } __attribute__((aligned(8))); |
b0d623f7 A |
166 | |
167 | typedef struct vm_statistics64 *vm_statistics64_t; | |
168 | typedef struct vm_statistics64 vm_statistics64_data_t; | |
169 | ||
170 | /* | |
171 | * VM_STATISTICS_TRUNCATE_TO_32_BIT | |
172 | * | |
173 | * This is used by host_statistics() to truncate and peg the 64-bit in-kernel values from | |
174 | * vm_statistics64 to the 32-bit values of the older structure above (vm_statistics). | |
175 | */ | |
176 | #define VM_STATISTICS_TRUNCATE_TO_32_BIT(value) ((uint32_t)(((value) > UINT32_MAX ) ? UINT32_MAX : (value))) | |
177 | ||
6d2010ae A |
178 | /* |
179 | * vm_extmod_statistics | |
180 | * | |
181 | * Structure to record modifications to a task by an | |
182 | * external agent. | |
183 | * | |
184 | * History: | |
185 | * rev0 - original structure. | |
186 | */ | |
187 | ||
188 | struct vm_extmod_statistics { | |
189 | int64_t task_for_pid_count; /* # of times task port was looked up */ | |
190 | int64_t task_for_pid_caller_count; /* # of times this task called task_for_pid */ | |
191 | int64_t thread_creation_count; /* # of threads created in task */ | |
192 | int64_t thread_creation_caller_count; /* # of threads created by task */ | |
193 | int64_t thread_set_state_count; /* # of register state sets in task */ | |
194 | int64_t thread_set_state_caller_count; /* # of register state sets by task */ | |
195 | } __attribute__((aligned(8))); | |
196 | ||
197 | typedef struct vm_extmod_statistics *vm_extmod_statistics_t; | |
198 | typedef struct vm_extmod_statistics vm_extmod_statistics_data_t; | |
b0d623f7 | 199 | |
39236c6e A |
200 | typedef struct vm_purgeable_stat { |
201 | uint64_t count; | |
202 | uint64_t size; | |
203 | }vm_purgeable_stat_t; | |
204 | ||
205 | struct vm_purgeable_info { | |
206 | vm_purgeable_stat_t fifo_data[8]; | |
207 | vm_purgeable_stat_t obsolete_data; | |
208 | vm_purgeable_stat_t lifo_data[8]; | |
209 | }; | |
210 | ||
211 | typedef struct vm_purgeable_info *vm_purgeable_info_t; | |
1c79356b A |
212 | |
213 | /* included for the vm_map_page_query call */ | |
214 | ||
215 | #define VM_PAGE_QUERY_PAGE_PRESENT 0x1 | |
216 | #define VM_PAGE_QUERY_PAGE_FICTITIOUS 0x2 | |
217 | #define VM_PAGE_QUERY_PAGE_REF 0x4 | |
218 | #define VM_PAGE_QUERY_PAGE_DIRTY 0x8 | |
2d21ac55 A |
219 | #define VM_PAGE_QUERY_PAGE_PAGED_OUT 0x10 |
220 | #define VM_PAGE_QUERY_PAGE_COPIED 0x20 | |
221 | #define VM_PAGE_QUERY_PAGE_SPECULATIVE 0x40 | |
b0d623f7 | 222 | #define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80 |
593a1d5f A |
223 | #define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100 |
224 | #define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200 | |
c18c124e | 225 | #define VM_PAGE_QUERY_PAGE_CS_NX 0x400 |
1c79356b | 226 | |
91447636 | 227 | #ifdef MACH_KERNEL_PRIVATE |
1c79356b A |
228 | |
229 | /* | |
230 | * Each machine dependent implementation is expected to | |
231 | * keep certain statistics. They may do this anyway they | |
232 | * so choose, but are expected to return the statistics | |
233 | * in the following structure. | |
234 | */ | |
235 | ||
236 | struct pmap_statistics { | |
237 | integer_t resident_count; /* # of pages mapped (total)*/ | |
2d21ac55 | 238 | integer_t resident_max; /* # of pages mapped (peak) */ |
1c79356b | 239 | integer_t wired_count; /* # of pages wired */ |
39236c6e A |
240 | |
241 | integer_t device; | |
242 | integer_t device_peak; | |
243 | integer_t internal; | |
244 | integer_t internal_peak; | |
245 | integer_t external; | |
246 | integer_t external_peak; | |
247 | integer_t reusable; | |
248 | integer_t reusable_peak; | |
fe8ab488 A |
249 | uint64_t compressed __attribute__((aligned(8))); |
250 | uint64_t compressed_peak __attribute__((aligned(8))); | |
251 | uint64_t compressed_lifetime __attribute__((aligned(8))); | |
1c79356b A |
252 | }; |
253 | ||
254 | typedef struct pmap_statistics *pmap_statistics_t; | |
255 | ||
39236c6e A |
256 | #define PMAP_STATS_PEAK(field) \ |
257 | MACRO_BEGIN \ | |
258 | if (field > field##_peak) { \ | |
259 | field##_peak = field; \ | |
260 | } \ | |
261 | MACRO_END | |
262 | ||
91447636 A |
263 | #endif /* MACH_KERNEL_PRIVATE */ |
264 | ||
265 | /* | |
266 | * VM allocation flags: | |
267 | * | |
268 | * VM_FLAGS_FIXED | |
269 | * (really the absence of VM_FLAGS_ANYWHERE) | |
270 | * Allocate new VM region at the specified virtual address, if possible. | |
271 | * | |
272 | * VM_FLAGS_ANYWHERE | |
273 | * Allocate new VM region anywhere it would fit in the address space. | |
274 | * | |
275 | * VM_FLAGS_PURGABLE | |
276 | * Create a purgable VM object for that new VM region. | |
277 | * | |
278 | * VM_FLAGS_NO_PMAP_CHECK | |
279 | * (for DEBUG kernel config only, ignored for other configs) | |
280 | * Do not check that there is no stale pmap mapping for the new VM region. | |
281 | * This is useful for kernel memory allocations at bootstrap when building | |
282 | * the initial kernel address space while some memory is already in use. | |
283 | * | |
284 | * VM_FLAGS_OVERWRITE | |
285 | * The new VM region can replace existing VM regions if necessary | |
286 | * (to be used in combination with VM_FLAGS_FIXED). | |
2d21ac55 A |
287 | * |
288 | * VM_FLAGS_NO_CACHE | |
289 | * Pages brought in to this VM region are placed on the speculative | |
290 | * queue instead of the active queue. In other words, they are not | |
291 | * cached so that they will be stolen first if memory runs low. | |
91447636 | 292 | */ |
5ba3f43e | 293 | |
91447636 A |
294 | #define VM_FLAGS_FIXED 0x0000 |
295 | #define VM_FLAGS_ANYWHERE 0x0001 | |
296 | #define VM_FLAGS_PURGABLE 0x0002 | |
39037602 | 297 | #define VM_FLAGS_RANDOM_ADDR 0x0008 |
2d21ac55 | 298 | #define VM_FLAGS_NO_CACHE 0x0010 |
3e170ce0 A |
299 | #define VM_FLAGS_RESILIENT_CODESIGN 0x0020 |
300 | #define VM_FLAGS_RESILIENT_MEDIA 0x0040 | |
b0d623f7 | 301 | #define VM_FLAGS_OVERWRITE 0x4000 /* delete any existing mappings first */ |
b0d623f7 A |
302 | /* |
303 | * VM_FLAGS_SUPERPAGE_MASK | |
304 | * 3 bits that specify whether large pages should be used instead of | |
305 | * base pages (!=0), as well as the requested page size. | |
306 | */ | |
307 | #define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */ | |
fe8ab488 | 308 | #define VM_FLAGS_RETURN_DATA_ADDR 0x100000 /* Return address of target data, rather than base of page */ |
3e170ce0 | 309 | #define VM_FLAGS_RETURN_4K_DATA_ADDR 0x800000 /* Return 4K aligned address of target data */ |
1c79356b A |
310 | #define VM_FLAGS_ALIAS_MASK 0xFF000000 |
311 | #define VM_GET_FLAGS_ALIAS(flags, alias) \ | |
312 | (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 | |
5ba3f43e | 313 | #if !XNU_KERNEL_PRIVATE |
1c79356b A |
314 | #define VM_SET_FLAGS_ALIAS(flags, alias) \ |
315 | (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ | |
316 | (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) | |
5ba3f43e | 317 | #endif /* !XNU_KERNEL_PRIVATE */ |
1c79356b | 318 | |
2d21ac55 A |
319 | /* These are the flags that we accept from user-space */ |
320 | #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ | |
321 | VM_FLAGS_ANYWHERE | \ | |
322 | VM_FLAGS_PURGABLE | \ | |
39037602 | 323 | VM_FLAGS_RANDOM_ADDR | \ |
2d21ac55 | 324 | VM_FLAGS_NO_CACHE | \ |
060df5ea | 325 | VM_FLAGS_OVERWRITE | \ |
b0d623f7 | 326 | VM_FLAGS_SUPERPAGE_MASK | \ |
2d21ac55 | 327 | VM_FLAGS_ALIAS_MASK) |
fe8ab488 | 328 | #define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \ |
3e170ce0 | 329 | VM_FLAGS_RETURN_4K_DATA_ADDR | \ |
fe8ab488 | 330 | VM_FLAGS_RETURN_DATA_ADDR) |
060df5ea A |
331 | #define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \ |
332 | VM_FLAGS_ANYWHERE | \ | |
39037602 | 333 | VM_FLAGS_RANDOM_ADDR | \ |
39236c6e | 334 | VM_FLAGS_OVERWRITE| \ |
3e170ce0 A |
335 | VM_FLAGS_RETURN_DATA_ADDR |\ |
336 | VM_FLAGS_RESILIENT_CODESIGN) | |
2d21ac55 | 337 | |
fe8ab488 A |
338 | #define VM_FLAGS_SUPERPAGE_SHIFT 16 |
339 | #define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ | |
340 | #define SUPERPAGE_SIZE_ANY 1 | |
341 | #define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT) | |
342 | #define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT) | |
343 | #if defined(__x86_64__) || !defined(KERNEL) | |
344 | #define SUPERPAGE_SIZE_2MB 2 | |
345 | #define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT) | |
346 | #endif | |
347 | ||
5ba3f43e A |
348 | |
349 | #ifdef KERNEL_PRIVATE | |
350 | typedef struct { | |
351 | unsigned int | |
352 | vmkf_atomic_entry:1, | |
353 | vmkf_permanent:1, | |
354 | vmkf_guard_after:1, | |
355 | vmkf_guard_before:1, | |
356 | vmkf_submap:1, | |
357 | vmkf_already:1, | |
358 | vmkf_beyond_max:1, | |
359 | vmkf_no_pmap_check:1, | |
360 | vmkf_map_jit:1, | |
361 | vmkf_iokit_acct:1, | |
362 | vmkf_keep_map_locked:1, | |
363 | vmkf_fourk:1, | |
364 | vmkf_overwrite_immutable:1, | |
365 | __vmkf_unused:19; | |
366 | } vm_map_kernel_flags_t; | |
367 | #define VM_MAP_KERNEL_FLAGS_NONE (vm_map_kernel_flags_t) { \ | |
368 | .vmkf_atomic_entry = 0, /* keep entry atomic (no coalescing) */ \ | |
369 | .vmkf_permanent = 0, /* mapping can NEVER be unmapped */ \ | |
370 | .vmkf_guard_after = 0, /* guard page after the mapping */ \ | |
371 | .vmkf_guard_before = 0, /* guard page before the mapping */ \ | |
372 | .vmkf_submap = 0, /* mapping a VM submap */ \ | |
373 | .vmkf_already = 0, /* OK if same mapping already exists */ \ | |
374 | .vmkf_beyond_max = 0, /* map beyond the map's max offset */ \ | |
375 | .vmkf_no_pmap_check = 0, /* do not check that pmap is empty */ \ | |
376 | .vmkf_map_jit = 0, /* mark entry as JIT region */ \ | |
377 | .vmkf_iokit_acct = 0, /* IOKit accounting */ \ | |
378 | .vmkf_keep_map_locked = 0, /* keep map locked when returning from vm_map_enter() */ \ | |
379 | .vmkf_fourk = 0, /* use fourk pager */ \ | |
380 | .vmkf_overwrite_immutable = 0, /* can overwrite immutable mappings */ \ | |
381 | .__vmkf_unused = 0 \ | |
382 | } | |
383 | #endif /* KERNEL_PRIVATE */ | |
384 | ||
385 | ||
386 | ||
1c79356b A |
387 | #define VM_MEMORY_MALLOC 1 |
388 | #define VM_MEMORY_MALLOC_SMALL 2 | |
389 | #define VM_MEMORY_MALLOC_LARGE 3 | |
390 | #define VM_MEMORY_MALLOC_HUGE 4 | |
391 | #define VM_MEMORY_SBRK 5// uninteresting -- no one should call | |
55e303ae A |
392 | #define VM_MEMORY_REALLOC 6 |
393 | #define VM_MEMORY_MALLOC_TINY 7 | |
b0d623f7 A |
394 | #define VM_MEMORY_MALLOC_LARGE_REUSABLE 8 |
395 | #define VM_MEMORY_MALLOC_LARGE_REUSED 9 | |
1c79356b A |
396 | |
397 | #define VM_MEMORY_ANALYSIS_TOOL 10 | |
398 | ||
39236c6e A |
399 | #define VM_MEMORY_MALLOC_NANO 11 |
400 | ||
1c79356b A |
401 | #define VM_MEMORY_MACH_MSG 20 |
402 | #define VM_MEMORY_IOKIT 21 | |
403 | #define VM_MEMORY_STACK 30 | |
404 | #define VM_MEMORY_GUARD 31 | |
405 | #define VM_MEMORY_SHARED_PMAP 32 | |
406 | /* memory containing a dylib */ | |
407 | #define VM_MEMORY_DYLIB 33 | |
b0d623f7 | 408 | #define VM_MEMORY_OBJC_DISPATCHERS 34 |
1c79356b | 409 | |
316670eb A |
410 | /* Was a nested pmap (VM_MEMORY_SHARED_PMAP) which has now been unnested */ |
411 | #define VM_MEMORY_UNSHARED_PMAP 35 | |
412 | ||
413 | ||
1c79356b A |
414 | // Placeholders for now -- as we analyze the libraries and find how they |
415 | // use memory, we can make these labels more specific. | |
416 | #define VM_MEMORY_APPKIT 40 | |
417 | #define VM_MEMORY_FOUNDATION 41 | |
418 | #define VM_MEMORY_COREGRAPHICS 42 | |
316670eb A |
419 | #define VM_MEMORY_CORESERVICES 43 |
420 | #define VM_MEMORY_CARBON VM_MEMORY_CORESERVICES | |
9bccf70c | 421 | #define VM_MEMORY_JAVA 44 |
39236c6e A |
422 | #define VM_MEMORY_COREDATA 45 |
423 | #define VM_MEMORY_COREDATA_OBJECTIDS 46 | |
1c79356b | 424 | #define VM_MEMORY_ATS 50 |
2d21ac55 A |
425 | #define VM_MEMORY_LAYERKIT 51 |
426 | #define VM_MEMORY_CGIMAGE 52 | |
427 | #define VM_MEMORY_TCMALLOC 53 | |
428 | ||
429 | /* private raster data (i.e. layers, some images, QGL allocator) */ | |
430 | #define VM_MEMORY_COREGRAPHICS_DATA 54 | |
431 | ||
432 | /* shared image and font caches */ | |
433 | #define VM_MEMORY_COREGRAPHICS_SHARED 55 | |
434 | ||
435 | /* Memory used for virtual framebuffers, shadowing buffers, etc... */ | |
436 | #define VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS 56 | |
437 | ||
438 | /* Window backing stores, custom shadow data, and compressed backing stores */ | |
439 | #define VM_MEMORY_COREGRAPHICS_BACKINGSTORES 57 | |
440 | ||
39037602 A |
441 | /* x-alloc'd memory */ |
442 | #define VM_MEMORY_COREGRAPHICS_XALLOC 58 | |
443 | ||
2d21ac55 A |
444 | /* catch-all for other uses, such as the read-only shared data page */ |
445 | #define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS | |
1c79356b | 446 | |
1c79356b A |
447 | /* memory allocated by the dynamic loader for itself */ |
448 | #define VM_MEMORY_DYLD 60 | |
449 | /* malloc'd memory created by dyld */ | |
450 | #define VM_MEMORY_DYLD_MALLOC 61 | |
451 | ||
b0d623f7 A |
452 | /* Used for sqlite page cache */ |
453 | #define VM_MEMORY_SQLITE 62 | |
454 | ||
455 | /* JavaScriptCore heaps */ | |
456 | #define VM_MEMORY_JAVASCRIPT_CORE 63 | |
5ba3f43e | 457 | #define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE |
b0d623f7 A |
458 | /* memory allocated for the JIT */ |
459 | #define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64 | |
460 | #define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65 | |
461 | ||
462 | /* memory allocated for GLSL */ | |
463 | #define VM_MEMORY_GLSL 66 | |
464 | ||
6d2010ae A |
465 | /* memory allocated for OpenCL.framework */ |
466 | #define VM_MEMORY_OPENCL 67 | |
467 | ||
468 | /* memory allocated for QuartzCore.framework */ | |
469 | #define VM_MEMORY_COREIMAGE 68 | |
470 | ||
471 | /* memory allocated for WebCore Purgeable Buffers */ | |
472 | #define VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS 69 | |
473 | ||
474 | /* ImageIO memory */ | |
475 | #define VM_MEMORY_IMAGEIO 70 | |
476 | ||
477 | /* CoreProfile memory */ | |
478 | #define VM_MEMORY_COREPROFILE 71 | |
479 | ||
480 | /* assetsd / MobileSlideShow memory */ | |
316670eb | 481 | #define VM_MEMORY_ASSETSD 72 |
6d2010ae | 482 | |
39236c6e A |
483 | /* libsystem_kernel os_once_alloc */ |
484 | #define VM_MEMORY_OS_ALLOC_ONCE 73 | |
485 | ||
486 | /* libdispatch internal allocator */ | |
487 | #define VM_MEMORY_LIBDISPATCH 74 | |
488 | ||
489 | /* Accelerate.framework image backing stores */ | |
490 | #define VM_MEMORY_ACCELERATE 75 | |
491 | ||
492 | /* CoreUI image block data */ | |
493 | #define VM_MEMORY_COREUI 76 | |
494 | ||
fe8ab488 A |
495 | /* CoreUI image file */ |
496 | #define VM_MEMORY_COREUIFILE 77 | |
497 | ||
498 | /* Genealogy buffers */ | |
499 | #define VM_MEMORY_GENEALOGY 78 | |
500 | ||
3e170ce0 A |
501 | /* RawCamera VM allocated memory */ |
502 | #define VM_MEMORY_RAWCAMERA 79 | |
503 | ||
504 | /* corpse info for dead process */ | |
505 | #define VM_MEMORY_CORPSEINFO 80 | |
506 | ||
507 | /* Apple System Logger (ASL) messages */ | |
508 | #define VM_MEMORY_ASL 81 | |
509 | ||
39037602 A |
510 | /* Swift runtime */ |
511 | #define VM_MEMORY_SWIFT_RUNTIME 82 | |
512 | ||
513 | /* Swift metadata */ | |
514 | #define VM_MEMORY_SWIFT_METADATA 83 | |
515 | ||
516 | /* DHMM data */ | |
517 | #define VM_MEMORY_DHMM 84 | |
518 | ||
743345f9 | 519 | |
39037602 A |
520 | /* memory allocated by SceneKit.framework */ |
521 | #define VM_MEMORY_SCENEKIT 86 | |
522 | ||
523 | /* memory allocated by skywalk networking */ | |
524 | #define VM_MEMORY_SKYWALK 87 | |
525 | ||
5ba3f43e A |
526 | #define VM_MEMORY_IOSURFACE 88 |
527 | ||
528 | #define VM_MEMORY_LIBNETWORK 89 | |
529 | ||
530 | #define VM_MEMORY_AUDIO 90 | |
531 | ||
532 | #define VM_MEMORY_VIDEOBITSTREAM 91 | |
533 | ||
1c79356b A |
534 | /* Reserve 240-255 for application */ |
535 | #define VM_MEMORY_APPLICATION_SPECIFIC_1 240 | |
536 | #define VM_MEMORY_APPLICATION_SPECIFIC_16 255 | |
537 | ||
5ba3f43e | 538 | #if !XNU_KERNEL_PRIVATE |
2d21ac55 | 539 | #define VM_MAKE_TAG(tag) ((tag) << 24) |
5ba3f43e | 540 | #endif /* XNU_KERNEL_PRIVATE */ |
3e170ce0 A |
541 | |
542 | ||
543 | #if KERNEL_PRIVATE | |
544 | ||
545 | /* kernel map tags */ | |
39037602 | 546 | /* please add new definition strings to zprint */ |
3e170ce0 A |
547 | |
548 | #define VM_KERN_MEMORY_NONE 0 | |
549 | ||
550 | #define VM_KERN_MEMORY_OSFMK 1 | |
551 | #define VM_KERN_MEMORY_BSD 2 | |
552 | #define VM_KERN_MEMORY_IOKIT 3 | |
553 | #define VM_KERN_MEMORY_LIBKERN 4 | |
554 | #define VM_KERN_MEMORY_OSKEXT 5 | |
555 | #define VM_KERN_MEMORY_KEXT 6 | |
556 | #define VM_KERN_MEMORY_IPC 7 | |
557 | #define VM_KERN_MEMORY_STACK 8 | |
558 | #define VM_KERN_MEMORY_CPU 9 | |
559 | #define VM_KERN_MEMORY_PMAP 10 | |
560 | #define VM_KERN_MEMORY_PTE 11 | |
561 | #define VM_KERN_MEMORY_ZONE 12 | |
562 | #define VM_KERN_MEMORY_KALLOC 13 | |
563 | #define VM_KERN_MEMORY_COMPRESSOR 14 | |
564 | #define VM_KERN_MEMORY_COMPRESSED_DATA 15 | |
565 | #define VM_KERN_MEMORY_PHANTOM_CACHE 16 | |
566 | #define VM_KERN_MEMORY_WAITQ 17 | |
567 | #define VM_KERN_MEMORY_DIAG 18 | |
568 | #define VM_KERN_MEMORY_LOG 19 | |
569 | #define VM_KERN_MEMORY_FILE 20 | |
570 | #define VM_KERN_MEMORY_MBUF 21 | |
571 | #define VM_KERN_MEMORY_UBC 22 | |
572 | #define VM_KERN_MEMORY_SECURITY 23 | |
573 | #define VM_KERN_MEMORY_MLOCK 24 | |
39037602 A |
574 | #define VM_KERN_MEMORY_REASON 25 |
575 | #define VM_KERN_MEMORY_SKYWALK 26 | |
576 | #define VM_KERN_MEMORY_LTABLE 27 | |
577 | ||
578 | #define VM_KERN_MEMORY_FIRST_DYNAMIC 28 | |
3e170ce0 A |
579 | /* out of tags: */ |
580 | #define VM_KERN_MEMORY_ANY 255 | |
581 | #define VM_KERN_MEMORY_COUNT 256 | |
582 | ||
583 | /* end kernel map tags */ | |
584 | ||
585 | // mach_memory_info.flags | |
586 | #define VM_KERN_SITE_TYPE 0x000000FF | |
587 | #define VM_KERN_SITE_TAG 0x00000000 | |
588 | #define VM_KERN_SITE_KMOD 0x00000001 | |
589 | #define VM_KERN_SITE_KERNEL 0x00000002 | |
590 | #define VM_KERN_SITE_COUNTER 0x00000003 | |
591 | #define VM_KERN_SITE_WIRED 0x00000100 /* add to wired count */ | |
592 | #define VM_KERN_SITE_HIDE 0x00000200 /* no zprint */ | |
5ba3f43e A |
593 | #define VM_KERN_SITE_NAMED 0x00000400 |
594 | #define VM_KERN_SITE_ZONE 0x00000800 | |
3e170ce0 A |
595 | |
596 | #define VM_KERN_COUNT_MANAGED 0 | |
597 | #define VM_KERN_COUNT_RESERVED 1 | |
598 | #define VM_KERN_COUNT_WIRED 2 | |
599 | #define VM_KERN_COUNT_WIRED_MANAGED 3 | |
600 | #define VM_KERN_COUNT_STOLEN 4 | |
601 | #define VM_KERN_COUNT_LOPAGE 5 | |
602 | #define VM_KERN_COUNT_MAP_KERNEL 6 | |
603 | #define VM_KERN_COUNT_MAP_ZONE 7 | |
604 | #define VM_KERN_COUNT_MAP_KALLOC 8 | |
605 | ||
5ba3f43e A |
606 | #define VM_KERN_COUNT_WIRED_BOOT 9 |
607 | ||
608 | #define VM_KERN_COUNT_BOOT_STOLEN 10 | |
609 | ||
610 | #define VM_KERN_COUNTER_COUNT 11 | |
3e170ce0 A |
611 | |
612 | #endif /* KERNEL_PRIVATE */ | |
613 | ||
91447636 | 614 | #endif /* _MACH_VM_STATISTICS_H_ */ |