Re: [PATCH FOR REFERENCE v8 10/10] gpu: nova-core: use the kernel `register!` macro

From: Gary Guo

Date: Mon Mar 09 2026 - 14:44:11 EST


On Mon Mar 9, 2026 at 6:34 PM GMT, John Hubbard wrote:
> On 3/9/26 11:28 AM, Gary Guo wrote:
>> On Mon Mar 9, 2026 at 6:01 PM GMT, John Hubbard wrote:
>>> On 3/9/26 10:51 AM, Joel Fernandes wrote:
>>>> On 3/9/2026 1:34 PM, John Hubbard wrote:
>>>>> On 3/9/26 8:43 AM, Joel Fernandes wrote:
>>>>>> On 3/9/2026 11:14 AM, Alexandre Courbot wrote:
>>> ...
>>> What about this instead (*very* approximately):
>>>
>>> // set up or construct NV_PFALCON_FALCON_MAILBOX1:
>>>
>>> let reg = NV_PFALCON_FALCON_MAILBOX1::zeroed(&bar);
>>
>> This doesn't really make sense. What does "zeroed(&bar)" even mean? You're
>> neither zeroing the register on the bar, nor constructing a zeroed value?
>>
>
> The idea was to separate constructing with a zeroed value, from
> the actual register write. I am not surprised that the syntax
> is All Wrong at this point, I'm just hoping to spark more ideas
> about how to make this clear and nice to read.

Separated construct and write is just

let reg = NV_PFALCON_FALCON_MAILBOX1::zeroed().with_value(mbox1);
bar.write(WithBase::of::<E>(), reg);

(or `bar.write_val(reg)` for non-relative registers)

Best,
Gary