Hello! These patches extract and enhance the bitfield support in the register macro in nova to define Rust structures with bitfields. It then moves out the bitfield support into the kenrel crate.
Since v5, I dropped several patches and only kept the simple ones that do code movement, added a few features and added a KUNIT test. After Alex's bounded integer [1] support is in, we can rewrite the dropped patches. I also dropped the MAINTAINER entry for now, pending more clarity around that. I am happy to maintain it, but I need more input on who all will co-maintain, now that the last 4 patches were dropped. Perhaps we can maintain it was a part of the core rust-for-linux? I suggest let us create the maintainer entry once Alex's bounded integer support is integrated but I am open to suggestions. Here are the v5 patches [2]. [1] https://lore.kernel.org/all/[email protected]/ [2] https://lore.kernel.org/all/[email protected]/ Joel Fernandes (5): nova-core: bitfield: Move bitfield-specific code from register! into new macro nova-core: bitfield: Add support for different storage widths nova-core: bitfield: Add support for custom visiblity rust: Move register and bitfield macros out of Nova rust: bitfield: Add KUNIT tests for bitfield drivers/gpu/nova-core/falcon.rs | 2 +- drivers/gpu/nova-core/falcon/gsp.rs | 4 +- drivers/gpu/nova-core/falcon/sec2.rs | 2 +- drivers/gpu/nova-core/regs.rs | 6 +- rust/kernel/bitfield.rs | 654 ++++++++++++++++++ rust/kernel/io.rs | 1 + .../macros.rs => rust/kernel/io/register.rs | 301 +------- rust/kernel/lib.rs | 1 + 8 files changed, 696 insertions(+), 275 deletions(-) create mode 100644 rust/kernel/bitfield.rs rename drivers/gpu/nova-core/regs/macros.rs => rust/kernel/io/register.rs (73%) base-commit: 299eb32863e584cfff7c6b667c3e92ae7d4d2bf9 -- 2.34.1
