1 /******************************************************************************* 2 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved. 3 * 4 *Redistribution and use in source and binary forms, with or without modification, are permitted provided 5 *that the following conditions are met: 6 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the 7 *following disclaimer. 8 *2. Redistributions in binary form must reproduce the above copyright notice, 9 *this list of conditions and the following disclaimer in the documentation and/or other materials provided 10 *with the distribution. 11 * 12 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED 13 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 15 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 16 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 17 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 18 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 19 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 20 * 21 * 22 *******************************************************************************/ 23 /****************************************************************************** 24 25 Note: 26 ******************************************************************************* 27 Module Name: 28 ostypes.h 29 Abstract: 30 Request by fclayer for data type define. 31 Authors: 32 EW - Yiding(Eddie) Wang 33 Environment: 34 Kernel or loadable module 35 36 Version Control Information: 37 $ver. 1.0.0 38 39 Revision History: 40 $Revision: 114125 $0.1.0 41 $Date: 2012-04-23 23:37:56 -0700 (Mon, 23 Apr 2012) $09-27-2001 42 $Modtime: 11/12/01 11:15a $15:56:00 43 44 Notes: 45 **************************** MODIFICATION HISTORY ***************************** 46 NAME DATE Rev. DESCRIPTION 47 ---- ---- ---- ----------- 48 EW 09-16-2002 0.1.0 Header file for most constant definitions 49 ******************************************************************************/ 50 51 #ifndef __OSTYPES_H__ 52 #define __OSTYPES_H__ 53 54 #include <sys/types.h> 55 #include <sys/kernel.h> 56 57 58 /* 59 ** Included for Linux 2.4, built in kernel and other possible cases. 60 */ 61 /* 62 #ifdef TARGET_DRIVER 63 #if !defined(AGBUILD_TFE_DRIVER) && !defined(COMBO_IBE_TFE_MODULE) 64 #include "lxtgtdef.h" 65 #endif 66 #endif 67 */ 68 /* 69 ** Included for possible lower layer ignorance. 70 */ 71 #include "osdebug.h" 72 73 #ifdef STATIC 74 #undef STATIC 75 #endif 76 77 #define STATIC 78 79 #ifndef INLINE 80 #define INLINE inline 81 #endif 82 83 84 #ifndef FORCEINLINE 85 #define FORCEINLINE 86 //#define FORCEINLINE inline 87 88 #endif 89 #if defined (__amd64__) 90 #define BITS_PER_LONG 64 91 #else 92 #define BITS_PER_LONG 32 93 #endif 94 95 96 typedef unsigned char bit8; 97 typedef unsigned short bit16; 98 typedef unsigned int bit32; 99 typedef char sbit8; 100 typedef short sbit16; 101 typedef int sbit32; 102 typedef unsigned int BOOLEAN; 103 typedef unsigned long long bit64; 104 typedef long long sbit64; 105 106 //typedef unsigned long long bitptr; 107 #if 1 108 #if (BITS_PER_LONG == 64) 109 typedef unsigned long long bitptr; 110 #else 111 typedef unsigned long bitptr; 112 #endif 113 #endif 114 115 typedef char S08; 116 typedef short S16; 117 typedef int S32; 118 typedef long S32_64; 119 typedef long long S64; 120 121 typedef unsigned char U08; 122 typedef unsigned short U16; 123 typedef unsigned int U32; 124 typedef unsigned long U32_64; 125 typedef unsigned long long U64; 126 127 /* 128 ** some really basic defines 129 */ 130 #define GLOBAL extern 131 #define LOCAL static 132 #ifndef TRUE 133 #define TRUE 1 134 #define FALSE 0 135 #endif 136 #ifndef SUCCESS 137 #define SUCCESS 0 138 #define FAILURE 1 139 #endif 140 #ifndef NULL 141 #define NULL ((void*)0) 142 #endif 143 144 145 #define agBOOLEAN BOOLEAN 146 #define osGLOBAL GLOBAL 147 #define osLOCAL LOCAL 148 #define agTRUE TRUE 149 #define agFALSE FALSE 150 #define agNULL NULL 151 152 #define AGTIAPI_UNKNOWN 2 153 #define AGTIAPI_SUCCESS 1 154 #define AGTIAPI_FAIL 0 155 156 #define AGTIAPI_DRIVER_VERSION "1.4.0.10800" 157 158 /*************************************************************************** 159 **************************************************************************** 160 * MACROS - some basic macros 161 **************************************************************************** 162 ***************************************************************************/ 163 #ifndef BIT 164 #define BIT(x) (1<<x) 165 #endif 166 167 #define osti_sprintf sprintf 168 169 #endif /* __OSTYPES_H__ */ 170