[PATCH 2/4] powerpc: Add new save_tar() register function.

Michael Neuling mikey at neuling.org
Wed Aug 7 20:55:55 EST 2013


> > +#ifdef CONFIG_PPC_BOOK3S_64
> > +_GLOBAL(_save_tar)
> > +	/*
> > +	 * Back up the TAR across context switches.  Note that the TAR is not
> > +	 * available for use in the kernel.  (To provide this, the TAR should
> > +	 * be backed up/restored on exception entry/exit instead, and be in
> > +	 * pt_regs.  FIXME, this should be in pt_regs anyway (for debug).)
> > +	 */
> > +	mfspr	r0,SPRN_TAR
> > +	std	r0,THREAD_TAR(r3)
> > +	blr
> > +#endif
> 
> Why not do this in C, as in prev->tar = mfspr(SPRN_TAR); ?

Good point! 

I'd just copied the original code which was inline asm in _switch().  

Thanks,
Mikey


More information about the Linuxppc-dev mailing list