Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20184
b: refs/heads/master
c: 9c15e85
h: refs/heads/master
v: v3
  • Loading branch information
Haren Myneni authored and Linus Torvalds committed Feb 10, 2006
1 parent 44cb108 commit 4e8ef8e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afcd024183d8a6eae7e489ce50b2485c5ae4f662
refs/heads/master: 9c15e852a524d55ab768cf48c97f5c684f876af2
1 change: 1 addition & 0 deletions trunk/include/linux/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/list.h>
#include <linux/linkage.h>
#include <linux/compat.h>
#include <linux/ioport.h>
#include <asm/kexec.h>

/* Verify architecture specific macros are defined */
Expand Down
24 changes: 23 additions & 1 deletion trunk/init/initramfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,32 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
extern char __initramfs_start[], __initramfs_end[];
#ifdef CONFIG_BLK_DEV_INITRD
#include <linux/initrd.h>
#include <linux/kexec.h>

static void __init free_initrd(void)
{
free_initrd_mem(initrd_start, initrd_end);
#ifdef CONFIG_KEXEC
unsigned long crashk_start = (unsigned long)__va(crashk_res.start);
unsigned long crashk_end = (unsigned long)__va(crashk_res.end);

/*
* If the initrd region is overlapped with crashkernel reserved region,
* free only memory that is not part of crashkernel region.
*/
if (initrd_start < crashk_end && initrd_end > crashk_start) {
/*
* Initialize initrd memory region since the kexec boot does
* not do.
*/
memset((void *)initrd_start, 0, initrd_end - initrd_start);
if (initrd_start < crashk_start)
free_initrd_mem(initrd_start, crashk_start);
if (initrd_end > crashk_end)
free_initrd_mem(crashk_end, initrd_end);
} else
#endif
free_initrd_mem(initrd_start, initrd_end);

initrd_start = 0;
initrd_end = 0;
}
Expand Down

0 comments on commit 4e8ef8e

Please sign in to comment.