summaryrefslogtreecommitdiffstats
path: root/linux-user
diff options
context:
space:
mode:
authorMichael Tokarev <mjt@tls.msk.ru>2015-12-29 12:43:39 +0300
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:22 -0600
commitfc536c256b031dbec58c1a4777621da50d5d174a (patch)
tree1f1b2b3b5e11829155fadfc2d8e14babffa7853f /linux-user
parentfed89ddbc098748d0d16bc1867dc2d0c3a85834b (diff)
downloadhqemu-fc536c256b031dbec58c1a4777621da50d5d174a.zip
hqemu-fc536c256b031dbec58c1a4777621da50d5d174a.tar.gz
unicore32: convert get_sp_from_cpustate from macro to inline
All other architectures define get_sp_from_cpustate as an inline function, only unicore32 uses a #define. With this, some usages are impossible, for example, enabling sigaltstack in linux-user/syscall.c results in linux-user/syscall.c: In function ‘do_syscall’: linux-user/syscall.c:8299:39: error: dereferencing ‘void *’ pointer [-Werror] get_sp_from_cpustate(arg1, arg2, get_sp_from_cpustate((CPUArchState *)cpu_env)); ^ linux-user/syscall.c:8299:39: error: request for member ‘regs’ in something not a structure or union Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/unicore32/target_signal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux-user/unicore32/target_signal.h b/linux-user/unicore32/target_signal.h
index 8b255c4..7c44238 100644
--- a/linux-user/unicore32/target_signal.h
+++ b/linux-user/unicore32/target_signal.h
@@ -21,6 +21,10 @@ typedef struct target_sigaltstack {
#define TARGET_SS_ONSTACK 1
#define TARGET_SS_DISABLE 2
-#define get_sp_from_cpustate(cpustate) (cpustate->regs[29])
+static inline abi_ulong get_sp_from_cpustate(CPUUniCore32State *state)
+{
+ return state->regs[29];
+}
+
#endif /* TARGET_SIGNAL_H */
OpenPOWER on IntegriCloud