#ifndef __KERNEL__
#include <sys/uio.h>
+#include <endian.h>
/*
* Functions to get network interfaces info
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[3]
-#if defined(__LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define HIPQUAD(addr) \
((unsigned char *)&addr)[3], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[0]
-#elif defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN)
+#elif __BYTE_ORDER == __BIG_ENDIAN
#define HIPQUAD NIPQUAD
#else
#error "Undefined byteorder??"
* This file contains part of linux kernel implementation of crc32
* kernel version 2.6.32
*/
+#include <endian.h>
#include <libcfs/libcfs.h>
#define CRCPOLY_LE 0xedb88320
#define CRC_LE_BITS 8
const unsigned int *b = (unsigned int *)p;
const unsigned int *tab = crc32table_le;
-# ifdef __LITTLE_ENDIAN
+# if __BYTE_ORDER == __LITTLE_ENDIAN
# define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc>>8)
# else
# define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc<<8)
if (tmp_id == 0ULL)
ret = -EHOSTUNREACH;
-#ifdef __LITTLE_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN
*nic_id = ___arch__swab64(tmp_id);
#else
*nic_id = tmp_id;
* @{
*/
#include <fcntl.h>
+#include <endian.h>
#include <sys/queue.h>
#ifdef __KERNEL__
static __inline__ int ext2_set_bit(int nr, void *addr)
{
-#ifdef __BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
return set_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
#else
return set_bit(nr, addr);
static inline int ext2_clear_bit(int nr, void *addr)
{
-#ifdef __BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
return clear_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
#else
return clear_bit(nr, addr);
static __inline__ int ext2_test_bit(int nr, void *addr)
{
-#ifdef __BIG_ENDIAN
+#if __BYTE_ORDER == __BIG_ENDIAN
__const__ unsigned char *tmp = (__const__ unsigned char *) addr;
return (tmp[nr >> 3] >> (nr & 7)) & 1;
#else