Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* patch d10v sim large transfers.
@ 2002-06-13  9:27 trix
  2002-06-13  9:39 ` Andrew Cagney
  2002-06-13  9:41 ` Frank Ch. Eigler
  0 siblings, 2 replies; 4+ messages in thread
From: trix @ 2002-06-13  9:27 UTC (permalink / raw)
  To: gdb-patches

[-- 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;
 }
 
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: patch d10v sim large transfers.
  2002-06-13  9:27 patch d10v sim large transfers trix
@ 2002-06-13  9:39 ` Andrew Cagney
  2002-06-13  9:41 ` Frank Ch. Eigler
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2002-06-13  9:39 UTC (permalink / raw)
  To: trix; +Cc: gdb-patches

> 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;
>  }

Is the problem fixed if, instead, you do a short/partial read 
(eliminating the loop?).

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: patch d10v sim large transfers.
  2002-06-13  9:27 patch d10v sim large transfers trix
  2002-06-13  9:39 ` Andrew Cagney
@ 2002-06-13  9:41 ` Frank Ch. Eigler
  2002-06-13  9:59   ` trix
  1 sibling, 1 reply; 4+ messages in thread
From: Frank Ch. Eigler @ 2002-06-13  9:41 UTC (permalink / raw)
  To: trix; +Cc: gdb-patches


trix wrote:

> The size is never decrements in xfer_mem.
> [...]

Why would it need to be decremented?
xfered is incremented; why not just return that value?


- FChE


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: patch d10v sim large transfers.
  2002-06-13  9:41 ` Frank Ch. Eigler
@ 2002-06-13  9:59   ` trix
  0 siblings, 0 replies; 4+ messages in thread
From: trix @ 2002-06-13  9:59 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: gdb-patches

"Frank Ch. Eigler" wrote:

> trix wrote:
>
> > The size is never decrements in xfer_mem.
> > [...]
>
> Why would it need to be decremented?
> xfered is incremented; why not just return that value?
>
> - FChE

size is used as an argument to sim_d10v_translate_addr.

On a large transfer, one requiring this loop,  phys_size does not
change.

This is bad.

Tom

--
Tom Rix
GCC Engineer
trix@redhat.com




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-06-13 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-13  9:27 patch d10v sim large transfers trix
2002-06-13  9:39 ` Andrew Cagney
2002-06-13  9:41 ` Frank Ch. Eigler
2002-06-13  9:59   ` trix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox