www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / bcmdrivers / opensource / include / bcm963xx / bcmtypes.h
1 /*
2 <:copyright-gpl 
3  Copyright 2002 Broadcom Corp. All Rights Reserved. 
4  
5  This program is free software; you can distribute it and/or modify it 
6  under the terms of the GNU General Public License (Version 2) as 
7  published by the Free Software Foundation. 
8  
9  This program is distributed in the hope it will be useful, but WITHOUT 
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
11  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
12  for more details. 
13  
14  You should have received a copy of the GNU General Public License along 
15  with this program; if not, write to the Free Software Foundation, Inc., 
16  59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 
17 :>
18 */
19
20 //
21 // bcmtypes.h - misc useful typedefs
22 //
23 #ifndef BCMTYPES_H
24 #define BCMTYPES_H
25
26 // These are also defined in typedefs.h in the application area, so I need to
27 // protect against re-definition.
28
29 #ifndef _TYPEDEFS_H_
30 typedef unsigned char   uint8;
31 typedef unsigned short  uint16;
32 typedef unsigned long   uint32;
33 typedef signed char     int8;
34 typedef signed short    int16;
35 typedef signed long     int32;
36 #if !defined(__cplusplus)
37 typedef int     bool;
38 #endif
39 #endif
40
41 typedef unsigned char   byte;
42 // typedef unsigned long   sem_t;
43
44 typedef unsigned long   HANDLE,*PULONG,DWORD,*PDWORD;
45 typedef signed long     LONG,*PLONG;
46
47 typedef unsigned int    *PUINT;
48 typedef signed int      INT;
49
50 typedef unsigned short  *PUSHORT;
51 typedef signed short    SHORT,*PSHORT;
52 typedef unsigned short  WORD,*PWORD;
53
54 typedef unsigned char   *PUCHAR;
55 typedef signed char     *PCHAR;
56
57 typedef void            *PVOID;
58
59 typedef unsigned char   BOOLEAN, *PBOOL, *PBOOLEAN;
60
61 typedef unsigned char   BYTE,*PBYTE;
62
63 typedef signed int      *PINT;
64
65 typedef signed char     INT8;
66 typedef signed short    INT16;
67 typedef signed long     INT32;
68
69 typedef unsigned char   UINT8;
70 typedef unsigned short  UINT16;
71 typedef unsigned long   UINT32;
72
73 typedef unsigned char   UCHAR;
74 typedef unsigned short  USHORT;
75 typedef unsigned int    UINT;
76 typedef unsigned long   ULONG;
77
78 typedef void            VOID;
79 typedef unsigned char   BOOL;
80
81 // These are also defined in typedefs.h in the application area, so I need to
82 // protect against re-definition.
83 #ifndef TYPEDEFS_H
84
85 // Maximum and minimum values for a signed 16 bit integer.
86 #define MAX_INT16 32767
87 #define MIN_INT16 -32768
88
89 // Useful for true/false return values.  This uses the
90 // Taligent notation (k for constant).
91 typedef enum
92 {
93     kFalse = 0,
94     kTrue = 1
95 } Bool;
96
97 #endif
98
99 #ifndef TRUE
100 #define TRUE 1
101 #endif
102
103 #ifndef FALSE
104 #define FALSE  0
105 #endif
106
107 #define READ32(addr)        (*(volatile UINT32 *)((ULONG)&addr))
108 #define READ16(addr)        (*(volatile UINT16 *)((ULONG)&addr))
109 #define READ8(addr)         (*(volatile UINT8  *)((ULONG)&addr))
110
111 #endif