static void cmd_host_ram_bitmap(struct vmm_chardev *cdev, int colcnt) { u32 ite, total = vmm_host_ram_total_frame_count(); physical_addr_t base = vmm_host_ram_base(); vmm_cprintf(cdev, "0 : free\n"); vmm_cprintf(cdev, "1 : used"); for (ite = 0; ite < total; ite++) { if (umod32(ite, colcnt) == 0) { if (sizeof(u64) == sizeof(physical_addr_t)) { vmm_cprintf(cdev, "\n0x%016llx: ", base + ite * VMM_PAGE_SIZE); } else { vmm_cprintf(cdev, "\n0x%08x: ", base + ite * VMM_PAGE_SIZE); } } if (vmm_host_ram_frame_isfree(base + ite * VMM_PAGE_SIZE)) { vmm_cprintf(cdev, "0"); } else { vmm_cprintf(cdev, "1"); } } vmm_cprintf(cdev, "\n"); }
void cmd_ram_stats(vmm_chardev_t *cdev) { u32 free = vmm_host_ram_free_frame_count(); u32 total = vmm_host_ram_total_frame_count(); physical_addr_t base = vmm_host_ram_base(); vmm_cprintf(cdev, "Base Address : 0x%08x\n", base); vmm_cprintf(cdev, "Frame Size : %d (0x%08x)\n", VMM_PAGE_SIZE, VMM_PAGE_SIZE); vmm_cprintf(cdev, "Free Frames : %d (0x%08x)\n", free, free); vmm_cprintf(cdev, "Total Frames : %d (0x%08x)\n", total, total); }
static void cmd_host_ram_info(struct vmm_chardev *cdev) { u32 free = vmm_host_ram_free_frame_count(); u32 total = vmm_host_ram_total_frame_count(); physical_addr_t base = vmm_host_ram_base(); if (sizeof(u64) == sizeof(physical_addr_t)) { vmm_cprintf(cdev, "Base Address : 0x%016llx\n", base); } else { vmm_cprintf(cdev, "Base Address : 0x%08x\n", base); } vmm_cprintf(cdev, "Frame Size : %d (0x%08x)\n", VMM_PAGE_SIZE, VMM_PAGE_SIZE); vmm_cprintf(cdev, "Free Frames : %d (0x%08x)\n", free, free); vmm_cprintf(cdev, "Total Frames : %d (0x%08x)\n", total, total); }