From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2hQ-0000sp-Gt for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:38:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rd2hK-00037z-GS for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:37:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rd2hK-00037j-6P for qemu-devel@nongnu.org; Tue, 20 Dec 2011 11:37:50 -0500 Message-ID: <4EF0B9D8.4040606@redhat.com> Date: Tue, 20 Dec 2011 18:37:44 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1324397336-31206-1-git-send-email-peter.maydell@linaro.org> <1324397336-31206-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1324397336-31206-3-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] hw/integratorcp: Simplify flash remap code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Anthony Liguori , =?ISO-8859-1?Q?Beno=EEt_?= =?ISO-8859-1?Q?Canet?= , qemu-devel@nongnu.org, patches@linaro.org On 12/20/2011 06:08 PM, Peter Maydell wrote: > Use the new memory mutator API to simplify the flash remap code; > this allows us to drop the flash_mapped flag. > > > -static void integratorcm_do_remap(integratorcm_state *s, int flash) > +static void integratorcm_do_remap(integratorcm_state *s) > { > - if (!flash) { > - if (s->flash_mapped) { > - sysbus_del_memory(&s->busdev, &s->flash); > - s->flash_mapped = false; > - } > + /* Sync memory region state with CM_CTRL REMAP bit: > + * bit 0 => flash at address 0; bit 1 => RAM > + */ > + if (s->cm_ctrl & 4) { > + memory_region_set_enabled(&s->flash, 0); > } else { > - if (!s->flash_mapped) { > - sysbus_add_memory_overlap(&s->busdev, 0, &s->flash, 1); > - s->flash_mapped = true; > - } > + memory_region_set_enabled(&s->flash, 1); > } memory_region_set_enabled(&s->flash, !(s->cm_ctrl & 4)); shows that the bit is inverted and passed directly to flash.enabled. -- error compiling committee.c: too many arguments to function