summaryrefslogtreecommitdiffstats
path: root/arch/csky/include/asm/segment.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/csky/include/asm/segment.h')
-rw-r--r--arch/csky/include/asm/segment.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/csky/include/asm/segment.h b/arch/csky/include/asm/segment.h
new file mode 100644
index 000000000..79ede9b1a
--- /dev/null
+++ b/arch/csky/include/asm/segment.h
@@ -0,0 +1,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) { 0x80000000UL })
+#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 */