diff mbox series

[v4,01/12] accel/tcg: Add stub for cpu_loop_exit()

Message ID 20200929224355.1224017-2-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series Support disabling TCG on ARM (part 2) | expand

Commit Message

Philippe Mathieu-Daudé Sept. 29, 2020, 10:43 p.m. UTC
Since the support of SYS_READC in commit 8de702cb67 the
semihosting code is strongly depedent of the TCG accelerator
via a call to cpu_loop_exit().

Ideally we would only build semihosting support when TCG
is available, but unfortunately this is not trivial because
semihosting is used by many targets in different configurations.
For now add a simple stub to avoid link failure when building
with --disable-tcg:

  hw/semihosting/console.c:160: undefined reference to `cpu_loop_exit'

Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 accel/stubs/tcg-stub.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Thomas Huth Sept. 30, 2020, 7:08 a.m. UTC | #1
On 30/09/2020 00.43, Philippe Mathieu-Daudé wrote:
> Since the support of SYS_READC in commit 8de702cb67 the
> semihosting code is strongly depedent of the TCG accelerator
> via a call to cpu_loop_exit().
> 
> Ideally we would only build semihosting support when TCG
> is available, but unfortunately this is not trivial because
> semihosting is used by many targets in different configurations.
> For now add a simple stub to avoid link failure when building
> with --disable-tcg:
> 
>   hw/semihosting/console.c:160: undefined reference to `cpu_loop_exit'
> 
> Cc: Keith Packard <keithp@keithp.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  accel/stubs/tcg-stub.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
> index e4bbf997aa..1eec7fb90e 100644
> --- a/accel/stubs/tcg-stub.c
> +++ b/accel/stubs/tcg-stub.c
> @@ -29,3 +29,8 @@ void *probe_access(CPUArchState *env, target_ulong addr, int size,
>       /* Handled by hardware accelerator. */
>       g_assert_not_reached();
>  }
> +
> +void cpu_loop_exit(CPUState *cpu)
> +{
> +    g_assert_not_reached();
> +}
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>
Richard Henderson Oct. 3, 2020, 9:09 a.m. UTC | #2
On 9/29/20 5:43 PM, Philippe Mathieu-Daudé wrote:
> Since the support of SYS_READC in commit 8de702cb67 the
> semihosting code is strongly depedent of the TCG accelerator
> via a call to cpu_loop_exit().
> 
> Ideally we would only build semihosting support when TCG
> is available, but unfortunately this is not trivial because
> semihosting is used by many targets in different configurations.
> For now add a simple stub to avoid link failure when building
> with --disable-tcg:
> 
>   hw/semihosting/console.c:160: undefined reference to `cpu_loop_exit'
> 
> Cc: Keith Packard <keithp@keithp.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  accel/stubs/tcg-stub.c | 5 +++++
>  1 file changed, 5 insertions(+)

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

r~
diff mbox series

Patch

diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index e4bbf997aa..1eec7fb90e 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -29,3 +29,8 @@  void *probe_access(CPUArchState *env, target_ulong addr, int size,
      /* Handled by hardware accelerator. */
      g_assert_not_reached();
 }
+
+void cpu_loop_exit(CPUState *cpu)
+{
+    g_assert_not_reached();
+}