On 30/04/2021 22:05, Richard Henderson wrote:
On 4/30/21 12:35 PM, Bruno Larsen (billionai) wrote:
+++ b/target/ppc/spr_tcg.c.inc
@@ -17,6 +17,8 @@
   * License along with this library; if not, see <http://www.gnu.org/licenses/>.
   */
  +#include "spr_tcg.h"

...

+++ b/target/ppc/translate_init.c.inc
@@ -42,6 +42,7 @@
  #include "fpu/softfloat.h"
  #include "qapi/qapi-commands-machine-target.h"
  +#include "spr_tcg.h"
  /* #define PPC_DEBUG_SPR */
  /* #define USE_APPLE_GDB */

Including this header twice, in files that are themselves both included in translate.c, is sketchy.  You really shouldn't add the one to translate_init.c.inc until patch 7, when it becomes the standalone cpu_init.c.
Good point, it might be a better idea if we end up going with spr_tcg.c.inc.

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

Note for future cleanup: Make spr_tcg.c be standalone as well.  Just need to move a few declarations to a translate.h.
it's not that easy, unfortunately. The readers and writers use a lot of global variables declared in translate.c, so we'd need to create getters and setters, or some better solution, before doing that.


r~
--
Bruno Piazera Larsen
Instituto de Pesquisas ELDORADO
Departamento Computação Embarcada
Analista de Software Trainee
Aviso Legal - Disclaimer