jlaitine commented on pull request #5782: URL: https://github.com/apache/incubator-nuttx/pull/5782#issuecomment-1077406182
> Since OpenSBI is the standard way to expose M-mode functionality to S-mode, what I suggest it's that we use OpenSBI API definition, but write our own minimal implementation. I must disagree on this part, yes you need SBI, but I don't consider OpenSBI library as "standard" the same way as posix is. It is much better to have a native SBI implementation which is designed for the OS. I guess only reason why Linux is using OpenSBI is, that the library happened to be available when the first port was done. > If you don' want to implement the minimal OpenSBI this time. It's better to use other hardware timer for OS scheduler. Since most SoC has a dozen of hardware timer, it isn't too difficult to find a free one. Actually, many chips supported NuttX use the chip specific hardware timer, instead of ARM recommend SYSTICK or general timer. I don't have an extra timer available on mpfs at the moment, and why wouldn't I want to use the one that is already there for the purpose, and also used for running NuttX in CONFIG_BUILD_FLAT? And in addition to that, in S-mode the hart-id reading needs to be implemented as well. Sorry, but I don't really see the point here. If someone has implemented a native SBI for NuttX, so that you can run it in S-mode, why mess with some extra interface which needs to be retro-fitted to NuttX? This is not an interface visible to applications anyhow, but very much OS internal thing, like interrupt handling or such. Remind you, that the current flag "CONFIG_OPENSBI" does not mean that you'll get SBI support for NuttX. It only means that it builds a companion library out of OpenSBI on the side. This PR actually brings in native S-mode support for RiscV/NuttX -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org