FreeBSD kernel usb device Code
usb_endian.h File Reference
#include <sys/stdint.h>
#include <sys/endian.h>
Include dependency graph for usb_endian.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UGETB(w)    ((w)[0])
 
#define UGETW(w)
 
#define UGETDW(w)
 
#define UGETQW(w)
 
#define USETB(w, v)
 
#define USETW(w, v)
 
#define USETDW(w, v)
 
#define USETQW(w, v)
 
#define USETW2(w, b1, b0)
 
#define USETW4(w, b3, b2, b1, b0)
 
#define USETW8(w, b7, b6, b5, b4, b3, b2, b1, b0)
 

Typedefs

typedef uint8_t uByte
 
typedef uint8_t uWord[2]
 
typedef uint8_t uDWord[4]
 
typedef uint8_t uQWord[8]
 

Macro Definition Documentation

◆ UGETB

#define UGETB (   w)     ((w)[0])

Definition at line 50 of file usb_endian.h.

◆ UGETDW

#define UGETDW (   w)
Value:
((w)[0] | \
(((uint16_t)((w)[1])) << 8) | \
(((uint32_t)((w)[2])) << 16) | \
(((uint32_t)((w)[3])) << 24))

Definition at line 57 of file usb_endian.h.

◆ UGETQW

#define UGETQW (   w)
Value:
((w)[0] | \
(((uint16_t)((w)[1])) << 8) | \
(((uint32_t)((w)[2])) << 16) | \
(((uint32_t)((w)[3])) << 24) | \
(((uint64_t)((w)[4])) << 32) | \
(((uint64_t)((w)[5])) << 40) | \
(((uint64_t)((w)[6])) << 48) | \
(((uint64_t)((w)[7])) << 56))

Definition at line 63 of file usb_endian.h.

◆ UGETW

#define UGETW (   w)
Value:
((w)[0] | \
(((uint16_t)((w)[1])) << 8))

Definition at line 53 of file usb_endian.h.

◆ USETB

#define USETB (   w,
 
)
Value:
do { \
(w)[0] = (uint8_t)(v); \
} while (0)

Definition at line 73 of file usb_endian.h.

◆ USETDW

#define USETDW (   w,
 
)
Value:
do { \
(w)[0] = (uint8_t)(v); \
(w)[1] = (uint8_t)((v) >> 8); \
(w)[2] = (uint8_t)((v) >> 16); \
(w)[3] = (uint8_t)((v) >> 24); \
} while (0)

Definition at line 82 of file usb_endian.h.

◆ USETQW

#define USETQW (   w,
 
)
Value:
do { \
(w)[0] = (uint8_t)(v); \
(w)[1] = (uint8_t)((v) >> 8); \
(w)[2] = (uint8_t)((v) >> 16); \
(w)[3] = (uint8_t)((v) >> 24); \
(w)[4] = (uint8_t)((v) >> 32); \
(w)[5] = (uint8_t)((v) >> 40); \
(w)[6] = (uint8_t)((v) >> 48); \
(w)[7] = (uint8_t)((v) >> 56); \
} while (0)

Definition at line 89 of file usb_endian.h.

◆ USETW

#define USETW (   w,
 
)
Value:
do { \
(w)[0] = (uint8_t)(v); \
(w)[1] = (uint8_t)((v) >> 8); \
} while (0)

Definition at line 77 of file usb_endian.h.

◆ USETW2

#define USETW2 (   w,
  b1,
  b0 
)
Value:
do { \
(w)[0] = (uint8_t)(b0); \
(w)[1] = (uint8_t)(b1); \
} while (0)

Definition at line 100 of file usb_endian.h.

◆ USETW4

#define USETW4 (   w,
  b3,
  b2,
  b1,
  b0 
)
Value:
do { \
(w)[0] = (uint8_t)(b0); \
(w)[1] = (uint8_t)(b1); \
(w)[2] = (uint8_t)(b2); \
(w)[3] = (uint8_t)(b3); \
} while (0)

Definition at line 105 of file usb_endian.h.

◆ USETW8

#define USETW8 (   w,
  b7,
  b6,
  b5,
  b4,
  b3,
  b2,
  b1,
  b0 
)
Value:
do { \
(w)[0] = (uint8_t)(b0); \
(w)[1] = (uint8_t)(b1); \
(w)[2] = (uint8_t)(b2); \
(w)[3] = (uint8_t)(b3); \
(w)[4] = (uint8_t)(b4); \
(w)[5] = (uint8_t)(b5); \
(w)[6] = (uint8_t)(b6); \
(w)[7] = (uint8_t)(b7); \
} while (0)

Definition at line 112 of file usb_endian.h.

Typedef Documentation

◆ uByte

typedef uint8_t uByte

Definition at line 41 of file usb_endian.h.

◆ uDWord

typedef uint8_t uDWord[4]

Definition at line 43 of file usb_endian.h.

◆ uQWord

typedef uint8_t uQWord[8]

Definition at line 44 of file usb_endian.h.

◆ uWord

typedef uint8_t uWord[2]

Definition at line 42 of file usb_endian.h.