On 4/30/21 12:35 PM, Bruno Larsen (billionai) wrote:Good point, it might be a better idea if we end up going with spr_tcg.c.inc.
+++ 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.
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.
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.
r~