summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin P. Sant <sachinp@in.ibm.com>2008-07-03 18:39:02 +0530
committerSimon Horman <horms@verge.net.au>2008-07-04 09:01:22 +1000
commitf63fe8aa4a22238768e28b59555d98d6b3b769f0 (patch)
tree7695606e631a77af7461d1c69663e89a187c711b
parent5887072c6392c43e5139c8c94305708c212e333b (diff)
[ppc64] Allow 32 bit kexec binary to boot kdump kernel on ppc64 architecture
Signed-off-by : Sachin Sant <sachinp@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ppc64/crashdump-ppc64.c13
-rw-r--r--kexec/arch/ppc64/crashdump-ppc64.h2
-rw-r--r--kexec/arch/ppc64/fs2dt.c12
-rw-r--r--kexec/arch/ppc64/kexec-elf-ppc64.c2
-rw-r--r--kexec/arch/ppc64/kexec-ppc64.c18
5 files changed, 24 insertions, 23 deletions
diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index a1963e1..962f445 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -82,7 +82,7 @@ mem_rgns_t usablemem_rgns = {0, NULL};
* we can determine the RAM size unless parsing the device-tree/memoy@/reg
* property in the kernel.
*/
-unsigned long saved_max_mem = 0;
+uint64_t saved_max_mem = 0;
/* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to
* create Elf headers. Keeping it separate from get_memory_ranges() as
@@ -264,7 +264,7 @@ err:
}
/* Converts unsigned long to ascii string. */
-static void ultoa(unsigned long i, char *str)
+static void ultoa(uint64_t i, char *str)
{
int j = 0, k;
char tmp;
@@ -282,8 +282,8 @@ static void ultoa(unsigned long i, char *str)
}
}
-static int add_cmdline_param(char *cmdline, unsigned long addr,
- char *cmdstr, char *byte)
+static int add_cmdline_param(char *cmdline, uint64_t addr, char *cmdstr,
+ char *byte)
{
int cmdlen, len, align = 1024;
char str[COMMAND_LINE_SIZE], *ptr;
@@ -320,10 +320,11 @@ static int add_cmdline_param(char *cmdline, unsigned long addr,
* for crash memory image.
*/
int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
- unsigned long max_addr, unsigned long min_base)
+ uint64_t max_addr, unsigned long min_base)
{
void *tmp;
- unsigned long sz, elfcorehdr;
+ unsigned long sz;
+ uint64_t elfcorehdr;
int nr_ranges, align = 1024, i;
unsigned long long end;
struct memory_range *mem_range;
diff --git a/kexec/arch/ppc64/crashdump-ppc64.h b/kexec/arch/ppc64/crashdump-ppc64.h
index 0ce9c46..434e2b6 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.h
+++ b/kexec/arch/ppc64/crashdump-ppc64.h
@@ -3,7 +3,7 @@
struct kexec_info;
int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
- unsigned long max_addr, unsigned long min_base);
+ uint64_t max_addr, unsigned long min_base);
void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
#define PAGE_OFFSET 0xC000000000000000
diff --git a/kexec/arch/ppc64/fs2dt.c b/kexec/arch/ppc64/fs2dt.c
index 348ff1b..4a8c8f6 100644
--- a/kexec/arch/ppc64/fs2dt.c
+++ b/kexec/arch/ppc64/fs2dt.c
@@ -125,9 +125,9 @@ static unsigned propnum(const char *name)
static void add_usable_mem_property(int fd, int len)
{
char fname[MAXPATH], *bname;
- unsigned long long buf[2];
- unsigned long ranges[2*MAX_MEMORY_RANGES];
- unsigned long long base, end, loc_base, loc_end;
+ uint64_t buf[2];
+ uint64_t ranges[2*MAX_MEMORY_RANGES];
+ uint64_t base, end, loc_base, loc_end;
int range, rlen = 0;
strcpy(fname, pathname);
@@ -137,9 +137,9 @@ static void add_usable_mem_property(int fd, int len)
if (strncmp(bname, "/memory@", 8))
return;
- if (len < 2 * sizeof(unsigned long long))
+ if (len < 2 * sizeof(uint64_t))
die("unrecoverable error: not enough data for mem property\n");
- len = 2 * sizeof(unsigned long long);
+ len = 2 * sizeof(uint64_t);
if (lseek(fd, 0, SEEK_SET) < 0)
die("unrecoverable error: error seeking in \"%s\": %s\n",
@@ -179,7 +179,7 @@ static void add_usable_mem_property(int fd, int len)
ranges[rlen++] = 0;
}
- rlen = rlen * sizeof(unsigned long);
+ rlen = rlen * sizeof(uint64_t);
/*
* No add linux,usable-memory property.
*/
diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 82bb32f..42ef59b 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -186,7 +186,7 @@ int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
if (size > phdr->p_memsz)
size = phdr->p_memsz;
- hole_addr = (unsigned long)locate_hole(info, size, 0, 0,
+ hole_addr = (uint64_t)locate_hole(info, size, 0, 0,
max_addr, 1);
ehdr.e_phdr[0].p_paddr = hole_addr;
result = elf_exec_load(&ehdr, info);
diff --git a/kexec/arch/ppc64/kexec-ppc64.c b/kexec/arch/ppc64/kexec-ppc64.c
index 5f73469..bc8ccc3 100644
--- a/kexec/arch/ppc64/kexec-ppc64.c
+++ b/kexec/arch/ppc64/kexec-ppc64.c
@@ -37,8 +37,8 @@
static struct memory_range *exclude_range = NULL;
static struct memory_range *memory_range = NULL;
static struct memory_range *base_memory_range = NULL;
-static unsigned long long rmo_top;
-unsigned long long memory_max = 0;
+static uint64_t rmo_top;
+uint64_t memory_max = 0;
static int nr_memory_ranges, nr_exclude_ranges;
uint64_t crash_base, crash_size;
unsigned int rtas_base, rtas_size;
@@ -251,12 +251,12 @@ static int sort_ranges(void)
*/
static int get_devtree_details(unsigned long kexec_flags)
{
- unsigned long long rmo_base;
- unsigned long long tce_base;
+ uint64_t rmo_base;
+ uint64_t tce_base;
unsigned int tce_size;
- unsigned long long htab_base, htab_size;
- unsigned long long kernel_end;
- unsigned long long initrd_start, initrd_end;
+ uint64_t htab_base, htab_size;
+ uint64_t kernel_end;
+ uint64_t initrd_start, initrd_end;
char buf[MAXBYTES];
char device_tree[256] = "/proc/device-tree/";
char fname[256];
@@ -465,8 +465,8 @@ static int get_devtree_details(unsigned long kexec_flags)
perror(fname);
goto error_openfile;
}
- rmo_base = ((unsigned long long *)buf)[0];
- rmo_top = rmo_base + ((unsigned long long *)buf)[1];
+ rmo_base = ((uint64_t *)buf)[0];
+ rmo_top = rmo_base + ((uint64_t *)buf)[1];
if (rmo_top > 0x30000000UL)
rmo_top = 0x30000000UL;