diff options
author | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-02-26 05:49:26 -0500 |
---|---|---|
committer | GuanXuetao <gxt@mprc.pku.edu.cn> | 2011-03-16 21:19:13 -0400 |
commit | 77c93b2f2388b974253af4149aa025b4751f92ad (patch) | |
tree | 59b3c67518e2cae1f347a2c2bc738a234b349bb4 /arch/unicore32/include/asm | |
parent | 28bab059a23aac6bb129b307410e5b63e132a290 (diff) |
unicore32 additional architecture files: low-level lib: uaccess
This patch implements low-level uaccess libraries.
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32/include/asm')
-rw-r--r-- | arch/unicore32/include/asm/uaccess.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/unicore32/include/asm/uaccess.h b/arch/unicore32/include/asm/uaccess.h new file mode 100644 index 000000000000..2acda503a6d9 --- /dev/null +++ b/arch/unicore32/include/asm/uaccess.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * linux/arch/unicore32/include/asm/uaccess.h | ||
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | ||
6 | * Copyright (C) 2001-2010 GUAN Xue-tao | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #ifndef __UNICORE_UACCESS_H__ | ||
13 | #define __UNICORE_UACCESS_H__ | ||
14 | |||
15 | #include <linux/thread_info.h> | ||
16 | #include <linux/errno.h> | ||
17 | |||
18 | #include <asm/memory.h> | ||
19 | #include <asm/system.h> | ||
20 | |||
21 | #define __copy_from_user __copy_from_user | ||
22 | #define __copy_to_user __copy_to_user | ||
23 | #define __strncpy_from_user __strncpy_from_user | ||
24 | #define __strnlen_user __strnlen_user | ||
25 | #define __clear_user __clear_user | ||
26 | |||
27 | #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) | ||
28 | #define __user_ok(addr, size) (((size) <= TASK_SIZE) \ | ||
29 | && ((addr) <= TASK_SIZE - (size))) | ||
30 | #define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size))) | ||
31 | |||
32 | extern unsigned long __must_check | ||
33 | __copy_from_user(void *to, const void __user *from, unsigned long n); | ||
34 | extern unsigned long __must_check | ||
35 | __copy_to_user(void __user *to, const void *from, unsigned long n); | ||
36 | extern unsigned long __must_check | ||
37 | __clear_user(void __user *addr, unsigned long n); | ||
38 | extern unsigned long __must_check | ||
39 | __strncpy_from_user(char *to, const char __user *from, unsigned long count); | ||
40 | extern unsigned long | ||
41 | __strnlen_user(const char __user *s, long n); | ||
42 | |||
43 | #include <asm-generic/uaccess.h> | ||
44 | |||
45 | extern int fixup_exception(struct pt_regs *regs); | ||
46 | |||
47 | #endif /* __UNICORE_UACCESS_H__ */ | ||