1#ifndef READ_FS_H 2#define READ_FS_H 3/* 4 * Squashfs 5 * 6 * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 7 * Phillip Lougher <phillip@lougher.demon.co.uk> 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2, 12 * or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * 23 * read_fs.h 24 * 25 */ 26 27#if __BYTE_ORDER == __BIG_ENDIAN 28#define SQUASHFS_SWAP_SHORTS(d, s, n) swap_le16_num(s, d, n) 29#define SQUASHFS_SWAP_INTS(d, s, n) swap_le32_num(s, d, n) 30#define SQUASHFS_SWAP_LONG_LONGS(d, s, n) swap_le64_num(s, d, n) 31 32#define SWAP_LE16(d, s) swap_le16(s, d) 33#define SWAP_LE32(d, s) swap_le32(s, d) 34#define SWAP_LE64(d, s) swap_le64(s, d) 35#else 36#define SQUASHFS_MEMCPY(d, s, n) memcpy(d, s, n) 37#define SQUASHFS_SWAP_SHORTS(d, s, n) memcpy(d, s, n * sizeof(short)) 38#define SQUASHFS_SWAP_INTS(d, s, n) memcpy(d, s, n * sizeof(int)) 39#define SQUASHFS_SWAP_LONG_LONGS(d, s, n) \ 40 memcpy(d, s, n * sizeof(long long)) 41#endif 42#endif 43