<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 17, 2024 at 12:51 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 16.04.24 16:51, Kinsey Moore wrote:<br>
> This adds warnings for arm_interrupt_enable_interrupts and <br>
> arm_interrupt_restore_interrupts. I suspect a missing header. They also <br>
> generate a link error on the a53_lp64_qemu bsp. I also dislike the <br>
> while(true), but I don't think we officially have anything against it <br>
> and there are existing examples in the codebase.<br>
<br>
Did you test this with the latest master? Actually, I committed a <br>
similar patch for the GICv2 and then noticed that this broke the GICv3 <br>
support. This is fixed by the current patch.<br>
<br>
What would be your alternative to this while (true) loop?<br>
<br>
void bsp_interrupt_dispatch(void)<br>
{<br>
while (true) {<br>
uint32_t icciar = READ_SR(ICC_IAR1);<br>
rtems_vector_number vector = GIC_CPUIF_ICCIAR_ACKINTID_GET(icciar);<br>
uint32_t status;<br>
<br>
if (!bsp_interrupt_is_valid_vector(vector)) {<br>
break;<br>
}<br>
<br>
status = arm_interrupt_enable_interrupts();<br>
bsp_interrupt_handler_dispatch_unchecked(vector);<br>
arm_interrupt_restore_interrupts(status);<br>
<br>
WRITE_SR(ICC_EOIR1, icciar);<br>
}<br>
}<br></blockquote><div><br></div><div>You're right, I was a couple patches behind when I checked this out. That's my fault. When I tried again just now the patch wouldn't apply because it was already committed.</div><div><br></div><div>As far as the loop, the sequence of calls just doesn't lead to a clean implementation since it's the above example, adding a loop prologue with duplicated code, duplicating a check, or stuffing several calls including an assignment into the conditional.</div><div><br></div><div>In any case, I suppose the point is moot since it's already upstream and there's not a clear answer for "better".<br></div><div><br></div><div>Kinsey<br></div></div></div>