mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-07-21 10:24:33 +00:00
portio: Allow to mark portio lists as coalesced MMIO flushing
This will enable us to remove all remaining explicit calls of qemu_flush_coalesced_mmio_buffer in IO handlers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
518420dfec
commit
c76bc480e2
|
@ -64,11 +64,13 @@ typedef struct PortioList {
|
||||||
struct MemoryRegion **regions;
|
struct MemoryRegion **regions;
|
||||||
void *opaque;
|
void *opaque;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
bool flush_coalesced_mmio;
|
||||||
} PortioList;
|
} PortioList;
|
||||||
|
|
||||||
void portio_list_init(PortioList *piolist, Object *owner,
|
void portio_list_init(PortioList *piolist, Object *owner,
|
||||||
const struct MemoryRegionPortio *callbacks,
|
const struct MemoryRegionPortio *callbacks,
|
||||||
void *opaque, const char *name);
|
void *opaque, const char *name);
|
||||||
|
void portio_list_set_flush_coalesced(PortioList *piolist);
|
||||||
void portio_list_destroy(PortioList *piolist);
|
void portio_list_destroy(PortioList *piolist);
|
||||||
void portio_list_add(PortioList *piolist,
|
void portio_list_add(PortioList *piolist,
|
||||||
struct MemoryRegion *address_space,
|
struct MemoryRegion *address_space,
|
||||||
|
|
9
ioport.c
9
ioport.c
|
@ -139,6 +139,12 @@ void portio_list_init(PortioList *piolist,
|
||||||
piolist->opaque = opaque;
|
piolist->opaque = opaque;
|
||||||
piolist->owner = owner;
|
piolist->owner = owner;
|
||||||
piolist->name = name;
|
piolist->name = name;
|
||||||
|
piolist->flush_coalesced_mmio = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void portio_list_set_flush_coalesced(PortioList *piolist)
|
||||||
|
{
|
||||||
|
piolist->flush_coalesced_mmio = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void portio_list_destroy(PortioList *piolist)
|
void portio_list_destroy(PortioList *piolist)
|
||||||
|
@ -231,6 +237,9 @@ static void portio_list_add_1(PortioList *piolist,
|
||||||
*/
|
*/
|
||||||
memory_region_init_io(&mrpio->mr, piolist->owner, &portio_ops, mrpio,
|
memory_region_init_io(&mrpio->mr, piolist->owner, &portio_ops, mrpio,
|
||||||
piolist->name, off_high - off_low);
|
piolist->name, off_high - off_low);
|
||||||
|
if (piolist->flush_coalesced_mmio) {
|
||||||
|
memory_region_set_flush_coalesced(&mrpio->mr);
|
||||||
|
}
|
||||||
memory_region_add_subregion(piolist->address_space,
|
memory_region_add_subregion(piolist->address_space,
|
||||||
start + off_low, &mrpio->mr);
|
start + off_low, &mrpio->mr);
|
||||||
piolist->regions[piolist->nr] = &mrpio->mr;
|
piolist->regions[piolist->nr] = &mrpio->mr;
|
||||||
|
|
Loading…
Reference in a new issue