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

From: Michael Neuling <[email-masked]>
Date: Wed, 07 Aug 2013 20:55:55 +1000

> > +#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