From patchwork Mon Jan 11 14:16:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 565905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 903AB140BEB for ; Tue, 12 Jan 2016 01:26:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=bFBqpmNw; dkim-atps=neutral Received: from localhost ([::1]:54561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIdQg-0006eo-9u for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2016 09:26:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIdH0-0004oW-Bp for qemu-devel@nongnu.org; Mon, 11 Jan 2016 09:16:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIdGw-0002BI-9n for qemu-devel@nongnu.org; Mon, 11 Jan 2016 09:16:42 -0500 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:33522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIdGw-0002BD-2p for qemu-devel@nongnu.org; Mon, 11 Jan 2016 09:16:38 -0500 Received: by mail-lf0-x22a.google.com with SMTP id m198so66848774lfm.0 for ; Mon, 11 Jan 2016 06:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5TpiYDsUFUcp14OVVa9fOMX4cG+DBnewW8gWfVFBjpU=; b=bFBqpmNwhKt0nEDjgUjN+uMSdhY8tMGmHPC7bs0IVNfglHWAAgmOvvYdeFB4hUzGI2 rr0Ln/FXo5v2iCcZZPQ8jpdxtTX4UP+jMnBYZfjg+6bfg++1jCCGudwDgKuEFzv1XE0K yDUeSf8tbwF6f4Eq+j91JLRf8EGXchWG7rHfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=5TpiYDsUFUcp14OVVa9fOMX4cG+DBnewW8gWfVFBjpU=; b=VlW51XCS5PsPQSj8vL8Z+p+MWbd39PFQhUp37rLIjBBMgrUiIE8hqILyhsqusAq43s 2eZ0/bg7sdwNKxCzxhiXKn6sczIoZoKwwBC2loAuewWa6qLn1Kw/FobWnzmKUFSNKeSC FJOUsno0JuBcIi0J9nSTCznZR6ygMKKPviIC/lw6czSKQqTrp5Q9niIKSYcLXVkpYJxx N0LrCa0nty6LkpQj6UrkXUDF6f2/xPjyJeL82hvLmvgH1fiaQ/ixXYEibILLdsGfm6RX Yv1pRA+15D7nKk9Wg6cZFKnpVIWNYoItAi2Omodrmn4vUy+PPLi2jUoP2YnY/si/Y/G0 a05w== X-Gm-Message-State: ALoCoQmKbUzsJbYGFxAVlzgiC90lNvQu1Np+NH8L74BI7UM+AZCvWOyuruwh4SqZSOXCdPhFXhHKj+PVVBF6cxu/AM6b71EyLw== X-Received: by 10.25.44.142 with SMTP id s136mr2582358lfs.113.1452521797479; Mon, 11 Jan 2016 06:16:37 -0800 (PST) Received: from localhost.localdomain (91-157-175-207.elisa-laajakaista.fi. [91.157.175.207]) by smtp.gmail.com with ESMTPSA id 130sm16806735lff.31.2016.01.11.06.16.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 06:16:36 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 11 Jan 2016 16:16:14 +0200 Message-Id: <27e112f9fd0dcac6c3448f0c71db1b62f0589ffd.1452521686.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.6.4 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22a Cc: Michael Tokarev Subject: [Qemu-devel] [PULL 12/17] unicore32: convert get_sp_from_cpustate from macro to inline X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: 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, 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 Signed-off-by: Riku Voipio --- 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 -#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 */