Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!rosemary.Berkeley.EDU!rab From: rab@rosemary.Berkeley.EDU (Robert A. Bruce) Newsgroups: comp.sys.m68k Subject: Re: Context switching with FPP Message-ID: <29362@ucbvax.BERKELEY.EDU> Date: 27 May 89 05:57:14 GMT References: <5664@lynx.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: rab@rosemary.Berkeley.EDU (Robert A. Bruce) Distribution: na Organization: C.S. Dept., U. C. Berkeley Lines: 20 In article <5664@lynx.UUCP> m5@lynx.UUCP (Mike McNally) writes: >Are there any clever things an OS can do to avoid the overhead of saving >the status of the 6888[12] on each context switch? When a process is created, set the internal fpu state to null. Then on each context switch you can check to see if it is still null. If so, there is no need to save the registers. | Save the fpu context | a0 contains the address of the pcb fsave a0@(FP_STATE_OFFSET) | Save the internal state. tstb a0@(FP_STATE_OFFSET) | See if the state is null. beq 1f | Skip if null. fmovem #0xff, a0@(FP_REGS_OFFSET) | Save the registers. fmovem fpc/fps/fpi, a0@(FP_CTRL_REGS_OFFSET) | Save ctrl regs. 1: For more infomation see section 6.4 in the MC68881/2 Users Manual. It has an excellent discussion of context switching, and state frames.