[PATCH 2/3] powerpc/85xx: Provide two functions to save/restore the core registers

Dongsheng.Wang at freescale.com Dongsheng.Wang at freescale.com
Mon Jan 20 17:03:36 EST 2014


> > > What is there that is specfic to a particular core type that can't be
> handled
> > > from C code?
> > >
> >
> > In the context of the calling, maybe not in C environment.(Deep sleep without
> > C environment when calling those interfaces)
> 
> Could you provide a concrete example?
> 

:)
Deep sleep, the patches will comes out soon.

> > > > +	/*
> > > > +	 * Need to save float-point registers if MSR[FP] = 1.
> > > > +	 */
> > > > +	mfmsr	r12
> > > > +	andi.	r12, r12, MSR_FP
> > > > +	beq	1f
> > > > +	do_sr_fpr_regs(save)
> > >
> > > C code should have already ensured that MSR[FP] is not 1 (and thus the FP
> > > context has been saved).
> > >
> >
> > Yes, right. But I mean if the FP still use in core save flow, we need to save
> it.
> > In this process, i don't care what other code do, we need to focus on not
> losing
> > valuable data.
> 
> It is not allowed to use FP at that point.
> 
If MSR[FP] not active, that is FP not allowed to use.
But here is a normal judgment, if MSR[FP] is active, this means that the floating
point module is being used. I offer is a function of the interface, we don't know
where is the function will be called. Just because we call this function in the
context of uncertainty, we need this judgment to ensure that no data is lost.

Thanks,
-Dongsheng


More information about the Linuxppc-dev mailing list