aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/sh_intc.c
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2021-10-29 23:02:09 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-10-30 18:39:37 +0200
commit51cb902baca1ccfba270fa5a1f230d85301a68e6 (patch)
tree1a7a7fb09d13838580f1de42a3ff6cd4c18a632e /hw/intc/sh_intc.c
parent92d1d3ada11dfb338bb96b6405d6938901182488 (diff)
downloadqemu-51cb902baca1ccfba270fa5a1f230d85301a68e6.zip
qemu-51cb902baca1ccfba270fa5a1f230d85301a68e6.tar.gz
qemu-51cb902baca1ccfba270fa5a1f230d85301a68e6.tar.bz2
hw/intc/sh_intc: Move sh_intc_register() closer to its only user
The sh_intc_register() function is only used at one place. Move them together so it's easier to see what's going on. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <49f2742bc67cba7164385fafad204ab1e1bd3a0b.1635541329.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/intc/sh_intc.c')
-rw-r--r--hw/intc/sh_intc.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index b908be0..1a2824f 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -269,36 +269,6 @@ struct intc_source *sh_intc_source(struct intc_desc *desc, intc_enum id)
return NULL;
}
-static unsigned int sh_intc_register(MemoryRegion *sysmem,
- struct intc_desc *desc,
- const unsigned long address,
- const char *type,
- const char *action,
- const unsigned int index)
-{
- char name[60];
- MemoryRegion *iomem, *iomem_p4, *iomem_a7;
-
- if (!address) {
- return 0;
- }
-
- iomem = &desc->iomem;
- iomem_p4 = desc->iomem_aliases + index;
- iomem_a7 = iomem_p4 + 1;
-
- snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "p4");
- memory_region_init_alias(iomem_p4, NULL, name, iomem, A7ADDR(address), 4);
- memory_region_add_subregion(sysmem, P4ADDR(address), iomem_p4);
-
- snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "a7");
- memory_region_init_alias(iomem_a7, NULL, name, iomem, A7ADDR(address), 4);
- memory_region_add_subregion(sysmem, A7ADDR(address), iomem_a7);
-
- /* used to increment aliases index */
- return 2;
-}
-
static void sh_intc_register_source(struct intc_desc *desc,
intc_enum source,
struct intc_group *groups,
@@ -398,6 +368,36 @@ void sh_intc_register_sources(struct intc_desc *desc,
}
}
+static unsigned int sh_intc_register(MemoryRegion *sysmem,
+ struct intc_desc *desc,
+ const unsigned long address,
+ const char *type,
+ const char *action,
+ const unsigned int index)
+{
+ char name[60];
+ MemoryRegion *iomem, *iomem_p4, *iomem_a7;
+
+ if (!address) {
+ return 0;
+ }
+
+ iomem = &desc->iomem;
+ iomem_p4 = desc->iomem_aliases + index;
+ iomem_a7 = iomem_p4 + 1;
+
+ snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "p4");
+ memory_region_init_alias(iomem_p4, NULL, name, iomem, A7ADDR(address), 4);
+ memory_region_add_subregion(sysmem, P4ADDR(address), iomem_p4);
+
+ snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "a7");
+ memory_region_init_alias(iomem_a7, NULL, name, iomem, A7ADDR(address), 4);
+ memory_region_add_subregion(sysmem, A7ADDR(address), iomem_a7);
+
+ /* used to increment aliases index */
+ return 2;
+}
+
int sh_intc_init(MemoryRegion *sysmem,
struct intc_desc *desc,
int nr_sources,