qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target/arm: Make cpu_register() available for other files

Make cpu_register() (renamed to arm_cpu_register()) available
from internals.h so we can register CPUs also from other files
in the future.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200423073358.27155-3-philmd@redhat.com
Message-ID: <20190921150420.30743-2-thuth@redhat.com>
[PMD: Only take cpu_register() from Thomas's patch]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Thomas Huth and committed by
Peter Maydell
37bcf244 9fb005b0

+11 -16
+8 -1
target/arm/cpu-qom.h
··· 35 35 36 36 #define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU 37 37 38 - typedef struct ARMCPUInfo ARMCPUInfo; 38 + typedef struct ARMCPUInfo { 39 + const char *name; 40 + void (*initfn)(Object *obj); 41 + void (*class_init)(ObjectClass *oc, void *data); 42 + } ARMCPUInfo; 43 + 44 + void arm_cpu_register(const ARMCPUInfo *info); 45 + void aarch64_cpu_register(const ARMCPUInfo *info); 39 46 40 47 /** 41 48 * ARMCPUClass:
+2 -8
target/arm/cpu.c
··· 2693 2693 2694 2694 #endif /* !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) */ 2695 2695 2696 - struct ARMCPUInfo { 2697 - const char *name; 2698 - void (*initfn)(Object *obj); 2699 - void (*class_init)(ObjectClass *oc, void *data); 2700 - }; 2701 - 2702 2696 static const ARMCPUInfo arm_cpus[] = { 2703 2697 #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) 2704 2698 { .name = "arm926", .initfn = arm926_initfn }, ··· 2864 2858 acc->info = data; 2865 2859 } 2866 2860 2867 - static void cpu_register(const ARMCPUInfo *info) 2861 + void arm_cpu_register(const ARMCPUInfo *info) 2868 2862 { 2869 2863 TypeInfo type_info = { 2870 2864 .parent = TYPE_ARM_CPU, ··· 2905 2899 type_register_static(&idau_interface_type_info); 2906 2900 2907 2901 while (info->name) { 2908 - cpu_register(info); 2902 + arm_cpu_register(info); 2909 2903 info++; 2910 2904 } 2911 2905
+1 -7
target/arm/cpu64.c
··· 737 737 cpu_max_set_sve_max_vq, NULL, NULL, &error_fatal); 738 738 } 739 739 740 - struct ARMCPUInfo { 741 - const char *name; 742 - void (*initfn)(Object *obj); 743 - void (*class_init)(ObjectClass *oc, void *data); 744 - }; 745 - 746 740 static const ARMCPUInfo aarch64_cpus[] = { 747 741 { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, 748 742 { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, ··· 825 819 acc->info = data; 826 820 } 827 821 828 - static void aarch64_cpu_register(const ARMCPUInfo *info) 822 + void aarch64_cpu_register(const ARMCPUInfo *info) 829 823 { 830 824 TypeInfo type_info = { 831 825 .parent = TYPE_AARCH64_CPU,