xref: /openbmc/linux/arch/arm64/mm/copypage.c (revision e6b1185f)
11d18c47cSCatalin Marinas /*
21d18c47cSCatalin Marinas  * Based on arch/arm/mm/copypage.c
31d18c47cSCatalin Marinas  *
41d18c47cSCatalin Marinas  * Copyright (C) 2002 Deep Blue Solutions Ltd, All Rights Reserved.
51d18c47cSCatalin Marinas  * Copyright (C) 2012 ARM Ltd.
61d18c47cSCatalin Marinas  *
71d18c47cSCatalin Marinas  * This program is free software; you can redistribute it and/or modify
81d18c47cSCatalin Marinas  * it under the terms of the GNU General Public License version 2 as
91d18c47cSCatalin Marinas  * published by the Free Software Foundation.
101d18c47cSCatalin Marinas  *
111d18c47cSCatalin Marinas  * This program is distributed in the hope that it will be useful,
121d18c47cSCatalin Marinas  * but WITHOUT ANY WARRANTY; without even the implied warranty of
131d18c47cSCatalin Marinas  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141d18c47cSCatalin Marinas  * GNU General Public License for more details.
151d18c47cSCatalin Marinas  *
161d18c47cSCatalin Marinas  * You should have received a copy of the GNU General Public License
171d18c47cSCatalin Marinas  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
181d18c47cSCatalin Marinas  */
191d18c47cSCatalin Marinas 
201d18c47cSCatalin Marinas #include <linux/mm.h>
211d18c47cSCatalin Marinas 
221d18c47cSCatalin Marinas #include <asm/page.h>
231d18c47cSCatalin Marinas #include <asm/cacheflush.h>
241d18c47cSCatalin Marinas 
251d18c47cSCatalin Marinas void __cpu_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
261d18c47cSCatalin Marinas {
27e6b1185fSAshok Kumar 	struct page *page = virt_to_page(kto);
281d18c47cSCatalin Marinas 	copy_page(kto, kfrom);
29e6b1185fSAshok Kumar 	flush_dcache_page(page);
301d18c47cSCatalin Marinas }
31bec7cedcSMark Salter EXPORT_SYMBOL_GPL(__cpu_copy_user_page);
321d18c47cSCatalin Marinas 
331d18c47cSCatalin Marinas void __cpu_clear_user_page(void *kaddr, unsigned long vaddr)
341d18c47cSCatalin Marinas {
351d18c47cSCatalin Marinas 	clear_page(kaddr);
361d18c47cSCatalin Marinas }
37bec7cedcSMark Salter EXPORT_SYMBOL_GPL(__cpu_clear_user_page);
38