linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <bh40@calva.net>
To: Josh Huber <huberj@WPI.EDU>, linuxppc-dev@lists.linuxppc.org
Subject: Re: Sleeping the powerbook G3 (small progress)
Date: Fri, 18 Jun 1999 20:47:36 +0200	[thread overview]
Message-ID: <19990618204736.028551@mail.mipsys.com> (raw)
In-Reply-To: <19990618195918.021366>


On Fri, Jun 18, 1999, Benjamin Herrenschmidt <bh40@calva.net> wrote:

>>if(*(addr+4) != magic_word) return;
>>*(addr+4) = 0;
>>branch to **addr;

Apparently, that's it, we need to put 'Lars' at address 4 (physical) and
a pointer to a function pointer at address 0. Since the kernel's own
entrypoint is located at those addresses, it should be harmless to
overwrite them.

So basically, to enable sleep, we should, just after sending the PMU
sleep command (the PMU will wait a little bit before shutting you down,
around 1 second I think), backup a complete CPU context along with SPRs
(BATs, segment regs, latest TB value, DEC value, ....), put a physical
pointer to a structure containing the physical pointer to the restore
code first, and the backup infos just after, at address 0, 'Lars' and
then wait to be shutdown.
The restore code will read at 0 to get the pointer to the structure,
restore the registers and, last, re-enable the MMU and jump back to the
sleep code.

If you don't have time to experient with actual coding, tell me, I'll try
this, but I won't have time myself until one or two weeks from now.


-- 
           Perso. e-mail: <mailto:bh40@calva.net>
           Work   e-mail: <mailto:benh@mipsys.com>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>




[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

       reply	other threads:[~1999-06-18 18:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <19990618195918.021366>
1999-06-18 18:47 ` Benjamin Herrenschmidt [this message]
1999-06-17 19:02 Sleeping the powerbook G3 (small progress) Josh Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990618204736.028551@mail.mipsys.com \
    --to=bh40@calva.net \
    --cc=huberj@WPI.EDU \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).