if (!write) memset (myaddr, 0, len); if (errno == 0) return EIO;
if (region->attrib.cache) res = dcache_xfer_memory (target_dcache, memaddr, myaddr, reg_len, write);
target_xfer_memory (memaddr, myaddr, len, write)     CORE_ADDR memaddr;     char *myaddr;     int len;     int write;{  int curlen;  int res;  struct target_ops *t;  struct target_stack_item *item;  /* to_xfer_memory is not guaranteed to set errno, even when it returns     0.  */  errno = 0;  /* The quick case is that the top target does it all.  */  res = current_target.to_xfer_memory			(memaddr, myaddr, len, write, &current_target);  if (res == len)    return 0;  if (res > 0)    goto bump;  /* If res <= 0 then we call it again in the loop.  Ah well.  */  for (; len > 0;)    {      curlen = len;		/* Want to do it all */      for (item = target_stack; item; item = item->next)	{	  t = item->target_ops;	  if (!t->to_has_memory)	    continue;	  res = t->to_xfer_memory (memaddr, myaddr, curlen, write, t);	  if (res > 0)	    break;		/* Handled all or part of xfer */	  if (t->to_has_all_memory)	    break;	}      if (res <= 0)	{	  /* If this address is for nonexistent memory,	     read zeros if reading, or do nothing if writing.  Return error. */	  if (!write)	    memset (myaddr, 0, len);	  if (errno == 0)	    return EIO;	  else	    return errno;	}bump:      memaddr += res;      myaddr  += res;      len     -= res;    }  return 0;			/* We managed to cover it all somehow. */}