The XINU routine that performs the context switch is called resched(). This routine places the currently running process back on the ready queue (if it is still ready), gets the next ready process, and then calls _ctxsw to perform the context switch. There are a couple points to bring up here:
_ctxsw has an underscore in front of it because it is an assembly routine. It has to be an assembly routine because it has the job of saving and restoring registers (which cannot be done in C). I suggest that you read the portion of the text that describes _ctxsw (pages 59-61). It is quite interesting.
One last bit of information about XINU scheduling is that there is a routine called ready() in XINU that other system routines can call when they want to take a process and move it to the ready queue. Ready() takes two parameters: the PID of the process to ready, and a flag that indicates whether ready() should make a call to resched().
Normally, the flag parameter indicates that a call to resched() should be made. If not, then it is possible that a ready process exists with a higher priority than the running process. However, if the system is readying a group of processes (using multiple calls to ready()), this flag allows the O/S to delay the context switch until the whole group has been placed on the ready queue.