diff mbox series

[v3,7/7] target/ppc: isolated cpu init from translation logic

Message ID 20210430193533.82136-8-bruno.larsen@eldorado.org.br (mailing list archive)
State New, archived
Headers show
Series target/ppc: untangle CPU init from translation | expand

Commit Message

Bruno Larsen (billionai) April 30, 2021, 7:35 p.m. UTC
finished isolation of CPU initialization logic from
translation logic. CPU initialization now only has common code
and may or may not call accelerator-specific code, as the
build options require.

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 target/ppc/{translate_init.c.inc => cpu_init.c} | 4 ++++
 target/ppc/meson.build                          | 1 +
 target/ppc/translate.c                          | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)
 rename target/ppc/{translate_init.c.inc => cpu_init.c} (99%)

Comments

Richard Henderson May 1, 2021, 1:11 a.m. UTC | #1
On 4/30/21 12:35 PM, Bruno Larsen (billionai) wrote:
> +++ b/target/ppc/cpu_init.c
> @@ -18,6 +18,7 @@
>    * License along with this library; if not, see<http://www.gnu.org/licenses/>.
>    */
>   
> +#include "qemu/osdep.h"
>   #include "disas/dis-asm.h"
>   #include "exec/gdbstub.h"
>   #include "kvm_ppc.h"
> @@ -42,7 +43,10 @@
>   #include "fpu/softfloat.h"
>   #include "qapi/qapi-commands-machine-target.h"
>   
> +#include "helper_regs.h"
> +#include "internal.h"
>   #include "spr_tcg.h"

You need "exec/helper-proto.h" until you deal with helper_mtvscr().

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/ppc/translate_init.c.inc b/target/ppc/cpu_init.c
similarity index 99%
rename from target/ppc/translate_init.c.inc
rename to target/ppc/cpu_init.c
index 274bd884a1..beb4a11841 100644
--- a/target/ppc/translate_init.c.inc
+++ b/target/ppc/cpu_init.c
@@ -18,6 +18,7 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "disas/dis-asm.h"
 #include "exec/gdbstub.h"
 #include "kvm_ppc.h"
@@ -42,7 +43,10 @@ 
 #include "fpu/softfloat.h"
 #include "qapi/qapi-commands-machine-target.h"
 
+#include "helper_regs.h"
+#include "internal.h"
 #include "spr_tcg.h"
+
 /* #define PPC_DEBUG_SPR */
 /* #define USE_APPLE_GDB */
 
diff --git a/target/ppc/meson.build b/target/ppc/meson.build
index bbfef90e08..ad53629298 100644
--- a/target/ppc/meson.build
+++ b/target/ppc/meson.build
@@ -2,6 +2,7 @@  ppc_ss = ss.source_set()
 ppc_ss.add(files(
   'cpu-models.c',
   'cpu.c',
+  'cpu_init.c',
   'dfp_helper.c',
   'excp_helper.c',
   'fpu_helper.c',
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index dba112087e..8774ad798b 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -37,6 +37,8 @@ 
 #include "exec/log.h"
 #include "qemu/atomic128.h"
 
+#include "qemu/qemu-print.h"
+#include "qapi/error.h"
 
 #define CPU_SINGLE_STEP 0x1
 #define CPU_BRANCH_STEP 0x2
@@ -7594,7 +7596,6 @@  GEN_HANDLER2_E(trechkpt, "trechkpt", 0x1F, 0x0E, 0x1F, 0x03FFF800, \
 
 #include "helper_regs.h"
 #include "spr_tcg.c.inc"
-#include "translate_init.c.inc"
 
 /*****************************************************************************/
 /* Misc PowerPC helpers */