Hi Gregory,

Apologies, possibly I wasn't clear with my description. I was referring to
having a method to *replace* a syscall with an architecture specific proxy.
For example, I should be able to use the usermode CSRs for providing
clock_gettime functionality.

Potentially, what you're suggesting is going to be easier, where I could
add an architecture specific implementation for gettimeofday in libc.
However, there are other places where clock_gettime is used, so it could be
advantageous to provide a proxy at this level.

Some of the integration at this level is going to be tricky, as Litex
customisations may not be risc-v generic. However, if there is or were to
be a standard way of providing this functionality, we could integrate these
additions a uniform manner, and contribute pieces back which make sense.


On Mon, 27 May 2024 at 09:49, Gregory Nutt <spudan...@gmail.com> wrote:

>
> > Adding non-standard APIs would be not be a good decision for the
> > future of a standards compliant OS.
>
> Sorry to respond again.  Perhaps I am not understanding properly.  Are
> you proposing another set of APIs or instead proposing to replace the
> standard APIs with a different implementation.
>
> Replacement of standard OS APIs with architecture specific versions of
> the same APIs is something that is done in several places in the OS.
> For example, this is done for several libc functions that can be CPU
> hogs (like memcpy, strcmp, etc.).  This is already done for RISC-V in
> libs/libc/machine/risc-v.  You could simply extend this for the
> optimized APIs that you want.
>
> That keeps the APIs standard and is very easy to maintain, especially if
> you were to follow the same pattern.  I would recommend that you look
> into these and see if this approach meets your need.
>
>
>

-- 
*Kind regards,*

*Stuart Ianna*
*Firmware Engineer*

-- 
*MoTeC Pty Ltd*

121 Merrindale Drive
Croydon South 3136
Victoria Australia
*T: *61 3 9761 5050
*W: *www.motec.com.au <https://www.motec.com.au/>


-- 
 <http://www.facebook.com/motec.global> 
<http://www.youtube.com/user/MoTeCAustralia> 
<https://www.instagram.com/motec_global/> 
<https://www.linkedin.com/company/motec-global>


-- 
 <https://www.thebatteryshow.eu/en/home.html>

-- 


Disclaimer Notice: This message, including any attachments, contains 
confidential information intended for a specific individual and purpose and 
is protected by law. If you are not the intended recipient you should 
delete this message. Any disclosure, copying, or distribution of this 
message or the taking of any action based on it is strictly prohibited.

Reply via email to