[comp.unix.questions] PS setting before interrupt handling

abhatia@ecs.umass.edu (08/01/90)

 Excuse me if this is a stupid question as I am a beginner with UNIX.
I'm taking a course in which we're going thru "a specially edited
selection of the UNIX Operating System source code, such as might be
used on a typical PDP11/40 computer installation." 
 While going thru the assembler _trap routine, I see that, just before
the specialised interrupt handling routine (to which r0 points), the 
PS is changed to reflect the previous processor mode as "user" if it
was "kernel". I can't understand why this is done. 
 Could it be because the interrupt handling routine might reassign priorities
and call swtch(), which needs the previous processor mode to be "user" for
it to swap out the interrupted process and swap in another {though I don't
see how swtch() could need that.}

Thanks,
Ajoy K. Bhatia
Internet: abhatia@omega.ecs.umass.edu
Bitnet  : abhatia@umaecs