-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)))
+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_V2_SIZE \
+ (sizeof (vm_region_submap_info_data_64_t))
+#define VM_REGION_SUBMAP_INFO_V1_SIZE \
+ (VM_REGION_SUBMAP_INFO_V2_SIZE - \
+ sizeof (vm_object_id_t) /* object_id_full */ )
+#define VM_REGION_SUBMAP_INFO_V0_SIZE \
+ (VM_REGION_SUBMAP_INFO_V1_SIZE - \
+ sizeof (unsigned int) /* pages_reusable */ )
+
+#define VM_REGION_SUBMAP_INFO_V2_COUNT_64 \
+ ((mach_msg_type_number_t) \
+ (VM_REGION_SUBMAP_INFO_V2_SIZE / sizeof (natural_t)))
+#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_V2_COUNT_64