From patchwork Sun Mar 17 13:02:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1912910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dOr+W+up; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=h/ckdxy4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TyJ7t0zVsz1yX0 for ; Mon, 18 Mar 2024 00:03:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sho0SJVCavOo41mMY84wXj8zuNfBILlQq6v2Is+8BGg=; b=dOr+W+upiWl6nw 1F3GvRBdXsM7b6OD35loVSOeQ0W6r8g+UAs2K/xzKnADzZzdSknYsAEkAdR3jESGTaRgcXgYYOatd wJVgsfPlE8APYF2T0LV0qRY5xVfJFNgdD7XFdfKdH6Q9kjsq6sc0zlUCpGX+stBVoRJ5f12MnK13Q p0zK6n2yf8woPzrkoL40BN84NN1ttd3XAiDM5hka5HSc0xuy/IwjYL0PuXH5uVMAXWbn2JeH3hNfk fjZH/OCB46O19zgRzGpaWqbAdG0OhTbuPfIKpD5UK8nXkPQaCJzQtpHW4OAMzDBRGUELZXF5PBiCr QoYWJEgP4XMKkU+gPVKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlqAV-00000005EG2-0SIz; Sun, 17 Mar 2024 13:03:15 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rlqAP-00000005ECI-2Mrn for opensbi@lists.infradead.org; Sun, 17 Mar 2024 13:03:11 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c36f882372so1958174b6e.2 for ; Sun, 17 Mar 2024 06:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1710680589; x=1711285389; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ngY2gAGCEqnGaH05Auk4SahKfqcnbllqyhkXJkgIxss=; b=h/ckdxy4S5stRbhElyMJ1Rd1cTb1U1icQuzU3at5W8SjnWI00P35JtbukSNkVSt3GL WxBd4xWdH8TXzbxeLkLnQcGs2PZNkffgFl83bWjgdb2bY9KmJciwjdzoIktmP9VBPiGp mZaUZBbzD4K9b9M/qAKAbIS8aK+eg80VKw45AU8cegnAgUD+U8ndXA4EKg1zc2zSFGMr FVFbbmmJ6UJ4banQoLiY6MiUdHZbid4M2WeJ/TffYfZnoTb233Lvs4tgpID88ZKrsHRs KXhLF6VqzVHc1JVwrlJVZIKB3ft5m8jJePqjAgyFImKgdO+gk38LyjEoZHIw9wVu6Uz0 g+vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710680589; x=1711285389; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ngY2gAGCEqnGaH05Auk4SahKfqcnbllqyhkXJkgIxss=; b=DGosEJz1R2uR1F74DJLKsCl9pFyactXcULXBFxNuBhz1AXmbUEuLiTiEoDf7lGTc2z +rcNSPTOLaUopZte3cJo9IoxtsmWd8SrVZ8a+GM4Nx1qrN/k45QQ9EkHcbUkNzZGNhnT Sf398yZtIzEuQijJs1yfBHncLLR2utFs6sftPoNRSUghHSVM09gou3lo5IJqEQJkgWwk sbNKVola+G9320wbKDhgpJiWTe3hWcW07IwN8H8IxHCrfKtIR74VNLZwPcevYvD+OFsN bibvggx/mfMHGkravIg3zxzkdnMm5aBCKH1OpBUtCBKzLk63ZGAfAdnfG78H8BEGeVor T/AA== X-Forwarded-Encrypted: i=1; AJvYcCX5f45B+wfY7WBj9RGjEXUG7HZdm93nLWrwvmI3fWaUQah8zOEOhdf2Gy3O3ZXR+YoysgThE7PGL62f3dh/cr/53/lI1/dHCpz9qfM= X-Gm-Message-State: AOJu0Yzx2ZcAEoEfgdkr9o/T6HCw80RKK41oHGcFd2w4f5cOOSFLsskA PKpJgNJ1CDupaGun601bEw1pzuUlpDd25flFmt0xkQ70lnjL/5VaErBarEsoN78= X-Google-Smtp-Source: AGHT+IFgpbpz8mssk2gYDwrZevApb5jEmVTGaxcfHucyCQeW4HFWbFY11kXuaWDGOW2CSg0iM2LThQ== X-Received: by 2002:a05:6808:159f:b0:3c3:85e4:49a7 with SMTP id t31-20020a056808159f00b003c385e449a7mr1003790oiw.11.1710680588592; Sun, 17 Mar 2024 06:03:08 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id cc12-20020a056808324c00b003c37ccb47c1sm613103oib.51.2024.03.17.06.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 06:03:08 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v3 07/10] lib: sbi: Remove regs paramter of sbi_irqchip_process() Date: Sun, 17 Mar 2024 18:32:28 +0530 Message-Id: <20240317130231.1705888-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240317130231.1705888-1-apatel@ventanamicro.com> References: <20240317130231.1705888-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240317_060309_866205_FF33F2D1 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__The_irqchip_handlers_will_typically_no?= =?unknown-8bit?q?t_need_pointer_to_trap?= =?unknown-8bit?q?_registers_so_remove_regs_parameter_of_sbi=5Firqchip=5Fproc?= =?unknown-8bit?q?ess=28=29=2E_Signed-off-by=3A?= =?unknown-8bit?q?_Anup_Patel_=3Capatel=40ventanamicro=2Ecom=3E_Reviewed-by?= =?unknown-8bit?q?=3A_Samuel_Holland_=3Csamuel=2Eholland=40sifive=2Ecom=3E?= =?unknown-8bit?q?_Tested-by=3A_Samuel_Holland_=3Csamuel=2Eholland=40sifive?= =?unknown-8bit?q?=2Ecom=3E_Reviewed-by=3A_Cl=C3=A9ment?= =?unknown-8bit?b?IEzDqWdlciA8Y2xlZ2VyQHIgWy4uLl0g?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E2_points=2C_5=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyNjA3OmY4YjA6NDg2NDoyMDowOjA6MDoyMmEgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Andrew Jones Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The irqchip handlers will typically not need pointer to trap registers so remove regs parameter of sbi_irqchip_process(). Signed-off-by: Anup Patel Reviewed-by: Samuel Holland Tested-by: Samuel Holland Reviewed-by: Clément Léger --- include/sbi/sbi_irqchip.h | 5 ++--- lib/sbi/sbi_irqchip.c | 10 +++++----- lib/sbi/sbi_trap.c | 4 ++-- lib/utils/irqchip/imsic.c | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/sbi/sbi_irqchip.h b/include/sbi/sbi_irqchip.h index 6acc6e3..0ed02eb 100644 --- a/include/sbi/sbi_irqchip.h +++ b/include/sbi/sbi_irqchip.h @@ -13,7 +13,6 @@ #include struct sbi_scratch; -struct sbi_trap_regs; /** * Set external interrupt handling function @@ -23,7 +22,7 @@ struct sbi_trap_regs; * * @param fn function pointer for handling external irqs */ -void sbi_irqchip_set_irqfn(int (*fn)(struct sbi_trap_regs *regs)); +void sbi_irqchip_set_irqfn(int (*fn)(void)); /** * Process external interrupts @@ -33,7 +32,7 @@ void sbi_irqchip_set_irqfn(int (*fn)(struct sbi_trap_regs *regs)); * * @param regs pointer for trap registers */ -int sbi_irqchip_process(struct sbi_trap_regs *regs); +int sbi_irqchip_process(void); /** Initialize interrupt controllers */ int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot); diff --git a/lib/sbi/sbi_irqchip.c b/lib/sbi/sbi_irqchip.c index 24128be..0ae604a 100644 --- a/lib/sbi/sbi_irqchip.c +++ b/lib/sbi/sbi_irqchip.c @@ -10,22 +10,22 @@ #include #include -static int default_irqfn(struct sbi_trap_regs *regs) +static int default_irqfn(void) { return SBI_ENODEV; } -static int (*ext_irqfn)(struct sbi_trap_regs *regs) = default_irqfn; +static int (*ext_irqfn)(void) = default_irqfn; -void sbi_irqchip_set_irqfn(int (*fn)(struct sbi_trap_regs *regs)) +void sbi_irqchip_set_irqfn(int (*fn)(void)) { if (fn) ext_irqfn = fn; } -int sbi_irqchip_process(struct sbi_trap_regs *regs) +int sbi_irqchip_process(void) { - return ext_irqfn(regs); + return ext_irqfn(); } int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot) diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c index 4e691df..72b1788 100644 --- a/lib/sbi/sbi_trap.c +++ b/lib/sbi/sbi_trap.c @@ -209,7 +209,7 @@ static int sbi_trap_nonaia_irq(struct sbi_trap_regs *regs, ulong mcause) sbi_ipi_process(); break; case IRQ_M_EXT: - return sbi_irqchip_process(regs); + return sbi_irqchip_process(); default: return SBI_ENOENT; } @@ -232,7 +232,7 @@ static int sbi_trap_aia_irq(struct sbi_trap_regs *regs, ulong mcause) sbi_ipi_process(); break; case IRQ_M_EXT: - rc = sbi_irqchip_process(regs); + rc = sbi_irqchip_process(); if (rc) return rc; break; diff --git a/lib/utils/irqchip/imsic.c b/lib/utils/irqchip/imsic.c index 36ef66c..f2a35c6 100644 --- a/lib/utils/irqchip/imsic.c +++ b/lib/utils/irqchip/imsic.c @@ -140,7 +140,7 @@ int imsic_get_target_file(u32 hartid) return imsic_get_hart_file(scratch); } -static int imsic_external_irqfn(struct sbi_trap_regs *regs) +static int imsic_external_irqfn(void) { ulong mirq;