Finally i dived deeper into the code for ARM and refreshed my assembly knowledge and found a fix for #55 ("Aieie, swapcontext() failed ...").
The arm ABI defines that the value in register r0 is used as the return value of a function. To indicate success for get/set/swapcontext (return value of 0) the register r0 must contain zero when get/set/swapcontext return. Thus set r0 to zero and store it in the context. This context is retrieved later before get/set/swapcontext return and thus it indicate successful execution, because r0 is 0.
The order registers are stored has changed so that only one additional instruction (mov r0, #0) needs to be added to fix the return value bug for get/set/swapcontext.
Finally i dived deeper into the code for ARM and refreshed my assembly knowledge and found a fix for #55 ("Aieie, swapcontext() failed ...").
The arm ABI defines that the value in register r0 is used as the return value of a function. To indicate success for get/set/swapcontext (return value of 0) the register r0 must contain zero when get/set/swapcontext return. Thus set r0 to zero and store it in the context. This context is retrieved later before get/set/swapcontext return and thus it indicate successful execution, because r0 is 0.
The order registers are stored has changed so that only one additional instruction (mov r0, #0) needs to be added to fix the return value bug for get/set/swapcontext.
Best regards Volker