Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373274
b: refs/heads/master
c: 7b1e427
h: refs/heads/master
v: v3
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed May 2, 2013
1 parent 98164f0 commit 0032fdb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 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: 0a694067111e8fcd3eda430f8fa2d0277edd231f
refs/heads/master: 7b1e427d685e2aee91f9a622f9c2691130f8e57d
30 changes: 15 additions & 15 deletions trunk/drivers/s390/char/zcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static void __init set_lc_mask(struct save_area *map)
/*
* Initialize dump globals for a given architecture
*/
static int __init sys_info_init(enum arch_id arch)
static int __init sys_info_init(enum arch_id arch, unsigned long mem_end)
{
int rc;

Expand All @@ -579,7 +579,7 @@ static int __init sys_info_init(enum arch_id arch)
rc = init_cpu_info(arch);
if (rc)
return rc;
sys_info.mem_size = real_memory_size;
sys_info.mem_size = mem_end;

return 0;
}
Expand All @@ -601,7 +601,7 @@ static int __init check_sdias(void)
return 0;
}

static int __init get_mem_size(unsigned long *mem)
static int __init get_mem_info(unsigned long *mem, unsigned long *end)
{
int i;
struct mem_chunk *chunk_array;
Expand All @@ -615,28 +615,26 @@ static int __init get_mem_size(unsigned long *mem)
if (chunk_array[i].size == 0)
break;
*mem += chunk_array[i].size;
*end = max(*end, chunk_array[i].addr + chunk_array[i].size);
}
kfree(chunk_array);
return 0;
}

static int __init zcore_header_init(int arch, struct zcore_header *hdr)
static void __init zcore_header_init(int arch, struct zcore_header *hdr,
unsigned long mem_size)
{
int rc, i;
unsigned long memory = 0;
u32 prefix;
int i;

if (arch == ARCH_S390X)
hdr->arch_id = DUMP_ARCH_S390X;
else
hdr->arch_id = DUMP_ARCH_S390;
rc = get_mem_size(&memory);
if (rc)
return rc;
hdr->mem_size = memory;
hdr->rmem_size = memory;
hdr->mem_size = mem_size;
hdr->rmem_size = mem_size;
hdr->mem_end = sys_info.mem_size;
hdr->num_pages = memory / PAGE_SIZE;
hdr->num_pages = mem_size / PAGE_SIZE;
hdr->tod = get_tod_clock();
get_cpu_id(&hdr->cpu_id);
for (i = 0; zfcpdump_save_areas[i]; i++) {
Expand All @@ -647,7 +645,6 @@ static int __init zcore_header_init(int arch, struct zcore_header *hdr)
hdr->lc_vec[hdr->cpu_cnt] = prefix;
hdr->cpu_cnt++;
}
return 0;
}

/*
Expand Down Expand Up @@ -682,9 +679,11 @@ static int __init zcore_reipl_init(void)

static int __init zcore_init(void)
{
unsigned long mem_size, mem_end;
unsigned char arch;
int rc;

mem_size = mem_end = 0;
if (ipl_info.type != IPL_TYPE_FCP_DUMP)
return -ENODATA;
if (OLDMEM_BASE)
Expand Down Expand Up @@ -727,13 +726,14 @@ static int __init zcore_init(void)
}
#endif /* CONFIG_64BIT */

rc = sys_info_init(arch);
rc = get_mem_info(&mem_size, &mem_end);
if (rc)
goto fail;

rc = zcore_header_init(arch, &zcore_header);
rc = sys_info_init(arch, mem_end);
if (rc)
goto fail;
zcore_header_init(arch, &zcore_header, mem_size);

rc = zcore_reipl_init();
if (rc)
Expand Down

0 comments on commit 0032fdb

Please sign in to comment.