rem: arch_vm_init_end(args); unreserve_boot_loader_ranges(args);
context: vm_init(kernel_args *args){	int err = 0;	unsigned int i;	struct preloaded_image *image;	addr_t heap_base;	void *address;	TRACE(("vm_init: entry\n"));	err = arch_vm_translation_map_init(args);	err = arch_vm_init(args);	// initialize some globals	next_region_id = 0;	region_hash_sem = -1;	max_commit = 0; // will be increased in vm_page_init	max_commit_lock = 0;	// map in the new heap and initialize it	heap_base = vm_alloc_from_kernel_args(args, HEAP_SIZE, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	TRACE(("heap at 0x%lx\n", heap_base));	heap_init(heap_base);	// initialize the free page list and physical page mapper	vm_page_init(args);	// initialize the hash table that stores the pages mapped to caches	vm_cache_init(args);	{		vm_region *region;		region_table = hash_init(REGION_HASH_TABLE_SIZE, (addr_t)&region->hash_next - (addr_t)region,			&region_compare, &region_hash);		if (region_table == NULL)			panic("vm_init: error creating aspace hash table\n");	}	vm_aspace_init();	reserve_boot_loader_ranges(args);	// do any further initialization that the architecture dependant layers may need now	arch_vm_translation_map_init_post_area(args);	arch_vm_init_post_area(args);	vm_page_init_post_area(args);	// allocate regions to represent stuff that already exists	address = (void *)ROUNDOWN(heap_base, B_PAGE_SIZE);	create_area("kernel heap", &address, B_EXACT_ADDRESS, HEAP_SIZE,		B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	allocate_kernel_args(args);	args->kernel_image.name = "kernel";		// the lazy boot loader currently doesn't set the kernel's name...	create_preloaded_image_areas(&args->kernel_image);	// allocate areas for preloaded images	for (image = args->preloaded_images; image != NULL; image = image->next) {		create_preloaded_image_areas(image);	}	// allocate kernel stacks	for (i = 0; i < args->num_cpus; i++) {		char temp[64];		sprintf(temp, "idle_thread%d_kstack", i);		address = (void *)args->cpu_kstack[i].start;		vm_create_anonymous_region(vm_get_kernel_aspace_id(), temp, &address, B_EXACT_ADDRESS,			args->cpu_kstack[i].size, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);	}	{		void *null;		vm_map_physical_memory(vm_get_kernel_aspace_id(), "bootdir", &null, B_ANY_KERNEL_ADDRESS,			args->bootdir_addr.size, B_KERNEL_READ_AREA, args->bootdir_addr.start);	}	arch_vm_init_end(args);	unreserve_boot_loader_ranges(args);	// add some debugger commands	add_debugger_command("regions", &dump_region_list, "Dump a list of all regions");	add_debugger_command("region", &dump_region, "Dump info about a particular region");	add_debugger_command("cache_ref", &dump_cache_ref, "Dump cache_ref data structure");	add_debugger_command("cache", &dump_cache, "Dump cache_ref data structure");//	add_debugger_command("dl", &display_mem, "dump memory long words (64-bit)");	add_debugger_command("dw", &display_mem, "dump memory words (32-bit)");	add_debugger_command("ds", &display_mem, "dump memory shorts (16-bit)");	add_debugger_command("db", &display_mem, "dump memory bytes (8-bit)");	TRACE(("vm_init: exit\n"));	return err;}