Organize vm print function prototypes into a new file. This will, among other files, be used by db_command.c.
* vm/vm_print.h: New file. Include <vm/vm_map.h>. Include <machine/db_machdep.h>. (vm_map_print): Add prototype. (vm_map_copy_print): Likewise. (vm_object_print): Likewise. (vm_page_print): Likewise. Include <vm/vm_object.h>. Include <vm/vm_page.h> * vm/vm_map.h (vm_map_print): Remove prototype. * vm/vm_map.c [MACH_KDB]: Include <vm/vm_print.h>. * vm/vm_object.h (vm_object_print): Remove prototype. * vm/vm_object.c [MACH_KDB]: Include <vm/vm_print.h>. * vm/vm_resident.c [MACH_KDB]: Include <vm/vm_print.h>.
From 7ad0c89384899681cdc9e39ccb7dee15f4a5bb82 Mon Sep 17 00:00:00 2001 From: Marin Ramesa <m...@hi.t-com.hr> Date: Wed, 10 Jul 2013 12:42:08 +0200 Subject: [PATCH 1/4] vm: organize vm print function prototypes --- vm/vm_map.c | 1 + vm/vm_map.h | 3 --- vm/vm_object.c | 1 + vm/vm_object.h | 2 -- vm/vm_print.h | 22 ++++++++++++++++++++++ vm/vm_resident.c | 1 + 6 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 vm/vm_print.h diff --git a/vm/vm_map.c b/vm/vm_map.c index 47db118..2be7147 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -55,6 +55,7 @@ #if MACH_KDB #include <ddb/db_output.h> +#include <vm/vm_print.h> #endif /* MACH_KDB */ diff --git a/vm/vm_map.h b/vm/vm_map.h index a15e681..5fdac4e 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -397,9 +397,6 @@ extern kern_return_t vm_map_protect(vm_map_t, vm_offset_t, vm_offset_t, extern kern_return_t vm_map_inherit(vm_map_t, vm_offset_t, vm_offset_t, vm_inherit_t); -/* Debugging: print a map */ -extern void vm_map_print(vm_map_t); - /* Look up an address */ extern kern_return_t vm_map_lookup(vm_map_t *, vm_offset_t, vm_prot_t, vm_map_version_t *, vm_object_t *, diff --git a/vm/vm_object.c b/vm/vm_object.c index d83c39f..18a909f 100644 --- a/vm/vm_object.c +++ b/vm/vm_object.c @@ -2969,6 +2969,7 @@ vm_object_page_map( #if MACH_KDB +#include <vm/vm_print.h> #define printf kdbprintf boolean_t vm_object_print_pages = FALSE; diff --git a/vm/vm_object.h b/vm/vm_object.h index 4e4c949..adeff65 100644 --- a/vm/vm_object.h +++ b/vm/vm_object.h @@ -233,8 +233,6 @@ extern void vm_object_page_map( vm_offset_t (*)(void *, vm_offset_t), void *); -extern void vm_object_print(vm_object_t); - extern vm_object_t vm_object_request_object(struct ipc_port *); extern boolean_t vm_object_coalesce( diff --git a/vm/vm_print.h b/vm/vm_print.h new file mode 100644 index 0000000..c7e558e --- /dev/null +++ b/vm/vm_print.h @@ -0,0 +1,22 @@ +#ifndef VM_PRINT_H +#define VM_PRINT_H + +#include <vm/vm_map.h> +#include <machine/db_machdep.h> + +/* Debugging: print a map */ +extern void vm_map_print(vm_map_t); + +/* Pretty-print a copy object for ddb. */ +extern void vm_map_copy_print(vm_map_copy_t); + +#include <vm/vm_object.h> + +extern void vm_object_print(vm_object_t); + +#include <vm/vm_page.h> + +extern void vm_page_print(vm_page_t); + +#endif /* VM_PRINT_H */ + diff --git a/vm/vm_resident.c b/vm/vm_resident.c index d2edf5a..7906b58 100644 --- a/vm/vm_resident.c +++ b/vm/vm_resident.c @@ -60,6 +60,7 @@ #if MACH_KDB #include <ddb/db_output.h> +#include <vm/vm_print.h> #endif /* MACH_KDB */ -- 1.8.1.4