Re: What is the preferred way of doing a context switch on the ARM?



Op Fri, 29 Aug 2008 07:45:34 +0200 schreef Michael <MichaelDMcDonnell@xxxxxxxxx>:
I’m asking, because I see no clean way to do it. On stack based
machines you simply “pushall” onto the active task’s stack, switch
stacks, and do a “popall”. The ARM makes this difficult because when
it switches to a privileged mode, the active task’s stack becomes
“invisible”, and the CPSR gets saved into the SPSR (as opposed to
being pushed onto the stack). Thanks!

User-defined task code is only run in User or System mode, which both use the 'unaliased' registers. On an exception, the processor starts using alternative registers, but you can go to System mode to access those unaliased registers and push them (and the SPSR as well, of course).



--
Gemaakt met Opera's revolutionaire e-mailprogramma: http://www.opera.com/mail/
.



Relevant Pages

  • Re: Team EM help please
    ... There should be 5 switch stacks back there. ... in stack 1, and changing the state of the make/break switch on stack ... Now manually actuate the plunger to advance the player unit one step ... only stack 2 should be on a cam and lifted closing all ...
    (rec.games.pinball)
  • Re: Team EM help please
    ... Start a game. ... There should be 5 switch stacks back there. ... in stack 1, and changing the state of the make/break switch on stack ... only stack 2 should be on a cam and lifted closing all ...
    (rec.games.pinball)
  • Re: Team EM help please
    ... There should be 5 switch stacks back there. ... in stack 1, and changing the state of the make/break switch on stack ... Now manually actuate the plunger to advance the player unit one step ... only stack 2 should be on a cam and lifted closing all ...
    (rec.games.pinball)
  • Re: A questionable piece of code for context switching (very short, only 5 lines)
    ... from thread B is put instead on the stack, the state of thread B is ... and SWITCH returns to where it was last ... and the program resumes execution at address x. ... The interrupt handler eventually calls SWITCH ...
    (comp.lang.asm.x86)
  • Re: Wimp_Initialise & Threading
    ... The initial thread has a stack (at ... least by the time you get to main) and no need to store its ... registers anywhere because there's no other thread to switch over to, ... A thread switch consists of storing the registers for the current ...
    (comp.sys.acorn.programmer)