提交 27e112f9 编写于 作者: M Michael Tokarev 提交者: Riku Voipio

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: NMichael Tokarev <mjt@tls.msk.ru>
Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
上级 e6deac9c
......@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册