summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2016-06-06 18:01:18 +0100
committerSimon Horman <horms@verge.net.au>2016-06-08 09:24:10 +0900
commit2f10ffb193c219709f3079854a15718ad872f40e (patch)
treefd10a8ba6b7542b4a4d649635da4c43d0ea612fb
parentfbee2f01cddffebc347e80d99ce0faf418e163b4 (diff)
arm: fix type of phys_offset
Some LPAE systems may have phys_offset above the 4GB mark. Hence, we need phys_offset to be a 64-bit integer. Reviewed-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/arm/crashdump-arm.c4
-rw-r--r--kexec/arch/arm/crashdump-arm.h1
-rw-r--r--kexec/arch/arm/phys_to_virt.c4
-rw-r--r--kexec/arch/arm/phys_to_virt.h8
4 files changed, 13 insertions, 4 deletions
diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
index 2dc8846..2589582 100644
--- a/kexec/arch/arm/crashdump-arm.c
+++ b/kexec/arch/arm/crashdump-arm.c
@@ -33,6 +33,7 @@
#include "../../mem_regions.h"
#include "crashdump-arm.h"
#include "iomem.h"
+#include "phys_to_virt.h"
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define ELFDATANATIVE ELFDATA2LSB
@@ -70,7 +71,6 @@ static struct crash_elf_info elf_info = {
.page_offset = DEFAULT_PAGE_OFFSET,
};
-unsigned long phys_offset;
extern unsigned long long user_page_offset;
/* Retrieve kernel _stext symbol virtual address from /proc/kallsyms */
@@ -293,7 +293,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
* region as PHYS_OFFSET.
*/
phys_offset = usablemem_rgns.ranges->start;
- dbgprintf("phys_offset: %#lx\n", phys_offset);
+ dbgprintf("phys_offset: %#llx\n", phys_offset);
if (get_kernel_page_offset(info, &elf_info))
return -1;
diff --git a/kexec/arch/arm/crashdump-arm.h b/kexec/arch/arm/crashdump-arm.h
index 7314960..6e87b13 100644
--- a/kexec/arch/arm/crashdump-arm.h
+++ b/kexec/arch/arm/crashdump-arm.h
@@ -16,7 +16,6 @@ extern struct memory_ranges usablemem_rgns;
struct kexec_info;
-extern unsigned long phys_offset;
extern int load_crashdump_segments(struct kexec_info *, char *);
#ifdef __cplusplus
diff --git a/kexec/arch/arm/phys_to_virt.c b/kexec/arch/arm/phys_to_virt.c
index c2fe2ea..46a4f68 100644
--- a/kexec/arch/arm/phys_to_virt.c
+++ b/kexec/arch/arm/phys_to_virt.c
@@ -1,6 +1,8 @@
#include "../../kexec.h"
#include "../../crashdump.h"
-#include "crashdump-arm.h"
+#include "phys_to_virt.h"
+
+uint64_t phys_offset;
/**
* phys_to_virt() - translate physical address to virtual address
diff --git a/kexec/arch/arm/phys_to_virt.h b/kexec/arch/arm/phys_to_virt.h
new file mode 100644
index 0000000..b3147dd
--- /dev/null
+++ b/kexec/arch/arm/phys_to_virt.h
@@ -0,0 +1,8 @@
+#ifndef PHYS_TO_VIRT_H
+#define PHYS_TO_VIRT_H
+
+#include <stdint.h>
+
+extern uint64_t phys_offset;
+
+#endif