1 #ifndef _M68K_SEGMENT_H
2 #define _M68K_SEGMENT_H
5 /* Address spaces (FC0-FC2) */
8 #define __USER_DS (USER_DATA)
10 #define USER_PROGRAM (2)
11 #define SUPER_DATA (5)
13 #define __KERNEL_DS (SUPER_DATA)
15 #define SUPER_PROGRAM (6)
24 #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
26 #ifdef CONFIG_CPU_HAS_ADDRESS_SPACES
28 * Get/set the SFC/DFC registers for MOVES instructions
30 #define USER_DS MAKE_MM_SEG(__USER_DS)
31 #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
33 static inline mm_segment_t
get_fs(void)
36 __asm__ ("movec %/dfc,%0":"=r" (_v
.seg
):);
40 static inline void set_fs(mm_segment_t val
)
42 __asm__
__volatile__ ("movec %0,%/sfc\n\t"
44 : /* no outputs */ : "r" (val
.seg
) : "memory");
47 static inline mm_segment_t
get_ds(void)
49 /* return the supervisor data space code */
54 #define USER_DS MAKE_MM_SEG(TASK_SIZE)
55 #define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFF)
56 #define get_ds() (KERNEL_DS)
57 #define get_fs() (current_thread_info()->addr_limit)
58 #define set_fs(x) (current_thread_info()->addr_limit = (x))
61 #define segment_eq(a, b) ((a).seg == (b).seg)
63 #endif /* __ASSEMBLY__ */
65 #endif /* _M68K_SEGMENT_H */