Staging: vt665x: Typedef and macro cleanup Part 2
[linux-2.6/kvm.git] / drivers / staging / vt6655 / tmacro.h
blobd18b01c6a47021557979312a9023215fc944a8ea
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 * File: tmacro.h
21 * Purpose: define basic common types and macros
23 * Author: Tevin Chen
25 * Date: May 21, 1996
30 #ifndef __TMACRO_H__
31 #define __TMACRO_H__
33 #include "ttype.h"
35 /****** Common helper macros ***********************************************/
37 #if !defined(LOBYTE)
38 #define LOBYTE(w) ((BYTE)(w))
39 #endif
40 #if !defined(HIBYTE)
41 #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
42 #endif
44 #if !defined(LOWORD)
45 #define LOWORD(d) ((WORD)(d))
46 #endif
47 #if !defined(HIWORD)
48 #define HIWORD(d) ((WORD)((((DWORD)(d)) >> 16) & 0xFFFF))
49 #endif
51 #define LODWORD(q) ((q).u.dwLowDword)
52 #define HIDWORD(q) ((q).u.dwHighDword)
54 #if !defined(MAKEWORD)
55 #define MAKEWORD(lb, hb) ((WORD)(((BYTE)(lb)) | (((WORD)((BYTE)(hb))) << 8)))
56 #endif
57 #if !defined(MAKEDWORD)
58 #define MAKEDWORD(lw, hw) ((DWORD)(((WORD)(lw)) | (((DWORD)((WORD)(hw))) << 16)))
59 #endif
61 #endif // __TMACRO_H__