aboutsummaryrefslogtreecommitdiff
path: root/include/mach_debug
diff options
context:
space:
mode:
authorPasha <pasha@member.fsf.org>2024-02-20 18:49:50 +0000
committerPasha <pasha@member.fsf.org>2024-02-20 18:49:50 +0000
commit5e0b8d508ed51004bd836384293be00950ee62c9 (patch)
treee3f16b1aa8b7177032ce3ec429fbad2b1d92a876 /include/mach_debug
downloadgnumach-riscv-5e0b8d508ed51004bd836384293be00950ee62c9.tar.gz
gnumach-riscv-5e0b8d508ed51004bd836384293be00950ee62c9.tar.bz2
init gnumach copy
Diffstat (limited to 'include/mach_debug')
-rw-r--r--include/mach_debug/hash_info.h41
-rw-r--r--include/mach_debug/mach_debug.defs228
-rw-r--r--include/mach_debug/mach_debug_types.defs121
-rw-r--r--include/mach_debug/mach_debug_types.h52
-rw-r--r--include/mach_debug/slab_info.h56
-rw-r--r--include/mach_debug/vm_info.h143
6 files changed, 641 insertions, 0 deletions
diff --git a/include/mach_debug/hash_info.h b/include/mach_debug/hash_info.h
new file mode 100644
index 0000000..8e6f19c
--- /dev/null
+++ b/include/mach_debug/hash_info.h
@@ -0,0 +1,41 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+
+#ifndef _MACH_DEBUG_HASH_INFO_H_
+#define _MACH_DEBUG_HASH_INFO_H_
+
+/*
+ * Remember to update the mig type definitions
+ * in mach_debug_types.defs when adding/removing fields.
+ */
+
+typedef struct hash_info_bucket {
+ unsigned int hib_count; /* number of records in bucket */
+} hash_info_bucket_t;
+
+typedef hash_info_bucket_t *hash_info_bucket_array_t;
+
+#endif /* _MACH_DEBUG_HASH_INFO_H_ */
diff --git a/include/mach_debug/mach_debug.defs b/include/mach_debug/mach_debug.defs
new file mode 100644
index 0000000..2de7df5
--- /dev/null
+++ b/include/mach_debug/mach_debug.defs
@@ -0,0 +1,228 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ * Matchmaker definitions file for Mach kernel debugging interface.
+ */
+
+subsystem
+#if KERNEL_SERVER
+ KernelServer
+#endif /* KERNEL_SERVER */
+ mach_debug 3000;
+
+#include <mach/std_types.defs>
+#include <mach/mach_types.defs>
+#include <mach_debug/mach_debug_types.defs>
+
+skip; /* host_ipc_statistics */
+skip; /* host_ipc_statistics_reset */
+skip; /* host_callout_info */
+skip; /* host_callout_statistics */
+skip; /* host_callout_statistics_reset */
+skip; /* host_zone_info */
+skip; /* host_ipc_bucket_info */
+
+#if !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG
+
+/*
+ * Returns the exact number of extant send rights
+ * for the given receive right.
+ */
+
+routine mach_port_get_srights(
+ task : ipc_space_t;
+ name : mach_port_name_t;
+ out srights : mach_port_rights_t);
+
+skip; /* host_ipc_hash_info */
+
+/*
+ * Returns information about the marequest hash table.
+ */
+
+routine host_ipc_marequest_info(
+ host : host_t;
+ out max_requests : unsigned;
+ out info : hash_info_bucket_array_t,
+ CountInOut, Dealloc);
+
+skip; /* mach_port_space_info */
+
+/*
+ * Returns information about the dead-name requests
+ * registered with the named receive right.
+ */
+
+routine mach_port_dnrequest_info(
+ task : ipc_space_t;
+ name : mach_port_name_t;
+ out total : unsigned; /* total size of table */
+ out used : unsigned); /* amount used */
+
+#else /* !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG */
+skip; /* mach_port_get_srights */
+skip; /* host_ipc_hash_info */
+skip; /* host_ipc_marequest_info */
+skip; /* mach_port_space_info */
+skip; /* mach_port_dnrequest_info */
+#endif /* !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG */
+
+skip; /* mach_vm_region_info */
+skip; /* vm_mapped_pages_info */
+
+/*
+ * Returns stack usage information:
+ * reserved Amount of stack space reserved for pcb.
+ * total Number of stacks.
+ * space Total VM space for stacks.
+ * resident Resident VM space for stacks.
+ * maxusage Maximum amount of stack used.
+ * maxstack Address in the kernel of the largest stack.
+ */
+
+routine host_stack_usage(
+ host : host_t;
+ out reserved : vm_size_t;
+ out total : unsigned;
+ out space : vm_size_t;
+ out resident : vm_size_t;
+ out maxusage : vm_size_t;
+ out maxstack : vm_offset_t);
+
+routine processor_set_stack_usage(
+ pset : processor_set_name_t;
+ out total : unsigned;
+ out space : vm_size_t;
+ out resident : vm_size_t;
+ out maxusage : vm_size_t;
+ out maxstack : vm_offset_t);
+
+#if !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG
+
+/*
+ * Returns information about the global VP table.
+ */
+
+routine host_virtual_physical_table_info(
+ host : host_t;
+ out info : hash_info_bucket_array_t,
+ CountInOut, Dealloc);
+
+#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
+skip; /* host_virtual_physical_table_info */
+#endif /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
+
+/* The old host_load_symbol_table with a different ABI for symtab_name_t */
+skip;
+
+#if !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG
+
+/*
+ * Return the type and address of the kernel object
+ * that the given send/receive right represents.
+ */
+
+routine mach_port_kernel_object(
+ task : ipc_space_t;
+ name : mach_port_name_t;
+ out object_type : unsigned;
+ out object_addr : vm_offset_t);
+
+#else /* !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG */
+skip; /* mach_port_kernel_object */
+#endif /* !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG */
+
+#if !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG
+
+/*
+ * Returns information about a region of memory.
+ */
+
+routine mach_vm_region_info(
+ task : vm_task_t;
+ address : vm_address_t;
+ out region : vm_region_info_t;
+ /* avoid out-translation of the argument */
+ out object : memory_object_name_t =
+ MACH_MSG_TYPE_MOVE_SEND
+ ctype: mach_port_t);
+
+routine mach_vm_object_info(
+ object : memory_object_name_t;
+ out info : vm_object_info_t;
+ /* avoid out-translation of the argument */
+ out shadow : memory_object_name_t =
+ MACH_MSG_TYPE_MOVE_SEND
+ ctype: mach_port_t;
+ /* avoid out-translation of the argument */
+ out copy : memory_object_name_t =
+ MACH_MSG_TYPE_MOVE_SEND
+ ctype: mach_port_t);
+
+routine mach_vm_object_pages(
+ object : memory_object_name_t;
+ out pages : vm_page_info_array_t,
+ CountInOut, Dealloc);
+
+#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
+skip; /* mach_vm_region_info */
+skip; /* mach_vm_object_info */
+skip; /* mach_vm_object_pages */
+#endif /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
+
+/*
+ * Returns information about the memory allocation caches.
+ */
+routine host_slab_info(
+ host : host_t;
+ out info : cache_info_array_t,
+ CountInOut, Dealloc);
+
+#if !defined(MACH_KDB) || MACH_KDB
+/*
+ * Loads a symbol table for an external file into the kernel debugger.
+ * The symbol table data is an array of characters. It is assumed that
+ * the caller and the kernel debugger agree on its format.
+ */
+
+routine host_load_symbol_table(
+ host : host_priv_t;
+ task : task_t;
+ name : symtab_name_t;
+ symtab : pointer_t);
+
+#else /* !defined(MACH_KDB) || MACH_KDB */
+skip; /* host_load_symbol_table */
+#endif /* !defined(MACH_KDB) || MACH_KDB */
+
+#if !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG
+routine mach_vm_object_pages_phys(
+ object : memory_object_name_t;
+ out pages : vm_page_phys_info_array_t,
+ CountInOut, Dealloc);
+#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
+skip; /* mach_vm_object_pages_phys */
+#endif /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
diff --git a/include/mach_debug/mach_debug_types.defs b/include/mach_debug/mach_debug_types.defs
new file mode 100644
index 0000000..d897380
--- /dev/null
+++ b/include/mach_debug/mach_debug_types.defs
@@ -0,0 +1,121 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ * Mach kernel debugging interface type declarations
+ */
+
+#ifndef _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_
+#define _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_
+
+#include <mach/std_types.defs>
+
+#define CACHE_NAME_MAX_LEN 32
+type cache_name_t = struct[CACHE_NAME_MAX_LEN] of char;
+#undef CACHE_NAME_MAX_LEN
+type cache_info_t = struct {
+ integer_t flags;
+ rpc_vm_size_t cpu_pool_size;
+ rpc_vm_size_t obj_size;
+ rpc_vm_size_t align;
+ rpc_vm_size_t buf_size;
+ rpc_vm_size_t slab_size;
+ rpc_long_natural_t bufs_per_slab;
+ rpc_long_natural_t nr_objs;
+ rpc_long_natural_t nr_bufs;
+ rpc_long_natural_t nr_slabs;
+ rpc_long_natural_t nr_free_slabs;
+ cache_name_t name;
+};
+type cache_info_array_t = array[] of cache_info_t;
+
+type hash_info_bucket_t = struct {
+ unsigned hib_count;
+};
+type hash_info_bucket_array_t = array[] of hash_info_bucket_t;
+
+type vm_region_info_t = struct {
+ rpc_vm_offset_t vri_start;
+ rpc_vm_offset_t vri_end;
+ vm_prot_t vri_protection;
+ vm_prot_t vri_max_protection;
+ vm_inherit_t vri_inheritance;
+ unsigned vri_wired_count;
+ unsigned vri_user_wired_count;
+ rpc_vm_offset_t vri_object;
+ rpc_vm_offset_t vri_offset;
+ integer_t vri_needs_copy;
+ unsigned vri_sharing;
+};
+type vm_region_info_array_t = array[] of vm_region_info_t;
+
+type vm_object_info_state_t = uint32_t;
+type vm_object_info_t = struct {
+ rpc_vm_offset_t voi_object;
+ rpc_vm_size_t voi_pagesize;
+ rpc_vm_size_t voi_size;
+ unsigned voi_ref_count;
+ unsigned voi_resident_page_count;
+ unsigned voi_absent_count;
+ rpc_vm_offset_t voi_copy;
+ rpc_vm_offset_t voi_shadow;
+ rpc_vm_offset_t voi_shadow_offset;
+ rpc_vm_offset_t voi_paging_offset;
+ memory_object_copy_strategy_t voi_copy_strategy;
+ rpc_vm_offset_t voi_last_alloc;
+ unsigned voi_paging_in_progress;
+ vm_object_info_state_t voi_state;
+};
+type vm_object_info_array_t = array[] of vm_object_info_t;
+
+type vm_page_info_state_t = uint32_t;
+
+type vm_page_info_t = struct {
+ rpc_vm_offset_t vpi_offset;
+ rpc_vm_offset_t vpi_phys_addr;
+ unsigned vpi_wire_count;
+ vm_prot_t vpi_page_lock;
+ vm_prot_t vpi_unlock_request;
+ vm_page_info_state_t vpi_state;
+};
+type vm_page_info_array_t = array[] of vm_page_info_t;
+
+type vm_page_phys_info_t = struct {
+ rpc_vm_offset_t vpi_offset;
+ rpc_phys_addr_t vpi_phys_addr;
+ unsigned vpi_wire_count;
+ vm_prot_t vpi_page_lock;
+ vm_prot_t vpi_unlock_request;
+ vm_page_info_state_t vpi_state;
+};
+type vm_page_phys_info_array_t = array[] of vm_page_phys_info_t;
+
+type symtab_name_t = c_string[32];
+
+type kernel_debug_name_t = c_string[*: 64];
+
+import <mach_debug/mach_debug_types.h>;
+
+#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_DEFS_ */
diff --git a/include/mach_debug/mach_debug_types.h b/include/mach_debug/mach_debug_types.h
new file mode 100644
index 0000000..98124ad
--- /dev/null
+++ b/include/mach_debug/mach_debug_types.h
@@ -0,0 +1,52 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ * Mach kernel debugging interface type declarations
+ */
+
+#ifndef _MACH_DEBUG_MACH_DEBUG_TYPES_H_
+#define _MACH_DEBUG_MACH_DEBUG_TYPES_H_
+
+#include <mach_debug/vm_info.h>
+#include <mach_debug/slab_info.h>
+#include <mach_debug/hash_info.h>
+
+typedef char symtab_name_t[32];
+typedef const char *const_symtab_name_t;
+
+/*
+ * A fixed-length string data type intended for names given to
+ * kernel objects.
+ *
+ * Note that it is not guaranteed that the in-kernel data
+ * structure will hold KERNEL_DEBUG_NAME_MAX bytes. The given
+ * name will be truncated to fit into the target data structure.
+ */
+#define KERNEL_DEBUG_NAME_MAX (64)
+typedef char kernel_debug_name_t[KERNEL_DEBUG_NAME_MAX];
+typedef const char *const_kernel_debug_name_t;
+
+#endif /* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
diff --git a/include/mach_debug/slab_info.h b/include/mach_debug/slab_info.h
new file mode 100644
index 0000000..0f6b5a2
--- /dev/null
+++ b/include/mach_debug/slab_info.h
@@ -0,0 +1,56 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+
+#ifndef _MACH_DEBUG_SLAB_INFO_H_
+#define _MACH_DEBUG_SLAB_INFO_H_
+
+#include <sys/types.h>
+
+/*
+ * Remember to update the mig type definitions
+ * in mach_debug_types.defs when adding/removing fields.
+ */
+
+#define CACHE_NAME_MAX_LEN 32
+
+typedef struct cache_info {
+ int flags;
+ rpc_vm_size_t cpu_pool_size;
+ rpc_vm_size_t obj_size;
+ rpc_vm_size_t align;
+ rpc_vm_size_t buf_size;
+ rpc_vm_size_t slab_size;
+ rpc_long_natural_t bufs_per_slab;
+ rpc_long_natural_t nr_objs;
+ rpc_long_natural_t nr_bufs;
+ rpc_long_natural_t nr_slabs;
+ rpc_long_natural_t nr_free_slabs;
+ char name[CACHE_NAME_MAX_LEN];
+} cache_info_t;
+
+typedef cache_info_t *cache_info_array_t;
+
+#endif /* _MACH_DEBUG_SLAB_INFO_H_ */
diff --git a/include/mach_debug/vm_info.h b/include/mach_debug/vm_info.h
new file mode 100644
index 0000000..cf45a2c
--- /dev/null
+++ b/include/mach_debug/vm_info.h
@@ -0,0 +1,143 @@
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+ * File: mach_debug/vm_info.h
+ * Author: Rich Draves
+ * Date: March, 1990
+ *
+ * Definitions for the VM debugging interface.
+ */
+
+#ifndef _MACH_DEBUG_VM_INFO_H_
+#define _MACH_DEBUG_VM_INFO_H_
+
+#include <mach/boolean.h>
+#include <mach/machine/vm_types.h>
+#include <mach/vm_inherit.h>
+#include <mach/vm_prot.h>
+#include <mach/memory_object.h>
+#include <stdint.h>
+
+/*
+ * Remember to update the mig type definitions
+ * in mach_debug_types.defs when adding/removing fields.
+ */
+
+typedef struct vm_region_info {
+ rpc_vm_offset_t vri_start; /* start of region */
+ rpc_vm_offset_t vri_end; /* end of region */
+
+ vm_prot_t vri_protection; /* protection code */
+ vm_prot_t vri_max_protection; /* maximum protection */
+ vm_inherit_t vri_inheritance; /* inheritance */
+ unsigned int vri_wired_count; /* number of times wired */
+ unsigned int vri_user_wired_count; /* number of times user has wired */
+
+ rpc_vm_offset_t vri_object; /* the mapped object */
+ rpc_vm_offset_t vri_offset; /* offset into object */
+/*boolean_t*/integer_t vri_needs_copy; /* does object need to be copied? */
+ unsigned int vri_sharing; /* share map references */
+} vm_region_info_t;
+
+typedef vm_region_info_t *vm_region_info_array_t;
+
+
+typedef uint32_t vm_object_info_state_t;
+
+#define VOI_STATE_PAGER_CREATED 0x00000001
+#define VOI_STATE_PAGER_INITIALIZED 0x00000002
+#define VOI_STATE_PAGER_READY 0x00000004
+#define VOI_STATE_CAN_PERSIST 0x00000008
+#define VOI_STATE_INTERNAL 0x00000010
+#define VOI_STATE_TEMPORARY 0x00000020
+#define VOI_STATE_ALIVE 0x00000040
+#define VOI_STATE_LOCK_IN_PROGRESS 0x00000080
+#define VOI_STATE_LOCK_RESTART 0x00000100
+
+typedef struct vm_object_info {
+ rpc_vm_offset_t voi_object; /* this object */
+ rpc_vm_size_t voi_pagesize; /* object's page size */
+ rpc_vm_size_t voi_size; /* object size (valid if internal) */
+ unsigned int voi_ref_count; /* number of references */
+ unsigned int voi_resident_page_count; /* number of resident pages */
+ unsigned int voi_absent_count; /* number requested but not filled */
+ rpc_vm_offset_t voi_copy; /* copy object */
+ rpc_vm_offset_t voi_shadow; /* shadow object */
+ rpc_vm_offset_t voi_shadow_offset; /* offset into shadow object */
+ rpc_vm_offset_t voi_paging_offset; /* offset into memory object */
+ memory_object_copy_strategy_t voi_copy_strategy;
+ /* how to handle data copy */
+ rpc_vm_offset_t voi_last_alloc; /* offset of last allocation */
+ unsigned int voi_paging_in_progress; /* paging references */
+ vm_object_info_state_t voi_state; /* random state bits */
+} vm_object_info_t;
+
+typedef vm_object_info_t *vm_object_info_array_t;
+
+typedef uint32_t vm_page_info_state_t;
+
+#define VPI_STATE_BUSY 0x00000001
+#define VPI_STATE_WANTED 0x00000002
+#define VPI_STATE_TABLED 0x00000004
+#define VPI_STATE_FICTITIOUS 0x00000008
+#define VPI_STATE_PRIVATE 0x00000010
+#define VPI_STATE_ABSENT 0x00000020
+#define VPI_STATE_ERROR 0x00000040
+#define VPI_STATE_DIRTY 0x00000080
+#define VPI_STATE_PRECIOUS 0x00000100
+#define VPI_STATE_OVERWRITING 0x00000200
+#define VPI_STATE_INACTIVE 0x00000400
+#define VPI_STATE_ACTIVE 0x00000800
+#define VPI_STATE_LAUNDRY 0x00001000
+#define VPI_STATE_FREE 0x00002000
+#define VPI_STATE_REFERENCE 0x00004000
+
+#define VPI_STATE_PAGER 0x80000000 /* pager has the page */
+
+/* XXX: This structure holds a 32bit vpi_phys_addr. */
+typedef struct vm_page_info {
+ rpc_vm_offset_t vpi_offset; /* offset in object */
+ rpc_vm_offset_t vpi_phys_addr; /* physical address */
+ unsigned int vpi_wire_count; /* number of times wired */
+ vm_prot_t vpi_page_lock; /* XP access restrictions */
+ vm_prot_t vpi_unlock_request; /* outstanding unlock requests */
+ vm_page_info_state_t vpi_state; /* random state bits */
+} vm_page_info_t;
+
+typedef vm_page_info_t *vm_page_info_array_t;
+
+typedef struct vm_page_phys_info {
+ rpc_vm_offset_t vpi_offset; /* offset in object */
+ rpc_phys_addr_t vpi_phys_addr; /* physical address */
+ unsigned int vpi_wire_count; /* number of times wired */
+ vm_prot_t vpi_page_lock; /* XP access restrictions */
+ vm_prot_t vpi_unlock_request; /* outstanding unlock requests */
+ vm_page_info_state_t vpi_state; /* random state bits */
+} vm_page_phys_info_t;
+
+typedef vm_page_phys_info_t *vm_page_phys_info_array_t;
+
+#endif /* _MACH_DEBUG_VM_INFO_H_ */