You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the parameter metal_interrupt_vector_handler_t isr of __metal_driver_sifive_clic0_vector_register that is also assigned to clic->metal_mtvt_table[id] does not have 64 bytes alignment requirement.
So the question is why __metal_clic0_default_vector_handler needs to be 64 bytes aligned?
The text was updated successfully, but these errors were encountered:
Good point. __metal_clic0_default_vector_handler is real ISR handler. CLIC specs require this handler to be 64-byte aligned (as far as I know, since it should fit into some part of the mtvec CSR).
On the other hand, isr is an arbitrary function pointer argument.
Should we add additional checks in the code to be sure isr is 64-byte aligned?
Actually for vectored mode (that does not place ISR handler address into mtvec directly) I can find that vector table address placed into mtvt should be 64-byte aligned (minimum, but can increase depending on the total number of CLIC interrupts implemented). Sorry for maybe a dummy question, but could you please point me to a doc that requires all mtvt entries to be 64-byte aligned as well?
I mean that __metal_clic0_handler is a default handler for non-vectored mode and it is required to be 64-byte aligned. That is fine
The
__metal_clic0_default_vector_handler
has 64 bytes alignment attribute.freedom-metal/src/drivers/sifive_clic0.c
Lines 32 to 33 in 26b85c9
it is assigned to
clic->metal_mtvt_table[id]
in__metal_driver_sifive_clic0_vector_register
:freedom-metal/src/drivers/sifive_clic0.c
Lines 559 to 590 in e21891c
But the parameter
metal_interrupt_vector_handler_t isr
of__metal_driver_sifive_clic0_vector_register
that is also assigned toclic->metal_mtvt_table[id]
does not have 64 bytes alignment requirement.So the question is why
__metal_clic0_default_vector_handler
needs to be 64 bytes aligned?The text was updated successfully, but these errors were encountered: