From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5046B2D9484 for ; Tue, 2 Dec 2025 18:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764700093; cv=none; b=KkTCaaWlH9xQQMmVl2E6mnMI9eJpwMqeVtXKKRHlad5p4h+CZMQaZGaf+GWT3RrxEGEh+vjKfVyq6vTBtEIDrcdR5jSsOMxX5elWJiatgpBcIhMy9vPV4ck2IIfyAWTgj6kXiMpjuo/S0kiNAG0HaJXLl41trApA2hmU/Gz1zT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764700093; c=relaxed/simple; bh=Z0piJ2uMHqJvLowyoCX36ouM9fy0bcmA2oM/iZMlUr0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e4egA1ikOcWb+IWpzdY4VOAxIP3FlqGyBQpd7TB1vD8h/g0xkZylMMNQtNbsUyOgSTuPnnuglRFDdYJT6zlULGqALlXapotSv5F2yHyuKQVr3zQrpagxR33DGf6wfwTGDONVGnzCO2xb+QxdPk+lUx69/Og844BDItPsEG11oUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=MiOZez5F; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MiOZez5F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1764700091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ctsqKiNbu9tw0Co3r3NlUOa+U4FB32iqwclFHrHc7RQ=; b=MiOZez5F6ZgI4sDrtdmoXx/oarvwVi0Ni/riOgMz0EZMHdunbG6hdIbGcpYL2Cj3SbvUcH AaYh4hfmx5Jlm16AiA1TADHUR8svEr6w7NpqT6ZuhFVKl8K55IKRpiA8UN9AAN+Yi0m7eb dGiWt49MyzRyggC7huYLsvaKs2XUSOc= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-wzeC9FmpOFuv_REbggpGJQ-1; Tue, 02 Dec 2025 13:28:06 -0500 X-MC-Unique: wzeC9FmpOFuv_REbggpGJQ-1 X-Mimecast-MFC-AGG-ID: wzeC9FmpOFuv_REbggpGJQ_1764700083 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3C67A195605B; Tue, 2 Dec 2025 18:28:03 +0000 (UTC) Received: from chopper.lan (unknown [10.22.80.109]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7D74019560A7; Tue, 2 Dec 2025 18:28:00 +0000 (UTC) From: Lyude Paul To: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Cc: Boqun Feng , Daniel Almeida , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Andrew Morton , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long Subject: [PATCH v15 07/16] rust: helper: Add spin_{un,}lock_irq_{enable,disable}() helpers Date: Tue, 2 Dec 2025 13:24:15 -0500 Message-ID: <20251202182720.125884-8-lyude@redhat.com> In-Reply-To: <20251202182720.125884-1-lyude@redhat.com> References: <20251202182720.125884-1-lyude@redhat.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 From: Boqun Feng spin_lock_irq_disable() and spin_unlock_irq_enable() are inline functions, to use them in Rust, helpers are introduced. This is for interrupt disabling lock abstraction in Rust. Signed-off-by: Boqun Feng Reviewed-by: Andreas Hindborg Signed-off-by: Lyude Paul --- rust/helpers/spinlock.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rust/helpers/spinlock.c b/rust/helpers/spinlock.c index 42c4bf01a23e4..d4e61057c2a7a 100644 --- a/rust/helpers/spinlock.c +++ b/rust/helpers/spinlock.c @@ -35,3 +35,18 @@ void rust_helper_spin_assert_is_held(spinlock_t *lock) { lockdep_assert_held(lock); } + +void rust_helper_spin_lock_irq_disable(spinlock_t *lock) +{ + spin_lock_irq_disable(lock); +} + +void rust_helper_spin_unlock_irq_enable(spinlock_t *lock) +{ + spin_unlock_irq_enable(lock); +} + +int rust_helper_spin_trylock_irq_disable(spinlock_t *lock) +{ + return spin_trylock_irq_disable(lock); +} -- 2.52.0