*** target-i386-dm/helper2.c.orig Wed Jan 7 12:37:30 2009 --- target-i386-dm/helper2.c Mon Dec 22 16:09:55 2008 *************** *** 47,52 **** --- 47,54 ---- #include #include + #include + #include #include *************** *** 570,575 **** --- 572,580 ---- extern int shutdown_requested; CPUState *env = opaque; ioreq_t *req = cpu_get_ioreq(); + static int fd = -1; + char buf[16]; + useconds_t udelay; handle_buffered_io(env); if (req) { *************** *** 606,611 **** --- 611,625 ---- } req->state = STATE_IORESP_READY; + if (send_vcpu != 0) { + if (fd == -1) + fd = open("/tmp/qemu_delay", O_RDONLY); + if (fd >= 0) { + pread(fd, buf, sizeof buf, 0L); + udelay = atoi(buf); + usleep(udelay); + } + } xc_evtchn_notify(xce_handle, ioreq_local_port[send_vcpu]); } }