2 * arch/ubicom32/include/asm/segment.h
3 * Memory segment definitions for Ubicom32 architecture.
5 * (C) Copyright 2009, Ubicom, Inc.
7 * This file is part of the Ubicom32 Linux Kernel Port.
9 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
10 * it and/or modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation, either version 2 of the
12 * License, or (at your option) any later version.
14 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
15 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
16 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with the Ubicom32 Linux Kernel Port. If not,
21 * see <http://www.gnu.org/licenses/>.
23 * Ubicom32 implementation derived from (with many thanks):
28 #ifndef _ASM_UBICOM32_SEGMENT_H
29 #define _ASM_UBICOM32_SEGMENT_H
31 /* define constants */
32 /* Address spaces (FC0-FC2) */
35 #define __USER_DS (USER_DATA)
37 #define USER_PROGRAM (2)
38 #define SUPER_DATA (5)
40 #define __KERNEL_DS (SUPER_DATA)
42 #define SUPER_PROGRAM (6)
51 #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
52 #define USER_DS MAKE_MM_SEG(__USER_DS)
53 #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
56 * Get/set the SFC/DFC registers for MOVES instructions
59 static inline mm_segment_t
get_fs(void)
64 static inline mm_segment_t
get_ds(void)
66 /* return the supervisor data space code */
70 static inline void set_fs(mm_segment_t val
)
74 #define segment_eq(a,b) ((a).seg == (b).seg)
76 #endif /* __ASSEMBLY__ */
78 #endif /* _ASM_UBICOM32_SEGMENT_H */