]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/core: Constify TCGCPUOps
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 27 Feb 2021 23:21:17 +0000 (15:21 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 26 May 2021 22:33:59 +0000 (15:33 -0700)
We no longer have any runtime modifications to this struct,
so declare them all const.

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20210227232519.222663-3-richard.henderson@linaro.org>

22 files changed:
include/hw/core/cpu.h
target/alpha/cpu.c
target/arm/cpu.c
target/arm/cpu_tcg.c
target/avr/cpu.c
target/cris/cpu.c
target/hexagon/cpu.c
target/hppa/cpu.c
target/i386/tcg/tcg-cpu.c
target/m68k/cpu.c
target/microblaze/cpu.c
target/mips/cpu.c
target/nios2/cpu.c
target/openrisc/cpu.c
target/ppc/cpu_init.c
target/riscv/cpu.c
target/rx/cpu.c
target/s390x/cpu.c
target/sh4/cpu.c
target/sparc/cpu.c
target/tricore/cpu.c
target/xtensa/cpu.c

index e4328de8d41d85663011c23bf271bb4ddc93d2dd..9f09a60fbdba9eaa75e3fe497033e8b211339804 100644 (file)
@@ -156,7 +156,7 @@ struct CPUClass {
     const struct SysemuCPUOps *sysemu_ops;
 
     /* when TCG is not available, this pointer is NULL */
-    struct TCGCPUOps *tcg_ops;
+    const struct TCGCPUOps *tcg_ops;
 
     /*
      * if not NULL, this is called in order for the CPUClass to initialize
index 7687d5a09af86a7339ae07e81637c7dc956ddf05..4871ad0c0a6a5dd18370ca5580e711f7ad2866f9 100644 (file)
@@ -216,7 +216,7 @@ static const struct SysemuCPUOps alpha_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps alpha_tcg_ops = {
+static const struct TCGCPUOps alpha_tcg_ops = {
     .initialize = alpha_translate_init,
     .cpu_exec_interrupt = alpha_cpu_exec_interrupt,
     .tlb_fill = alpha_cpu_tlb_fill,
index 2d9b32ec9208acd7df4f43a627f7e287f11bce7b..ad65b60b043ae1eb1816b1b9ad606c658b763a52 100644 (file)
@@ -1958,7 +1958,7 @@ static const struct SysemuCPUOps arm_sysemu_ops = {
 #endif
 
 #ifdef CONFIG_TCG
-static struct TCGCPUOps arm_tcg_ops = {
+static const struct TCGCPUOps arm_tcg_ops = {
     .initialize = arm_translate_init,
     .synchronize_from_tb = arm_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = arm_cpu_exec_interrupt,
index d3458335ed90ae0afbe79b4f704919b7d7b3131f..2e0e508f0e98cc594c29123446eb9d0f9c6060fc 100644 (file)
@@ -898,7 +898,7 @@ static void pxa270c5_initfn(Object *obj)
 }
 
 #ifdef CONFIG_TCG
-static struct TCGCPUOps arm_v7m_tcg_ops = {
+static const struct TCGCPUOps arm_v7m_tcg_ops = {
     .initialize = arm_translate_init,
     .synchronize_from_tb = arm_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt,
index 7551bca3a689958583c06b7362cf845b39394648..57e3fab4a0af226362435f48526dc07be9cb3cb9 100644 (file)
@@ -192,7 +192,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps avr_tcg_ops = {
+static const struct TCGCPUOps avr_tcg_ops = {
     .initialize = avr_cpu_tcg_init,
     .synchronize_from_tb = avr_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = avr_cpu_exec_interrupt,
index 9cb4f817b4ce8d65f4ccaf8f4c0158d33f551675..70932b1f8c7ddb86b81d0b6abf8ba0d0f411867c 100644 (file)
@@ -203,7 +203,7 @@ static const struct SysemuCPUOps cris_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps crisv10_tcg_ops = {
+static const struct TCGCPUOps crisv10_tcg_ops = {
     .initialize = cris_initialize_crisv10_tcg,
     .cpu_exec_interrupt = cris_cpu_exec_interrupt,
     .tlb_fill = cris_cpu_tlb_fill,
@@ -213,7 +213,7 @@ static struct TCGCPUOps crisv10_tcg_ops = {
 #endif /* !CONFIG_USER_ONLY */
 };
 
-static struct TCGCPUOps crisv32_tcg_ops = {
+static const struct TCGCPUOps crisv32_tcg_ops = {
     .initialize = cris_initialize_tcg,
     .cpu_exec_interrupt = cris_cpu_exec_interrupt,
     .tlb_fill = cris_cpu_tlb_fill,
index ebe60a6e158dac6759faf5aac061acae8c156a63..3338365c16ecd9d014ed397f1d2ea6db63ddc8fc 100644 (file)
@@ -269,7 +269,7 @@ static bool hexagon_tlb_fill(CPUState *cs, vaddr address, int size,
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps hexagon_tcg_ops = {
+static const struct TCGCPUOps hexagon_tcg_ops = {
     .initialize = hexagon_translate_init,
     .synchronize_from_tb = hexagon_cpu_synchronize_from_tb,
     .tlb_fill = hexagon_tlb_fill,
index 4018e3ad90c8ce89e26e005378539912f12c59b5..2eace4ee1240bef8a6e41338eeac8b9874798bad 100644 (file)
@@ -141,7 +141,7 @@ static const struct SysemuCPUOps hppa_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps hppa_tcg_ops = {
+static const struct TCGCPUOps hppa_tcg_ops = {
     .initialize = hppa_translate_init,
     .synchronize_from_tb = hppa_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = hppa_cpu_exec_interrupt,
index ba39531aa506c49c9efada6b737a4d101a5421da..014ebea2f6f1a975a8c19ce4a627af233e80ebb0 100644 (file)
@@ -56,7 +56,7 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs,
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps x86_tcg_ops = {
+static const struct TCGCPUOps x86_tcg_ops = {
     .initialize = tcg_x86_init,
     .synchronize_from_tb = x86_cpu_synchronize_from_tb,
     .cpu_exec_enter = x86_cpu_exec_enter,
index 4238775d5e3726b8ce85bff143ac0c5c8e5bec57..72de6e9726275792d9984e033525a04484fe8aa9 100644 (file)
@@ -513,7 +513,7 @@ static const struct SysemuCPUOps m68k_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps m68k_tcg_ops = {
+static const struct TCGCPUOps m68k_tcg_ops = {
     .initialize = m68k_tcg_init,
     .cpu_exec_interrupt = m68k_cpu_exec_interrupt,
     .tlb_fill = m68k_cpu_tlb_fill,
index 8f88f2afb98e06700d70077f39a136dc69216836..72d8f2a0daa61c5729b9c21846b44827c833adca 100644 (file)
@@ -362,7 +362,7 @@ static const struct SysemuCPUOps mb_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps mb_tcg_ops = {
+static const struct TCGCPUOps mb_tcg_ops = {
     .initialize = mb_tcg_init,
     .synchronize_from_tb = mb_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = mb_cpu_exec_interrupt,
index 7275f64eabce2976fd148bbf05850ec74a5202e5..96236abc0065cdffa64bc04c258ca41069b2bb8b 100644 (file)
@@ -536,7 +536,7 @@ static const struct SysemuCPUOps mips_sysemu_ops = {
  * NB: cannot be const, as some elements are changed for specific
  * mips hardware (see hw/mips/jazz.c).
  */
-static struct TCGCPUOps mips_tcg_ops = {
+static const struct TCGCPUOps mips_tcg_ops = {
     .initialize = mips_tcg_init,
     .synchronize_from_tb = mips_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = mips_cpu_exec_interrupt,
index afcd7767465f62ade5e4a187f7f848d02754ab04..5e37defef805dafeb512ff2bd4396bdefec7ed28 100644 (file)
@@ -217,7 +217,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps nios2_tcg_ops = {
+static const struct TCGCPUOps nios2_tcg_ops = {
     .initialize = nios2_tcg_init,
     .cpu_exec_interrupt = nios2_cpu_exec_interrupt,
     .tlb_fill = nios2_cpu_tlb_fill,
index d8e80b81a2f7e82d6b74ea5e53177304cac729c1..bd34e429ecbf42de611ef2b57ea85616f854d1f6 100644 (file)
@@ -184,7 +184,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps openrisc_tcg_ops = {
+static const struct TCGCPUOps openrisc_tcg_ops = {
     .initialize = openrisc_translate_init,
     .cpu_exec_interrupt = openrisc_cpu_exec_interrupt,
     .tlb_fill = openrisc_cpu_tlb_fill,
index 1afa29e338b97d7106fb7cf72594a5e7e40fc064..7bdb44311460d522476de0de0119fbdac793252e 100644 (file)
@@ -9278,7 +9278,7 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {
 #ifdef CONFIG_TCG
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps ppc_tcg_ops = {
+static const struct TCGCPUOps ppc_tcg_ops = {
   .initialize = ppc_translate_init,
   .cpu_exec_interrupt = ppc_cpu_exec_interrupt,
   .tlb_fill = ppc_cpu_tlb_fill,
index 9775d8ca5c4ea4a54bdf2a41e287cc7ebaf4ecf3..1f1cef1d6a17b114a77f82887150a72a2cefbd2e 100644 (file)
@@ -609,7 +609,7 @@ static const struct SysemuCPUOps riscv_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps riscv_tcg_ops = {
+static const struct TCGCPUOps riscv_tcg_ops = {
     .initialize = riscv_translate_init,
     .synchronize_from_tb = riscv_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = riscv_cpu_exec_interrupt,
index e575669ad1e34c0224a16025633cb7220d50ccb6..96cc96e514fe723a13426b2fb599dd4a0d5d6f54 100644 (file)
@@ -183,7 +183,7 @@ static const struct SysemuCPUOps rx_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps rx_tcg_ops = {
+static const struct TCGCPUOps rx_tcg_ops = {
     .initialize = rx_translate_init,
     .synchronize_from_tb = rx_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = rx_cpu_exec_interrupt,
index bd5070c783e9c02cc1817d55f27f5dcd25b3dd46..890f382a36c6abc2edb0aea95408e9580fd79c3d 100644 (file)
@@ -490,7 +490,7 @@ static const struct SysemuCPUOps s390_sysemu_ops = {
 #ifdef CONFIG_TCG
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps s390_tcg_ops = {
+static const struct TCGCPUOps s390_tcg_ops = {
     .initialize = s390x_translate_init,
     .tlb_fill = s390_cpu_tlb_fill,
 
index 1d5a7156318846016d19b1bcf762582b34bc0bed..8326922942119fb42b80adfd058203e368dec451 100644 (file)
@@ -233,7 +233,7 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps superh_tcg_ops = {
+static const struct TCGCPUOps superh_tcg_ops = {
     .initialize = sh4_translate_init,
     .synchronize_from_tb = superh_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = superh_cpu_exec_interrupt,
index ff950fb307a6b7698d5709a393b05350d3858621..da6b30ec747acf0d2fffb317a50d615e6835cf17 100644 (file)
@@ -860,7 +860,7 @@ static const struct SysemuCPUOps sparc_sysemu_ops = {
 #ifdef CONFIG_TCG
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps sparc_tcg_ops = {
+static const struct TCGCPUOps sparc_tcg_ops = {
     .initialize = sparc_tcg_init,
     .synchronize_from_tb = sparc_cpu_synchronize_from_tb,
     .cpu_exec_interrupt = sparc_cpu_exec_interrupt,
index ff17d1cecd83333379ba151b4620e38d0cb95caa..b95682b7f04d137c4059c26841220b7fd7299b19 100644 (file)
@@ -150,7 +150,7 @@ static const struct SysemuCPUOps tricore_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps tricore_tcg_ops = {
+static const struct TCGCPUOps tricore_tcg_ops = {
     .initialize = tricore_tcg_init,
     .synchronize_from_tb = tricore_cpu_synchronize_from_tb,
     .tlb_fill = tricore_cpu_tlb_fill,
index da4dbecdf1a1716f50c295778257d750c72c04b6..58ec3a08622479310325dbbf43527cbc24c1b5b5 100644 (file)
@@ -190,7 +190,7 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = {
 
 #include "hw/core/tcg-cpu-ops.h"
 
-static struct TCGCPUOps xtensa_tcg_ops = {
+static const struct TCGCPUOps xtensa_tcg_ops = {
     .initialize = xtensa_translate_init,
     .cpu_exec_interrupt = xtensa_cpu_exec_interrupt,
     .tlb_fill = xtensa_cpu_tlb_fill,