> On 7 Oct 2025, at 10:39, Daniel Almeida <[email protected]> wrote:
>
> Hi Dan, thanks for the review!
>
> […]
>
>>
>>> +static void
>>> +issue_store_multiple(u8 *command_stream, uint64_t kernel_va, uint32_t
>>> constant)
>>> +{
>>> + uint64_t opcode, reg_num, mov48, store_multiple, flush;
>>> + uint64_t sr, src0, register_bitmap, offset;
>>> +
>>> + // MOV48: Load the source register ([r68; r69]) with the
>>> kernel address
>>> + opcode = 0x1;
>>> + reg_num = 68;
>>> + mov48 = (opcode << 56) | (reg_num << 48) | kernel_va;
>>> + mov48 = htole64(mov48);
>>> + memcpy(&command_stream[0], &mov48, sizeof(mov48));
>>> +
>>> + // MOV48: Load a known constant into r70
>>> + opcode = 0x1;
>>> + reg_num = 70;
>>> + mov48 = (opcode << 56) | (reg_num << 48) | constant;
>>> + mov48 = htole64(mov48);
>>> + memcpy(&command_stream[8], &mov48, sizeof(mov48));
>>> +
>>> + // STORE_MULTIPLE: Store the first register to the address
>>> pointed to by [r68; r69]
>>> + opcode = 0x15; // STORE_MULTIPLE
>>> + sr = 70; // Starting from register r70
>>> + src0 = 68; // Address pointed to by [r68; r69]
>>> + register_bitmap = 1; // Store the first register
>>> + offset = 0; // Offset
>>> + store_multiple = (opcode << 56) | (sr << 48) | (src0 << 40)
>>> |
>>> +
>>> (register_bitmap << 16) | offset;
>>> + store_multiple = htole64(store_multiple);
>>> + memcpy(&command_stream[16], &store_multiple,
>>> sizeof(store_multiple));
>>
>> // MOV48 r68, 0 on the below?
>
> Wdym? / Why?
>
> I want to clarify what you mean here because it was a bit tricky to get this
> to
> work, so I am trying to be really mindful about any changes so that it
> doesn’t break.
>
Oh, I now see that you probably also want this to be a comment placed before the
opcode like the FLUSH_CACHES below.
— Daniel