qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 16/34] exec: [CPUTLB] Move cpu_*()/cpu_env() to common he


From: Richard Henderson
Subject: Re: [RFC PATCH 16/34] exec: [CPUTLB] Move cpu_*()/cpu_env() to common header
Date: Sun, 28 Jan 2024 10:15:43 +1000
User-agent: Mozilla Thunderbird

On 1/28/24 08:14, Richard Henderson wrote:
On 1/20/24 00:40, Anton Johansson wrote:
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -347,4 +347,29 @@ G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, 
uintptr_t pc);
   */
  #define PAGE_PASSTHROUGH 0x0800
+/* accel/tcg/cpu-exec.c */
+int cpu_exec(CPUState *cpu);
+
+/**
+ * env_archcpu(env)
+ * @env: The architecture environment
+ *
+ * Return the ArchCPU associated with the environment.
+ */
+static inline ArchCPU *env_archcpu(CPUArchState *env)
+{
+    return (void *)env - sizeof(CPUState);
+}
+
+/**
+ * env_cpu(env)
+ * @env: The architecture environment
+ *
+ * Return the CPUState associated with the environment.
+ */
+static inline CPUState *env_cpu(CPUArchState *env)
+{
+    return (void *)env - sizeof(CPUState);
+}
+
  #endif /* CPU_COMMON_H */

Missing include of hw/core/cpu.h, as far as I can see?

Queued, with this fix.

r~




reply via email to

[Prev in Thread] Current Thread [Next in Thread]