int simple_bus_fdt_init(char *bus_node_path, FDTMachineInfo *fdti, void *unused) { int i; int num_children = qemu_devtree_get_num_children(fdti->fdt, bus_node_path, 1); char **children = qemu_devtree_get_children(fdti->fdt, bus_node_path, 1); int initialRoutinesPending = fdti->routinesPending; DB_PRINT("num child devices: %d\n", num_children); for (i = 0; i < num_children; i++) { struct FDTInitNodeArgs *init_args = g_malloc0(sizeof(*init_args)); init_args->node_path = children[i]; init_args->fdti = fdti; fdti->routinesPending++; qemu_coroutine_enter(qemu_coroutine_create(fdt_init_node), init_args); } if (fdti->routinesPending != initialRoutinesPending) { bdrv_drain_all(); } g_free(children); return 0; }
static int cpus_probe(char *node_path, FDTMachineInfo *fdti, void *opaque) { int num_children = qemu_devtree_get_num_children(fdti->fdt, "/cpus", 1); char **children = qemu_devtree_get_children(fdti->fdt, "/cpus", 1); int i; for (i = 0; i < num_children; i++) { sopc_device_probe(fdti, children[i], 0, 0xE0000000); } fdti->sysbus_base = 0xE0000000; return 0; }
static int simple_bus_fdt_init(char *node_path, FDTMachineInfo *fdti) { int i; int num_children = qemu_devtree_get_num_children(fdti->fdt, node_path, 1); char **children = qemu_devtree_get_children(fdti->fdt, node_path, 1); DB_PRINT_NP(num_children ? 0 : 1, "num child devices: %d\n", num_children); for (i = 0; i < num_children; i++) { struct FDTInitNodeArgs *init_args = g_malloc0(sizeof(*init_args)); init_args->node_path = children[i]; init_args->fdti = fdti; qemu_coroutine_enter(qemu_coroutine_create(fdt_init_node), init_args); } g_free(children); return 0; }