From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11641 invoked by alias); 1 Aug 2006 13:20:23 -0000 Received: (qmail 11632 invoked by uid 22791); 1 Aug 2006 13:20:22 -0000 X-Spam-Check-By: sourceware.org Received: from potter.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 01 Aug 2006 13:20:20 +0000 Received: (qmail 652 invoked from network); 1 Aug 2006 13:20:19 -0000 Received: from unknown (HELO zigzag.lvk.cs.msu.su) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Aug 2006 13:20:19 -0000 From: Vladimir Prus To: Daniel Jacobowitz Subject: Re: Flash support part 2: flash programming Date: Tue, 01 Aug 2006 13:20:00 -0000 User-Agent: KMail/1.7.2 Cc: Mark Kettenis , eliz@gnu.org, gdb-patches@sources.redhat.com References: <200607201342.30712.vladimir@codesourcery.com> <200608010923.25082.vladimir@codesourcery.com> <20060801131252.GA9084@nevyn.them.org> In-Reply-To: <20060801131252.GA9084@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608011720.14398.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00010.txt.bz2 On Tuesday 01 August 2006 17:12, Daniel Jacobowitz wrote: > On Tue, Aug 01, 2006 at 09:23:23AM +0400, Vladimir Prus wrote: > > No, this is intentional change. The target_write_memory_blocks uses it, > > and it was made explicitly so that we can produce progress report while > > loading data. It's currently used by MI frontend, and if > > target_write_memory_blocks is coded to call progress reporting routine > > only at the end of a section, it will make progress reporting much less > > usefull. > > Vlad, I'm a little scared by how many versions of this patch are > floating around :-) I have a copy from the internal list on 2006-07-12 > which uses target_write_memory instead. Yep, that one does not have *any* progress reporting, I believe. > And there's also the > xfer_partial_using_stratum change we discussed, in order to keep using > target_write_memory_partial. > > But the last suggestion I can find in the discussion was: > > But that suggests there's a simpler way to do it. We could break out > > target_write into another function, target_write_with_progress, that > > takes a progress callback. Have target_write call that without a > > callback. Then you could use the new interface to write out large > > chunks of data, without having to perform the partial transfers > > yourself, or having to do the bookkeeping for the progress bar. > > Maybe that would be easier. > > I think that may be the way to go; I don't really want to re-export > target_write_partial if we can avoid it. I realize you're not going to > have time to revise these for a while, so I may take care of this, > once we're finished with expat. I think I've missed that email. Yes, for a flash code having target_write_with_progress is more convenient. The trick is, and still was, to propagate callbacks all the way along the all codepaths, including writing memory via xfer_using_stratum and writing target objects via to_xfer_partial. For the case at hand, flash code knows it will only be writing to target object, so it can directly call target_write_partial. That's why I took this route. - Volodya