This is a virtual device designed for educational purposes. The only spec I found is in QEMU documentation: https://github.com/qemu/qemu/blob/master/docs/specs/edu.rst According to the documentation: direction (0: from RAM to EDU, 1: from EDU to RAM) The macros confused me and my goal is to make the direction easier to differentiate. Something like EDU_DMA_TO_PCI_BUS and EDU_DMA_FROM_PCI_BUS would also work. Do you have any suggestions?
thanks Peter Maydell <peter.mayd...@linaro.org> 於 2025年3月12日 週三 上午2:41寫道: > On Thu, 27 Feb 2025 at 07:32, Jason Chien <jason.ch...@sifive.com> wrote: > > > > This commit renames the macros to accurately reflect the direction of > > DMA operations. > > > > EDU_DMA_TO_PCI now represents reading memory content into the EDU buffer, > > while EDU_DMA_FROM_PCI represents writing EDU buffer content to memory. > > The EDU device is a PCI device, so if it is reading > then it is reading data from the PCI bus, and if it is > writing then it is writing data to the PCI bus. So I > think there's an argument that the current names make > sense. > > Plus, presumably this device model is implementing the hardware > half of a defined specification. The authoritative source for > what names the 0 and 1 values of the DIR bit should be named > would be that specification. > > Where is that spec, and what does it say? If it says 0 for > FROM and 1 for TO, that's what we should use. If it's the > other way around, that's an error in our device implementation > that we should correct. > > thanks > -- PMM >