uaccess.h (90997c128049c75a74bd9ebb852b17e359066541) | uaccess.h (12700c17fc286149324f92d6d380bc48e43f253d) |
---|---|
1/* 2 * User space memory access functions for Nios II 3 * 4 * Copyright (C) 2010-2011, Tobias Klauser <tklauser@distanz.ch> 5 * Copyright (C) 2009, Wind River Systems Inc 6 * Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com 7 * 8 * This file is subject to the terms and conditions of the GNU General Public --- 16 unchanged lines hidden (view full) --- 25#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) 26#define USER_DS MAKE_MM_SEG(0x80000000UL) 27#define KERNEL_DS MAKE_MM_SEG(0) 28 29 30#define get_fs() (current_thread_info()->addr_limit) 31#define set_fs(seg) (current_thread_info()->addr_limit = (seg)) 32 | 1/* 2 * User space memory access functions for Nios II 3 * 4 * Copyright (C) 2010-2011, Tobias Klauser <tklauser@distanz.ch> 5 * Copyright (C) 2009, Wind River Systems Inc 6 * Implemented by fredrik.markstrom@gmail.com and ivarholmqvist@gmail.com 7 * 8 * This file is subject to the terms and conditions of the GNU General Public --- 16 unchanged lines hidden (view full) --- 25#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) 26#define USER_DS MAKE_MM_SEG(0x80000000UL) 27#define KERNEL_DS MAKE_MM_SEG(0) 28 29 30#define get_fs() (current_thread_info()->addr_limit) 31#define set_fs(seg) (current_thread_info()->addr_limit = (seg)) 32 |
33#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg) | 33#include <asm-generic/access_ok.h> |
34 | 34 |
35#define __access_ok(addr, len) \ 36 (((signed long)(((long)get_fs().seg) & \ 37 ((long)(addr) | (((long)(addr)) + (len)) | (len)))) == 0) 38 39#define access_ok(addr, len) \ 40 likely(__access_ok((unsigned long)(addr), (unsigned long)(len))) 41 | |
42# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n" 43 | 35# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n" 36 |
44#define user_addr_max() (uaccess_kernel() ? ~0UL : TASK_SIZE) 45 | |
46/* 47 * Zero Userspace 48 */ 49 50static inline unsigned long __must_check __clear_user(void __user *to, 51 unsigned long n) 52{ 53 __asm__ __volatile__ ( --- 157 unchanged lines hidden --- | 37/* 38 * Zero Userspace 39 */ 40 41static inline unsigned long __must_check __clear_user(void __user *to, 42 unsigned long n) 43{ 44 __asm__ __volatile__ ( --- 157 unchanged lines hidden --- |