bsd-user: Make compile for non-linux user-mode stuff
authorWarner Losh <imp@bsdimp.com>
Sun, 21 Jul 2024 22:29:03 +0000 (16:29 -0600)
committerWarner Losh <imp@bsdimp.com>
Tue, 23 Jul 2024 16:56:30 +0000 (10:56 -0600)
We include the files that define PR_MTE_TCF_SHIFT only on Linux, but use
them unconditionally. Restrict its use to Linux-only.

"It's ugly, but it's not actually wrong."

Signed-off-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/gdbstub64.c

index c8cef8cbc0e2bf7bf7eee82c5d1ec8023aab2b8d..5221381cc8520130592724e9a9f8fbb807142deb 100644 (file)
@@ -404,6 +404,7 @@ int aarch64_gdb_get_tag_ctl_reg(CPUState *cs, GByteArray *buf, int reg)
 
 int aarch64_gdb_set_tag_ctl_reg(CPUState *cs, uint8_t *buf, int reg)
 {
+#if defined(CONFIG_LINUX)
     ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
 
@@ -425,6 +426,9 @@ int aarch64_gdb_set_tag_ctl_reg(CPUState *cs, uint8_t *buf, int reg)
     arm_set_mte_tcf0(env, tcf);
 
     return 1;
+#else
+    return 0;
+#endif
 }
 
 static void handle_q_memtag(GArray *params, void *user_ctx)