From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C95E5C05027 for ; Fri, 20 Jan 2023 20:09:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229491AbjATUJh convert rfc822-to-8bit (ORCPT ); Fri, 20 Jan 2023 15:09:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjATUJf (ORCPT ); Fri, 20 Jan 2023 15:09:35 -0500 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FDC4743AF for ; Fri, 20 Jan 2023 12:09:34 -0800 (PST) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.19/8.17.1.19) with ESMTP id 30KDfIEQ001632 for ; Fri, 20 Jan 2023 12:09:33 -0800 Received: from mail.thefacebook.com ([163.114.132.120]) by m0001303.ppops.net (PPS) with ESMTPS id 3n7qeyujut-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 20 Jan 2023 12:09:33 -0800 Received: from snc-exhub201.TheFacebook.com (2620:10d:c085:21d::7) by snc-exhub204.TheFacebook.com (2620:10d:c085:21d::4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 20 Jan 2023 12:09:32 -0800 Received: from twshared26225.38.frc1.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 20 Jan 2023 12:09:31 -0800 Received: by devbig019.vll3.facebook.com (Postfix, from userid 137359) id 17D8C25B4B0C7; Fri, 20 Jan 2023 12:09:30 -0800 (PST) From: Andrii Nakryiko To: , , CC: , , Pu Lehui Subject: [PATCH v2 bpf-next 07/25] libbpf: complete riscv arch spec in bpf_tracing.h Date: Fri, 20 Jan 2023 12:08:56 -0800 Message-ID: <20230120200914.3008030-8-andrii@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230120200914.3008030-1-andrii@kernel.org> References: <20230120200914.3008030-1-andrii@kernel.org> X-FB-Internal: Safe Content-Type: text/plain X-Proofpoint-ORIG-GUID: gsLDgLjmiqkf-Cm3fxYicOASocoNWAGp X-Proofpoint-GUID: gsLDgLjmiqkf-Cm3fxYicOASocoNWAGp Content-Transfer-Encoding: 8BIT X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-20_10,2023-01-20_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Add PARM6 through PARM8 definitions for RISC V (riscv) arch. Leave the link for ABI doc for future reference. Tested-by: Pu Lehui # RISC-V Signed-off-by: Andrii Nakryiko --- tools/lib/bpf/bpf_tracing.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h index 0f9640ddbe1c..579e2f830532 100644 --- a/tools/lib/bpf/bpf_tracing.h +++ b/tools/lib/bpf/bpf_tracing.h @@ -268,12 +268,19 @@ struct pt_regs___arm64 { #elif defined(bpf_target_riscv) +/* + * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#risc-v-calling-conventions + */ + #define __PT_REGS_CAST(x) ((const struct user_regs_struct *)(x)) #define __PT_PARM1_REG a0 #define __PT_PARM2_REG a1 #define __PT_PARM3_REG a2 #define __PT_PARM4_REG a3 #define __PT_PARM5_REG a4 +#define __PT_PARM6_REG a5 +#define __PT_PARM7_REG a6 +#define __PT_PARM8_REG a7 #define __PT_RET_REG ra #define __PT_FP_REG s0 #define __PT_RC_REG a0 -- 2.30.2