From bc23dda642a299fb1380294f4e5940511bc512ef Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Fri, 5 Aug 2016 15:00:07 +0200 Subject: Augment VM maps with task names This change improves the clarity of "no more room for ..." VM map allocation errors. * kern/task.c (task_init): Call vm_map_set_name for the kernel map. (task_create): Call vm_map_set_name where appropriate. * vm/vm_map.c (vm_map_setup): Set map name to NULL. (vm_map_find_entry_anywhere): Update error message to include map name. * vm/vm_map.h (struct vm_map): New `name' member. (vm_map_set_name): New inline function. --- vm/vm_map.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vm/vm_map.h') diff --git a/vm/vm_map.h b/vm/vm_map.h index 74c86a79..9e946c5e 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -194,6 +194,8 @@ struct vm_map { /* boolean_t */ wiring_required:1; /* All memory wired? */ unsigned int timestamp; /* Version number */ + + const char *name; /* Associated name */ }; #define vm_map_to_entry(map) ((struct vm_map_entry *) &(map)->hdr.links) @@ -466,6 +468,12 @@ boolean_t vm_map_lookup_entry( vm_offset_t address, vm_map_entry_t *entry); /* OUT */ +static inline void vm_map_set_name(vm_map_t map, const char *name) +{ + map->name = name; +} + + /* * Functions implemented as macros */ -- cgit v1.2.3