X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..527f99514973766e9c0382a4d8550dfb00f54939:/osfmk/mach/vm_statistics.h diff --git a/osfmk/mach/vm_statistics.h b/osfmk/mach/vm_statistics.h index cf89a6471..fa0560559 100644 --- a/osfmk/mach/vm_statistics.h +++ b/osfmk/mach/vm_statistics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2009 Apple Inc. All rights reserved. + * Copyright (c) 2000-2016 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -222,6 +222,7 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; #define VM_PAGE_QUERY_PAGE_EXTERNAL 0x80 #define VM_PAGE_QUERY_PAGE_CS_VALIDATED 0x100 #define VM_PAGE_QUERY_PAGE_CS_TAINTED 0x200 +#define VM_PAGE_QUERY_PAGE_CS_NX 0x400 #ifdef MACH_KERNEL_PRIVATE @@ -245,9 +246,9 @@ struct pmap_statistics { integer_t external_peak; integer_t reusable; integer_t reusable_peak; - uint64_t compressed; - uint64_t compressed_peak; - uint64_t compressed_lifetime; + uint64_t compressed __attribute__((aligned(8))); + uint64_t compressed_peak __attribute__((aligned(8))); + uint64_t compressed_lifetime __attribute__((aligned(8))); }; typedef struct pmap_statistics *pmap_statistics_t; @@ -289,61 +290,101 @@ typedef struct pmap_statistics *pmap_statistics_t; * queue instead of the active queue. In other words, they are not * cached so that they will be stolen first if memory runs low. */ + #define VM_FLAGS_FIXED 0x0000 #define VM_FLAGS_ANYWHERE 0x0001 #define VM_FLAGS_PURGABLE 0x0002 +#define VM_FLAGS_RANDOM_ADDR 0x0008 #define VM_FLAGS_NO_CACHE 0x0010 -#ifdef KERNEL_PRIVATE -#define VM_FLAGS_PERMANENT 0x0100 /* mapping can NEVER be unmapped */ -#define VM_FLAGS_GUARD_AFTER 0x0200 /* guard page after the mapping */ -#define VM_FLAGS_GUARD_BEFORE 0x0400 /* guard page before the mapping */ -#define VM_FLAGS_SUBMAP 0x0800 /* mapping a VM submap */ -#define VM_FLAGS_ALREADY 0x1000 /* OK if same mapping already exists */ -#define VM_FLAGS_BEYOND_MAX 0x2000 /* map beyond the map's max offset */ -#endif /* KERNEL_PRIVATE */ +#define VM_FLAGS_RESILIENT_CODESIGN 0x0020 +#define VM_FLAGS_RESILIENT_MEDIA 0x0040 #define VM_FLAGS_OVERWRITE 0x4000 /* delete any existing mappings first */ -#ifdef KERNEL_PRIVATE -#define VM_FLAGS_NO_PMAP_CHECK 0x8000 /* do not check that pmap is empty */ -#define VM_FLAGS_MAP_JIT 0x80000 /* Used to mark an entry as describing a JIT region */ -#endif /* KERNEL_PRIVATE */ -#define VM_FLAGS_RETURN_DATA_ADDR 0x100000 /* Return address of target data, rather than base of page */ /* * VM_FLAGS_SUPERPAGE_MASK * 3 bits that specify whether large pages should be used instead of * base pages (!=0), as well as the requested page size. */ #define VM_FLAGS_SUPERPAGE_MASK 0x70000 /* bits 0x10000, 0x20000, 0x40000 */ -#define VM_FLAGS_SUPERPAGE_SHIFT 16 - -#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ -#define SUPERPAGE_SIZE_ANY 1 -#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT) -#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT) -#if defined(__x86_64__) || !defined(KERNEL) -#define SUPERPAGE_SIZE_2MB 2 -#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<> 24 +#if !XNU_KERNEL_PRIVATE #define VM_SET_FLAGS_ALIAS(flags, alias) \ (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) +#endif /* !XNU_KERNEL_PRIVATE */ /* These are the flags that we accept from user-space */ #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ VM_FLAGS_ANYWHERE | \ VM_FLAGS_PURGABLE | \ + VM_FLAGS_RANDOM_ADDR | \ VM_FLAGS_NO_CACHE | \ VM_FLAGS_OVERWRITE | \ VM_FLAGS_SUPERPAGE_MASK | \ VM_FLAGS_ALIAS_MASK) -#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | VM_FLAGS_RETURN_DATA_ADDR) +#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \ + VM_FLAGS_RETURN_4K_DATA_ADDR | \ + VM_FLAGS_RETURN_DATA_ADDR) #define VM_FLAGS_USER_REMAP (VM_FLAGS_FIXED | \ VM_FLAGS_ANYWHERE | \ + VM_FLAGS_RANDOM_ADDR | \ VM_FLAGS_OVERWRITE| \ - VM_FLAGS_RETURN_DATA_ADDR) + VM_FLAGS_RETURN_DATA_ADDR |\ + VM_FLAGS_RESILIENT_CODESIGN) + +#define VM_FLAGS_SUPERPAGE_SHIFT 16 +#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */ +#define SUPERPAGE_SIZE_ANY 1 +#define VM_FLAGS_SUPERPAGE_NONE (SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT) +#define VM_FLAGS_SUPERPAGE_SIZE_ANY (SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT) +#if defined(__x86_64__) || !defined(KERNEL) +#define SUPERPAGE_SIZE_2MB 2 +#define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<