Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 97781 Details for
Bug 148549
suspend2-sources-2.6.18 compile error on amd64
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that actually applies
x86_64_nosave.patch (text/plain), 3.05 KB, created by
Jan Jitse Venselaar
on 2006-09-22 12:10:19 UTC
(
hide
)
Description:
Patch that actually applies
Filename:
MIME Type:
Creator:
Jan Jitse Venselaar
Created:
2006-09-22 12:10:19 UTC
Size:
3.05 KB
patch
obsolete
>=================================================================== >--- linux-2.6.18-rc1-mm2.orig/arch/x86_64/kernel/e820.c >+++ linux-2.6.18-rc1-mm2/arch/x86_64/kernel/e820.c >@@ -16,6 +16,7 @@ > #include <linux/string.h> > #include <linux/kexec.h> > #include <linux/module.h> >+#include <linux/mm.h> > > #include <asm/pgtable.h> > #include <asm/page.h> >@@ -293,6 +294,53 @@ void __init e820_reserve_resources(void) > } > } > >+/* Mark pages corresponding to given address range as nosave */ >+static void __init >+e820_mark_nosave_range(unsigned long start, unsigned long end) >+{ >+ unsigned long pfn, max_pfn; >+ >+ if (start >= end) >+ return; >+ >+ printk("Nosave address range: %016lx - %016lx\n", start, end); >+ max_pfn = end >> PAGE_SHIFT; >+ for (pfn = start >> PAGE_SHIFT; pfn < max_pfn; pfn++) >+ if (pfn_valid(pfn)) >+ SetPageNosave(pfn_to_page(pfn)); >+} >+ >+/* >+ * Find the ranges of physical addresses that do not correspond to >+ * e820 RAM areas and mark the corresponding pages as nosave for software >+ * suspend and suspend to RAM. >+ * >+ * This function requires the e820 map to be sorted and without any >+ * overlapping entries and assumes the first e820 area to be RAM. >+ */ >+void __init e820_mark_nosave_regions(void) >+{ >+ int i; >+ unsigned long paddr; >+ >+ paddr = round_down(e820.map[0].addr + e820.map[0].size, PAGE_SIZE); >+ for (i = 1; i < e820.nr_map; i++) { >+ struct e820entry *ei = &e820.map[i]; >+ >+ if (paddr < ei->addr) >+ e820_mark_nosave_range(paddr, >+ round_up(ei->addr, PAGE_SIZE)); >+ >+ paddr = round_down(ei->addr + ei->size, PAGE_SIZE); >+ if (ei->type != E820_RAM) >+ e820_mark_nosave_range(round_up(ei->addr, PAGE_SIZE), >+ paddr); >+ >+ if (paddr >= (end_pfn << PAGE_SHIFT)) >+ break; >+ } >+} >+ > /* > * Add a memory region to the kernel e820 map. > */ >Index: linux-2.6.18-rc1-mm2/arch/x86_64/kernel/setup.c >=================================================================== >--- linux-2.6.18-rc1-mm2.orig/arch/x86_64/kernel/setup.c >+++ linux-2.6.18-rc1-mm2/arch/x86_64/kernel/setup.c >@@ -684,6 +684,7 @@ void __init setup_arch(char **cmdline_p) > probe_roms(); > e820_reserve_resources(); > >+ e820_mark_nosave_regions(); > request_resource(&iomem_resource, &video_ram_resource); > > { >Index: linux-2.6.18-rc1-mm2/include/asm-x86_64/e820.h >=================================================================== >--- linux-2.6.18-rc1-mm2.orig/include/asm-x86_64/e820.h >+++ linux-2.6.18-rc1-mm2/include/asm-x86_64/e820.h >@@ -46,6 +46,7 @@ extern void setup_memory_region(void); > extern void contig_e820_setup(void); > extern unsigned long e820_end_of_ram(void); > extern void e820_reserve_resources(void); >+extern void e820_mark_nosave_regions(void); > extern void e820_print_map(char *who); > extern int e820_any_mapped(unsigned long start, unsigned long end, unsigned type); > extern int e820_all_mapped(unsigned long start, unsigned long end, unsigned type); >- >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html >Please read the FAQ at http://www.tux.org/lkml/ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 148549
:
97777
| 97781