summaryrefslogtreecommitdiffstats
path: root/hw/dma.c
Commit message (Collapse)AuthorAgeFilesLines
* hw/dma.c: Fix conversion of ioport_register* to MemoryRegionJulien Grall2013-01-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | The commit 582299336879504353e60c7937fbc70fea93f3da introduced a 1-shift for some offset in DMA emulation. Before the previous commit, which converted ioport_register_* to MemoryRegion, the DMA controller registered 8 ioports with the following formula: base + ((8 + i) << d->shift) where 0 <= i < 8 When an IO occured within a Memory Region, DMA callback receives an offset relative to the start address. Here the start address is: base + (8 << d->shift). The offset should be: (i << d->shift). After the shift is reverted, the offsets are 0..7 not 1..8. Fixes LP#1089996. Reported-by: Andreas Gustafsson <gson@gson.org> Signed-off-by: Julien Grall <julien.grall@citrix.com> Tested-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* janitor: do not rely on indirect inclusions of or from qemu-char.hPaolo Bonzini2012-12-191-0/+1
| | | | | | | | | Various header files rely on qemu-char.h including qemu-config.h or main-loop.h, but they really do not need qemu-char.h at all (particularly interesting is the case of the block layer!). Clean this up, and also add missing inclusions of qemu-char.h itself. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw/dma.c: Replace register_ioport_*Julien Grall2012-12-041-36/+70
| | | | | | | | | | Replace all register_ioport_*() with the new Memory API functions. This permits to use the new Memory stuff like listeners. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr] Signed-off-by: Andreas Färber <afaerber@suse.de>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-231-2/+2
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* dma: Avoid reentrancy in DMA transfer handlersKevin Wolf2011-11-041-0/+10
| | | | | | | | | | | | | | | With the conversion of the block layer to coroutines, bdrv_read/write have changed to run a nested event loop that calls qemu_bh_poll. Consequently a scheduled BH can be called while a DMA transfer handler runs and this means that DMA_run becomes reentrant. Devices haven't been designed to cope with that, so instead of running a nested transfer handler just wait for the next invocation of the BH from the main loop. This fixes some problems with the floppy device. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* savevm: Add DeviceState paramAlex Williamson2010-07-061-2/+2
| | | | | | | | | | When available, we'd like to be able to access the DeviceState when registering a savevm. For buses with a get_dev_path() function, this will allow us to create more unique savevm id strings. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Compile dma only onceBlue Swirl2010-05-221-7/+10
| | | | | | | | Use a qemu_irq to request CPU exit. 7 compilations less for the full build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* dma/sb16: make clang analyzer not complainmalc2010-01-121-1/+0
| | | | Signed-off-by: malc <av1474@comtv.ru>
* vmstate: add version_id argument to post_loadJuan Quintela2009-10-051-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-2/+2
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-2/+2
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* vmstate: port dma deviceJuan Quintela2009-09-111-51/+34
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "Introduce reset notifier order"Jan Kiszka2009-06-291-1/+1
| | | | | | | | | This reverts commit 8217606e6edb49591b4a6fd5a0d1229cebe470a9 (and updates later added users of qemu_register_reset), we solved the problem it originally addressed less invasively. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Introduce reset notifier orderJan Kiszka2009-05-221-1/+1
| | | | | | | | | | | | | | | Add the parameter 'order' to qemu_register_reset and sort callbacks on registration. On system reset, callbacks with lower order will be invoked before those with higher order. Update all existing users to the standard order 0. Note: At least for x86, the existing users seem to assume that handlers are called in their registration order. Therefore, the patch preserves this property. If someone feels bored, (s)he could try to identify this dependency and express it properly on callback registration. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Delete some unused macros detected with -Wp,-Wunused-macros useblueswir12009-03-161-2/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6856 c046a42c-6fe2-441c-8c8c-71466251a162
* Use a dedicated function to request exit from execution loopaurel322009-03-071-1/+1
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
* Use the ARRAY_SIZE() macro where appropriate.malc2008-12-221-4/+2
| | | | | | | | | Change from v1: Avoid changing the existing coding style in certain files. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6120 c046a42c-6fe2-441c-8c8c-71466251a162
* Make DMA bottom-half driven (v2)aliguori2008-10-311-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Re-add static qualifier. Fix annother occurance of "const static".pbrook2008-07-051-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4850 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove staticmalc2008-07-051-1/+1
| | | | | | Also avoids GCC warning about old style declaration git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4849 c046a42c-6fe2-441c-8c8c-71466251a162
* pthreads-based audio and miscellaneous audio clean-up (malc).balrog2008-01-141-0/+10
| | | | | | | ESD support (malc, Frederick Reeve). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3917 c046a42c-6fe2-441c-8c8c-71466251a162
* qemu_put signedness fixes, by Andre Przywara.ths2007-12-161-6/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3824 c046a42c-6fe2-441c-8c8c-71466251a162
* Break up vl.h.pbrook2007-11-171-1/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix incorrect target_ulong use in hw devicesblueswir12007-06-081-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2962 c046a42c-6fe2-441c-8c8c-71466251a162
* cpu_single_env usage fixbellard2005-11-211-1/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1644 c046a42c-6fe2-441c-8c8c-71466251a162
* indent fixesbellard2004-11-141-17/+17
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1140 c046a42c-6fe2-441c-8c8c-71466251a162
* audio merge (malc)bellard2004-11-071-55/+160
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1125 c046a42c-6fe2-441c-8c8c-71466251a162
* high page register support for PPC PREPbellard2004-06-211-7/+42
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@951 c046a42c-6fe2-441c-8c8c-71466251a162
* new reset APIbellard2004-06-201-1/+8
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@938 c046a42c-6fe2-441c-8c8c-71466251a162
* debugbellard2004-06-071-0/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@910 c046a42c-6fe2-441c-8c8c-71466251a162
* fixed invalid command testbellard2004-04-121-7/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@721 c046a42c-6fe2-441c-8c8c-71466251a162
* dma clean up - added missing read accessesbellard2004-04-061-61/+88
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@711 c046a42c-6fe2-441c-8c8c-71466251a162
* win32 port (initial patch by kazu)bellard2004-03-311-5/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@692 c046a42c-6fe2-441c-8c8c-71466251a162
* io port API changebellard2004-03-141-12/+12
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@661 c046a42c-6fe2-441c-8c8c-71466251a162
* DMA API changebellard2004-02-251-27/+18
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@646 c046a42c-6fe2-441c-8c8c-71466251a162
* 16 bit DMA fix (malc)bellard2004-01-191-28/+10
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@572 c046a42c-6fe2-441c-8c8c-71466251a162
* debug fixesbellard2004-01-051-13/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@542 c046a42c-6fe2-441c-8c8c-71466251a162
* Soundblaster 16 support (malc)bellard2003-11-131-0/+395
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@455 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud