Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
unaligned.h File Reference
#include <linux/swab.h>

Go to the source code of this file.

Macros

#define get_unaligned_le32(p)   get_unaligned32(p)
 
#define get_unaligned_le64(p)   get_unaligned64(p)
 
#define get_unaligned_be32(p)   __swab32(get_unaligned32(p))
 
#define get_unaligned_be64(p)   __swab64(get_unaligned64(p))
 
#define put_unaligned_le32(v, p)   put_unaligned32((v), (p))
 
#define put_unaligned_le64(v, p)   put_unaligned64((v), (p))
 
#define put_unaligned_be32(v, p)   put_unaligned32(__swab32(v), (p))
 
#define put_unaligned_be64(v, p)   put_unaligned64(__swab64(v), (p))
 
#define get_unaligned   __get_unaligned_le
 
#define put_unaligned   __put_unaligned_le
 
#define __get_unaligned_le(ptr)
 
#define __get_unaligned_be(ptr)
 
#define __put_unaligned_le(val, ptr)
 
#define __put_unaligned_be(val, ptr)
 

Functions

int __bad_unaligned_access_size (void)
 

Macro Definition Documentation

#define __get_unaligned_be (   ptr)
Value:
(__force typeof(*(ptr)))({ \
sizeof(*(ptr)) == 1 ? *(ptr) : \
(sizeof(*(ptr)) == 2 ? get_unaligned_be16((ptr)) : \
(sizeof(*(ptr)) == 4 ? get_unaligned_be32((ptr)) : \
(sizeof(*(ptr)) == 8 ? get_unaligned_be64((ptr)) : \
})

Definition at line 120 of file unaligned.h.

#define __get_unaligned_le (   ptr)
Value:
(typeof(*(ptr)))({ \
sizeof(*(ptr)) == 1 ? *(ptr) : \
(sizeof(*(ptr)) == 2 ? get_unaligned_le16((ptr)) : \
(sizeof(*(ptr)) == 4 ? get_unaligned_le32((ptr)) : \
(sizeof(*(ptr)) == 8 ? get_unaligned_le64((ptr)) : \
})

Definition at line 112 of file unaligned.h.

#define __put_unaligned_be (   val,
  ptr 
)
Value:
({ \
void *__gu_p = (ptr); \
switch (sizeof(*(ptr))) { \
case 1: \
*(u8 *)__gu_p = (__force u8)(val); \
break; \
case 2: \
put_unaligned_be16((__force u16)(val), __gu_p); \
break; \
case 4: \
put_unaligned_be32((__force u32)(val), __gu_p); \
break; \
case 8: \
put_unaligned_be64((__force u64)(val), __gu_p); \
break; \
default: \
__bad_unaligned_access_size(); \
break; \
} \
(void)0; })

Definition at line 149 of file unaligned.h.

#define __put_unaligned_le (   val,
  ptr 
)
Value:
({ \
void *__gu_p = (ptr); \
switch (sizeof(*(ptr))) { \
case 1: \
*(u8 *)__gu_p = (__force u8)(val); \
break; \
case 2: \
put_unaligned_le16((__force u16)(val), __gu_p); \
break; \
case 4: \
put_unaligned_le32((__force u32)(val), __gu_p); \
break; \
case 8: \
put_unaligned_le64((__force u64)(val), __gu_p); \
break; \
default: \
__bad_unaligned_access_size(); \
break; \
} \
(void)0; })

Definition at line 128 of file unaligned.h.

#define get_unaligned   __get_unaligned_le

Definition at line 101 of file unaligned.h.

#define get_unaligned_be32 (   p)    __swab32(get_unaligned32(p))

Definition at line 95 of file unaligned.h.

#define get_unaligned_be64 (   p)    __swab64(get_unaligned64(p))

Definition at line 96 of file unaligned.h.

#define get_unaligned_le32 (   p)    get_unaligned32(p)

Definition at line 93 of file unaligned.h.

#define get_unaligned_le64 (   p)    get_unaligned64(p)

Definition at line 94 of file unaligned.h.

#define put_unaligned   __put_unaligned_le

Definition at line 102 of file unaligned.h.

#define put_unaligned_be32 (   v,
  p 
)    put_unaligned32(__swab32(v), (p))

Definition at line 99 of file unaligned.h.

#define put_unaligned_be64 (   v,
  p 
)    put_unaligned64(__swab64(v), (p))

Definition at line 100 of file unaligned.h.

#define put_unaligned_le32 (   v,
  p 
)    put_unaligned32((v), (p))

Definition at line 97 of file unaligned.h.

#define put_unaligned_le64 (   v,
  p 
)    put_unaligned64((v), (p))

Definition at line 98 of file unaligned.h.

Function Documentation

int __bad_unaligned_access_size ( void  )