rem: dprintf("cache at %p:\n", cache); dprintf("cache_ref: %p\n", cache->ref); dprintf("source: %p\n", cache->source); dprintf("store: %p\n", cache->store);  dprintf("virtual_size: 0x%Lx\n", cache->virtual_size); dprintf("temporary: %ld\n", cache->temporary); dprintf("scan_skip: %ld\n", cache->scan_skip); dprintf("page_list:\n");
add: kprintf("cache at %p:\n", cache); kprintf("cache_ref: %p\n", cache->ref); kprintf("source: %p\n", cache->source); kprintf("store: %p\n", cache->store); kprintf("virtual_size: 0x%Lx\n", cache->virtual_size); kprintf("temporary: %ld\n", cache->temporary); kprintf("scan_skip: %ld\n", cache->scan_skip); kprintf("page_list:\n");
context: dump_cache(int argc, char **argv){	addr_t address;	vm_cache *cache;	vm_page *page;	if (argc < 2) {		dprintf("cache: not enough arguments\n");		return 0;	}	if (strlen(argv[1]) < 2 || argv[1][0] != '0' || argv[1][1] != 'x') {		dprintf("cache: invalid argument, pass address\n");		return 0;	}	address = atoul(argv[1]);	cache = (vm_cache *)address;	dprintf("cache at %p:\n", cache);	dprintf("cache_ref: %p\n", cache->ref);	dprintf("source: %p\n", cache->source);	dprintf("store: %p\n", cache->store);	// XXX 64-bit	dprintf("virtual_size: 0x%Lx\n", cache->virtual_size);	dprintf("temporary: %ld\n", cache->temporary);	dprintf("scan_skip: %ld\n", cache->scan_skip);	dprintf("page_list:\n");	for (page = cache->page_list; page != NULL; page = page->cache_next) {		// XXX offset is 64-bit		if (page->type == PAGE_TYPE_PHYSICAL) {			dprintf(" %p ppn 0x%lx offset 0x%Lx type %ld state %ld (%s) ref_count %ld\n",				page, page->ppn, page->offset, page->type, page->state, 				page_state_to_text(page->state), page->ref_count);		} else if(page->type == PAGE_TYPE_DUMMY) {			dprintf(" %p DUMMY PAGE state %ld (%s)\n", 				page, page->state, page_state_to_text(page->state));		} else			dprintf(" %p UNKNOWN PAGE type %ld\n", page, page->type);	}	return 0;}