@Seeky Just to make sure I understand your post, does "Context Switch" refer to an external interrupt (of any sort) occurring on one of the first two instructions of his manual disable interrupts code? When I see Context Switch, I personally keep thinking of Context Synchronization (isync), lol.
Also, are you saying he should function call OSDisableInterrupts or any such task? Or are you saying to function call OSSave/Load Context which itself later on calls OSDisable/Restore Interrupts ?
Because if it's the former, then yes that would make sense. He would either need to call OSDisableInterrupts, or just execute the exact function manually (so r3 and r4 are used/filled accordingly if a external interrupt does indeed happen during this time).
At the end of his code, the method in which he restores interrupts shouldn't matter as long as he grabs the latest MSR and re-inserts the original MSR EE bit since interrupts are disabled at this moment in time. In essence, the Restore Interrupts function is "silly" for its need to check r3 (old EE bit) and branch. A simple bit re-insertion should work.
I just woke up, so apologies if I'm missing something obvious. Regardless, I share your same final thought, I'm not sure why Interrupts are being disabled at all?
---
@Jawa Nice work on learning some of the more advanced stuff on PPC Assembly. Was there a weird issues occurring in your code before you added in the Interrupt stuff?
Also, are you saying he should function call OSDisableInterrupts or any such task? Or are you saying to function call OSSave/Load Context which itself later on calls OSDisable/Restore Interrupts ?
Because if it's the former, then yes that would make sense. He would either need to call OSDisableInterrupts, or just execute the exact function manually (so r3 and r4 are used/filled accordingly if a external interrupt does indeed happen during this time).
At the end of his code, the method in which he restores interrupts shouldn't matter as long as he grabs the latest MSR and re-inserts the original MSR EE bit since interrupts are disabled at this moment in time. In essence, the Restore Interrupts function is "silly" for its need to check r3 (old EE bit) and branch. A simple bit re-insertion should work.
I just woke up, so apologies if I'm missing something obvious. Regardless, I share your same final thought, I'm not sure why Interrupts are being disabled at all?
---
@Jawa Nice work on learning some of the more advanced stuff on PPC Assembly. Was there a weird issues occurring in your code before you added in the Interrupt stuff?