Update of /cvsroot/gc-linux/linux/kernel
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22540/kernel
Modified Files:
kexec.c
Log Message:
Merge v2.6.32.
Index: kexec.c
===================================================================
RCS file: /cvsroot/gc-linux/linux/kernel/kexec.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** kexec.c 9 Dec 2009 18:18:07 -0000 1.6
--- kexec.c 9 Dec 2009 18:44:55 -0000 1.7
***************
*** 581,590 ****
! static int kimage_add_page(struct kimage *image, unsigned long page)
{
int result;
page &= PAGE_MASK;
! result = kimage_add_entry(image, page | IND_SOURCE);
if (result == 0)
image->destination += PAGE_SIZE;
--- 581,591 ----
! static inline int kimage_add_page_with_flags(struct kimage *image,
! unsigned long page, int flags)
{
int result;
page &= PAGE_MASK;
! result = kimage_add_entry(image, page | (flags & ~PAGE_MASK));
if (result == 0)
image->destination += PAGE_SIZE;
***************
*** 593,596 ****
--- 594,607 ----
}
+ static int kimage_add_page(struct kimage *image, unsigned long page)
+ {
+ return kimage_add_page_with_flags(image, page, IND_SOURCE);
+ }
+
+ static int kimage_add_page_noalloc(struct kimage *image, unsigned long page)
+ {
+ return kimage_add_page_with_flags(image, page, IND_SOURCE|IND_NOALLOC);
+ }
+
static void kimage_free_extra_pages(struct kimage *image)
***************
*** 611,614 ****
--- 622,646 ----
}
+ int kimage_add_preserved_region(struct kimage *image, unsigned long to,
+ unsigned long from, int length)
+ {
+ int result = 0;
+
+ if (length > 0) {
+ result = kimage_set_destination(image, to);
+ if (result < 0)
+ goto out;
+ while (length > 0) {
+ result = kimage_add_page_noalloc(image, from);
+ if (result < 0)
+ goto out;
+ from += PAGE_SIZE;
+ length -= PAGE_SIZE;
+ }
+ }
+ out:
+ return result;
+ }
+
#define for_each_kimage_entry(image, ptr, entry) \
for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); \
***************
*** 642,648 ****
*/
ind = entry;
}
- else if (entry & IND_SOURCE)
- kimage_free_entry(entry);
}
/* Free the final indirection page */
--- 674,682 ----
*/
ind = entry;
+ } else if (entry & IND_SOURCE) {
+ /* free only entries that we really allocated */
+ if (!(entry & IND_NOALLOC))
+ kimage_free_entry(entry);
}
}
/* Free the final indirection page */
|