xref: /linux/arch/mips/kernel/crash_dump.c (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/highmem.h>
3 #include <linux/crash_dump.h>
4 #include <linux/uio.h>
5 
6 ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
7 			 size_t csize, unsigned long offset)
8 {
9 	void  *vaddr;
10 
11 	if (!csize)
12 		return 0;
13 
14 	vaddr = kmap_local_pfn(pfn);
15 	csize = copy_to_iter(vaddr + offset, csize, iter);
16 	kunmap_local(vaddr);
17 
18 	return csize;
19 }
20