Skip to contentSkip to conversation

How to add "t_restart" to pSoS emulator

Xenomai-help [email protected] 2 participants 2 messages Sep 23, 2010

lore
Share & tools
lore
#0 lore raw

 Hi all,
 
Currenly, the pSoS emulator doesn't support the syscall "t_restart", Is it difficulty to add it to the pSoS emulator? Does anyone have a idea about it? Thanks.  
 
 
 
Best regards
Wenyi Gao

#1 lore raw
Quoted 7 lines · On Thu, 2010-09-23 at 09:38 +0800, [email protected] wrote:

Hi all,

Currenly, the pSoS emulator doesn't support the syscall "t_restart", Is it difficulty to add it to the pSoS emulator? Does anyone have a idea about it? Thanks.

Doable, but not trivial from user-space; you would need support from the in-kernel emulator to reset the tcb properly, before playing the setjmp/longjmp game in userland to emulate the code restart. The t_restart() call already available from kernel space does most of the first part, but the second one would require some work.

pSOS introduced t_restart() mainly as a way to force the target task to run some cleanup code before self-deleting, because this call could unblock that task from any syscall it was pending on. If this matches your current use case, then you have other ways to emulate this in a linux/Xenomai environment - typically sending a thread-directed linux signal to the target task, running the cleanup code in the signal handler, and issuing t_delete(0) to finish there.

Quoted 17 lines

Best regards

Wenyi Gao

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.