summaryrefslogtreecommitdiff
path: root/arch/csky/include/asm/segment.h
blob: 66d5e0f4f0e09488e5cc387a9b7aea7bc28e4d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* SPDX-License-Identifier: GPL-2.0 */
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.

#ifndef __ASM_CSKY_SEGMENT_H
#define __ASM_CSKY_SEGMENT_H

typedef struct {
	unsigned long seg;
} mm_segment_t;

#define KERNEL_DS		((mm_segment_t) { 0xFFFFFFFF })

#define USER_DS			((mm_segment_t) { PAGE_OFFSET })
#define get_fs()		(current_thread_info()->addr_limit)
#define set_fs(x)		(current_thread_info()->addr_limit = (x))
#define uaccess_kernel()	(get_fs().seg == KERNEL_DS.seg)

#endif /* __ASM_CSKY_SEGMENT_H */