Commit 09723aa114f9755b860dd1b6ad2281dea47b77fc

Authored by blueswir1
1 parent 3af72a4d

Revert part of r5853

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6057 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 5 additions and 2 deletions
hw/sparc32_dma.c
... ... @@ -45,6 +45,9 @@ do { printf("DMA: " fmt , ##args); } while (0)
45 45  
46 46 #define DMA_REGS 4
47 47 #define DMA_SIZE (4 * sizeof(uint32_t))
  48 +/* We need the mask, because one instance of the device is not page
  49 + aligned (ledma, start address 0x0010) */
  50 +#define DMA_MASK (DMA_SIZE - 1)
48 51  
49 52 #define DMA_VER 0xa0000000
50 53 #define DMA_INTR 1
... ... @@ -156,7 +159,7 @@ static uint32_t dma_mem_readl(void *opaque, target_phys_addr_t addr)
156 159 DMAState *s = opaque;
157 160 uint32_t saddr;
158 161  
159   - saddr = addr >> 2;
  162 + saddr = (addr & DMA_MASK) >> 2;
160 163 DPRINTF("read dmareg " TARGET_FMT_plx ": 0x%8.8x\n", addr,
161 164 s->dmaregs[saddr]);
162 165  
... ... @@ -168,7 +171,7 @@ static void dma_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
168 171 DMAState *s = opaque;
169 172 uint32_t saddr;
170 173  
171   - saddr = addr >> 2;
  174 + saddr = (addr & DMA_MASK) >> 2;
172 175 DPRINTF("write dmareg " TARGET_FMT_plx ": 0x%8.8x -> 0x%8.8x\n", addr,
173 176 s->dmaregs[saddr], val);
174 177 switch (saddr) {
... ...