ostypes.h revision 285809
1142425Snectar/*******************************************************************************
2160814Ssimon*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3142425Snectar*
4142425Snectar*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5142425Snectar*that the following conditions are met:
6142425Snectar*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7142425Snectar*following disclaimer.
8142425Snectar*2. Redistributions in binary form must reproduce the above copyright notice,
9142425Snectar*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10142425Snectar*with the distribution.
11142425Snectar*
12142425Snectar*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13142425Snectar*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14142425Snectar*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15142425Snectar*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16142425Snectar*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17142425Snectar*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18142425Snectar*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19142425Snectar*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20142425Snectar*
21142425Snectar* $FreeBSD$
22142425Snectar*
23142425Snectar*******************************************************************************/
24142425Snectar/******************************************************************************
25142425Snectar
26142425SnectarNote:
27142425Snectar*******************************************************************************
28142425SnectarModule Name:
29142425Snectar  ostypes.h
30142425SnectarAbstract:
31142425Snectar  Request by fclayer for data type define.
32142425SnectarAuthors:
33142425Snectar  EW - Yiding(Eddie) Wang
34142425SnectarEnvironment:
35142425Snectar  Kernel or loadable module
36142425Snectar
37142425SnectarVersion Control Information:
38194206Ssimon  $ver. 1.0.0
39142425Snectar
40142425SnectarRevision History:
41142425Snectar  $Revision: 114125 $0.1.0
42142425Snectar  $Date: 2012-04-23 23:37:56 -0700 (Mon, 23 Apr 2012) $09-27-2001
43142425Snectar  $Modtime: 11/12/01 11:15a $15:56:00
44142425Snectar
45142425SnectarNotes:
46142425Snectar**************************** MODIFICATION HISTORY *****************************
47142425SnectarNAME     DATE         Rev.          DESCRIPTION
48142425Snectar----     ----         ----          -----------
49142425SnectarEW     09-16-2002     0.1.0     Header file for most constant definitions
50142425Snectar******************************************************************************/
51160814Ssimon
52160814Ssimon#ifndef __OSTYPES_H__
53142425Snectar#define __OSTYPES_H__
54142425Snectar
55142425Snectar#include <sys/types.h>
56142425Snectar#include <sys/kernel.h>
57142425Snectar
58142425Snectar
59142425Snectar/*
60142425Snectar** Included for Linux 2.4, built in kernel and other possible cases.
61142425Snectar*/
62142425Snectar/*
63142425Snectar#ifdef  TARGET_DRIVER
64142425Snectar#if !defined(AGBUILD_TFE_DRIVER) && !defined(COMBO_IBE_TFE_MODULE)
65142425Snectar#include "lxtgtdef.h"
66142425Snectar#endif
67160814Ssimon#endif
68142425Snectar*/
69142425Snectar/*
70142425Snectar** Included for possible lower layer ignorance.
71142425Snectar*/
72142425Snectar#include "osdebug.h"
73142425Snectar
74142425Snectar#ifdef  STATIC
75142425Snectar#undef  STATIC
76142425Snectar#endif
77142425Snectar
78142425Snectar#define STATIC
79142425Snectar
80142425Snectar#ifndef INLINE
81142425Snectar#define INLINE inline
82142425Snectar#endif
83142425Snectar
84160814Ssimon
85160814Ssimon#ifndef FORCEINLINE
86160814Ssimon#define FORCEINLINE
87142425Snectar//#define FORCEINLINE inline
88142425Snectar
89142425Snectar#endif
90142425Snectar#if defined (__amd64__)
91142425Snectar#define BITS_PER_LONG	    64
92160814Ssimon#else
93160814Ssimon#define BITS_PER_LONG	    32
94160814Ssimon#endif
95142425Snectar
96142425Snectar
97142425Snectartypedef unsigned char       bit8;
98142425Snectartypedef unsigned short      bit16;
99160814Ssimontypedef unsigned int        bit32;
100160814Ssimontypedef char                sbit8;
101160814Ssimontypedef short               sbit16;
102142425Snectartypedef int                 sbit32;
103142425Snectartypedef unsigned int        BOOLEAN;
104142425Snectartypedef unsigned long long  bit64;
105142425Snectartypedef long long           sbit64;
106142425Snectar
107160814Ssimon//typedef unsigned long long  bitptr;
108160814Ssimon#if 1
109160814Ssimon#if (BITS_PER_LONG == 64)
110142425Snectartypedef unsigned long long  bitptr;
111142425Snectar#else
112142425Snectartypedef unsigned long       bitptr;
113142425Snectar#endif
114142425Snectar#endif
115160814Ssimon
116160814Ssimontypedef char                S08;
117160814Ssimontypedef short               S16;
118142425Snectartypedef int                 S32;
119142425Snectartypedef long                S32_64;
120142425Snectartypedef long long           S64;
121142425Snectar
122142425Snectartypedef unsigned char       U08;
123142425Snectartypedef unsigned short      U16;
124160814Ssimontypedef unsigned int        U32;
125142425Snectartypedef unsigned long       U32_64;
126142425Snectartypedef unsigned long long  U64;
127142425Snectar
128142425Snectar/*
129142425Snectar** some really basic defines
130142425Snectar*/
131142425Snectar#define GLOBAL extern
132160814Ssimon#define LOCAL static
133160814Ssimon#ifndef TRUE
134160814Ssimon#define TRUE	1
135142425Snectar#define FALSE	0
136142425Snectar#endif
137142425Snectar#ifndef SUCCESS
138142425Snectar#define SUCCESS	0
139142425Snectar#define FAILURE	1
140160814Ssimon#endif
141160814Ssimon#ifndef NULL
142160814Ssimon#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