On 9/4/25 4:06 AM, Alexandre Courbot wrote:
> On Thu Sep 4, 2025 at 4:16 PM JST, Danilo Krummrich wrote:
>> On Thu Sep 4, 2025 at 5:16 AM CEST, Alexandre Courbot wrote:
>>> On Thu Sep 4, 2025 at 12:15 AM JST, Joel Fernandes wrote:
>>> <snip>
>> pub struct PageTableEntry {
>> 63:63 nx as bool,
>> 62:52 available2 as u16,
>> 51:12 pfn as u64,
>> 11:9 available as u8,
>> 1:1 writable as bool,
>> 0:0 present as bool,
>> }
>>
>> This is also what would be my preferred style for the kernel in general.
>
> Sorry for the confusion. The discussion was whether to keep using the
> `H:L` syntax of the current macro, or use Rust's inclusive ranges syntax
> (i.e. `L..=H`), as the `genmask_*` macros currently do.
>
The H:L (for example "11:9 available as u8", above) is elegant and readable.
The Rust native syntax "L..=H", much less so.
For this part of the kernel, dealing specifically with bits, feel pretty
strongly that we should go with "H:L".
thanks,
--
John Hubbard