| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc. |
| * Purpose: define basic common types and macros |
| /****** Common helper macros ***********************************************/ |
| #define LOBYTE(w) ((unsigned char)(w)) |
| #define HIBYTE(w) ((unsigned char)(((unsigned short)(w) >> 8) & 0xFF)) |
| #define LOWORD(d) ((unsigned short)(d)) |
| #define HIWORD(d) ((unsigned short)((((unsigned long)(d)) >> 16) & 0xFFFF)) |
| #define LODWORD(q) ((q).u.dwLowDword) |
| #define HIDWORD(q) ((q).u.dwHighDword) |
| #define MAKEWORD(lb, hb) ((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8))) |
| #define MAKEDWORD(lw, hw) ((unsigned long)(((unsigned short)(lw)) | (((unsigned long)((unsigned short)(hw))) << 16))) |
| #endif /* __TMACRO_H__ */ |