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

Icenowy Zheng uwu at icenowy.me
Wed Sep 13 21:12:52 PDT 2023


在 2023-09-14星期四的 11:55 +0800,Inochi Amaoto写道:
> > 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

1M OpenSBI sounds quite weird, and shouldn't happen in near future.

> 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