crash_dump.c (646B)
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * kernel/crash_dump.c - Memory preserving reboot related code. 4 * 5 * Created by: Simon Horman <horms@verge.net.au> 6 * Original code moved from kernel/crash.c 7 * Original code comment copied from the i386 version of this file 8 */ 9 10#include <linux/errno.h> 11#include <linux/types.h> 12#include <linux/crash_dump.h> 13#include <linux/uio.h> 14#include <asm/page.h> 15 16ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, 17 size_t csize, unsigned long offset) 18{ 19 void *vaddr; 20 21 if (!csize) 22 return 0; 23 vaddr = __va(pfn<<PAGE_SHIFT); 24 csize = copy_to_iter(vaddr + offset, csize, iter); 25 return csize; 26} 27