提交 301f8d74 编写于 作者: R Rafael J. Wysocki

Merge branch 'pm-sleep'

* pm-sleep:
  PM: hibernate: constify attribute_group structures.
  PM / hibernate: Drop redundant parameter of swsusp_alloc()
  PM / hibernate: Use CONFIG_HAVE_SET_MEMORY for include condition
  x86/power/64: Use char arrays for asm function names
...@@ -42,8 +42,7 @@ struct saved_context { ...@@ -42,8 +42,7 @@ struct saved_context {
set_debugreg((thread)->debugreg##register, register) set_debugreg((thread)->debugreg##register, register)
/* routines for saving/restoring kernel state */ /* routines for saving/restoring kernel state */
extern int acpi_save_state_mem(void); extern char core_restore_code[];
extern char core_restore_code; extern char restore_registers[];
extern char restore_registers;
#endif /* _ASM_X86_SUSPEND_64_H */ #endif /* _ASM_X86_SUSPEND_64_H */
...@@ -147,7 +147,7 @@ static int relocate_restore_code(void) ...@@ -147,7 +147,7 @@ static int relocate_restore_code(void)
if (!relocated_restore_code) if (!relocated_restore_code)
return -ENOMEM; return -ENOMEM;
memcpy((void *)relocated_restore_code, &core_restore_code, PAGE_SIZE); memcpy((void *)relocated_restore_code, core_restore_code, PAGE_SIZE);
/* Make the page containing the relocated code executable */ /* Make the page containing the relocated code executable */
pgd = (pgd_t *)__va(read_cr3()) + pgd_index(relocated_restore_code); pgd = (pgd_t *)__va(read_cr3()) + pgd_index(relocated_restore_code);
...@@ -292,8 +292,8 @@ int arch_hibernation_header_save(void *addr, unsigned int max_size) ...@@ -292,8 +292,8 @@ int arch_hibernation_header_save(void *addr, unsigned int max_size)
if (max_size < sizeof(struct restore_data_record)) if (max_size < sizeof(struct restore_data_record))
return -EOVERFLOW; return -EOVERFLOW;
rdr->jump_address = (unsigned long)&restore_registers; rdr->jump_address = (unsigned long)restore_registers;
rdr->jump_address_phys = __pa_symbol(&restore_registers); rdr->jump_address_phys = __pa_symbol(restore_registers);
rdr->cr3 = restore_cr3; rdr->cr3 = restore_cr3;
rdr->magic = RESTORE_MAGIC; rdr->magic = RESTORE_MAGIC;
......
...@@ -1108,7 +1108,7 @@ static struct attribute * g[] = { ...@@ -1108,7 +1108,7 @@ static struct attribute * g[] = {
}; };
static struct attribute_group attr_group = { static const struct attribute_group attr_group = {
.attrs = g, .attrs = g,
}; };
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/io.h> #include <asm/io.h>
#ifdef CONFIG_STRICT_KERNEL_RWX #ifdef CONFIG_ARCH_HAS_SET_MEMORY
#include <asm/set_memory.h> #include <asm/set_memory.h>
#endif #endif
#include "power.h" #include "power.h"
#ifdef CONFIG_STRICT_KERNEL_RWX #if defined(CONFIG_STRICT_KERNEL_RWX) && defined(CONFIG_ARCH_HAS_SET_MEMORY)
static bool hibernate_restore_protection; static bool hibernate_restore_protection;
static bool hibernate_restore_protection_active; static bool hibernate_restore_protection_active;
...@@ -77,7 +77,7 @@ static inline void hibernate_restore_protection_begin(void) {} ...@@ -77,7 +77,7 @@ static inline void hibernate_restore_protection_begin(void) {}
static inline void hibernate_restore_protection_end(void) {} static inline void hibernate_restore_protection_end(void) {}
static inline void hibernate_restore_protect_page(void *page_address) {} static inline void hibernate_restore_protect_page(void *page_address) {}
static inline void hibernate_restore_unprotect_page(void *page_address) {} static inline void hibernate_restore_unprotect_page(void *page_address) {}
#endif /* CONFIG_STRICT_KERNEL_RWX */ #endif /* CONFIG_STRICT_KERNEL_RWX && CONFIG_ARCH_HAS_SET_MEMORY */
static int swsusp_page_is_free(struct page *); static int swsusp_page_is_free(struct page *);
static void swsusp_set_page_forbidden(struct page *); static void swsusp_set_page_forbidden(struct page *);
...@@ -1929,8 +1929,7 @@ static inline unsigned int alloc_highmem_pages(struct memory_bitmap *bm, ...@@ -1929,8 +1929,7 @@ static inline unsigned int alloc_highmem_pages(struct memory_bitmap *bm,
* also be located in the high memory, because of the way in which * also be located in the high memory, because of the way in which
* copy_data_pages() works. * copy_data_pages() works.
*/ */
static int swsusp_alloc(struct memory_bitmap *orig_bm, static int swsusp_alloc(struct memory_bitmap *copy_bm,
struct memory_bitmap *copy_bm,
unsigned int nr_pages, unsigned int nr_highmem) unsigned int nr_pages, unsigned int nr_highmem)
{ {
if (nr_highmem > 0) { if (nr_highmem > 0) {
...@@ -1976,7 +1975,7 @@ asmlinkage __visible int swsusp_save(void) ...@@ -1976,7 +1975,7 @@ asmlinkage __visible int swsusp_save(void)
return -ENOMEM; return -ENOMEM;
} }
if (swsusp_alloc(&orig_bm, &copy_bm, nr_pages, nr_highmem)) { if (swsusp_alloc(&copy_bm, nr_pages, nr_highmem)) {
printk(KERN_ERR "PM: Memory allocation failed\n"); printk(KERN_ERR "PM: Memory allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册