v01d commented on pull request #3589:
URL: https://github.com/apache/incubator-nuttx/pull/3589#issuecomment-825081367


   > > BTW, I'm currently trying to solve an issue with sim: my understanding 
is that up_head call's the host's setjmp/longjmp, but when inspecting this 
symbol from Make build, it appears it is renamed to NXsetjmp so it is using 
internal definition of setjmp. Isn't up_head.c the host interface to the 
simulator? Why is it using the simulated setjmp? Is the host's setjmp not 
usable for up_head? (I understand that the simulated nuttx internally provides 
its own mechanism for setjmp)
   > 
   > I tried that many years ago. It would crash immediately. I forget the 
details, but as I recall, there are a couple of issues with with the host 
longjmp/setjmp for this usage. For one, the stack is encrypted for security 
reasons. I forget why this caused the crash, try it and see.
   > 
   > Another problem is the the GNU/Linux setjmp/longjmp is tied into Linux 
signal handling in a way that makes it unsuitable for use in the simulation.
   > 
   > For the simulation, you need a simple setup/longjmp that just saves the 
and restores the critical registers.
   
   Great, thanks for the explanation! 


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to