1// 2// bcmtypes.h - misc useful typedefs 3// 4#ifndef BCMTYPES_H 5#define BCMTYPES_H 6 7// These are also defined in typedefs.h in the application area, so I need to 8// protect against re-definition. 9 10#ifndef _TYPEDEFS_H_ 11typedef unsigned char uint8; 12typedef unsigned short uint16; 13typedef unsigned long uint32; 14typedef signed char int8; 15typedef signed short int16; 16typedef signed long int32; 17#if !defined(__cplusplus) 18typedef int bool; 19#endif 20#endif 21 22typedef unsigned char byte; 23typedef unsigned long sem_t; 24 25typedef unsigned long HANDLE,*PULONG,DWORD,*PDWORD; 26typedef signed long LONG,*PLONG; 27 28typedef unsigned int *PUINT; 29typedef signed int INT; 30 31typedef unsigned short *PUSHORT; 32typedef signed short SHORT,*PSHORT,WORD,*PWORD; 33 34typedef unsigned char *PUCHAR; 35typedef signed char *PCHAR; 36 37typedef void *PVOID; 38 39typedef unsigned char BOOLEAN, *PBOOL, *PBOOLEAN; 40 41typedef unsigned char BYTE,*PBYTE; 42 43//#ifndef __GNUC__ 44//The following has been defined in Vxworks internally: vxTypesOld.h 45//redefine under vxworks will cause error 46typedef signed int *PINT; 47 48typedef signed char INT8; 49typedef signed short INT16; 50typedef signed long INT32; 51 52typedef unsigned char UINT8; 53typedef unsigned short UINT16; 54typedef unsigned long UINT32; 55 56typedef unsigned char UCHAR; 57typedef unsigned short USHORT; 58typedef unsigned int UINT; 59typedef unsigned long ULONG; 60 61typedef void VOID; 62typedef unsigned char BOOL; 63 64//#endif /* __GNUC__ */ 65 66 67// These are also defined in typedefs.h in the application area, so I need to 68// protect against re-definition. 69#ifndef TYPEDEFS_H 70 71#define MAX_INT16 32767 72#define MIN_INT16 -32768 73 74// Useful for true/false return values. This uses the 75// Taligent notation (k for constant). 76typedef enum 77{ 78 kFalse = 0, 79 kTrue = 1 80} Bool; 81 82#endif 83 84/* macros to protect against unaligned accesses */ 85 86 87#ifndef YES 88#define YES 1 89#endif 90 91#ifndef NO 92#define NO 0 93#endif 94 95#ifndef IN 96#define IN 97#endif 98 99#ifndef OUT 100#define OUT 101#endif 102 103#ifndef TRUE 104#define TRUE 1 105#endif 106 107#ifndef FALSE 108#define FALSE 0 109#endif 110 111#define READ32(addr) (*(volatile UINT32 *)((ULONG)&addr)) 112#define READ16(addr) (*(volatile UINT16 *)((ULONG)&addr)) 113#define READ8(addr) (*(volatile UINT8 *)((ULONG)&addr)) 114 115#endif 116