]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/sh/include/asm/segment.h
Merge remote-tracking branches 'asoc/topic/max98925', 'asoc/topic/max98927', 'asoc...
[mirror_ubuntu-bionic-kernel.git] / arch / sh / include / asm / segment.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2#ifndef __ASM_SH_SEGMENT_H
3#define __ASM_SH_SEGMENT_H
4
02f7e627 5#ifndef __ASSEMBLY__
1da177e4 6
02f7e627
PM
7typedef struct {
8 unsigned long seg;
9} mm_segment_t;
10
11#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
12
13/*
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.
17 *
18 * For historical reasons, these macros are grossly misnamed.
19 */
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
26
3237f28e 27#define segment_eq(a, b) ((a).seg == (b).seg)
02f7e627
PM
28
29#define get_ds() (KERNEL_DS)
30
31#define get_fs() (current_thread_info()->addr_limit)
32#define set_fs(x) (current_thread_info()->addr_limit = (x))
33
34#endif /* __ASSEMBLY__ */
1da177e4 35#endif /* __ASM_SH_SEGMENT_H */