Exemple #1
0
static void cmd_host_info(struct vmm_chardev *cdev)
{
    const char *attr;
    struct vmm_devtree_node *node;
    u32 total = vmm_host_ram_total_frame_count();

    attr = NULL;
    node = vmm_devtree_getnode(VMM_DEVTREE_PATH_SEPARATOR_STRING);
    if (node) {
        vmm_devtree_read_string(node,
                                VMM_DEVTREE_MODEL_ATTR_NAME, &attr);
    }
    if (attr) {
        vmm_cprintf(cdev, "%-20s: %s\n", "Host Name", attr);
    } else {
        vmm_cprintf(cdev, "%-20s: %s\n", "Host Name", CONFIG_BOARD);
    }

    vmm_cprintf(cdev, "%-20s: %u\n", "Boot CPU",
                vmm_smp_bootcpu_id());
    vmm_cprintf(cdev, "%-20s: %u\n", "Total Online CPUs",
                vmm_num_online_cpus());
    vmm_cprintf(cdev, "%-20s: %u MB\n", "Total VAPOOL",
                CONFIG_VAPOOL_SIZE_MB);
    vmm_cprintf(cdev, "%-20s: %u MB\n", "Total RAM",
                ((total *VMM_PAGE_SIZE) >> 20));

    arch_board_print_info(cdev);
}
Exemple #2
0
static int cmd_host_info(struct vmm_chardev *cdev)
{
	int rc;
	const char *attr;
	unsigned long hwid;
	struct vmm_devtree_node *node;
	u32 total = vmm_host_ram_total_frame_count();

	attr = NULL;
	node = vmm_devtree_getnode(VMM_DEVTREE_PATH_SEPARATOR_STRING);
	if (node) {
		vmm_devtree_read_string(node,
					VMM_DEVTREE_MODEL_ATTR_NAME, &attr);
		vmm_devtree_dref_node(node);
	}
	if (attr) {
		vmm_cprintf(cdev, "%-25s: %s\n", "Host Name", attr);
	} else {
		vmm_cprintf(cdev, "%-25s: %s\n", "Host Name", CONFIG_BOARD);
	}

	rc = vmm_smp_map_hwid(vmm_smp_bootcpu_id(), &hwid);
	if (rc)
		return rc;

	vmm_cprintf(cdev, "%-25s: 0x%lx\n", "Boot CPU Hardware ID", hwid);
	vmm_cprintf(cdev, "%-25s: %u\n", "Total Online CPUs",
		    vmm_num_online_cpus());
	vmm_cprintf(cdev, "%-25s: %u MB\n", "Total VAPOOL",
		    CONFIG_VAPOOL_SIZE_MB);
	vmm_cprintf(cdev, "%-25s: %lu MB\n", "Total RAM",
		    ((total *VMM_PAGE_SIZE) >> 20));

	arch_board_print_info(cdev);

	return VMM_OK;
}