From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (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 4A7E6238C0D for ; Thu, 4 Sep 2025 16:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757004623; cv=none; b=XarfUHEzW5pPXPzM74WdAaTp1sphq5B0RlA+NNTdI15dIZqNc5Ow3i6A3gyg02JECyQqsxTPEmjxxI9kVPrpKO719i8AzOTmU93VCQHzCWwl+9UKwns+2dpXAzYEUpow/n8ycZCEPLtzR+IFQPBZG7GBz3da1g8WYqfz3KtdV8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757004623; c=relaxed/simple; bh=UTmCdn/FzjnodmTcSXD82eo8JigSTdbjwunFXeJNyqA=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=EKcwGfpYsaHx7bG/HQYLNhf6ghlZeK/aiB/b6JDHhT49SlxCo2vECaGgYeBDwzP9t7gfwscmD2SCanL3TBSxm8GcHlqztUNENVmW0vCazpnWXbLhjFMr5Jo3blks6Wju0ZHWbYI3UPrmu9r1Yli/VNz7lCJMumhwxCmNXtasCCk= 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=iGysncjB; arc=none smtp.client-ip=209.85.221.73 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="iGysncjB" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-3cd821eaac8so696550f8f.1 for ; Thu, 04 Sep 2025 09:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1757004619; x=1757609419; 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=BOSnFe1ei8q7hQMHyNdWmjuvcJ60+O1jk5lk1vh7ZRY=; b=iGysncjBzFmAn421fFKHs+npwjb9SAZbKaf5lJB/lDK9iwdsGSe16PuHNar3KUarRB yaha578JjkR2vxeUTCo0LS+tv2sSMNetQj1WsOh1xhtkGEqeiwiVzMji4yCuI/Lphgl7 zthonpE2PKxKfcQLysb1yer+uecWHe8xuAvvjn8MWo5VTpuyd7qOWsCFwIfRJ4y06DMY 1+OmEgDUUc9hnbi7Q2CrmnwEEUUhGNEZL2ct4GqF9Kh3FSr0OVRRhra0BNpUYgkdenzU 4mJvheVk5CFM70GPTEYkJ7U/d02lb4hAJWbjpytukS5nLu9uJnydMZ/UokEISIlzBWQQ 64qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757004619; x=1757609419; 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=BOSnFe1ei8q7hQMHyNdWmjuvcJ60+O1jk5lk1vh7ZRY=; b=rZwmyyweCkio0D9RB78nOafRXf1Cd2a1y/6Meqq51j6kNYCAeYYxOUFBoQKbSp1oIx fGP/uh82hRayVDMTt6SS15fE+4vc+wXASFt481rH16bHo7F3dRkdsd2bhYJJpTmVfWGN rGP5x3TXsNSUUOdHTgNAmiGjrKkaJOMdTsVmfSmc5EDnpbnH7pbt78IcWrtVl7o4D0I1 g0Gj5KYJMtlJLNasvhknqfpHCdjz95/pbpQu0qoBOmhrc7nO0jk9XNAcP53detMmO+ur QfJvqnyPtXoELTzMvBThdax4G7Y9yQBmDyNoKCxbTj7ZWOCqwmGGICG3gunjO4hqcXAt co+A== X-Forwarded-Encrypted: i=1; AJvYcCWMna6+PuxT2xhhuxk8kiuw9gJDc5uFjJO/x0aFjq+fmikvK/Fw5h+7NYZcDtwMXy03DwN22UgdQjMMSawROw==@vger.kernel.org X-Gm-Message-State: AOJu0Yz/+JdArCfvhKA15RR6+jE434v7mDGYP+rTszmfYgNMS7hDXTXv shFLb73IA3Thg7Dh6FJYhUKcHuTcpw+DU6O5/Fk19zxm1NeC+Keo5Hvob+Eq9YZEEEbeZQ== X-Google-Smtp-Source: AGHT+IEb26DBkGhwW+Vc5w8DUd4B4+rbVfmalUYAE8JPSvISa1+76GowtJNLQIYYdwkd3FvAJD9WwFo= X-Received: from wmbiw7.prod.google.com ([2002:a05:600c:54c7:b0:45b:8a9e:b2a0]) (user=bqe job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2481:b0:3e1:219e:a74a with SMTP id ffacd0b85a97d-3e1219eaa1amr2329986f8f.21.1757004619513; Thu, 04 Sep 2025 09:50:19 -0700 (PDT) Date: Thu, 4 Sep 2025 16:50:05 +0000 In-Reply-To: <20250904165015.3791895-1-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: <20250904165015.3791895-1-bqe@google.com> X-Mailer: git-send-email 2.51.0.355.g5224444f11-goog Message-ID: <20250904165015.3791895-2-bqe@google.com> Subject: [PATCH v15 1/5] rust: add bindings for bitmap.h From: Burak Emir To: Yury Norov , Kees Cook 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 , "Gustavo A . R . Silva" , Carlos LLama , Pekka Ristola , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@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 Reviewed-by: Alice Ryhl Acked-by: Yury Norov [NVIDIA] - --- 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 cecb0419a537..c1d72e26fba8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4299,6 +4299,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 84d60635e8a9..7bb575043c86 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -36,6 +36,7 @@ #include #include #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 7cf7fe95e41d..8437736fdf28 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -8,6 +8,7 @@ */ #include "auxiliary.c" +#include "bitmap.c" #include "blk.c" #include "bug.c" #include "build_assert.c" -- 2.51.0.355.g5224444f11-goog