Received: from eggs.gnu.org ([2001:4830:134:3::10]:52942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDqox-0000vB-Lt for qemu-devel@nongnu.org; Tue, 29 Dec 2015 04:44:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDqos-0006aB-NR for qemu-devel@nongnu.org; Tue, 29 Dec 2015 04:43:59 -0500 From: Michael Tokarev Date: Tue, 29 Dec 2015 12:43:39 +0300 Message-Id: <1451382219-5159-1-git-send-email-mjt@msgid.tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH trivial] unicore32: convert get_sp_from_cpustate from macro to inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev All other architectures define get_sp_from_cpustate as an inline function= , only unicore32 uses a #define. With this, some usages are impossible, fo= r example, enabling sigaltstack in linux-user/syscall.c results in linux-user/syscall.c: In function =E2=80=98do_syscall=E2=80=99: linux-user/syscall.c:8299:39: error: dereferencing =E2=80=98void *=E2=80=99= pointer [-Werror] get_sp_from_cpustate(arg1, arg2, get_sp_from_cpustate((CPUArchState *)c= pu_env)); ^ linux-user/syscall.c:8299:39: error: request for member =E2=80=98regs=E2=80= =99 in something not a structure or union Signed-off-by: Michael Tokarev --- linux-user/unicore32/target_signal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 =20 -#define get_sp_from_cpustate(cpustate) (cpustate->regs[29]) +static inline abi_ulong get_sp_from_cpustate(CPUUniCore32State *state) +{ + return state->regs[29]; +} + =20 #endif /* TARGET_SIGNAL_H */ --=20 2.1.4