[ 2815726 ] Fix HALFWORD and BYTE DMA read access (Jochen Friedrich)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1662 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 16 years ago
parent 558247e218
commit 5f9f92bd29

@ -1,5 +1,8 @@
2009-07-15 Arnim Laeuger <arniml>
* src/bus/ejtag_dma.c: [ 2815726 ] Fix HALFWORD and BYTE DMA read access
(Jochen Friedrich)
* src/flash/amd_flash.c: [ 2821629 ] Can't find flash_info : amd_flash.c
(MURANAKA Masaki)
* src/flash/amd_flash.c: [ 2821646 ] Possible buffer overrun in amd_detect

@ -25,6 +25,7 @@ Andrew Dyer
Chris Ellec
Ralf Engels
Steve Franks
Jochen Friedrich
Thomas Fröhlich
Mike Frysinger
Robin Getz

@ -342,10 +342,20 @@ ejtag_dma_read (urj_bus_t *bus, unsigned int addr, int sz)
switch (sz)
{
case DMA_HALFWORD:
ret &= ret & 0xffff;
if (addr & 2)
ret = (ret >> 16) & 0xffff;
else
ret = ret & 0xffff;
break;
case DMA_BYTE:
ret &= ret & 0xff;
if ((addr & 3) == 3)
ret = (ret >> 24) & 0xff;
else if ((addr & 3) == 2)
ret = (ret >> 16) & 0xff;
else if ((addr & 3) == 1)
ret = (ret >> 8) & 0xff;
else
ret = ret & 0xff;
break;
case DMA_WORD:
default:

Loading…
Cancel
Save