Merge tag 'locking-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / sh / include / asm / segment.h
blob02e54a3335d68f1d6ea0e1f832ce42d7f8cb71ce
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_SEGMENT_H
3 #define __ASM_SH_SEGMENT_H
5 #ifndef __ASSEMBLY__
7 typedef struct {
8 unsigned long seg;
9 } mm_segment_t;
11 #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
14 * The fs value determines whether argument validity checking should be
15 * performed or not. If get_fs() == USER_DS, checking is performed, with
16 * get_fs() == KERNEL_DS, checking is bypassed.
18 * For historical reasons, these macros are grossly misnamed.
20 #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFFUL)
21 #ifdef CONFIG_MMU
22 #define USER_DS MAKE_MM_SEG(PAGE_OFFSET)
23 #else
24 #define USER_DS KERNEL_DS
25 #endif
27 #define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
29 #define get_fs() (current_thread_info()->addr_limit)
30 #define set_fs(x) (current_thread_info()->addr_limit = (x))
32 #endif /* __ASSEMBLY__ */
33 #endif /* __ASM_SH_SEGMENT_H */