diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 19:54:53 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 20:01:40 (GMT) |
commit | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (patch) | |
tree | 3c2086ab67398a019089a47ca3f362a4bc6db74f /drivers/staging/vt6655/tmacro.h | |
parent | 34e84f39a27d059a3e6ec6e8b94aafa702e6f220 (diff) | |
parent | 9173a8ef24a6b1b8031507b35b8ffe5f85a87692 (diff) | |
download | linux-fsl-qoriq-ae19ffbadc1b2100285a5b5b3d0a4e0a11390904.tar.xz |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/staging/vt6655/tmacro.h')
-rw-r--r-- | drivers/staging/vt6655/tmacro.h | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/drivers/staging/vt6655/tmacro.h b/drivers/staging/vt6655/tmacro.h index 3d932a2..e96c140 100644 --- a/drivers/staging/vt6655/tmacro.h +++ b/drivers/staging/vt6655/tmacro.h @@ -26,27 +26,13 @@ * */ - #ifndef __TMACRO_H__ #define __TMACRO_H__ - -#if !defined(__TTYPE_H__) #include "ttype.h" -#endif - - - /****** Common helper macros ***********************************************/ -#if !defined(LONIBBLE) -#define LONIBBLE(b) ((BYTE)(b) & 0x0F) -#endif -#if !defined(HINIBBLE) -#define HINIBBLE(b) ((BYTE)(((WORD)(b) >> 4) & 0x0F)) -#endif - #if !defined(LOBYTE) #define LOBYTE(w) ((BYTE)(w)) #endif @@ -64,88 +50,12 @@ #define LODWORD(q) ((q).u.dwLowDword) #define HIDWORD(q) ((q).u.dwHighDword) - - -#if !defined(MAKEBYTE) -#define MAKEBYTE(ln, hn) ((BYTE)(((BYTE)(ln) & 0x0F) | ((BYTE)(hn) << 4))) -#endif #if !defined(MAKEWORD) #define MAKEWORD(lb, hb) ((WORD)(((BYTE)(lb)) | (((WORD)((BYTE)(hb))) << 8))) #endif #if !defined(MAKEDWORD) #define MAKEDWORD(lw, hw) ((DWORD)(((WORD)(lw)) | (((DWORD)((WORD)(hw))) << 16))) #endif -#if !defined(MAKEQWORD) -#define MAKEQWORD(ld, hd, pq) {pq->u.dwLowDword = ld; pq->u.dwHighDword = hd;} -#endif - -#if !defined(MAKELONG) -#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16))) -#endif - - - -// Bytes Reverse: big endian to little endian convert -#if !defined(REVWORD) -#define REVWORD(w) ((WORD)( ((WORD)(w) >> 8) | ((WORD)(w) << 8) )) -#endif -#if !defined(REVDWORD) -#define REVDWORD(d) (MAKEDWORD(MAKEWORD(HIBYTE(HIWORD(d)),LOBYTE(HIWORD(d))),MAKEWORD(HIBYTE(LOWORD(d)),LOBYTE(LOWORD(d))))) -#endif - -/* map to known network names */ -/* -#define ntohs(x) REVWORD(x) -#define ntohl(x) REVDWORD(x) -#define htons(x) REVWORD(x) -#define htonl(x) REVDWORD(x) -*/ - - -/* -#ifndef NOMINMAX -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif -#endif // NOMINMAX -*/ - - - -/****** Misc macros ********************************************************/ - -// get the field offset in the type(struct, class, ...) -#define OFFSET(type, field) ((int)(&((type NEAR*)1)->field)-1) - - -/* string equality shorthand */ -#define STR_EQ(x, y) (strcmp(x, y) == 0) -#define STR_NE(x, y) (strcmp(x, y) != 0) - - -// calculate element # of array -#define ELEMENT_NUM(array) (sizeof(array) / sizeof(array[0])) -//#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - - -// null statement -#define NULL_FUNC() - - -/* Since not all compilers support structure assignment, the ASSIGN() - * macro is used. This controls how it's actually implemented. - */ -#ifdef NOSTRUCTASSIGN /* Version for old compilers that don't support it */ -#define ASSIGN(a,b) memcpy((char *)&(a),(char *)&(b),sizeof(b); -#else /* Version for compilers that do */ -#define ASSIGN(a,b) ((a) = (b)) -#endif - - - #endif // __TMACRO_H__ |