lkml.org 
[lkml]   [2019]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] RISC-V: Mark existing SBI as legacy SBI.
On Tue, Aug 27, 2019 at 07:03:04AM -0700, Christoph Hellwig wrote:
> > +#define SBI_EXT_LEGACY_SET_TIMER 0x0
> > +#define SBI_EXT_LEGACY_CONSOLE_PUTCHAR 0x1
> > +#define SBI_EXT_LEGACY_CONSOLE_GETCHAR 0x2
> > +#define SBI_EXT_LEGACY_CLEAR_IPI 0x3
> > +#define SBI_EXT_LEGACY_SEND_IPI 0x4
> > +#define SBI_EXT_LEGACY_REMOTE_FENCE_I 0x5
> > +#define SBI_EXT_LEGACY_REMOTE_SFENCE_VMA 0x6
> > +#define SBI_EXT_LEGACY_REMOTE_SFENCE_VMA_ASID 0x7
> > +#define SBI_EXT_LEGACY_SHUTDOWN 0x8
>
> As Mike said legacy is a bit of a weird name. I think this should
> be SBI01_* or so. And pleae align the numeric values and maybe use
> an enum.
>
> > +
> > +#define SBI_CALL_LEGACY(which, arg0, arg1, arg2, arg3) ({ \
> > register uintptr_t a0 asm ("a0") = (uintptr_t)(arg0); \
> > register uintptr_t a1 asm ("a1") = (uintptr_t)(arg1); \
> > register uintptr_t a2 asm ("a2") = (uintptr_t)(arg2); \
>
> Instead of the weird inline assembly with forced register allocation,
> why not move this to pure assembly? AFAICs this is the whole assembly
> code we'd need:
>
> ENTRY(sbi01_call)
> ecall
> END(sbi01_call)

Actually we'll need a mv to a7 for the function id, but the point
still stands.

\
 
 \ /
  Last update: 2019-08-27 16:05    [W:0.124 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site