uaccess.h (a97b693c3712f040c5802f32b2d685352e08cefa) uaccess.h (12700c17fc286149324f92d6d380bc48e43f253d)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
4 * Copyright (C) 2008-2009 PetaLogix
5 * Copyright (C) 2006 Atmark Techno, Inc.
6 */
7
8#ifndef _ASM_MICROBLAZE_UACCESS_H

--- 25 unchanged lines hidden (view full) ---

34# define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
35
36# define get_fs() (current_thread_info()->addr_limit)
37# define set_fs(val) (current_thread_info()->addr_limit = (val))
38# define user_addr_max() get_fs().seg
39
40# define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
41
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
4 * Copyright (C) 2008-2009 PetaLogix
5 * Copyright (C) 2006 Atmark Techno, Inc.
6 */
7
8#ifndef _ASM_MICROBLAZE_UACCESS_H

--- 25 unchanged lines hidden (view full) ---

34# define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
35
36# define get_fs() (current_thread_info()->addr_limit)
37# define set_fs(val) (current_thread_info()->addr_limit = (val))
38# define user_addr_max() get_fs().seg
39
40# define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
41
42static inline int __access_ok(unsigned long addr, unsigned long size)
43{
44 unsigned long limit = user_addr_max();
42#include <asm-generic/access_ok.h>
45
43
46 return (size <= limit) && (addr <= (limit - size));
47}
48#define access_ok(addr, size) __access_ok((unsigned long)addr, size)
49
50# define __FIXUP_SECTION ".section .fixup,\"ax\"\n"
51# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n"
52
53extern unsigned long __copy_tofrom_user(void __user *to,
54 const void __user *from, unsigned long size);
55
56/* Return: number of not copied bytes, i.e. 0 if OK or non-zero if fail. */
57static inline unsigned long __must_check __clear_user(void __user *to,

--- 242 unchanged lines hidden ---
44# define __FIXUP_SECTION ".section .fixup,\"ax\"\n"
45# define __EX_TABLE_SECTION ".section __ex_table,\"a\"\n"
46
47extern unsigned long __copy_tofrom_user(void __user *to,
48 const void __user *from, unsigned long size);
49
50/* Return: number of not copied bytes, i.e. 0 if OK or non-zero if fail. */
51static inline unsigned long __must_check __clear_user(void __user *to,

--- 242 unchanged lines hidden ---