X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d7e50217d7adf6e52786a38bcaa4cd698cb9a79e..4452a7af2eac33dbad800bcc91f2399d62c18f53:/osfmk/mach/vm_statistics.h diff --git a/osfmk/mach/vm_statistics.h b/osfmk/mach/vm_statistics.h index 754aec336..cdcd19405 100644 --- a/osfmk/mach/vm_statistics.h +++ b/osfmk/mach/vm_statistics.h @@ -1,16 +1,19 @@ /* - * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. * - * @APPLE_LICENSE_HEADER_START@ - * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER @@ -20,7 +23,7 @@ * Please see the License for the specific language governing rights and * limitations under the License. * - * @APPLE_LICENSE_HEADER_END@ + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ @@ -60,29 +63,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 */ @@ -91,6 +114,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 @@ -106,8 +130,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 @@ -120,6 +175,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 @@ -140,7 +197,6 @@ typedef struct pmap_statistics *pmap_statistics_t; #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 */ @@ -151,4 +207,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_ */