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 * $FreeBSD$ 22 * 23 *******************************************************************************/ 24 /****************************************************************************** 25 26 Note: 27 ******************************************************************************* 28 Module Name: 29 ostypes.h 30 Abstract: 31 Request by fclayer for data type define. 32 Authors: 33 EW - Yiding(Eddie) Wang 34 Environment: 35 Kernel or loadable module 36 37 Version Control Information: 38 $ver. 1.0.0 39 40 Revision History: 41 $Revision: 114125 $0.1.0 42 $Date: 2012-04-23 23:37:56 -0700 (Mon, 23 Apr 2012) $09-27-2001 43 $Modtime: 11/12/01 11:15a $15:56:00 44 45 Notes: 46 **************************** MODIFICATION HISTORY ***************************** 47 NAME DATE Rev. DESCRIPTION 48 ---- ---- ---- ----------- 49 EW 09-16-2002 0.1.0 Header file for most constant definitions 50 ******************************************************************************/ 51 52 #ifndef __OSTYPES_H__ 53 #define __OSTYPES_H__ 54 55 #include <sys/types.h> 56 #include <sys/kernel.h> 57 58 59 /* 60 ** Included for Linux 2.4, built in kernel and other possible cases. 61 */ 62 /* 63 #ifdef TARGET_DRIVER 64 #if !defined(AGBUILD_TFE_DRIVER) && !defined(COMBO_IBE_TFE_MODULE) 65 #include "lxtgtdef.h" 66 #endif 67 #endif 68 */ 69 /* 70 ** Included for possible lower layer ignorance. 71 */ 72 #include "osdebug.h" 73 74 #ifdef STATIC 75 #undef STATIC 76 #endif 77 78 #define STATIC 79 80 #ifndef INLINE 81 #define INLINE inline 82 #endif 83 84 85 #ifndef FORCEINLINE 86 #define FORCEINLINE 87 //#define FORCEINLINE inline 88 89 #endif 90 #if defined (__amd64__) 91 #define BITS_PER_LONG 64 92 #else 93 #define BITS_PER_LONG 32 94 #endif 95 96 97 typedef unsigned char bit8; 98 typedef unsigned short bit16; 99 typedef unsigned int bit32; 100 typedef char sbit8; 101 typedef short sbit16; 102 typedef int sbit32; 103 typedef unsigned int BOOLEAN; 104 typedef unsigned long long bit64; 105 typedef long long sbit64; 106 107 //typedef unsigned long long bitptr; 108 #if 1 109 #if (BITS_PER_LONG == 64) 110 typedef unsigned long long bitptr; 111 #else 112 typedef unsigned long bitptr; 113 #endif 114 #endif 115 116 typedef char S08; 117 typedef short S16; 118 typedef int S32; 119 typedef long S32_64; 120 typedef long long S64; 121 122 typedef unsigned char U08; 123 typedef unsigned short U16; 124 typedef unsigned int U32; 125 typedef unsigned long U32_64; 126 typedef unsigned long long U64; 127 128 /* 129 ** some really basic defines 130 */ 131 #define GLOBAL extern 132 #define LOCAL static 133 #ifndef TRUE 134 #define TRUE 1 135 #define FALSE 0 136 #endif 137 #ifndef SUCCESS 138 #define SUCCESS 0 139 #define FAILURE 1 140 #endif 141 #ifndef NULL 142 #define NULL ((void*)0) 143 #endif 144 145 146 #define agBOOLEAN BOOLEAN 147 #define osGLOBAL GLOBAL 148 #define osLOCAL LOCAL 149 #define agTRUE TRUE 150 #define agFALSE FALSE 151 #define agNULL NULL 152 153 #define AGTIAPI_UNKNOWN 2 154 #define AGTIAPI_SUCCESS 1 155 #define AGTIAPI_FAIL 0 156 157 #define AGTIAPI_DRIVER_VERSION "1.4.0.10800" 158 159 /*************************************************************************** 160 **************************************************************************** 161 * MACROS - some basic macros 162 **************************************************************************** 163 ***************************************************************************/ 164 #ifndef BIT 165 #define BIT(x) (1<<x) 166 #endif 167 168 #define osti_sprintf sprintf 169 170 #endif /* __OSTYPES_H__ */ 171