Closed trylimits closed 9 years ago
See initial Bug #28 for more information
I think I found the problem. I'll write you later.
From Bug #28 @mpe5651
Take a look at the last line in the restore registers function:
RestoreRegisters:
ADD SP, SP, #40
LDMFD SP!, {CPSR}
LDMFD SP, {R13}^
NOP
ADD SP, SP, #4
;LDMFD SP!, {SP}
LDMFD SP, {R0-R12, PC}^
;ADD SP, SP, #56
We are restoring the registers without correcting the stack pointer. Then the relative slow crash after about an hour would make sense. What do you think? I'm sorry that I can't test it, I'm currently not st home.
I think you are right but the problem is a little bit difficult to solve. The last line restores the context including the PC, thus we cannot do anything below that line. Let's discuss that issue in the next coaching.
Ok. But I would like to invest about 10 minutes tomorrow and test the following sequence:
LDMFD SP, {R0-R12}^
ADD SP, SP, #52
LDMFD SP, {LR}^
ADD SP, SP, #4
SUBS PC, LR, #4
@mpe5651 Implemented the suggested fix. Further testing needed, but looks good.
Commit has not changed the behaviour.
Introducing the MMU has fixed this problem. Therefore closing this issue.
The scheduler crashes after some time (atm it crashes after one hour). I assume this is caused by not restoring the stack pointer after a context switch, however, we should investigate the problem if it causes major issues.