示例#1
0
static void cmd_host_ram_bitmap(struct vmm_chardev *cdev, int colcnt)
{
	u32 ite, count, bn, bank_count = vmm_host_ram_bank_count();
	physical_addr_t start;

	for (bn = 0; bn < bank_count; bn++) {
		if (bn) {
			vmm_cprintf(cdev, "\n");
		}
		start = vmm_host_ram_bank_start(bn);
		count = vmm_host_ram_bank_frame_count(bn);
		vmm_cprintf(cdev, "Bank%02d\n", bn);
		vmm_cprintf(cdev, "0 : free\n");
		vmm_cprintf(cdev, "1 : used");
		for (ite = 0; ite < count; ite++) {
			if (umod32(ite, colcnt) == 0) {
				vmm_cprintf(cdev, "\n0x%"PRIPADDR": ",
				(physical_addr_t)(start + ite * VMM_PAGE_SIZE));
			}
			if (vmm_host_ram_frame_isfree(start + ite * VMM_PAGE_SIZE)) {
				vmm_cprintf(cdev, "0");
			} else {
				vmm_cprintf(cdev, "1");
			}
		}
		vmm_cprintf(cdev, "\n");
	}
}
示例#2
0
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");
}