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