Message ID | 1511703326-25325-7-git-send-email-mark.cave-ayland@ilande.co.uk |
---|---|
State | New |
Headers | show |
Series | sparc: IOMMU tidy-up and reorganisation | expand |
On 11/26/2017 10:35 AM, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/sparc64/sun4u_iommu.c | 35 ++++++++++++++++++----------------- > include/hw/sparc/sun4u_iommu.h | 2 +- > 2 files changed, 19 insertions(+), 18 deletions(-) > > diff --git a/hw/sparc64/sun4u_iommu.c b/hw/sparc64/sun4u_iommu.c > index e5aa817..612fec4 100644 > --- a/hw/sparc64/sun4u_iommu.c > +++ b/hw/sparc64/sun4u_iommu.c > @@ -81,8 +81,9 @@ do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0) > > > /* Called from RCU critical section */ > -static IOMMUTLBEntry pbm_translate_iommu(IOMMUMemoryRegion *iommu, hwaddr addr, > - IOMMUAccessFlags flag) > +static IOMMUTLBEntry sun4u_translate_iommu(IOMMUMemoryRegion *iommu, > + hwaddr addr, > + IOMMUAccessFlags flag) > { > IOMMUState *is = container_of(iommu, IOMMUState, iommu); > hwaddr baseaddr, offset; > @@ -233,7 +234,7 @@ static void iommu_mem_write(void *opaque, hwaddr addr, > break; > default: > qemu_log_mask(LOG_UNIMP, > - "apb iommu: Unimplemented register write " > + "sun4u-iommu: Unimplemented register write " > "reg 0x%" HWADDR_PRIx " size 0x%x value 0x%" PRIx64 "\n", > addr, size, val); > break; > @@ -272,7 +273,7 @@ static uint64_t iommu_mem_read(void *opaque, hwaddr addr, unsigned size) > break; > default: > qemu_log_mask(LOG_UNIMP, > - "apb iommu: Unimplemented register read " > + "sun4u-iommu: Unimplemented register read " > "reg 0x%" HWADDR_PRIx " size 0x%x\n", > addr, size); > val = 0; > @@ -304,9 +305,9 @@ static void iommu_init(Object *obj) > SysBusDevice *sbd = SYS_BUS_DEVICE(obj); > > memory_region_init_iommu(&s->iommu, sizeof(s->iommu), > - TYPE_APB_IOMMU_MEMORY_REGION, OBJECT(s), > - "iommu-apb", UINT64_MAX); > - address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "pbm-as"); > + TYPE_SUN4U_IOMMU_MEMORY_REGION, OBJECT(s), > + "iommu-sun4u", UINT64_MAX); > + address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); > > memory_region_init_io(&s->iomem, obj, &iommu_mem_ops, s, "iommu", > IOMMU_NREGS * sizeof(uint64_t)); > @@ -320,7 +321,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) > dc->reset = iommu_reset; > } > > -static const TypeInfo pbm_iommu_info = { > +static const TypeInfo iommu_info = { > .name = TYPE_SUN4U_IOMMU, > .parent = TYPE_SYS_BUS_DEVICE, > .instance_size = sizeof(IOMMUState), > @@ -328,23 +329,23 @@ static const TypeInfo pbm_iommu_info = { > .class_init = iommu_class_init, > }; > > -static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data) > +static void sun4u_iommu_memory_region_class_init(ObjectClass *klass, void *data) > { > IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_CLASS(klass); > > - imrc->translate = pbm_translate_iommu; > + imrc->translate = sun4u_translate_iommu; > } > > -static const TypeInfo pbm_iommu_memory_region_info = { > +static const TypeInfo sun4u_iommu_memory_region_info = { > .parent = TYPE_IOMMU_MEMORY_REGION, > - .name = TYPE_APB_IOMMU_MEMORY_REGION, > - .class_init = pbm_iommu_memory_region_class_init, > + .name = TYPE_SUN4U_IOMMU_MEMORY_REGION, > + .class_init = sun4u_iommu_memory_region_class_init, > }; > > -static void pbm_register_types(void) > +static void iommu_register_types(void) > { > - type_register_static(&pbm_iommu_info); > - type_register_static(&pbm_iommu_memory_region_info); > + type_register_static(&iommu_info); > + type_register_static(&sun4u_iommu_memory_region_info); > } > > -type_init(pbm_register_types) > +type_init(iommu_register_types) > diff --git a/include/hw/sparc/sun4u_iommu.h b/include/hw/sparc/sun4u_iommu.h > index bc4506b..a760172 100644 > --- a/include/hw/sparc/sun4u_iommu.h > +++ b/include/hw/sparc/sun4u_iommu.h > @@ -45,6 +45,6 @@ typedef struct IOMMUState { > #define TYPE_SUN4U_IOMMU "sun4u-iommu" > #define SUN4U_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4U_IOMMU) > > -#define TYPE_APB_IOMMU_MEMORY_REGION "pbm-iommu-memory-region" > +#define TYPE_SUN4U_IOMMU_MEMORY_REGION "sun4u-iommu-memory-region" > > #endif >
diff --git a/hw/sparc64/sun4u_iommu.c b/hw/sparc64/sun4u_iommu.c index e5aa817..612fec4 100644 --- a/hw/sparc64/sun4u_iommu.c +++ b/hw/sparc64/sun4u_iommu.c @@ -81,8 +81,9 @@ do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0) /* Called from RCU critical section */ -static IOMMUTLBEntry pbm_translate_iommu(IOMMUMemoryRegion *iommu, hwaddr addr, - IOMMUAccessFlags flag) +static IOMMUTLBEntry sun4u_translate_iommu(IOMMUMemoryRegion *iommu, + hwaddr addr, + IOMMUAccessFlags flag) { IOMMUState *is = container_of(iommu, IOMMUState, iommu); hwaddr baseaddr, offset; @@ -233,7 +234,7 @@ static void iommu_mem_write(void *opaque, hwaddr addr, break; default: qemu_log_mask(LOG_UNIMP, - "apb iommu: Unimplemented register write " + "sun4u-iommu: Unimplemented register write " "reg 0x%" HWADDR_PRIx " size 0x%x value 0x%" PRIx64 "\n", addr, size, val); break; @@ -272,7 +273,7 @@ static uint64_t iommu_mem_read(void *opaque, hwaddr addr, unsigned size) break; default: qemu_log_mask(LOG_UNIMP, - "apb iommu: Unimplemented register read " + "sun4u-iommu: Unimplemented register read " "reg 0x%" HWADDR_PRIx " size 0x%x\n", addr, size); val = 0; @@ -304,9 +305,9 @@ static void iommu_init(Object *obj) SysBusDevice *sbd = SYS_BUS_DEVICE(obj); memory_region_init_iommu(&s->iommu, sizeof(s->iommu), - TYPE_APB_IOMMU_MEMORY_REGION, OBJECT(s), - "iommu-apb", UINT64_MAX); - address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "pbm-as"); + TYPE_SUN4U_IOMMU_MEMORY_REGION, OBJECT(s), + "iommu-sun4u", UINT64_MAX); + address_space_init(&s->iommu_as, MEMORY_REGION(&s->iommu), "iommu-as"); memory_region_init_io(&s->iomem, obj, &iommu_mem_ops, s, "iommu", IOMMU_NREGS * sizeof(uint64_t)); @@ -320,7 +321,7 @@ static void iommu_class_init(ObjectClass *klass, void *data) dc->reset = iommu_reset; } -static const TypeInfo pbm_iommu_info = { +static const TypeInfo iommu_info = { .name = TYPE_SUN4U_IOMMU, .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(IOMMUState), @@ -328,23 +329,23 @@ static const TypeInfo pbm_iommu_info = { .class_init = iommu_class_init, }; -static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data) +static void sun4u_iommu_memory_region_class_init(ObjectClass *klass, void *data) { IOMMUMemoryRegionClass *imrc = IOMMU_MEMORY_REGION_CLASS(klass); - imrc->translate = pbm_translate_iommu; + imrc->translate = sun4u_translate_iommu; } -static const TypeInfo pbm_iommu_memory_region_info = { +static const TypeInfo sun4u_iommu_memory_region_info = { .parent = TYPE_IOMMU_MEMORY_REGION, - .name = TYPE_APB_IOMMU_MEMORY_REGION, - .class_init = pbm_iommu_memory_region_class_init, + .name = TYPE_SUN4U_IOMMU_MEMORY_REGION, + .class_init = sun4u_iommu_memory_region_class_init, }; -static void pbm_register_types(void) +static void iommu_register_types(void) { - type_register_static(&pbm_iommu_info); - type_register_static(&pbm_iommu_memory_region_info); + type_register_static(&iommu_info); + type_register_static(&sun4u_iommu_memory_region_info); } -type_init(pbm_register_types) +type_init(iommu_register_types) diff --git a/include/hw/sparc/sun4u_iommu.h b/include/hw/sparc/sun4u_iommu.h index bc4506b..a760172 100644 --- a/include/hw/sparc/sun4u_iommu.h +++ b/include/hw/sparc/sun4u_iommu.h @@ -45,6 +45,6 @@ typedef struct IOMMUState { #define TYPE_SUN4U_IOMMU "sun4u-iommu" #define SUN4U_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4U_IOMMU) -#define TYPE_APB_IOMMU_MEMORY_REGION "pbm-iommu-memory-region" +#define TYPE_SUN4U_IOMMU_MEMORY_REGION "sun4u-iommu-memory-region" #endif
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> --- hw/sparc64/sun4u_iommu.c | 35 ++++++++++++++++++----------------- include/hw/sparc/sun4u_iommu.h | 2 +- 2 files changed, 19 insertions(+), 18 deletions(-)