]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/platform_defs.h.in
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __XFS_PLATFORM_DEFS_H__
21 #define __XFS_PLATFORM_DEFS_H__
35 #include <sys/types.h>
41 #include <asm/types.h>
43 typedef unsigned char __u8
;
44 typedef signed char __s8
;
45 typedef unsigned short __u16
;
46 typedef signed short __s16
;
47 typedef unsigned int __u32
;
48 typedef signed int __s32
;
49 typedef unsigned long long int __u64
;
50 typedef signed long long int __s64
;
54 #define __bitwise __attribute__((bitwise))
55 #define __force __attribute__((force))
61 typedef __u16 __bitwise __le16
;
62 typedef __u32 __bitwise __le32
;
63 typedef __u64 __bitwise __le64
;
65 typedef __u16 __bitwise __be16
;
66 typedef __u32 __bitwise __be32
;
67 typedef __u64 __bitwise __be64
;
69 typedef struct filldir filldir_t
;
71 #if defined(__linux__)
72 #include <xfs/linux.h>
73 #elif defined(__FreeBSD__)
74 #include <xfs/freebsd.h>
75 #elif defined(__FreeBSD_kernel__)
76 #include <xfs/gnukfreebsd.h>
77 #elif defined(__APPLE__)
78 #include <xfs/darwin.h>
79 #elif defined(__sgi__) || defined(__sgi)
82 # error unknown platform... have fun porting!
85 /* long and pointer must be either 32 bit or 64 bit */
88 #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
90 /* Check if __psint_t is set to something meaningful */
92 #ifndef HAVE___PSINT_T
93 # if (SIZEOF_CHAR_P * CHAR_BIT) == 32
94 typedef int __psint_t
;
95 # elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
96 # if BITS_PER_LONG == 64
97 typedef long __psint_t
;
99 /* This is a very strange architecture, which has 64 bit pointers but */
100 /* not 64 bit longs. So, just punt here and assume long long is OK. */
101 typedef long long __psint_t
;
104 # error Unknown pointer size
108 /* Check if __psunsigned_t is set to something meaningful */
109 #undef HAVE___PSUNSIGNED_T
110 #ifndef HAVE___PSUNSIGNED_T
111 # if (SIZEOF_CHAR_P * CHAR_BIT) == 32
112 typedef unsigned int __psunsigned_t
;
113 # elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
114 # if BITS_PER_LONG == 64
115 typedef long __psunsigned_t
;
117 /* This is a very strange architecture, which has 64 bit pointers but */
118 /* not 64 bit longs. So, just punt here and assume long long is OK. */
119 typedef unsigned long long __psunsigned_t
;
122 # error Unknown pointer size
126 /* Check whether to define umode_t ourselves. */
128 typedef unsigned short umode_t
;
131 /* Define if you want gettext (I18N) support */
132 #undef ENABLE_GETTEXT
133 #ifdef ENABLE_GETTEXT
134 # include <libintl.h>
135 # define _(x) gettext(x)
140 # define textdomain(d) do { } while (0)
141 # define bindtextdomain(d,dir) do { } while (0)
146 # define ASSERT(EX) assert(EX)
148 # define ASSERT(EX) ((void) 0)
152 * sparse kernel source annotations
158 #define IRIX_DEV_BITSMAJOR 14
159 #define IRIX_DEV_BITSMINOR 18
160 #define IRIX_DEV_MAXMAJ 0x1ff
161 #define IRIX_DEV_MAXMIN 0x3ffff
162 #define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
164 #define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN))
165 #define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
166 | (minor&IRIX_DEV_MAXMIN)))
167 #define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
169 /* ARM old ABI has some weird alignment/padding */
170 #if defined(__arm__) && !defined(__ARM_EABI__)
171 #define __arch_pack __attribute__((packed))
176 #endif /* __XFS_PLATFORM_DEFS_H__ */