blob: 91ed4e695ff7cd0e9624583c777eab2215411b69 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/sh/mm/pg-nommu.c
3 *
4 * clear_page()/copy_page() implementation for MMUless SH.
5 *
6 * Copyright (C) 2003 Paul Mundt
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/string.h>
15#include <asm/page.h>
Paul Mundtfa439722008-09-04 18:53:58 +090016#include <asm/uaccess.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
Paul Mundt379a95d2007-11-20 16:51:28 +090018void copy_page(void *to, void *from)
Linus Torvalds1da177e2005-04-16 15:20:36 -070019{
20 memcpy(to, from, PAGE_SIZE);
21}
22
Paul Mundt379a95d2007-11-20 16:51:28 +090023void clear_page(void *to)
Linus Torvalds1da177e2005-04-16 15:20:36 -070024{
25 memset(to, 0, PAGE_SIZE);
26}
27
Yoshinori Satoe96636c2006-09-27 17:21:02 +090028__kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n)
Linus Torvalds1da177e2005-04-16 15:20:36 -070029{
Yoshinori Satoe96636c2006-09-27 17:21:02 +090030 memcpy(to, from, n);
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 return 0;
32}
33
Yoshinori Satoe96636c2006-09-27 17:21:02 +090034__kernel_size_t __clear_user(void *to, __kernel_size_t n)
35{
36 memset(to, 0, n);
37 return 0;
38}