1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
8 * Purpose: define basic common types and macros
19 /****** Common helper macros ***********************************************/
22 #define LOBYTE(w) ((unsigned char)(w))
25 #define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF))
29 #define LOWORD(d) ((unsigned short)(d))
32 #define HIWORD(d) ((unsigned short)((((unsigned long)(d)) >> 16) & 0xFFFF))
35 #define LODWORD(q) ((q).u.dwLowDword)
36 #define HIDWORD(q) ((q).u.dwHighDword)
38 #if !defined(MAKEWORD)
39 #define MAKEWORD(lb, hb) ((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8)))
41 #if !defined(MAKEDWORD)
42 #define MAKEDWORD(lw, hw) ((unsigned long)(((unsigned short)(lw)) | (((unsigned long)((unsigned short)(hw))) << 16)))
45 #endif /* __TMACRO_H__ */