diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2015-12-29 12:39:44 +0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2016-01-10 10:25:38 +0300 |
commit | 6e502164618ea23f6351b5055296180c8672cad9 (patch) | |
tree | 045faa65f6480a7ffaeab13e681a5cfe36542da7 /linux-user | |
parent | 6bb9ead762bf749af11ea225fc2a74db1b93c105 (diff) | |
download | qemu-6e502164618ea23f6351b5055296180c8672cad9.tar.gz qemu-6e502164618ea23f6351b5055296180c8672cad9.tar.bz2 qemu-6e502164618ea23f6351b5055296180c8672cad9.zip |
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>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/unicore32/target_signal.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux-user/unicore32/target_signal.h b/linux-user/unicore32/target_signal.h index 8b255c4550..7c442381ab 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 */ |