X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..13fec9890cf095cc781fdf7b8917cb03bf32dd4c:/osfmk/mach/vm_statistics.h?ds=inline diff --git a/osfmk/mach/vm_statistics.h b/osfmk/mach/vm_statistics.h index b86d0c51f..544c121ce 100644 --- a/osfmk/mach/vm_statistics.h +++ b/osfmk/mach/vm_statistics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -22,85 +22,6 @@ /* * @OSF_COPYRIGHT@ */ -/* - * HISTORY - * - * Revision 1.1.1.1 1998/09/22 21:05:31 wsanchez - * Import of Mac OS X kernel (~semeria) - * - * Revision 1.1.1.1 1998/03/07 02:25:46 wsanchez - * Import of OSF Mach kernel (~mburg) - * - * Revision 1.2.12.2 1995/01/06 19:52:25 devrcs - * mk6 CR668 - 1.3b26 merge - * added vm stats - * [1994/10/14 03:43:30 dwm] - * - * Revision 1.2.12.1 1994/09/23 02:44:40 ezf - * change marker to not FREE - * [1994/09/22 21:43:49 ezf] - * - * Revision 1.2.4.4 1993/08/03 18:30:01 gm - * CR9596: Change KERNEL to MACH_KERNEL. - * [1993/08/02 18:58:32 gm] - * - * Revision 1.2.4.3 1993/06/15 20:28:27 brezak - * Make xxx_vm_statistic for now. - * [1993/06/14 14:11:07 brezak] - * - * Revision 1.2.2.2 1993/06/08 19:03:02 brezak - * Remove page_size from vm_statistics. - * - * Revision 1.1.4.2 1993/06/02 23:49:41 jeffc - * Added to OSF/1 R1.3 from NMK15.0. - * [1993/06/02 21:18:54 jeffc] - * - * Revision 1.2 1993/04/19 16:40:55 devrcs - * ansi C conformance changes - * [1993/02/02 18:55:38 david] - * - * Revision 1.1 1992/09/30 02:32:30 robert - * Initial revision - * - * $EndLog$ - */ -/* CMU_HIST */ -/* - * Revision 2.3 91/05/14 17:03:07 mrt - * Correcting copyright - * - * Revision 2.2 91/02/05 17:37:41 mrt - * Changed to new Mach copyright - * [91/02/01 17:22:49 mrt] - * - * Revision 2.1 89/08/03 16:06:55 rwd - * Created. - * - * Revision 2.4 89/02/25 18:42:35 gm0w - * Changes for cleanup. - * - * Revision 2.3 89/02/07 00:54:39 mwyoung - * Relocated from sys/vm_statistics.h - * - * Revision 2.2 89/01/30 22:08:54 rpd - * Made variable declarations use "extern". - * [89/01/25 15:26:30 rpd] - * - * 30-Sep-86 Avadis Tevanian (avie) at Carnegie-Mellon University - * Changed "reclaim" to "inactive." - * - * 22-Aug-86 Michael Young (mwyoung) at Carnegie-Mellon University - * Made vm_stat structure kernel-only. - * - * 22-May-86 Avadis Tevanian (avie) at Carnegie-Mellon University - * Defined vm_statistics_data_t as a real typedef so that - * MatchMaker can deal with it. - * - * 14-Feb-86 Avadis Tevanian (avie) at Carnegie-Mellon University - * Created. - * - */ -/* CMU_ENDHIST */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University @@ -136,29 +57,49 @@ * */ -#ifndef VM_STATISTICS_H_ -#define VM_STATISTICS_H_ +#ifndef _MACH_VM_STATISTICS_H_ +#define _MACH_VM_STATISTICS_H_ #include struct vm_statistics { - integer_t free_count; /* # of pages free */ - integer_t active_count; /* # of pages active */ - integer_t inactive_count; /* # of pages inactive */ - integer_t wire_count; /* # of pages wired down */ - integer_t zero_fill_count; /* # of zero fill pages */ - integer_t reactivations; /* # of pages reactivated */ - integer_t pageins; /* # of pageins */ - integer_t pageouts; /* # of pageouts */ - integer_t faults; /* # of faults */ - integer_t cow_faults; /* # of copy-on-writes */ - integer_t lookups; /* object cache lookups */ - integer_t hits; /* object cache hits */ + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + natural_t zero_fill_count; /* # of zero fill pages */ + natural_t reactivations; /* # of pages reactivated */ + natural_t pageins; /* # of pageins */ + natural_t pageouts; /* # of pageouts */ + natural_t faults; /* # of faults */ + natural_t cow_faults; /* # of copy-on-writes */ + natural_t lookups; /* object cache lookups */ + natural_t hits; /* object cache hits */ + + natural_t purgeable_count; /* # of pages purgeable */ + natural_t purges; /* # of pages purged */ }; typedef struct vm_statistics *vm_statistics_t; typedef struct vm_statistics vm_statistics_data_t; +struct vm_statistics_rev0 { + natural_t free_count; /* # of pages free */ + natural_t active_count; /* # of pages active */ + natural_t inactive_count; /* # of pages inactive */ + natural_t wire_count; /* # of pages wired down */ + natural_t zero_fill_count; /* # of zero fill pages */ + natural_t reactivations; /* # of pages reactivated */ + natural_t pageins; /* # of pageins */ + natural_t pageouts; /* # of pageouts */ + natural_t faults; /* # of faults */ + natural_t cow_faults; /* # of copy-on-writes */ + natural_t lookups; /* object cache lookups */ + natural_t hits; /* object cache hits */ +}; + +typedef struct vm_statistics_rev0 *vm_statistics_rev0_t; +typedef struct vm_statistics_rev0 vm_statistics_rev0_data_t; /* included for the vm_map_page_query call */ @@ -167,6 +108,7 @@ typedef struct vm_statistics vm_statistics_data_t; #define VM_PAGE_QUERY_PAGE_REF 0x4 #define VM_PAGE_QUERY_PAGE_DIRTY 0x8 +#ifdef MACH_KERNEL_PRIVATE /* * Each machine dependent implementation is expected to @@ -182,8 +124,39 @@ struct pmap_statistics { typedef struct pmap_statistics *pmap_statistics_t; -#define VM_FLAGS_FIXED 0x0 -#define VM_FLAGS_ANYWHERE 0x1 +#endif /* MACH_KERNEL_PRIVATE */ + +/* + * VM allocation flags: + * + * VM_FLAGS_FIXED + * (really the absence of VM_FLAGS_ANYWHERE) + * Allocate new VM region at the specified virtual address, if possible. + * + * VM_FLAGS_ANYWHERE + * Allocate new VM region anywhere it would fit in the address space. + * + * VM_FLAGS_PURGABLE + * Create a purgable VM object for that new VM region. + * + * VM_FLAGS_NO_PMAP_CHECK + * (for DEBUG kernel config only, ignored for other configs) + * Do not check that there is no stale pmap mapping for the new VM region. + * This is useful for kernel memory allocations at bootstrap when building + * the initial kernel address space while some memory is already in use. + * + * VM_FLAGS_OVERWRITE + * The new VM region can replace existing VM regions if necessary + * (to be used in combination with VM_FLAGS_FIXED). + */ +#define VM_FLAGS_FIXED 0x0000 +#define VM_FLAGS_ANYWHERE 0x0001 +#define VM_FLAGS_PURGABLE 0x0002 +#ifdef KERNEL_PRIVATE +#define VM_FLAGS_NO_PMAP_CHECK 0x0004 +#endif /* KERNEL_PRIVATE */ +#define VM_FLAGS_OVERWRITE 0x0008 + #define VM_FLAGS_ALIAS_MASK 0xFF000000 #define VM_GET_FLAGS_ALIAS(flags, alias) \ (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 @@ -196,6 +169,8 @@ typedef struct pmap_statistics *pmap_statistics_t; #define VM_MEMORY_MALLOC_LARGE 3 #define VM_MEMORY_MALLOC_HUGE 4 #define VM_MEMORY_SBRK 5// uninteresting -- no one should call +#define VM_MEMORY_REALLOC 6 +#define VM_MEMORY_MALLOC_TINY 7 #define VM_MEMORY_ANALYSIS_TOOL 10 @@ -213,9 +188,9 @@ typedef struct pmap_statistics *pmap_statistics_t; #define VM_MEMORY_FOUNDATION 41 #define VM_MEMORY_COREGRAPHICS 42 #define VM_MEMORY_CARBON 43 +#define VM_MEMORY_JAVA 44 #define VM_MEMORY_ATS 50 - /* memory allocated by the dynamic loader for itself */ #define VM_MEMORY_DYLD 60 /* malloc'd memory created by dyld */ @@ -226,4 +201,5 @@ typedef struct pmap_statistics *pmap_statistics_t; #define VM_MEMORY_APPLICATION_SPECIFIC_16 255 #define VM_MAKE_TAG(tag) (tag<<24) -#endif /* VM_STATISTICS_H_ */ + +#endif /* _MACH_VM_STATISTICS_H_ */