]>
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 whether to define umode_t ourselves. */
92 typedef unsigned short umode_t
;
95 /* Define if you want gettext (I18N) support */
99 # define _(x) gettext(x)
104 # define textdomain(d) do { } while (0)
105 # define bindtextdomain(d,dir) do { } while (0)
110 # define ASSERT(EX) assert(EX)
112 # define ASSERT(EX) ((void) 0)
116 * sparse kernel source annotations
122 #define IRIX_DEV_BITSMAJOR 14
123 #define IRIX_DEV_BITSMINOR 18
124 #define IRIX_DEV_MAXMAJ 0x1ff
125 #define IRIX_DEV_MAXMIN 0x3ffff
126 #define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
128 #define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN))
129 #define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
130 | (minor&IRIX_DEV_MAXMIN)))
131 #define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
133 /* ARM old ABI has some weird alignment/padding */
134 #if defined(__arm__) && !defined(__ARM_EABI__)
135 #define __arch_pack __attribute__((packed))
141 #define min(a,b) (((a)<(b))?(a):(b))
142 #define max(a,b) (((a)>(b))?(a):(b))
145 #endif /* __XFS_PLATFORM_DEFS_H__ */