From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9KjM-0005qC-FA for qemu-devel@nongnu.org; Wed, 27 May 2009 11:07:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9KjH-0005nZ-QR for qemu-devel@nongnu.org; Wed, 27 May 2009 11:07:47 -0400 Received: from [199.232.76.173] (port=37405 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9KjH-0005nS-I2 for qemu-devel@nongnu.org; Wed, 27 May 2009 11:07:43 -0400 Received: from mx2.redhat.com ([66.187.237.31]:48537) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9KjG-0003M8-UZ for qemu-devel@nongnu.org; Wed, 27 May 2009 11:07:43 -0400 Message-ID: <4A1D5731.2080907@redhat.com> Date: Wed, 27 May 2009 18:07:29 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/3] Add PhysicalMemoryRegion type References: <1243157375-14329-1-git-send-email-avi@redhat.com> <1243157375-14329-2-git-send-email-avi@redhat.com> <20090527141644.GB29118@lst.de> In-Reply-To: <20090527141644.GB29118@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org Christoph Hellwig wrote: > On Sun, May 24, 2009 at 12:29:33PM +0300, Avi Kivity wrote: > >> +struct PhysicalMemoryRegion { >> + target_phys_addr_t start_addr; >> + target_phys_addr_t size; >> + ram_addr_t ram_addr; >> + ram_addr_t region_offset; >> +}; >> + >> +PhysicalMemoryRegion *physical_memory_region_register( >> + target_phys_addr_t start_addr, >> + target_phys_addr_t size, >> + ram_addr_t ram_addr) >> +{ >> + return physical_memory_region_register_offset(start_addr, size, ram_addr, 0); >> +} >> > > Wouldn't it be much easier if the client allocated the > PhysicalMemoryRegion and just passed a pointer to it into > physical_memory_region_register? That would also take care of the > physical_memory_region_register vs > physical_memory_region_register_offset split as the non-offset case > would just not fill out the region_offset field and be done with it. > Good idea. I'll make is so. It's a little different from current qemu style, but I don't this that should be a problem. -- error compiling committee.c: too many arguments to function