MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / segment.h
blob25871b3cd8a115353fa54ccbdd007a4a810f75f4
1 #ifndef _NIOS2NOMMU_SEGMENT_H
2 #define _NIOS2NOMMU_SEGMENT_H
4 /*--------------------------------------------------------------------
6 * include/asm-nios2nommu/segment.h
8 * Derived from M68knommu
10 * Copyright (C) 2004 Microtronix Datacom Ltd
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
23 * Jan/20/2004 dgt NiosII
25 ---------------------------------------------------------------------*/
28 /* define constants */
29 /* Address spaces (FC0-FC2) */
30 #define USER_DATA (1)
31 #ifndef __USER_DS
32 #define __USER_DS (USER_DATA)
33 #endif
34 #define USER_PROGRAM (2)
35 #define SUPER_DATA (5)
36 #ifndef __KERNEL_DS
37 #define __KERNEL_DS (SUPER_DATA)
38 #endif
39 #define SUPER_PROGRAM (6)
40 #define CPU_SPACE (7)
42 #ifndef __ASSEMBLY__
44 typedef struct {
45 unsigned long seg;
46 } mm_segment_t;
48 #define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
49 #define USER_DS MAKE_MM_SEG(__USER_DS)
50 #define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
53 * Get/set the SFC/DFC registers for MOVES instructions
56 static inline mm_segment_t get_fs(void)
58 return USER_DS;
61 static inline mm_segment_t get_ds(void)
63 /* return the supervisor data space code */
64 return KERNEL_DS;
67 static inline void set_fs(mm_segment_t val)
71 #define segment_eq(a,b) ((a).seg == (b).seg)
73 #endif /* __ASSEMBLY__ */
75 #endif /* _NIOS2NOMMU_SEGMENT_H */