davet@oakhill.UUCP (Dave Trissel) (01/27/85)
This answers a question Jeff Hardy at sdcsvax asked: Why does the MC68020 when switching from the supervisor stack to the interrupt stack place context information on the supervisor as well as the interrupt stack? This allows an interrupt routine to do a task switch without messing around with the supervisor stack. Remember that the context data saved pertains to the supervisor routine which was interrupted. A dispatcher changes tasks by storing the supervisor stack pointer (with other context data) into a Task Control Block (or equivalent.) Notice that this works regardless of whether the dispatcher is called from a standard supervisor routine running on the supervisor stack or from an interrupt routine running on the interrupt stack. The dispatcher replaces the Supervisor stack pointer with a new task's stack pointer as part of the changeover to the new task. Notice that when an RTE is done to the end (last of) the interrupt stack that only the generic vector word is used. The context (PC and SR) are always obtained from the Supervisor stack. Thus whatever task was (is now) in control is properly continued since its context was at the top of the supervisor stack. I hope this has been clear. We will be adding information like this to the back of an updated MC68020 User's Guide. Motorola Semiconductor Inc. Dave Trissel Austin, Texas {ihnp4,seismo,ctvax,gatech}!ut-sally!oakhill!davet