diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2017-04-26 08:58:17 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2017-04-26 20:20:26 +0200 |
commit | 7d9d71e67f8763b0db96545e124c002fe0ba7e73 (patch) | |
tree | dd807d86e63727df9c864fde0866d8ccbf9a7feb /package/mtd-utils/src/include/linux | |
parent | 0510be4cc4affbc497040486d3d4a0a271985ba9 (diff) |
mtd-utils: allow host-tools to compile on Darwin
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Diffstat (limited to 'package/mtd-utils/src/include/linux')
-rw-r--r-- | package/mtd-utils/src/include/linux/fs.h | 71 | ||||
-rw-r--r-- | package/mtd-utils/src/include/linux/stddef.h | 27 | ||||
-rw-r--r-- | package/mtd-utils/src/include/linux/types.h | 62 |
3 files changed, 160 insertions, 0 deletions
diff --git a/package/mtd-utils/src/include/linux/fs.h b/package/mtd-utils/src/include/linux/fs.h new file mode 100644 index 000000000..b28168d37 --- /dev/null +++ b/package/mtd-utils/src/include/linux/fs.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) Bernhard Walle <bernhard@bwalle.de>, 2012 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Comatibility with BSD-like userland. + */ +#ifndef LINUX_FS_H_ +#define LINUX_FS_H_ + +#ifdef __linux__ +#include_next <linux/fs.h> +#else + +#define FS_IOC_GETFLAGS _IOR('f', 1, long) +#define FS_IOC_SETFLAGS _IOW('f', 2, long) +#define FS_IOC_GETVERSION _IOR('v', 1, long) +#define FS_IOC_SETVERSION _IOW('v', 2, long) +#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) +#define FS_IOC32_GETFLAGS _IOR('f', 1, int) +#define FS_IOC32_SETFLAGS _IOW('f', 2, int) +#define FS_IOC32_GETVERSION _IOR('v', 1, int) +#define FS_IOC32_SETVERSION _IOW('v', 2, int) + +/* + * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) + */ +#define FS_SECRM_FL 0x00000001 /* Secure deletion */ +#define FS_UNRM_FL 0x00000002 /* Undelete */ +#define FS_COMPR_FL 0x00000004 /* Compress file */ +#define FS_SYNC_FL 0x00000008 /* Synchronous updates */ +#define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ +#define FS_APPEND_FL 0x00000020 /* writes to file may only append */ +#define FS_NODUMP_FL 0x00000040 /* do not dump file */ +#define FS_NOATIME_FL 0x00000080 /* do not update atime */ +/* Reserved for compression usage... */ +#define FS_DIRTY_FL 0x00000100 +#define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ +#define FS_NOCOMP_FL 0x00000400 /* Don't compress */ +#define FS_ECOMPR_FL 0x00000800 /* Compression error */ +/* End compression flags --- maybe not all used */ +#define FS_BTREE_FL 0x00001000 /* btree format dir */ +#define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ +#define FS_IMAGIC_FL 0x00002000 /* AFS directory */ +#define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ +#define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ +#define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ +#define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ +#define FS_EXTENT_FL 0x00080000 /* Extents */ +#define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ +#define FS_NOCOW_FL 0x00800000 /* Do not cow file */ +#define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ + +#define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ +#define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ + +#endif + +#endif /* LINUX_FS_H_ */ diff --git a/package/mtd-utils/src/include/linux/stddef.h b/package/mtd-utils/src/include/linux/stddef.h new file mode 100644 index 000000000..492cf6173 --- /dev/null +++ b/package/mtd-utils/src/include/linux/stddef.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Bernhard Walle <bernhard@bwalle.de>, 2012 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Comatibility with BSD-like userland. + */ +#ifndef LINUX_STDDEF_H_ +#define LINUX_STDDEF_H_ + +#ifdef __linux__ +#include_next <linux/stddef.h> +#endif + +#endif /* LINUX_STDDEF_H_ */ diff --git a/package/mtd-utils/src/include/linux/types.h b/package/mtd-utils/src/include/linux/types.h new file mode 100644 index 000000000..8de4c8a58 --- /dev/null +++ b/package/mtd-utils/src/include/linux/types.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) Bernhard Walle <bernhard@bwalle.de>, 2012 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Comatibility with BSD-like userland. + */ +#ifndef LINUX_TYPES_H_ +#define LINUX_TYPES_H_ + +#ifdef __linux__ +#include_next <linux/types.h> +#else + +#include <stdint.h> /* get uint8_t etc. */ +#include <sys/types.h> /* get u_long etc. */ + +/* This types are provided to Linux userland */ + +typedef uint8_t __u8; +typedef uint16_t __u16; +typedef uint32_t __u32; +typedef uint64_t __u64; + +typedef int8_t __s8; +typedef int16_t __s16; +typedef int32_t __s32; +typedef int64_t __s64; + +/* + * The type itself has no endianess. It's only used for code checkers + * but we don't need to run that checkers on non-Linux OSes + */ +typedef __u16 __le16; +typedef __u16 __be16; +typedef __u32 __le32; +typedef __u32 __be32; +typedef __u64 __le64; +typedef __u64 __be64; + +/* from /usr/include/asm-generic/posix_types.h on Linux */ +typedef long __kernel_off_t; +typedef long long __kernel_loff_t; + +typedef long long loff_t; +typedef long long off64_t; + +#endif + +#endif /* LINUX_TYPES_H_ */ |