xref: /openbmc/linux/arch/arm64/mm/copypage.c (revision 8795a739)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Based on arch/arm/mm/copypage.c
4  *
5  * Copyright (C) 2002 Deep Blue Solutions Ltd, All Rights Reserved.
6  * Copyright (C) 2012 ARM Ltd.
7  */
8 
9 #include <linux/mm.h>
10 
11 #include <asm/page.h>
12 #include <asm/cacheflush.h>
13 
14 void __cpu_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
15 {
16 	struct page *page = virt_to_page(kto);
17 	copy_page(kto, kfrom);
18 	flush_dcache_page(page);
19 }
20 EXPORT_SYMBOL_GPL(__cpu_copy_user_page);
21 
22 void __cpu_clear_user_page(void *kaddr, unsigned long vaddr)
23 {
24 	clear_page(kaddr);
25 }
26 EXPORT_SYMBOL_GPL(__cpu_clear_user_page);
27