patch d10v sim large transfers.

trix
2002-06-13T16:27:43Z

[-- Attachment #1: Type: text/plain, Size: 146 bytes --]

The size is never decrements in xfer_mem.

If there are no objections, I will commit this patch.

Tom

--
Tom Rix
GCC Engineer
trix@redhat.com

[-- Attachment #2: sim-d10v-seg-1001-fa.patch --]
[-- Type: text/plain, Size: 783 bytes --]

sim/d10v:
2002-06-13 Tom Rix <trix@redhat.com>

* interp.c (xfer_mem): Fix transfers across multiple segments.

Index: sim/d10v/interp.c
===================================================================
RCS file: /cvs/src/src/sim/d10v/interp.c,v
retrieving revision 1.11
diff -d -u -p -r1.11 interp.c
--- sim/d10v/interp.c 9 Jun 2002 15:45:46 -0000 1.11
+++ sim/d10v/interp.c 13 Jun 2002 16:18:34 -0000
@@ -715,7 +715,7 @@ xfer_mem (SIM_ADDR virt,
{
int xfered = 0;

- while (xfered < size)
+ while (0 < size)
{
uint8 *memory;
unsigned long phys;
@@ -754,9 +754,10 @@ xfer_mem (SIM_ADDR virt,
virt += phys_size;
buffer += phys_size;
xfered += phys_size;
+ size -= phys_size;
}

- return size;
+ return xfered;
}