2 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2008-2009 PetaLogix
4 * Copyright (C) 2006 Atmark Techno, Inc.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
11 #ifndef _ASM_MICROBLAZE_SEGMENT_H
12 #define _ASM_MICROBLAZE_SEGMENT_H
21 * On Microblaze the fs value is actually the top of the corresponding
24 * The fs value determines whether argument validity checking should be
25 * performed or not. If get_fs() == USER_DS, checking is performed, with
26 * get_fs() == KERNEL_DS, checking is bypassed.
28 * For historical reasons, these macros are grossly misnamed.
30 * For non-MMU arch like Microblaze, KERNEL_DS and USER_DS is equal.
32 # define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
35 # define KERNEL_DS MAKE_MM_SEG(0)
36 # define USER_DS KERNEL_DS
38 # define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
39 # define USER_DS MAKE_MM_SEG(TASK_SIZE - 1)
42 # define get_ds() (KERNEL_DS)
43 # define get_fs() (current_thread_info()->addr_limit)
44 # define set_fs(val) (current_thread_info()->addr_limit = (val))
46 # define segment_eq(a, b) ((a).seg == (b).seg)
48 # endif /* __ASSEMBLY__ */
49 #endif /* _ASM_MICROBLAZE_SEGMENT_H */