···10791079 tcsetattr(STDIN_FILENO, TCSANOW, &orig_term);10801080}1081108110821082-/*L:21510831083- * This is the generic routine we call when the Guest uses LHCALL_NOTIFY.10841084- */10851085-static void handle_output(unsigned long addr)10861086-{10871087- /*10881088- * Early console write is done using notify on a nul-terminated string10891089- * in Guest memory. It's also great for hacking debugging messages10901090- * into a Guest.10911091- */10921092- if (addr >= guest_limit)10931093- errx(1, "Bad NOTIFY %#lx", addr);10941094-10951095- write(STDOUT_FILENO, from_guest_phys(addr),10961096- strnlen(from_guest_phys(addr), guest_limit - addr));10971097-}10981098-10991082/*L:21711001083 * We do PCI. This is mainly done to let us test the kernel virtio PCI11011084 * code.···2645266226462663 /* We read from the /dev/lguest device to run the Guest. */26472664 readval = pread(lguest_fd, ¬ify, sizeof(notify), cpu_id);26482648-26492649- /* One unsigned long means the Guest did HCALL_NOTIFY */26502665 if (readval == sizeof(notify)) {26512651- if (notify.trap == 0x1F) {26522652- verbose("Notify on address %#08x\n",26532653- notify.addr);26542654- handle_output(notify.addr);26552655- } else if (notify.trap == 13) {26662666+ if (notify.trap == 13) {26562667 verbose("Emulating instruction at %#x\n",26572668 getreg(eip));26582669 emulate_insn(notify.insn);