From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Jju-0005TT-8c for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5Jjt-0003LX-3j for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:57:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5Jjs-0003LR-Rk for qemu-devel@nongnu.org; Sun, 18 Sep 2011 11:57:05 -0400 Message-ID: <4E7614CC.4000206@redhat.com> Date: Sun, 18 Sep 2011 18:57:00 +0300 From: Avi Kivity MIME-Version: 1.0 References: <4E75EA08.4090809@web.de> In-Reply-To: <4E75EA08.4090809@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel , Richard Henderson On 09/18/2011 03:54 PM, Jan Kiszka wrote: > From: Jan Kiszka > > We can express the offset of old portio completely via > MemoryRegionPortio::offset by splitting up regions of different offsets > and adjusting those offsets appropriately. Please split into two patches - core and isa. > + /* Copy the sub-list and null-terminate it. */ > + pio = g_new(MemoryRegionPortio, count + 1); > + memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count); > + memset(pio + count, 0, sizeof(MemoryRegionPortio)); Wish: g_copy(pio, pio_init, count); // aka std::copy() > @@ -396,12 +395,12 @@ static void memory_region_iorange_read(IORange *iorange, > > *data = ((uint64_t)1<< (width * 8)) - 1; > if (mrp) { > - *data = mrp->read(mr->opaque, offset + mr->offset); > + *data = mrp->read(mr->opaque, offset + mrp->offset); > } else if (width == 2) { > mrp = find_portio(mr, offset, 1, false); > assert(mrp); > - *data = mrp->read(mr->opaque, offset + mr->offset) | > - (mrp->read(mr->opaque, offset + mr->offset + 1)<< 8); > + *data = mrp->read(mr->opaque, offset + mrp->offset) | > + (mrp->read(mr->opaque, offset + mrp->offset + 1)<< 8); > } > return; > } So long as mr->offset exists, you need to take it into account. And I don't want to remove memory_region_set_offset() until everything (that can potentially use it, at least) has been converted. -- error compiling committee.c: too many arguments to function