#include #include START(pid, tid, d0, d1, d2, d3) { UNUSED(d2); UNUSED(d3); check(pid == 0, "wrong src process ID"); check(tid == 1, "wrong root thread ID"); check(d0 == SYS_USER_SPAWNED, "wrong op"); printf("fdt at %lx\n", d1); void *fdt = (void *)d1; int chosen_offset = fdt_path_offset(fdt, "/chosen"); check(chosen_offset > 0, "couldn't find /chosen"); const char *stdout = fdt_getprop(fdt, chosen_offset, "stdout-path", NULL); check(stdout != NULL, "couldn't find stdout-path"); /* ideally we would also parse the stdout node and check that it is some * reasonable value, but I'm not sure if we can trust the Qemu fdt to be * stable. The above is suspicious enough I suppose */ printf("found stdout at: %s\n", stdout); ok(); }