[PATCH] Change the name of pagedir_nosave
The name of the pagedir_nosave variable does not make sense any more, so it seems reasonable to change it to something more meaningful. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Родитель
dcbb5a54f6
Коммит
75534b50cc
|
@ -32,7 +32,7 @@ ENTRY(swsusp_arch_resume)
|
||||||
movl $swsusp_pg_dir-__PAGE_OFFSET, %ecx
|
movl $swsusp_pg_dir-__PAGE_OFFSET, %ecx
|
||||||
movl %ecx, %cr3
|
movl %ecx, %cr3
|
||||||
|
|
||||||
movl pagedir_nosave, %edx
|
movl restore_pblist, %edx
|
||||||
.p2align 4,,7
|
.p2align 4,,7
|
||||||
|
|
||||||
copy_loop:
|
copy_loop:
|
||||||
|
|
|
@ -159,8 +159,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
|
||||||
isync
|
isync
|
||||||
|
|
||||||
/* Load ptr the list of pages to copy in r3 */
|
/* Load ptr the list of pages to copy in r3 */
|
||||||
lis r11,(pagedir_nosave - KERNELBASE)@h
|
lis r11,(restore_pblist - KERNELBASE)@h
|
||||||
ori r11,r11,pagedir_nosave@l
|
ori r11,r11,restore_pblist@l
|
||||||
lwz r10,0(r11)
|
lwz r10,0(r11)
|
||||||
|
|
||||||
/* Copy the pages. This is a very basic implementation, to
|
/* Copy the pages. This is a very basic implementation, to
|
||||||
|
|
|
@ -54,7 +54,7 @@ ENTRY(restore_image)
|
||||||
movq %rcx, %cr3;
|
movq %rcx, %cr3;
|
||||||
movq %rax, %cr4; # turn PGE back on
|
movq %rax, %cr4; # turn PGE back on
|
||||||
|
|
||||||
movq pagedir_nosave(%rip), %rdx
|
movq restore_pblist(%rip), %rdx
|
||||||
loop:
|
loop:
|
||||||
testq %rdx, %rdx
|
testq %rdx, %rdx
|
||||||
jz done
|
jz done
|
||||||
|
|
|
@ -38,8 +38,6 @@ extern struct subsystem power_subsys;
|
||||||
/* References to section boundaries */
|
/* References to section boundaries */
|
||||||
extern const void __nosave_begin, __nosave_end;
|
extern const void __nosave_begin, __nosave_end;
|
||||||
|
|
||||||
extern struct pbe *pagedir_nosave;
|
|
||||||
|
|
||||||
/* Preferred image size in bytes (default 500 MB) */
|
/* Preferred image size in bytes (default 500 MB) */
|
||||||
extern unsigned long image_size;
|
extern unsigned long image_size;
|
||||||
extern int in_suspend;
|
extern int in_suspend;
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
|
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
|
|
||||||
struct pbe *pagedir_nosave;
|
/* List of PBEs used for creating and restoring the suspend image */
|
||||||
|
struct pbe *restore_pblist;
|
||||||
|
|
||||||
static unsigned int nr_copy_pages;
|
static unsigned int nr_copy_pages;
|
||||||
static unsigned int nr_meta_pages;
|
static unsigned int nr_meta_pages;
|
||||||
static unsigned long *buffer;
|
static unsigned long *buffer;
|
||||||
|
@ -415,7 +417,7 @@ void swsusp_free(void)
|
||||||
}
|
}
|
||||||
nr_copy_pages = 0;
|
nr_copy_pages = 0;
|
||||||
nr_meta_pages = 0;
|
nr_meta_pages = 0;
|
||||||
pagedir_nosave = NULL;
|
restore_pblist = NULL;
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,15 +492,15 @@ asmlinkage int swsusp_save(void)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
pagedir_nosave = swsusp_alloc(nr_pages);
|
restore_pblist = swsusp_alloc(nr_pages);
|
||||||
if (!pagedir_nosave)
|
if (!restore_pblist)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* During allocating of suspend pagedir, new cold pages may appear.
|
/* During allocating of suspend pagedir, new cold pages may appear.
|
||||||
* Kill them.
|
* Kill them.
|
||||||
*/
|
*/
|
||||||
drain_local_pages();
|
drain_local_pages();
|
||||||
copy_data_pages(pagedir_nosave);
|
copy_data_pages(restore_pblist);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* End of critical section. From now on, we can write to memory,
|
* End of critical section. From now on, we can write to memory,
|
||||||
|
@ -580,13 +582,13 @@ int snapshot_read_next(struct snapshot_handle *handle, size_t count)
|
||||||
if (!handle->offset) {
|
if (!handle->offset) {
|
||||||
init_header((struct swsusp_info *)buffer);
|
init_header((struct swsusp_info *)buffer);
|
||||||
handle->buffer = buffer;
|
handle->buffer = buffer;
|
||||||
handle->pbe = pagedir_nosave;
|
handle->pbe = restore_pblist;
|
||||||
}
|
}
|
||||||
if (handle->prev < handle->cur) {
|
if (handle->prev < handle->cur) {
|
||||||
if (handle->cur <= nr_meta_pages) {
|
if (handle->cur <= nr_meta_pages) {
|
||||||
handle->pbe = pack_orig_addresses(buffer, handle->pbe);
|
handle->pbe = pack_orig_addresses(buffer, handle->pbe);
|
||||||
if (!handle->pbe)
|
if (!handle->pbe)
|
||||||
handle->pbe = pagedir_nosave;
|
handle->pbe = restore_pblist;
|
||||||
} else {
|
} else {
|
||||||
handle->buffer = (void *)handle->pbe->address;
|
handle->buffer = (void *)handle->pbe->address;
|
||||||
handle->pbe = handle->pbe->next;
|
handle->pbe = handle->pbe->next;
|
||||||
|
@ -689,7 +691,7 @@ static int load_header(struct snapshot_handle *handle,
|
||||||
pblist = alloc_pagedir(info->image_pages, GFP_ATOMIC, 0);
|
pblist = alloc_pagedir(info->image_pages, GFP_ATOMIC, 0);
|
||||||
if (!pblist)
|
if (!pblist)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
pagedir_nosave = pblist;
|
restore_pblist = pblist;
|
||||||
handle->pbe = pblist;
|
handle->pbe = pblist;
|
||||||
nr_copy_pages = info->image_pages;
|
nr_copy_pages = info->image_pages;
|
||||||
nr_meta_pages = info->pages - info->image_pages - 1;
|
nr_meta_pages = info->pages - info->image_pages - 1;
|
||||||
|
@ -716,7 +718,7 @@ static inline struct pbe *unpack_orig_addresses(unsigned long *buf,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepare_image - use metadata contained in the PBE list
|
* prepare_image - use metadata contained in the PBE list
|
||||||
* pointed to by pagedir_nosave to mark the pages that will
|
* pointed to by restore_pblist to mark the pages that will
|
||||||
* be overwritten in the process of restoring the system
|
* be overwritten in the process of restoring the system
|
||||||
* memory state from the image ("unsafe" pages) and allocate
|
* memory state from the image ("unsafe" pages) and allocate
|
||||||
* memory for the image
|
* memory for the image
|
||||||
|
@ -741,7 +743,7 @@ static int prepare_image(struct snapshot_handle *handle)
|
||||||
unsigned int nr_pages = nr_copy_pages;
|
unsigned int nr_pages = nr_copy_pages;
|
||||||
struct pbe *p, *pblist = NULL;
|
struct pbe *p, *pblist = NULL;
|
||||||
|
|
||||||
p = pagedir_nosave;
|
p = restore_pblist;
|
||||||
error = mark_unsafe_pages(p);
|
error = mark_unsafe_pages(p);
|
||||||
if (!error) {
|
if (!error) {
|
||||||
pblist = alloc_pagedir(nr_pages, GFP_ATOMIC, 1);
|
pblist = alloc_pagedir(nr_pages, GFP_ATOMIC, 1);
|
||||||
|
@ -773,7 +775,7 @@ static int prepare_image(struct snapshot_handle *handle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!error) {
|
if (!error) {
|
||||||
pagedir_nosave = pblist;
|
restore_pblist = pblist;
|
||||||
} else {
|
} else {
|
||||||
handle->pbe = NULL;
|
handle->pbe = NULL;
|
||||||
swsusp_free();
|
swsusp_free();
|
||||||
|
@ -858,7 +860,7 @@ int snapshot_write_next(struct snapshot_handle *handle, size_t count)
|
||||||
error = prepare_image(handle);
|
error = prepare_image(handle);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
handle->pbe = pagedir_nosave;
|
handle->pbe = restore_pblist;
|
||||||
handle->last_pbe = NULL;
|
handle->last_pbe = NULL;
|
||||||
handle->buffer = get_buffer(handle);
|
handle->buffer = get_buffer(handle);
|
||||||
handle->sync_read = 0;
|
handle->sync_read = 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче