Linux 4.18.10
[linux/fpc-iii.git] / arch / unicore32 / include / asm / uaccess.h
blob1d55f2f8375917956b258845a3f2521cabd88fb5
1 /*
2 * linux/arch/unicore32/include/asm/uaccess.h
4 * Code specific to PKUnity SoC and UniCore ISA
6 * Copyright (C) 2001-2010 GUAN Xue-tao
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.
12 #ifndef __UNICORE_UACCESS_H__
13 #define __UNICORE_UACCESS_H__
15 #include <asm/memory.h>
17 #define __strncpy_from_user __strncpy_from_user
18 #define __strnlen_user __strnlen_user
19 #define __clear_user __clear_user
21 #define __kernel_ok (uaccess_kernel())
22 #define __user_ok(addr, size) (((size) <= TASK_SIZE) \
23 && ((addr) <= TASK_SIZE - (size)))
24 #define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size)))
26 extern unsigned long __must_check
27 raw_copy_from_user(void *to, const void __user *from, unsigned long n);
28 extern unsigned long __must_check
29 raw_copy_to_user(void __user *to, const void *from, unsigned long n);
30 extern unsigned long __must_check
31 __clear_user(void __user *addr, unsigned long n);
32 extern unsigned long __must_check
33 __strncpy_from_user(char *to, const char __user *from, unsigned long count);
34 extern unsigned long
35 __strnlen_user(const char __user *s, long n);
36 #define INLINE_COPY_FROM_USER
37 #define INLINE_COPY_TO_USER
39 #include <asm-generic/uaccess.h>
41 #endif /* __UNICORE_UACCESS_H__ */