#ifndef _MACH_VM_REGION_H_
#define _MACH_VM_REGION_H_
#include <mach/boolean.h>
#include <mach/vm_prot.h>
#include <mach/vm_inherit.h>
#include <mach/vm_behavior.h>
#include <mach/vm_types.h>
#include <mach/message.h>
#include <mach/machine/vm_param.h>
#include <mach/machine/vm_types.h>
#include <mach/memory_object_types.h>
#include <sys/cdefs.h>
#pragma pack(4)
typedef uint32_t vm32_object_id_t;
#define VM_REGION_INFO_MAX (1024)
typedef int *vm_region_info_t;
typedef int *vm_region_info_64_t;
typedef int *vm_region_recurse_info_t;
typedef int *vm_region_recurse_info_64_t;
typedef int vm_region_flavor_t;
typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
#define VM_REGION_BASIC_INFO_64 9
struct vm_region_basic_info_64 {
vm_prot_t protection;
vm_prot_t max_protection;
vm_inherit_t inheritance;
boolean_t shared;
boolean_t reserved;
memory_object_offset_t offset;
vm_behavior_t behavior;
unsigned short user_wired_count;
};
typedef struct vm_region_basic_info_64 *vm_region_basic_info_64_t;
typedef struct vm_region_basic_info_64 vm_region_basic_info_data_64_t;
#define VM_REGION_BASIC_INFO_COUNT_64 ((mach_msg_type_number_t) \
(sizeof(vm_region_basic_info_data_64_t)/sizeof(int)))
#define VM_REGION_BASIC_INFO 10
struct vm_region_basic_info {
vm_prot_t protection;
vm_prot_t max_protection;
vm_inherit_t inheritance;
boolean_t shared;
boolean_t reserved;
uint32_t offset;
vm_behavior_t behavior;
unsigned short user_wired_count;
};
typedef struct vm_region_basic_info *vm_region_basic_info_t;
typedef struct vm_region_basic_info vm_region_basic_info_data_t;
#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
#define SM_SHARED 4
#define SM_TRUESHARED 5
#define SM_PRIVATE_ALIASED 6
#define SM_SHARED_ALIASED 7
#define SM_LARGE_PAGE 8
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;
};
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(int)))
#define VM_REGION_TOP_INFO 12
struct vm_region_top_info {
unsigned int obj_id;
unsigned int ref_count;
unsigned int private_pages_resident;
unsigned int shared_pages_resident;
unsigned char share_mode;
};
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)))
struct vm_region_submap_info {
vm_prot_t protection;
vm_prot_t max_protection;
vm_inherit_t inheritance;
uint32_t offset;
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;
boolean_t is_submap;
vm_behavior_t behavior;
vm32_object_id_t object_id;
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)))
struct vm_region_submap_info_64 {
vm_prot_t protection;
vm_prot_t max_protection;
vm_inherit_t inheritance;
memory_object_offset_t offset;
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;
boolean_t is_submap;
vm_behavior_t behavior;
vm32_object_id_t object_id;
unsigned short user_wired_count;
};
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)))
struct vm_region_submap_short_info_64 {
vm_prot_t protection;
vm_prot_t max_protection;
vm_inherit_t inheritance;
memory_object_offset_t offset;
unsigned int user_tag;
unsigned int ref_count;
unsigned short shadow_depth;
unsigned char external_pager;
unsigned char share_mode;
boolean_t is_submap;
vm_behavior_t behavior;
vm32_object_id_t object_id;
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)))
struct mach_vm_read_entry {
mach_vm_address_t address;
mach_vm_size_t size;
};
struct vm_read_entry {
vm_address_t address;
vm_size_t size;
};
#if VM32_SUPPORT
struct vm32_read_entry {
vm32_address_t address;
vm32_size_t size;
};
#endif
#define VM_MAP_ENTRY_MAX (256)
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
typedef struct vm32_read_entry vm32_read_entry_t[VM_MAP_ENTRY_MAX];
#endif
#pragma pack()
#define VM_PAGE_INFO_MAX
typedef int *vm_page_info_t;
typedef int vm_page_info_data_t[VM_PAGE_INFO_MAX];
typedef int vm_page_info_flavor_t;
#define VM_PAGE_INFO_BASIC 1
struct vm_page_info_basic {
int disposition;
int ref_count;
vm_object_id_t object_id;
memory_object_offset_t offset;
int depth;
int __pad;
};
typedef struct vm_page_info_basic *vm_page_info_basic_t;
typedef struct vm_page_info_basic vm_page_info_basic_data_t;
#define VM_PAGE_INFO_BASIC_COUNT ((mach_msg_type_number_t) \
(sizeof(vm_page_info_basic_data_t)/sizeof(int)))
#endif