Make DMA bottom-half driven (v2)

The current DMA routines are driven by a call in main_loop_wait() after every
select.

This patch converts the DMA code to be driven by a constantly rescheduled
bottom half.  The advantage of using a scheduled bottom half is that we can
stop scheduling the bottom half when there no DMA channels are runnable.  This
means we can potentially detect this case and sleep longer in the main loop.

The only two architectures implementing DMA_run() are cris and i386.  For cris,
I converted it to a simple repeating bottom half.  I've only compile tested
this as cris does not seem to work on a 64-bit host.  It should be functionally
identical to the previous implementation so I expect it to work.

For x86, I've made sure to only fire the DMA bottom half if there is a DMA
channel that is runnable.  The effect of this is that unless you're using sb16
or a floppy disk, the DMA bottom half never fires.

You probably should test this malc.  My own benchmarks actually show slight
improvement by it's possible the change in timing could affect your demos.

Since v1, I've changed the code to use a BH instead of a timer.  cris at least
seems to depend on faster than 10ms polling.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5573 c046a42c-6fe2-441c-8c8c-71466251a162
9 files changed
tree: 6f95d3dacabf2f99be4d0b60e41ad855385ee055
  1. audio/
  2. bsd-user/
  3. darwin-user/
  4. fpu/
  5. gdb-xml/
  6. hw/
  7. keymaps/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-mips/
  17. target-ppc/
  18. target-sh4/
  19. target-sparc/
  20. tcg/
  21. tests/
  22. .gitignore
  23. a.out.h
  24. aes.c
  25. aes.h
  26. aio.c
  27. alpha-dis.c
  28. alpha.ld
  29. arm-dis.c
  30. arm-semi.c
  31. arm.ld
  32. block-bochs.c
  33. block-cloop.c
  34. block-cow.c
  35. block-dmg.c
  36. block-nbd.c
  37. block-parallels.c
  38. block-qcow.c
  39. block-qcow2.c
  40. block-raw-posix.c
  41. block-raw-win32.c
  42. block-vmdk.c
  43. block-vpc.c
  44. block-vvfat.c
  45. block.c
  46. block.h
  47. block_int.h
  48. bswap.h
  49. bt-host.c
  50. bt-vhci.c
  51. buffered_file.c
  52. buffered_file.h
  53. Changelog
  54. check_ops.sh
  55. cocoa.m
  56. configure
  57. console.c
  58. console.h
  59. COPYING
  60. COPYING.LIB
  61. cpu-all.h
  62. cpu-defs.h
  63. cpu-exec.c
  64. cris-dis.c
  65. curses.c
  66. curses_keys.h
  67. cutils.c
  68. d3des.c
  69. d3des.h
  70. dis-asm.h
  71. disas.c
  72. disas.h
  73. dyngen-exec.h
  74. dyngen.c
  75. elf.h
  76. elf_ops.h
  77. exec-all.h
  78. exec.c
  79. feature_to_c.sh
  80. gdbstub.c
  81. gdbstub.h
  82. gen-icount.h
  83. host-utils.c
  84. host-utils.h
  85. hostregs_helper.h
  86. hpet.h
  87. hppa-dis.c
  88. hppa.ld
  89. i386-dis.c
  90. i386.ld
  91. ia64.ld
  92. keymaps.c
  93. kqemu.c
  94. kqemu.h
  95. LICENSE
  96. loader.c
  97. m68k-dis.c
  98. m68k-semi.c
  99. m68k.ld
  100. MAINTAINERS
  101. Makefile
  102. Makefile.target
  103. migration-tcp.c
  104. migration.c
  105. migration.h
  106. mips-dis.c
  107. mips.ld
  108. mipsel.ld
  109. monitor.c
  110. nbd.c
  111. nbd.h
  112. net-checksum.c
  113. net.h
  114. osdep.c
  115. osdep.h
  116. ppc-dis.c
  117. ppc.ld
  118. ppc64.ld
  119. qemu-aio.h
  120. qemu-binfmt-conf.sh
  121. qemu-char.h
  122. qemu-common.h
  123. qemu-doc.texi
  124. qemu-img.c
  125. qemu-img.texi
  126. qemu-lock.h
  127. qemu-log.h
  128. qemu-malloc.c
  129. qemu-nbd.c
  130. qemu-nbd.texi
  131. qemu-tech.texi
  132. qemu-timer.h
  133. qemu-tool.c
  134. qemu_socket.h
  135. readline.c
  136. README
  137. s390-dis.c
  138. s390.ld
  139. sdl.c
  140. sdl_keysym.h
  141. sh4-dis.c
  142. softmmu-semi.h
  143. softmmu_defs.h
  144. softmmu_exec.h
  145. softmmu_header.h
  146. softmmu_template.h
  147. sparc-dis.c
  148. sparc.ld
  149. sparc64.ld
  150. sys-queue.h
  151. sysemu.h
  152. tap-win32.c
  153. texi2pod.pl
  154. thunk.c
  155. thunk.h
  156. TODO
  157. translate-all.c
  158. uboot_image.h
  159. usb-linux.c
  160. VERSION
  161. vgafont.h
  162. vl.c
  163. vnc.c
  164. vnc_keysym.h
  165. vnchextile.h
  166. x86_64.ld
  167. x_keymap.c