gnewsense-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnewsense-dev] Re: [loongson-PATCH-v1 22/27] Hibernation Support in mip


From: Atsushi Nemoto
Subject: [Gnewsense-dev] Re: [loongson-PATCH-v1 22/27] Hibernation Support in mips system
Date: Sat, 23 May 2009 21:30:45 +0900 (JST)

On Sat, 23 May 2009 16:06:43 +0800, yanh <address@hidden> wrote:
> > > +unsigned long
> > > + saved_ra,
> > > + saved_sp,
...
> > > + saved_v0,
> > > + saved_v1;
> > 
> > Instead of enumerating them, I would prefer something like "struct
> > pt_regs saved_regs" or "unsigned long saved_regs[32]".
> This implementation is referencing the x86 platform. 
> Not all the 32 reigsters are needed to save. 
> Maybe the whole registers needed to save can still be reduced.

I did not mean save/restore all registers.  I just mean using only one
symbol (struct or array).  Though the struct or array contains some
unused members, it saves many instructions in
swsusp_arch_{suspend,resume}.

For saving N registers, (N * 2) instructions are required to save to
individual variables, but (N + 2) instructions are required to save to
array or struct.

> > > +void save_processor_state(void)
> > > +{
> > > + saved_status = read_c0_status();
> > > +}
> > 
> > No need to save/restore floating point registers?
> the floating point registers are not used by kernel, for user part, they
> are already saved while entering into kernel mode.

No, floating point registers are not saved on entering into kernel.
They are saved on context switch.  

---
Atsushi Nemoto




reply via email to

[Prev in Thread] Current Thread [Next in Thread]