On 10/29/25 7:05 AM, Alexandre Courbot wrote:
> On Wed Oct 29, 2025 at 12:03 PM JST, John Hubbard wrote:
> <snip>
> This allows the implementation of `NV_PMC_BOOT_42` to mirror that of
> `NV_PMC_BOOT_0`:
>
> impl NV_PMC_BOOT_42 {
> pub(crate) fn chipset(self) -> Result<Chipset> {
> self.architecture()
> .map(|arch| {
> ((arch as u32) << Self::IMPLEMENTATION_RANGE.len())
A quick note: _RANGE() and related functions are (I think?) deeply,
madly undocumented. Not only is bitfield a macro within a macro, but
bitfield itself leaves the user with only the following as "documentation":
::kernel::macros::paste!(
const [<$field:upper _RANGE>]: ::core::ops::RangeInclusive<u8> = $lo..=$hi;
The net result is that those of us who did not author or carefully
review register!() and bitfield!() are going to have a rough time
using these facilities.
I'm not sure of the best way to add documentation here, but just
thought I'd better give an early warning about this.
thanks,
--
John Hubbard