From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B91AA19D892 for ; Wed, 23 Apr 2025 13:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745415858; cv=none; b=bzn+SK31TCirzCR1k9+qqe/zSyiLvgLY26htOimEURN2cOGu7SUUNV9eVX5YlREUIaioUCp4WNRnwnAN9u6Y4XhuBaHdKJJhoAt8hkE30gmJ2ToCHCir9TEbscExrMqjPI08Xxe0EVlu0HO7kKXEq0JbyTXVExuChtkdg3HH948= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745415858; c=relaxed/simple; bh=yIzxX0tP9e0JLmagsZ1eMyHw7tAe7CyG3pSIZakoVB8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Nb/bFRhQ3+8P5SJgaPKioly+z7eaZeWIfSocQtTwlfG2DuJPooL+4DB0sBNAf7U1R0SsUE1tE0kH8bTOuYCzm06tCSAYy9Oz1Y/UIk1rWwzvu9CeWXZyZCXEXPZ/NMu1F7tEj+T7O+AjVrGJIYNM/Xz/oudM8Akt+7GnadWZgLc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--bqe.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JqMPznQ5; arc=none smtp.client-ip=209.85.221.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--bqe.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JqMPznQ5" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-39135d31ca4so483183f8f.1 for ; Wed, 23 Apr 2025 06:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1745415855; x=1746020655; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=1A99eSFUrFSGG4Bz7Jobdz4l0qm1fXeNjUFJwd6iyuI=; b=JqMPznQ5BQndRrmxm/0zsbsybSPovI3zlj3uRJpOQSOeyvLafMKfNwgeM0bEFDf4S1 SjwqX/fQ972LBhdrJogR9z7XcAkTd+ENRCJuIUunUPBJaAuM2F2BCFjmAiAcHRttbsg0 HKEJsfbNAPpjtL5l/WrfaLxro2BoXDHaKpDSrS1J0MHYQjm2QCWhW/ewc9LmrHpfkw85 puydUh1xDRQ8qfq1zPKaAxZpu8k+hC8L6Kopi9uMT/uu05ztoxF0HMHTMNIAefIAxfxE N3oKclou8zpqoPW7EVqbhmc92LbOnvW/PEbgYBllssAIM5izz728AkfCtWXE1Y6jqFrV oJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745415855; x=1746020655; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1A99eSFUrFSGG4Bz7Jobdz4l0qm1fXeNjUFJwd6iyuI=; b=VpB6LIY5N0UGmssSwN9hk0HdQUS97Qot0JoJMQmYbgpn+Xlx7kF70iWJ9OOhZAzOPb bgMkVolAHr4P70cV4beaEIKhdhfPJfvySst48SLJtcZ5i5Kh17PojNKXeQYLfbMvR59j Yei/f/44kauhOT+0AWkUvKDCp6LYFUS1E9jGEF2MMSnR6aWpe4TyXm2Fs/zYmDfinIpE iwJdNamY4gxuivtU0X1u3SEnhl61ClZztZU2uv0K6db6rohkKKxsZxjow+wrEGqhaW7R NX3DTEbI7kPi2SwIwKVnEGJy14Hdbwaq8l31x1D60Noi0yyxsfCD76KHDsNbM6bKKVQE jyuQ== X-Forwarded-Encrypted: i=1; AJvYcCU44RgxfnlLV+PE8NoZikRVYvur8XM17uVUcQWHhe9C7fwcyqiS9tjOOPFD3wLUpB3CLbsVBDIpqyeDNfRy+A==@vger.kernel.org X-Gm-Message-State: AOJu0YzgAXf2NZVSKC3izKap1bAGiim1eN4PB/je2OzppJxqB8fSVHVR HsYwPPYkJqWJkcb0JoNXpXI8CeBY1rhssek65t4MxKhQhqUUQWGvecp0/gs37Rfv0A== X-Google-Smtp-Source: AGHT+IExriZUSDPN8q5d2JMXs3ZHtyHv81PF2eu9U05mRYtvnV31LLQuXxobwHvEkXUV2OBWSji3sRo= X-Received: from wrbgv2.prod.google.com ([2002:a05:6000:4602:b0:39a:bed5:1512]) (user=bqe job=prod-delivery.src-stubby-dispatcher) by 2002:a5d:6d87:0:b0:391:1218:d5f4 with SMTP id ffacd0b85a97d-3a067258559mr2721090f8f.23.1745415854992; Wed, 23 Apr 2025 06:44:14 -0700 (PDT) Date: Wed, 23 Apr 2025 13:43:33 +0000 In-Reply-To: <20250423134344.3888205-2-bqe@google.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250423134344.3888205-2-bqe@google.com> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog Message-ID: <20250423134344.3888205-3-bqe@google.com> Subject: [PATCH v7 1/5] rust: add bindings for bitmap.h From: Burak Emir To: Yury Norov Cc: Burak Emir , Rasmus Villemoes , Viresh Kumar , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Makes the bitmap_copy_and_extend inline function available to Rust. Adds F: to existing MAINTAINERS section BITMAP API BINDINGS [RUST]. Suggested-by: Alice Ryhl Suggested-by: Yury Norov Signed-off-by: Burak Emir --- MAINTAINERS | 1 + rust/bindings/bindings_helper.h | 1 + rust/helpers/bitmap.c | 9 +++++++++ rust/helpers/helpers.c | 1 + 4 files changed, 12 insertions(+) create mode 100644 rust/helpers/bitmap.c diff --git a/MAINTAINERS b/MAINTAINERS index a5584c5020ac..b11eb9ebc53d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4132,6 +4132,7 @@ F: tools/lib/find_bit.c BITMAP API BINDINGS [RUST] M: Yury Norov S: Maintained +F: rust/helpers/bitmap.c F: rust/helpers/cpumask.c BITOPS API diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index ab37e1d35c70..b6bf3b039c1b 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/rust/helpers/bitmap.c b/rust/helpers/bitmap.c new file mode 100644 index 000000000000..a50e2f082e47 --- /dev/null +++ b/rust/helpers/bitmap.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include + +void rust_helper_bitmap_copy_and_extend(unsigned long *to, const unsigned long *from, + unsigned int count, unsigned int size) +{ + bitmap_copy_and_extend(to, from, count, size); +} diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 0aea103c16be..aa0c0c2cdee2 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -7,6 +7,7 @@ * Sorted alphabetically. */ +#include "bitmap.c" #include "blk.c" #include "bug.c" #include "build_assert.c" -- 2.49.0.805.g082f7c87e0-goog