You already have the VecInfo pointer at all the callsites,
so I think it would be better to pass it to this function
rather than recalculating it from the irq number etc.

I agree with Alex about using a bool for the event_register
struct field.

Otherwise I think this looks good!

thanks
-- PMM


Hi Peter,

Thanks for the review and feedback!

Quick clarification on the nvic_update_pending_state() refactoring:

I've changed the signature from -
    nvic_update_pending_state(s, irq, secure, value)
to -
    nvic_update_pending_state(s, vec, irq, scr_bank, value)

This removes the internal vec/scr_bank calculation. Callsites now calculate both vec (already present) and scr_bank before the call.
Example(at callsite) -

    if (banked && secure) {
        vec = &s->sec_vectors[irq];
        scr_bank = M_REG_S;
    } else {
        vec = &s->vectors[irq];
        scr_bank = M_REG_NS;
    }
nvic_update_pending_state(s, vec, irq, scr_bank, 1);

In some places like nvic_writel() case 0xd24, where we're in a known attrs.secure context with specific exceptions, I hardcode the scr_bank value (M_REG_S or M_REG_NS) directly.

Is this the approach you had in mind?

Thanks,
Ashish



Reply via email to