[PATCH 1/2] nova-core: Add a library for bitfields in Rust structs
Danilo Krummrich
dakr at kernel.org
Mon Aug 25 10:46:18 UTC 2025
On 8/24/25 3:59 PM, Joel Fernandes wrote:
> Add a minimal bitfield library for defining in Rust structures (called
> bitstruct), similar in concept to bit fields in C structs. This will be used
> for defining page table entries and other structures in nova-core.
>
> Signed-off-by: Joel Fernandes <joelagnelf at nvidia.com>
> ---
> drivers/gpu/nova-core/bitstruct.rs | 149 +++++++++++++++++++++++++++++
> drivers/gpu/nova-core/nova_core.rs | 1 +
> 2 files changed, 150 insertions(+)
> create mode 100644 drivers/gpu/nova-core/bitstruct.rs
I think this is much simpler than the register!() macro that we decided to
experiment with and work out within nova-core before making it available as
generic infrastructure.
So, probably this should go under rust/kernel/ directly.
- Danilo
More information about the Nouveau
mailing list