From patchwork Wed Apr 30 09:51:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 4092271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 684D5BFF02 for ; Wed, 30 Apr 2014 09:56:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82D0D201D5 for ; Wed, 30 Apr 2014 09:56:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68A3C201DE for ; Wed, 30 Apr 2014 09:56:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfRDV-0003iy-QI; Wed, 30 Apr 2014 09:54:17 +0000 Received: from mail-ie0-f173.google.com ([209.85.223.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WfRDT-0003ca-Qk for linux-arm-kernel@lists.infradead.org; Wed, 30 Apr 2014 09:54:16 +0000 Received: by mail-ie0-f173.google.com with SMTP id rp18so1688165iec.32 for ; Wed, 30 Apr 2014 02:53:53 -0700 (PDT) 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; bh=/OjaDlOHSWo1uyI5NGvq3I7HMfZIqKh6cObmNvCrh/U=; b=cjk21vCLPDRME/u4OZtjCpQaiLM1y15c2rICjFtZPM5wjSa3aUizkHZALueiJa9acT t8xQqIbCxt9LupaWGoGLBAks+safL68aU4bC+CMrc3sAA/kmH44wISMHyLX9K+cNCabu ozmj9ySxfxCdooASzpGlvyjFX+56p5eftQkAIXNBab77n3XrDarSCv7mffX3LqtqUvYx 3A76qx4IcoR6wjrj5EMfq0zQOLpppUeHS06wEfoT0hcCXrmqF1yh8wsqnNGsf6qZeyKV dd6UwFJFy2RMi5BELMJWQU+ScYV/ojGGVXJWsUukYURy4vJ4OvrSLMGVZqC2esS9JARK 6WzQ== X-Gm-Message-State: ALoCoQnYRIp7favlQb48VrVdyOWluUBdQD8FEenJhaEOtI488X4AL8kddaAkJaJTUU3K5zFj5ZJ1 X-Received: by 10.50.152.68 with SMTP id uw4mr15883924igb.15.1398851633187; Wed, 30 Apr 2014 02:53:53 -0700 (PDT) Received: from localhost.localdomain (KD182249095136.au-net.ne.jp. [182.249.95.136]) by mx.google.com with ESMTPSA id s8sm4428691ige.4.2014.04.30.02.53.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Apr 2014 02:53:52 -0700 (PDT) From: AKASHI Takahiro To: will.deacon@arm.com Subject: [PATCH v6 3/4] arm64: Add regs_return_value() in syscall.h Date: Wed, 30 Apr 2014 18:51:31 +0900 Message-Id: <1398851492-16345-4-git-send-email-takahiro.akashi@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398851492-16345-1-git-send-email-takahiro.akashi@linaro.org> References: <1394861948-28712-1-git-send-email-takahiro.akashi@linaro.org> <1398851492-16345-1-git-send-email-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140430_025415_901287_BA9EFC23 X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, rgb@redhat.com, catalin.marinas@arm.com, arndb@arndb.de, eparis@redhat.com, linux-kernel@vger.kernel.org, AKASHI Takahiro , dsaxena@linaro.org, viro@zeniv.linux.org.uk, linux-audit@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This macro, regs_return_value, is used mainly for audit to record system call's results, but may also be used in test_kprobes.c. Acked-by: Will Deacon Acked-by: Richard Guy Briggs Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ptrace.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index c7ba261..a429b59 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h @@ -135,6 +135,11 @@ struct pt_regs { #define user_stack_pointer(regs) \ (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp) +static inline unsigned long regs_return_value(struct pt_regs *regs) +{ + return regs->regs[0]; +} + /* * Are the current registers suitable for user mode? (used to maintain * security in signal handlers)