]> Git Repo - qemu.git/commitdiff
unicore32: convert get_sp_from_cpustate from macro to inline
authorMichael Tokarev <[email protected]>
Tue, 29 Dec 2015 09:43:39 +0000 (12:43 +0300)
committerRiku Voipio <[email protected]>
Fri, 8 Jan 2016 13:36:21 +0000 (15:36 +0200)
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 <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
linux-user/unicore32/target_signal.h

index 8b255c455088669e0b7cc1ec8feac13b85b84d07..7c442381abaaf29c3ecf4d55e3bae7019f3235d6 100644 (file)
@@ -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 */
This page took 0.02691 seconds and 4 git commands to generate.