Linux 6.13-rc4
[linux.git] / arch / sh / kernel / crash_dump.c
blob19ce6a950aaca83b6b74d7ffbd46968b0cf71a79
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * crash_dump.c - Memory preserving reboot related code.
5 * Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
6 * Copyright (C) IBM Corporation, 2004. All rights reserved
7 */
8 #include <linux/errno.h>
9 #include <linux/crash_dump.h>
10 #include <linux/io.h>
11 #include <linux/uio.h>
12 #include <linux/uaccess.h>
14 ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn,
15 size_t csize, unsigned long offset)
17 void __iomem *vaddr;
19 if (!csize)
20 return 0;
22 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
23 csize = copy_to_iter(vaddr + offset, csize, iter);
24 iounmap(vaddr);
26 return csize;