diff mbox series

[08/18] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'

Message ID 20241212185341.2857-9-philmd@linaro.org
State Superseded
Headers show
Series accel/tcg: Extract user APIs out of 'exec/[cpu, exec]-all.h' | expand

Commit Message

Philippe Mathieu-Daudé Dec. 12, 2024, 6:53 p.m. UTC
"exec/translate-all.h" is only useful to TCG accelerator,
so move it to accel/tcg/, after renaming it 'tb-internal.h'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/internal-target.h  |  2 +-
 accel/tcg/tb-internal.h      | 14 ++++++++++++++
 include/exec/translate-all.h | 28 ----------------------------
 accel/tcg/cputlb.c           |  2 +-
 accel/tcg/tb-maint.c         |  2 +-
 accel/tcg/translate-all.c    |  2 +-
 accel/tcg/user-exec.c        |  1 +
 accel/tcg/watchpoint.c       |  2 +-
 8 files changed, 20 insertions(+), 33 deletions(-)
 create mode 100644 accel/tcg/tb-internal.h
 delete mode 100644 include/exec/translate-all.h

Comments

Pierrick Bouvier Dec. 12, 2024, 7:25 p.m. UTC | #1
On 12/12/24 10:53, Philippe Mathieu-Daudé wrote:
> "exec/translate-all.h" is only useful to TCG accelerator,
> so move it to accel/tcg/, after renaming it 'tb-internal.h'.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/internal-target.h  |  2 +-
>   accel/tcg/tb-internal.h      | 14 ++++++++++++++
>   include/exec/translate-all.h | 28 ----------------------------
>   accel/tcg/cputlb.c           |  2 +-
>   accel/tcg/tb-maint.c         |  2 +-
>   accel/tcg/translate-all.c    |  2 +-
>   accel/tcg/user-exec.c        |  1 +
>   accel/tcg/watchpoint.c       |  2 +-
>   8 files changed, 20 insertions(+), 33 deletions(-)
>   create mode 100644 accel/tcg/tb-internal.h
>   delete mode 100644 include/exec/translate-all.h
> 
> diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
> index a03c05315a4..6f4ec0bd424 100644
> --- a/accel/tcg/internal-target.h
> +++ b/accel/tcg/internal-target.h
> @@ -10,7 +10,7 @@
>   #define ACCEL_TCG_INTERNAL_TARGET_H
>   
>   #include "exec/exec-all.h"
> -#include "exec/translate-all.h"
> +#include "tb-internal.h"
>   
>   /*
>    * Access to the various translations structures need to be serialised
> diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h
> new file mode 100644
> index 00000000000..8313f90fd71
> --- /dev/null
> +++ b/accel/tcg/tb-internal.h
> @@ -0,0 +1,14 @@
> +/*
> + * TranslationBlock internal declarations (target specific)
> + *
> + *  Copyright (c) 2003 Fabrice Bellard
> + *
> + * SPDX-License-Identifier: LGPL-2.1-or-later
> + */
> +
> +#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H
> +#define ACCEL_TCG_TB_INTERNAL_TARGET_H
> +
> +void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
> +
> +#endif
> diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h
> deleted file mode 100644
> index 039668ff8ac..00000000000
> --- a/include/exec/translate-all.h
> +++ /dev/null
> @@ -1,28 +0,0 @@
> -/*
> - *  Translated block handling
> - *
> - *  Copyright (c) 2003 Fabrice Bellard
> - *
> - * This library is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU Lesser General Public
> - * License as published by the Free Software Foundation; either
> - * version 2.1 of the License, or (at your option) any later version.
> - *
> - * This library is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> - * Lesser General Public License for more details.
> - *
> - * You should have received a copy of the GNU Lesser General Public
> - * License along with this library; if not, see <http://www.gnu.org/licenses/>.
> - */
> -#ifndef TRANSLATE_ALL_H
> -#define TRANSLATE_ALL_H
> -
> -#include "exec/exec-all.h"
> -
> -
> -/* translate-all.c */
> -void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
> -
> -#endif /* TRANSLATE_ALL_H */
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index b76a4eac4e0..451cf13e876 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -37,7 +37,7 @@
>   #include "exec/helper-proto-common.h"
>   #include "qemu/atomic.h"
>   #include "qemu/atomic128.h"
> -#include "exec/translate-all.h"
> +#include "tb-internal.h"
>   #include "trace.h"
>   #include "tb-hash.h"
>   #include "internal-common.h"
> diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
> index 97d2e39ec0d..bdf5a0b7d58 100644
> --- a/accel/tcg/tb-maint.c
> +++ b/accel/tcg/tb-maint.c
> @@ -25,7 +25,7 @@
>   #include "exec/exec-all.h"
>   #include "exec/page-protection.h"
>   #include "exec/tb-flush.h"
> -#include "exec/translate-all.h"
> +#include "tb-internal.h"
>   #include "system/tcg.h"
>   #include "tcg/tcg.h"
>   #include "tb-hash.h"
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index d586ac9bb1d..bad3fce0ffb 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
> @@ -45,7 +45,7 @@
>   
>   #include "exec/cputlb.h"
>   #include "exec/page-protection.h"
> -#include "exec/translate-all.h"
> +#include "tb-internal.h"
>   #include "exec/translator.h"
>   #include "exec/tb-flush.h"
>   #include "qemu/bitmap.h"
> diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
> index 636932303bb..815a39503f3 100644
> --- a/accel/tcg/user-exec.c
> +++ b/accel/tcg/user-exec.c
> @@ -33,6 +33,7 @@
>   #include "tcg/tcg-ldst.h"
>   #include "internal-common.h"
>   #include "internal-target.h"
> +#include "tb-internal.h"
>   
>   __thread uintptr_t helper_retaddr;
>   
> diff --git a/accel/tcg/watchpoint.c b/accel/tcg/watchpoint.c
> index 8923301b8b8..e24baead562 100644
> --- a/accel/tcg/watchpoint.c
> +++ b/accel/tcg/watchpoint.c
> @@ -21,8 +21,8 @@
>   #include "qemu/main-loop.h"
>   #include "qemu/error-report.h"
>   #include "exec/exec-all.h"
> -#include "exec/translate-all.h"
>   #include "exec/page-protection.h"
> +#include "tb-internal.h"
>   #include "system/tcg.h"
>   #include "system/replay.h"
>   #include "hw/core/tcg-cpu-ops.h"

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Richard Henderson Dec. 12, 2024, 7:54 p.m. UTC | #2
On 12/12/24 12:53, Philippe Mathieu-Daudé wrote:
> "exec/translate-all.h" is only useful to TCG accelerator,
> so move it to accel/tcg/, after renaming it 'tb-internal.h'.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/internal-target.h  |  2 +-
>   accel/tcg/tb-internal.h      | 14 ++++++++++++++
>   include/exec/translate-all.h | 28 ----------------------------
>   accel/tcg/cputlb.c           |  2 +-
>   accel/tcg/tb-maint.c         |  2 +-
>   accel/tcg/translate-all.c    |  2 +-
>   accel/tcg/user-exec.c        |  1 +
>   accel/tcg/watchpoint.c       |  2 +-
>   8 files changed, 20 insertions(+), 33 deletions(-)
>   create mode 100644 accel/tcg/tb-internal.h
>   delete mode 100644 include/exec/translate-all.h

Move it into accel/tcg/internal-common.h rather than create a new header.


r~
Richard Henderson Dec. 12, 2024, 7:56 p.m. UTC | #3
On 12/12/24 13:54, Richard Henderson wrote:
> On 12/12/24 12:53, Philippe Mathieu-Daudé wrote:
>> "exec/translate-all.h" is only useful to TCG accelerator,
>> so move it to accel/tcg/, after renaming it 'tb-internal.h'.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   accel/tcg/internal-target.h  |  2 +-
>>   accel/tcg/tb-internal.h      | 14 ++++++++++++++
>>   include/exec/translate-all.h | 28 ----------------------------
>>   accel/tcg/cputlb.c           |  2 +-
>>   accel/tcg/tb-maint.c         |  2 +-
>>   accel/tcg/translate-all.c    |  2 +-
>>   accel/tcg/user-exec.c        |  1 +
>>   accel/tcg/watchpoint.c       |  2 +-
>>   8 files changed, 20 insertions(+), 33 deletions(-)
>>   create mode 100644 accel/tcg/tb-internal.h
>>   delete mode 100644 include/exec/translate-all.h
> 
> Move it into accel/tcg/internal-common.h rather than create a new header.

Hmm. Nevermind, I should have read to the end.

r~
diff mbox series

Patch

diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
index a03c05315a4..6f4ec0bd424 100644
--- a/accel/tcg/internal-target.h
+++ b/accel/tcg/internal-target.h
@@ -10,7 +10,7 @@ 
 #define ACCEL_TCG_INTERNAL_TARGET_H
 
 #include "exec/exec-all.h"
-#include "exec/translate-all.h"
+#include "tb-internal.h"
 
 /*
  * Access to the various translations structures need to be serialised
diff --git a/accel/tcg/tb-internal.h b/accel/tcg/tb-internal.h
new file mode 100644
index 00000000000..8313f90fd71
--- /dev/null
+++ b/accel/tcg/tb-internal.h
@@ -0,0 +1,14 @@ 
+/*
+ * TranslationBlock internal declarations (target specific)
+ *
+ *  Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H
+#define ACCEL_TCG_TB_INTERNAL_TARGET_H
+
+void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
+
+#endif
diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h
deleted file mode 100644
index 039668ff8ac..00000000000
--- a/include/exec/translate-all.h
+++ /dev/null
@@ -1,28 +0,0 @@ 
-/*
- *  Translated block handling
- *
- *  Copyright (c) 2003 Fabrice Bellard
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-#ifndef TRANSLATE_ALL_H
-#define TRANSLATE_ALL_H
-
-#include "exec/exec-all.h"
-
-
-/* translate-all.c */
-void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
-
-#endif /* TRANSLATE_ALL_H */
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b76a4eac4e0..451cf13e876 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -37,7 +37,7 @@ 
 #include "exec/helper-proto-common.h"
 #include "qemu/atomic.h"
 #include "qemu/atomic128.h"
-#include "exec/translate-all.h"
+#include "tb-internal.h"
 #include "trace.h"
 #include "tb-hash.h"
 #include "internal-common.h"
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 97d2e39ec0d..bdf5a0b7d58 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -25,7 +25,7 @@ 
 #include "exec/exec-all.h"
 #include "exec/page-protection.h"
 #include "exec/tb-flush.h"
-#include "exec/translate-all.h"
+#include "tb-internal.h"
 #include "system/tcg.h"
 #include "tcg/tcg.h"
 #include "tb-hash.h"
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index d586ac9bb1d..bad3fce0ffb 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -45,7 +45,7 @@ 
 
 #include "exec/cputlb.h"
 #include "exec/page-protection.h"
-#include "exec/translate-all.h"
+#include "tb-internal.h"
 #include "exec/translator.h"
 #include "exec/tb-flush.h"
 #include "qemu/bitmap.h"
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 636932303bb..815a39503f3 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -33,6 +33,7 @@ 
 #include "tcg/tcg-ldst.h"
 #include "internal-common.h"
 #include "internal-target.h"
+#include "tb-internal.h"
 
 __thread uintptr_t helper_retaddr;
 
diff --git a/accel/tcg/watchpoint.c b/accel/tcg/watchpoint.c
index 8923301b8b8..e24baead562 100644
--- a/accel/tcg/watchpoint.c
+++ b/accel/tcg/watchpoint.c
@@ -21,8 +21,8 @@ 
 #include "qemu/main-loop.h"
 #include "qemu/error-report.h"
 #include "exec/exec-all.h"
-#include "exec/translate-all.h"
 #include "exec/page-protection.h"
+#include "tb-internal.h"
 #include "system/tcg.h"
 #include "system/replay.h"
 #include "hw/core/tcg-cpu-ops.h"