qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Benoît Canet" <benoit.canet@gmail.com>,
	qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH v2 2/2] hw/integratorcp: Simplify flash remap code
Date: Tue, 20 Dec 2011 18:37:44 +0200	[thread overview]
Message-ID: <4EF0B9D8.4040606@redhat.com> (raw)
In-Reply-To: <1324397336-31206-3-git-send-email-peter.maydell@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

      reply	other threads:[~2011-12-20 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-20 16:08 [Qemu-devel] [PATCH v2 0/2] integratorcp: fix and simplify flash remap code Peter Maydell
2011-12-20 16:08 ` [Qemu-devel] [PATCH v2 1/2] hw/integratorcp: Fix sense of REMAP bit Peter Maydell
2011-12-20 16:08 ` [Qemu-devel] [PATCH v2 2/2] hw/integratorcp: Simplify flash remap code Peter Maydell
2011-12-20 16:37   ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF0B9D8.4040606@redhat.com \
    --to=avi@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=benoit.canet@gmail.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).