linux-mips
[Top] [All Lists]

Re: [loongson-PATCH-v1 22/27] Hibernation Support in mips system

To: huhb@lemote.com
Subject: Re: [loongson-PATCH-v1 22/27] Hibernation Support in mips system
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Tue, 26 May 2009 23:48:51 +0900 (JST)
Cc: yanh@lemote.com, wuzhangjin@gmail.com, linux-mips@linux-mips.org, ralf@linux-mips.org, philippe@cowpig.ca, r0bertz@gentoo.org, zhangfx@lemote.com, apatard@mandriva.com, loongson-dev@googlegroups.com, gnewsense-dev@nongnu.org, hofrat@hofr.at, liujl@lemote.com, erwan@thiscow.com
In-reply-to: <4A1B53A3.6060503@lemote.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20090523.213045.39168996.anemo@mba.ocn.ne.jp> <1243302188.9819.58.camel@localhost.localdomain> <4A1B53A3.6060503@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 26 May 2009 10:27:47 +0800, Hongbing Hu <huhb@lemote.com> wrote:
> > Yes, the struct array method is more efficient, we will change to it.
> >   
> The length of registers  is different between  32bit kernel  and  64bit 
> kernel.
> That means the file hibernate.S wiil be divided into  hibernate_32.S  
> and hibernate_64.S ?

No, you can use macros in include/asm/asm.h to write common code for
32-bit/64-bit kernel.

> >> No, floating point registers are not saved on entering into kernel.
> >> They are saved on context switch.  
> >>     
> Yes, suspend to disk  will freeze processes at first,and i think the 
> process wiil save the float point regs.
> So there is no need to save them.

Hmm, but the floating point registers in _current_ task are not saved
(I think, but it this wrong?).

Maybe nobody might notice if ioctl() of the s2disk process clobbers
floating point registers, but I think something like this is needed:

        if (is_fpu_owner())
                save_fp(current);
        if (cpu_has_dsp)
                save_dsp(p);

I'm not sure DSP part, and I also wonder other cp0 registers should be
saved or not ...

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>