/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#define VM_REGION_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
(sizeof(vm_region_basic_info_data_t)/sizeof(int)))
-#define VM_REGION_EXTENDED_INFO 11
-
#define SM_COW 1
#define SM_PRIVATE 2
#define SM_EMPTY 3
* back.
*/
-struct vm_region_extended_info {
+#ifdef MACH_KERNEL_PRIVATE
+#define VM_REGION_EXTENDED_INFO__legacy 11
+struct vm_region_extended_info__legacy {
vm_prot_t protection;
unsigned int user_tag;
unsigned int pages_resident;
unsigned short shadow_depth;
unsigned char external_pager;
unsigned char share_mode;
+ /*
+ * XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
+ * DO NOT EXTEND THIS DATA STRUCTURE.
+ * IT IS NOW ABANDONED AND REPLACED WITH vm_region_extended_info BELOW.
+ * XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
+ */
};
+#define VM_REGION_EXTENDED_INFO_COUNT__legacy \
+ ((mach_msg_type_number_t) \
+ (sizeof (struct vm_region_extended_info__legacy) / \
+ sizeof (natural_t)))
+#endif /* MACH_KERNEL_PRIVATE */
+
+
+#define VM_REGION_EXTENDED_INFO 13
+struct vm_region_extended_info {
+ vm_prot_t protection;
+ unsigned int user_tag;
+ unsigned int pages_resident;
+ unsigned int pages_shared_now_private;
+ unsigned int pages_swapped_out;
+ unsigned int pages_dirtied;
+ unsigned int ref_count;
+ unsigned short shadow_depth;
+ unsigned char external_pager;
+ unsigned char share_mode;
+ unsigned int pages_reusable;
+};
typedef struct vm_region_extended_info *vm_region_extended_info_t;
typedef struct vm_region_extended_info vm_region_extended_info_data_t;
+#define VM_REGION_EXTENDED_INFO_COUNT \
+ ((mach_msg_type_number_t) \
+ (sizeof (vm_region_extended_info_data_t) / sizeof (natural_t)))
+
-#define VM_REGION_EXTENDED_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(vm_region_extended_info_data_t)/sizeof(int)))
#define VM_REGION_TOP_INFO 12
typedef struct vm_region_top_info *vm_region_top_info_t;
typedef struct vm_region_top_info vm_region_top_info_data_t;
-#define VM_REGION_TOP_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(vm_region_top_info_data_t)/sizeof(int)))
+#define VM_REGION_TOP_INFO_COUNT \
+ ((mach_msg_type_number_t) \
+ (sizeof(vm_region_top_info_data_t) / sizeof(natural_t)))
unsigned char share_mode; /* see enumeration */
boolean_t is_submap; /* submap vs obj */
vm_behavior_t behavior; /* access behavior hint */
- vm32_object_id_t object_id; /* obj/map name, not a handle */
+ vm32_object_id_t object_id; /* obj/map name, not a handle */
unsigned short user_wired_count;
};
typedef struct vm_region_submap_info *vm_region_submap_info_t;
typedef struct vm_region_submap_info vm_region_submap_info_data_t;
-#define VM_REGION_SUBMAP_INFO_COUNT ((mach_msg_type_number_t) \
- (sizeof(vm_region_submap_info_data_t)/sizeof(int)))
+#define VM_REGION_SUBMAP_INFO_COUNT \
+ ((mach_msg_type_number_t) \
+ (sizeof(vm_region_submap_info_data_t) / sizeof(natural_t)))
struct vm_region_submap_info_64 {
vm_prot_t protection; /* present access protection */
unsigned char share_mode; /* see enumeration */
boolean_t is_submap; /* submap vs obj */
vm_behavior_t behavior; /* access behavior hint */
- vm32_object_id_t object_id; /* obj/map name, not a handle */
- unsigned short user_wired_count;
+ vm32_object_id_t object_id; /* obj/map name, not a handle */
+ unsigned short user_wired_count;
+ unsigned int pages_reusable;
};
typedef struct vm_region_submap_info_64 *vm_region_submap_info_64_t;
typedef struct vm_region_submap_info_64 vm_region_submap_info_data_64_t;
-#define VM_REGION_SUBMAP_INFO_COUNT_64 ((mach_msg_type_number_t) \
- (sizeof(vm_region_submap_info_data_64_t)/sizeof(int)))
+#define VM_REGION_SUBMAP_INFO_V1_SIZE \
+ (sizeof (vm_region_submap_info_data_64_t))
+#define VM_REGION_SUBMAP_INFO_V0_SIZE \
+ (VM_REGION_SUBMAP_INFO_V1_SIZE - \
+ sizeof (unsigned int) /* pages_reusable */)
+
+#define VM_REGION_SUBMAP_INFO_V1_COUNT_64 \
+ ((mach_msg_type_number_t) \
+ (VM_REGION_SUBMAP_INFO_V1_SIZE / sizeof (natural_t)))
+#define VM_REGION_SUBMAP_INFO_V0_COUNT_64 \
+ ((mach_msg_type_number_t) \
+ (VM_REGION_SUBMAP_INFO_V0_SIZE / sizeof (natural_t)))
+
+/* set this to the latest version */
+#define VM_REGION_SUBMAP_INFO_COUNT_64 VM_REGION_SUBMAP_INFO_V1_COUNT_64
struct vm_region_submap_short_info_64 {
vm_prot_t protection; /* present access protection */
unsigned char share_mode; /* see enumeration */
boolean_t is_submap; /* submap vs obj */
vm_behavior_t behavior; /* access behavior hint */
- vm32_object_id_t object_id; /* obj/map name, not a handle */
+ vm32_object_id_t object_id; /* obj/map name, not a handle */
unsigned short user_wired_count;
};
typedef struct vm_region_submap_short_info_64 *vm_region_submap_short_info_64_t;
typedef struct vm_region_submap_short_info_64 vm_region_submap_short_info_data_64_t;
-#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t) \
- (sizeof(vm_region_submap_short_info_data_64_t)/sizeof(int)))
+#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 \
+ ((mach_msg_type_number_t) \
+ (sizeof (vm_region_submap_short_info_data_64_t) / sizeof (natural_t)))
+
struct mach_vm_read_entry {
vm_size_t size;
};
-#if VM32_SUPPORT
+#ifdef VM32_SUPPORT
struct vm32_read_entry {
vm32_address_t address;
vm32_size_t size;
typedef struct mach_vm_read_entry mach_vm_read_entry_t[VM_MAP_ENTRY_MAX];
typedef struct vm_read_entry vm_read_entry_t[VM_MAP_ENTRY_MAX];
-#if VM32_SUPPORT
+#ifdef VM32_SUPPORT
typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX];
#endif