From b26a48ecf406221c5d777ca7a9cded6ce7f0e1d6 Mon Sep 17 00:00:00 2001 From: Rutger Hofman Date: Tue, 17 Nov 2009 09:05:28 +0000 Subject: [PATCH] writemem.c: big-endian shifted one too many. Bug report by Snowel Xue git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1683 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 5 +++++ urjtag/src/bus/writemem.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 8050492f..83b75480 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,8 @@ +2009-11-17 Rutger Hofman + + * src/bus/writemem.c: big-endian write shifts one too much. Patch by + Snowel Xue + 2009-11-10 Arnim Laeuger * src/svf/svf.c: use urj_tap_chain_defer_clock() for state traversals diff --git a/urjtag/src/bus/writemem.c b/urjtag/src/bus/writemem.c index 6f400b54..b0cc50c8 100644 --- a/urjtag/src/bus/writemem.c +++ b/urjtag/src/bus/writemem.c @@ -130,8 +130,8 @@ urj_bus_writemem (urj_bus_t *bus, FILE *f, uint32_t addr, uint32_t len) { if (urj_big_endian) { + data <<= 8; /* first shift doesn't matter: data = 0 */ data |= b[bidx++]; - data <<= 8; } else data |= (b[bidx++] << ((step - j) * 8));