[RFC PATCH v2 1/2] include: Move trap handle helper functions to sbi_trap.h

Inochi Amaoto inochiama at outlook.com
Wed Sep 13 20:55:28 PDT 2023


>On 14 Sep 2023, at 03:40, Inochi Amaoto <inochiama at outlook.com> wrote:
>>
>> The trap handle helper macros can help platform make a compatible trap
>> handler, this is helpful if a platform need a custom trap handler. So
>> move these helper macro into sbi_trap.h to allow platforms to use them.
>
>Why? What’s wrong with:
>
>_thead_trap_handler:
>    sfence.vma
>    j _trap_handler
>
>No modification of any code outside of T-HEAD platform code required.
>
>Jess
>

The inst j only can access 1 MiB offset from the pc, I am not sure whether
this will cause some problem in the future. If this does not matter, I agree
to use direct jmp to get less code.



More information about the opensbi mailing list