aboutsummaryrefslogtreecommitdiff
path: root/target/mips/translate.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-04-13 20:21:16 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-05-02 16:49:35 +0200
commitecdbcb0a9450e9109ae3dd6cfa10c71fda753bda (patch)
tree8ec95dfa2a174e9e1e5ce10801bda9f913ecb0f3 /target/mips/translate.c
parentd60146a9389db771fa4061d9376ba3e208ff2cdb (diff)
target/mips: Move helper_cache() to tcg/sysemu/special_helper.c
Move helper_cache() to tcg/sysemu/special_helper.c. The CACHE opcode is privileged and is not accessible in user emulation. However we get a link failure when restricting the symbol to sysemu. For now, add a stub helper to satisfy linking, which abort if ever called. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210428170410.479308-25-f4bug@amsat.org>
Diffstat (limited to 'target/mips/translate.c')
-rw-r--r--target/mips/translate.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/mips/translate.c b/target/mips/translate.c
index f0ae371602..c03a8ae1fe 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -39,6 +39,19 @@
#include "fpu_helper.h"
#include "translate.h"
+/*
+ * Many sysemu-only helpers are not reachable for user-only.
+ * Define stub generators here, so that we need not either sprinkle
+ * ifdefs through the translator, nor provide the helper function.
+ */
+#define STUB_HELPER(NAME, ...) \
+ static inline void gen_helper_##NAME(__VA_ARGS__) \
+ { g_assert_not_reached(); }
+
+#ifdef CONFIG_USER_ONLY
+STUB_HELPER(cache, TCGv_env env, TCGv val, TCGv_i32 reg)
+#endif
+
enum {
/* indirect opcode tables */
OPC_SPECIAL = (0x00 << 26),