summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2008-03-04 12:13:33 +0900
committerSimon Horman <horms@verge.net.au>2008-03-04 12:13:33 +0900
commit91ce7876a6ec7e51532f3a2a949bd8d284f5aaad (patch)
tree6de63d3b2aa28d110889b83cca02a6793b05ce38
parent3f8791a7ed926363a882213886299cb65a4738d4 (diff)
kexec-tools: no machine machine to proc_iomem()
Removes the machine parameter to proc_iomem() which is no longer of any use. Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/i386/crashdump-x86.c4
-rw-r--r--kexec/arch/i386/kexec-x86.c2
-rw-r--r--kexec/arch/ia64/crashdump-ia64.c4
-rw-r--r--kexec/arch/ia64/kexec-elf-ia64.c2
-rw-r--r--kexec/arch/ia64/kexec-ia64.c4
-rw-r--r--kexec/arch/ia64/kexec-iomem.c4
-rw-r--r--kexec/arch/s390/kexec-s390.c2
-rw-r--r--kexec/arch/x86_64/crashdump-x86_64.c6
-rw-r--r--kexec/arch/x86_64/kexec-x86_64.c2
-rw-r--r--kexec/crashdump-xen.c4
-rw-r--r--kexec/kexec-iomem.c10
-rw-r--r--kexec/kexec.h6
12 files changed, 26 insertions, 24 deletions
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 60bd8c5..86dc166 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -59,7 +59,7 @@ static struct memory_range crash_reserved_mem;
*/
static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
{
- const char *iomem = proc_iomem(1);
+ const char *iomem = proc_iomem();
int memory_ranges = 0;
char line[MAX_LINE];
FILE *fp;
@@ -582,6 +582,6 @@ int is_crashkernel_mem_reserved(void)
{
uint64_t start, end;
- return parse_iomem_single("Crash kernel\n", 1, &start, &end) == 0 ?
+ return parse_iomem_single("Crash kernel\n", &start, &end) == 0 ?
(start != end) : 0;
}
diff --git a/kexec/arch/i386/kexec-x86.c b/kexec/arch/i386/kexec-x86.c
index c82b8ba..4a41fed 100644
--- a/kexec/arch/i386/kexec-x86.c
+++ b/kexec/arch/i386/kexec-x86.c
@@ -39,7 +39,7 @@ static struct memory_range memory_range[MAX_MEMORY_RANGES];
int get_memory_ranges(struct memory_range **range, int *ranges,
unsigned long kexec_flags)
{
- const char *iomem= proc_iomem(kexec_flags & KEXEC_ON_CRASH);
+ const char *iomem= proc_iomem();
int memory_ranges = 0;
char line[MAX_LINE];
FILE *fp;
diff --git a/kexec/arch/ia64/crashdump-ia64.c b/kexec/arch/ia64/crashdump-ia64.c
index a1fc311..54747ac 100644
--- a/kexec/arch/ia64/crashdump-ia64.c
+++ b/kexec/arch/ia64/crashdump-ia64.c
@@ -143,7 +143,7 @@ static int exclude_crash_reserve_region(int *nr_ranges)
static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
{
- const char *iomem = proc_iomem(1);
+ const char *iomem = proc_iomem();
char line[MAX_LINE];
FILE *fp;
unsigned long start, end;
@@ -268,6 +268,6 @@ int is_crashkernel_mem_reserved(void)
{
uint64_t start, end;
- return parse_iomem_single("Crash kernel\n", 1, &start,
+ return parse_iomem_single("Crash kernel\n", &start,
&end) == 0 ? (start != end) : 0;
}
diff --git a/kexec/arch/ia64/kexec-elf-ia64.c b/kexec/arch/ia64/kexec-elf-ia64.c
index b5eab6c..8f8d239 100644
--- a/kexec/arch/ia64/kexec-elf-ia64.c
+++ b/kexec/arch/ia64/kexec-elf-ia64.c
@@ -195,7 +195,7 @@ int elf_ia64_load(int argc, char **argv, const char *buf, off_t len,
if (info->kexec_flags & KEXEC_ON_CRASH ) {
if ((mem_min == 0x00) && (mem_max == ULONG_MAX)) {
fprintf(stderr, "Failed to find crash kernel region "
- "in %s\n", proc_iomem(1));
+ "in %s\n", proc_iomem());
free_elf_info(&ehdr);
return -1;
}
diff --git a/kexec/arch/ia64/kexec-ia64.c b/kexec/arch/ia64/kexec-ia64.c
index dc0c382..97cf0ea 100644
--- a/kexec/arch/ia64/kexec-ia64.c
+++ b/kexec/arch/ia64/kexec-ia64.c
@@ -80,7 +80,7 @@ static int split_range(int range, unsigned long start, unsigned long end)
int get_memory_ranges(struct memory_range **range, int *ranges,
unsigned long kexec_flags)
{
- const char *iomem = proc_iomem(kexec_flags & KEXEC_ON_CRASH);
+ const char *iomem = proc_iomem();
char line[MAX_LINE];
FILE *fp;
fp = fopen(iomem, "r");
@@ -134,9 +134,11 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
}
continue;
} else if (memcmp(str, "Boot parameter\n", 14) == 0) {
+ printf("Boot parameter\n");
memory_ranges = split_range(memory_ranges, start, end);
continue;
} else if (memcmp(str, "EFI Memory Map\n", 14) == 0) {
+ printf("EFI Memory Map\n");
memory_ranges = split_range(memory_ranges, start, end);
saved_efi_memmap_size = end - start;
continue;
diff --git a/kexec/arch/ia64/kexec-iomem.c b/kexec/arch/ia64/kexec-iomem.c
index 7696113..7fd50cd 100644
--- a/kexec/arch/ia64/kexec-iomem.c
+++ b/kexec/arch/ia64/kexec-iomem.c
@@ -13,9 +13,9 @@ static const char proc_iomem_machine_str[]= "/proc/iomem_machine";
* If Xen is in use, then /proc/iomem is used for memory regions relating
* to the currently running dom0 kernel, and /proc/iomem_machine is used
* for regions relating to the machine itself or the hypervisor.
- * If Xen is not in used, then /proc/iomem is always used.
+ * If Xen is not in used, then /proc/iomem used.
*/
-const char *proc_iomem(int machine)
+const char *proc_iomem(void)
{
if (xen_present())
return proc_iomem_machine_str;
diff --git a/kexec/arch/s390/kexec-s390.c b/kexec/arch/s390/kexec-s390.c
index e303db9..94a5d9e 100644
--- a/kexec/arch/s390/kexec-s390.c
+++ b/kexec/arch/s390/kexec-s390.c
@@ -40,7 +40,7 @@ static struct memory_range memory_range[MAX_MEMORY_RANGES];
int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long flags)
{
char sys_ram[] = "System RAM\n";
- char *iomem = proc_iomem(flags & KEXEC_ON_CRASH);
+ char *iomem = proc_iomem();
FILE *fp;
char line[80];
int current_range = 0;
diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c
index 0815cf4..f40b146 100644
--- a/kexec/arch/x86_64/crashdump-x86_64.c
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
@@ -61,7 +61,7 @@ static int get_kernel_paddr(struct kexec_info *info)
if (xen_present()) /* Kernel not entity mapped under Xen */
return 0;
- if (parse_iomem_single("Kernel code\n", 0, &start, NULL) == 0) {
+ if (parse_iomem_single("Kernel code\n", &start, NULL) == 0) {
info->kern_paddr_start = start;
#ifdef DEBUG
printf("kernel load physical addr start = 0x%016Lx\n", start);
@@ -164,7 +164,7 @@ static struct memory_range crash_reserved_mem;
*/
static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
{
- const char *iomem= proc_iomem(1);
+ const char *iomem= proc_iomem();
int memory_ranges = 0;
char line[MAX_LINE];
FILE *fp;
@@ -642,6 +642,6 @@ int is_crashkernel_mem_reserved(void)
{
uint64_t start, end;
- return parse_iomem_single("Crash kernel\n", 1, &start, &end) == 0 ?
+ return parse_iomem_single("Crash kernel\n", &start, &end) == 0 ?
(start != end) : 0;
}
diff --git a/kexec/arch/x86_64/kexec-x86_64.c b/kexec/arch/x86_64/kexec-x86_64.c
index c4b059e..f222ec8 100644
--- a/kexec/arch/x86_64/kexec-x86_64.c
+++ b/kexec/arch/x86_64/kexec-x86_64.c
@@ -40,7 +40,7 @@ static struct memory_range memory_range[MAX_MEMORY_RANGES];
int get_memory_ranges(struct memory_range **range, int *ranges,
unsigned long kexec_flags)
{
- const char *iomem= proc_iomem(kexec_flags & KEXEC_ON_CRASH);
+ const char *iomem= proc_iomem();
int memory_ranges = 0;
char line[MAX_LINE];
FILE *fp;
diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
index 1fdaf05..a66c21e 100644
--- a/kexec/crashdump-xen.c
+++ b/kexec/crashdump-xen.c
@@ -93,7 +93,7 @@ int xen_get_nr_phys_cpus(void)
if (xen_phys_cpus)
return xen_phys_cpus;
- if ((cpus = kexec_iomem_for_each_line(match, 1, NULL, NULL))) {
+ if ((cpus = kexec_iomem_for_each_line(match, NULL, NULL))) {
n = sizeof(struct crash_note_info) * cpus;
xen_phys_notes = malloc(n);
if (!xen_phys_notes) {
@@ -101,7 +101,7 @@ int xen_get_nr_phys_cpus(void)
return -1;
}
memset(xen_phys_notes, 0, n);
- kexec_iomem_for_each_line(match, 1,
+ kexec_iomem_for_each_line(match,
xen_crash_note_callback, NULL);
xen_phys_cpus = cpus;
}
diff --git a/kexec/kexec-iomem.c b/kexec/kexec-iomem.c
index 2497b79..8e4abab 100644
--- a/kexec/kexec-iomem.c
+++ b/kexec/kexec-iomem.c
@@ -22,7 +22,7 @@
* Return the number of lines matched.
*/
-int kexec_iomem_for_each_line(char *match, int machine,
+int kexec_iomem_for_each_line(char *match,
int (*callback)(void *data,
int nr,
char *str,
@@ -30,7 +30,7 @@ int kexec_iomem_for_each_line(char *match, int machine,
unsigned long length),
void *data)
{
- const char *iomem = proc_iomem(machine);
+ const char *iomem = proc_iomem();
char line[MAX_LINE];
FILE *fp;
unsigned long long start, end, size;
@@ -78,14 +78,14 @@ static int kexec_iomem_single_callback(void *data, int nr,
return 0;
}
-int parse_iomem_single(char *str, int machine, uint64_t *start, uint64_t *end)
+int parse_iomem_single(char *str, uint64_t *start, uint64_t *end)
{
struct memory_range range;
int ret;
memset(&range, 0, sizeof(range));
- ret = kexec_iomem_for_each_line(str, machine,
+ ret = kexec_iomem_for_each_line(str,
kexec_iomem_single_callback, &range);
if (ret == 1) {
@@ -109,7 +109,7 @@ static const char proc_iomem_str[]= "/proc/iomem";
* function to override the location of a file looking a lot
* like /proc/iomem
*/
-const char * __attribute__((weak)) proc_iomem(int machine)
+const char * __attribute__((weak)) proc_iomem(void)
{
return proc_iomem_str;
}
diff --git a/kexec/kexec.h b/kexec/kexec.h
index 2384c53..3ae605e 100644
--- a/kexec/kexec.h
+++ b/kexec/kexec.h
@@ -207,15 +207,15 @@ int arch_compat_trampoline(struct kexec_info *info);
void arch_update_purgatory(struct kexec_info *info);
int is_crashkernel_mem_reserved(void);
-int kexec_iomem_for_each_line(char *match, int machine,
+int kexec_iomem_for_each_line(char *match,
int (*callback)(void *data,
int nr,
char *str,
unsigned long base,
unsigned long length),
void *data);
-int parse_iomem_single(char *str, int machine, uint64_t *start, uint64_t *end);
-const char * proc_iomem(int machine);
+int parse_iomem_single(char *str, uint64_t *start, uint64_t *end);
+const char * proc_iomem(void);
#define MAX_LINE 160