mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 8/9] [Suspend2] Get pageset1 load addresses.
Date: Tue, 27 Jun 2006 08:34:39 +1000	[thread overview]
Message-ID: <20060626223438.3963.82572.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060626223412.3963.1484.stgit@nigel.suspend2.net>

Get the addresses into which the atomically copied memory should loaded
prior to restoring it. They need to be locations that won't be overwritten
in the process.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

 kernel/power/pagedir.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/kernel/power/pagedir.c b/kernel/power/pagedir.c
index ec75e79..daf498a 100644
--- a/kernel/power/pagedir.c
+++ b/kernel/power/pagedir.c
@@ -308,3 +308,29 @@ void suspend_relocate_if_required(unsign
 	}
 }
 
+/* get_pageset1_load_addresses
+ * 
+ * Description: We check here that pagedir & pages it points to won't collide
+ * 		with pages where we're going to restore from the loaded pages
+ * 		later.
+ * Returns:	Zero on success, one if couldn't find enough pages (shouldn't
+ * 		happen).
+ */
+
+int suspend_get_pageset1_load_addresses(void)
+{
+	int i, result = 0;
+	void *this;
+
+	for(i=0; i < pagedir1.pageset_size; i++) {
+		this = (void *) suspend_get_nonconflicting_page();
+		if (!this) {
+			abort_suspend("Error: Ran out of memory seeking locations for reloading data.");
+			result = 1;
+			break;
+		}
+		SetPagePageset1Copy(virt_to_page(this));
+	}
+
+	return result;
+}

--
Nigel Cunningham		nigel at suspend2 dot net

  parent reply	other threads:[~2006-06-26 23:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 22:34 [Suspend2][ 0/9] Pagedir specific routines Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 1/9] [Suspend2] Pagedir.c header Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 2/9] [Suspend2] Free extra memory allocated for the atomic copy Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 3/9] [Suspend2] Allocate extra memory " Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 4/9] [Suspend2] Mark a task as pageset 1 Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 5/9] [Suspend2] Mark pages for pageset 2 Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 6/9] [Suspend2] Get nonconflicting page Nigel Cunningham
2006-06-26 22:34 ` [Suspend2][ 7/9] [Suspend2] Relocate a piece of memory if required Nigel Cunningham
2006-06-26 22:34 ` Nigel Cunningham [this message]
2006-06-26 22:34 ` [Suspend2][ 9/9] [Suspend2] Header file for pagedir functions Nigel Cunningham

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=20060626223438.3963.82572.stgit@nigel.suspend2.net \
    --to=nigel@suspend2.net \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®