L 6.3:  Prologue of lthread_ex_regs

(Revision 0 - 5 November 2000)

 

overview    system call #6

parameters	a0	target thread tid (tid of addressed thread in current task)
		a1	target thread new ip
		a2	target thread new sp
		a3	target thread exception handler id
		a4	target thread pager id
output          a1	target thread old ip
		a2	target thread old sp
		a3	target thread old exception handler id
		a4	target thread old pager id

lthread_ex_regs (local thread exchange register) inquires and can modify a local thread's program counter, stack pointer, pager and excepter. It also creates the target thread and its TCB as necessary.

on entry	a0-a4	as above
		t8	pointer to high end of caller's tcb
0-3 save a1-a4 in s4-s7
4 s0  ¬  caller's tid
5-9 construct target thread's tid from caller's tid and put it in s1
10 s2  <--   target thread tcb (lo core address)
11-13 if target tcb valid goto l62 L6.5
else continue on l14 L6.4 to allocate and initialize a valid tcb