From: Dirk Behme <dirk.behme@de.bosch.com>
To: "Andreas Hindborg" <a.hindborg@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>
Subject: Re: [PATCH 1/2] rust: add a wrapper for the `num_possible_cpus` C function
Date: Mon, 16 Feb 2026 09:23:23 +0100 [thread overview]
Message-ID: <7a4279df-8f48-42fe-bd96-12c978430b09@de.bosch.com> (raw)
In-Reply-To: <20260215-cpu-helpers-v1-1-fab13d817a5e@kernel.org>
On 15.02.2026 21:10, Andreas Hindborg wrote:
> This function returns the max number of CPUs that can be online.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
> ---
> rust/helpers/helpers.c | 1 +
> rust/helpers/num_cpus.c | 8 ++++++++
> rust/kernel/lib.rs | 6 ++++++
> 3 files changed, 15 insertions(+)
>
> diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
> index 79c72762ad9c4..a19d6562fcb3a 100644
> --- a/rust/helpers/helpers.c
> +++ b/rust/helpers/helpers.c
> @@ -35,6 +35,7 @@
> #include "maple_tree.c"
> #include "mm.c"
> #include "mutex.c"
> +#include "num_cpus.c"
> #include "of.c"
> #include "page.c"
> #include "pci.c"
> diff --git a/rust/helpers/num_cpus.c b/rust/helpers/num_cpus.c
> new file mode 100644
> index 0000000000000..daddacb0418d8
> --- /dev/null
> +++ b/rust/helpers/num_cpus.c
> @@ -0,0 +1,8 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <linux/cpumask.h>
> +
> +unsigned int rust_helper_num_possible_cpus(void)
Should we add `__rust_helper` here?
Thanks
Dirk
next prev parent reply other threads:[~2026-02-16 8:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-15 20:10 [PATCH 0/2] rust: add a few helpers Andreas Hindborg
2026-02-15 20:10 ` [PATCH 1/2] rust: add a wrapper for the `num_possible_cpus` C function Andreas Hindborg
2026-02-16 8:23 ` Dirk Behme [this message]
2026-02-15 20:10 ` [PATCH 2/2] rust: add a wrapper for the `nr_online_nodes` " Andreas Hindborg
2026-02-15 20:14 ` [PATCH 0/2] rust: add a few helpers Miguel Ojeda
2026-02-15 21:06 ` Andreas Hindborg
2026-02-16 8:39 ` Alice Ryhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a4279df-8f48-42fe-bd96-12c978430b09@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®