Path: blob/master/arch/unicore32/include/asm/uaccess.h
10818 views
/*1* linux/arch/unicore32/include/asm/uaccess.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __UNICORE_UACCESS_H__12#define __UNICORE_UACCESS_H__1314#include <linux/thread_info.h>15#include <linux/errno.h>1617#include <asm/memory.h>18#include <asm/system.h>1920#define __copy_from_user __copy_from_user21#define __copy_to_user __copy_to_user22#define __strncpy_from_user __strncpy_from_user23#define __strnlen_user __strnlen_user24#define __clear_user __clear_user2526#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))27#define __user_ok(addr, size) (((size) <= TASK_SIZE) \28&& ((addr) <= TASK_SIZE - (size)))29#define __access_ok(addr, size) (__kernel_ok || __user_ok((addr), (size)))3031extern unsigned long __must_check32__copy_from_user(void *to, const void __user *from, unsigned long n);33extern unsigned long __must_check34__copy_to_user(void __user *to, const void *from, unsigned long n);35extern unsigned long __must_check36__clear_user(void __user *addr, unsigned long n);37extern unsigned long __must_check38__strncpy_from_user(char *to, const char __user *from, unsigned long count);39extern unsigned long40__strnlen_user(const char __user *s, long n);4142#include <asm-generic/uaccess.h>4344extern int fixup_exception(struct pt_regs *regs);4546#endif /* __UNICORE_UACCESS_H__ */474849