2 * S390 kdump implementation
4 * Copyright IBM Corp. 2011
5 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
8 #include <linux/crash_dump.h>
9 #include <asm/lowcore.h>
12 * Copy one page from "oldmem"
14 * For the kdump reserved memory this functions performs a swap operation:
15 * - [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] is mapped to [0 - OLDMEM_SIZE].
16 * - [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE]
18 ssize_t
copy_oldmem_page(unsigned long pfn
, char *buf
,
19 size_t csize
, unsigned long offset
, int userbuf
)
27 src
= (pfn
<< PAGE_SHIFT
) + offset
;
28 if (src
< OLDMEM_SIZE
)
30 else if (src
> OLDMEM_BASE
&&
31 src
< OLDMEM_BASE
+ OLDMEM_SIZE
)
34 rc
= copy_to_user_real((void __user
*) buf
, (void *) src
,
37 rc
= memcpy_real(buf
, (void *) src
, csize
);
38 return rc
< 0 ? rc
: csize
;