xref: /freebsd/sys/dev/mpt/mpilib/mpi_type.h (revision 780fb4a2)
1 /* $FreeBSD$ */
2 /*-
3  * SPDX-License-Identifier: BSD-3-Clause
4  *
5  * Copyright (c) 2000-2010, LSI Logic Corporation and its contributors.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14  *    substantially similar to the "NO WARRANTY" disclaimer below
15  *    ("Disclaimer") and any redistribution must be conditioned upon including
16  *    a substantially similar Disclaimer requirement for further binary
17  *    redistribution.
18  * 3. Neither the name of the LSI Logic Corporation nor the names of its
19  *    contributors may be used to endorse or promote products derived from
20  *    this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
32  * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  *
35  *           Name:  mpi_type.h
36  *          Title:  MPI Basic type definitions
37  *  Creation Date:  June 6, 2000
38  *
39  *    mpi_type.h Version:  01.05.02
40  *
41  *  Version History
42  *  ---------------
43  *
44  *  Date      Version   Description
45  *  --------  --------  ------------------------------------------------------
46  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
47  *  06-06-00  01.00.01  Update version number for 1.0 release.
48  *  11-02-00  01.01.01  Original release for post 1.0 work
49  *  02-20-01  01.01.02  Added define and ifdef for MPI_POINTER.
50  *  08-08-01  01.02.01  Original release for v1.2 work.
51  *  05-11-04  01.03.01  Original release for MPI v1.3.
52  *  08-19-04  01.05.01  Original release for MPI v1.5.
53  *  08-30-05  01.05.02  Added PowerPC option to #ifdef's.
54  *  --------------------------------------------------------------------------
55  */
56 
57 #ifndef MPI_TYPE_H
58 #define MPI_TYPE_H
59 
60 
61 /*******************************************************************************
62  * Define MPI_POINTER if it hasn't already been defined. By default MPI_POINTER
63  * is defined to be a near pointer. MPI_POINTER can be defined as a far pointer
64  * by defining MPI_POINTER as "far *" before this header file is included.
65  */
66 #ifndef MPI_POINTER
67 #define MPI_POINTER     *
68 #endif
69 
70 
71 /*****************************************************************************
72 *
73 *               B a s i c    T y p e s
74 *
75 *****************************************************************************/
76 
77 typedef signed   char   S8;
78 typedef unsigned char   U8;
79 typedef signed   short  S16;
80 typedef unsigned short  U16;
81 
82 #ifdef	__FreeBSD__
83 
84 typedef int32_t  S32;
85 typedef uint32_t U32;
86 
87 #else
88 
89 #if defined(__unix__) || defined(__arm) || defined(ALPHA) || defined(__PPC__) || defined(__ppc)
90 
91     typedef signed   int   S32;
92     typedef unsigned int   U32;
93 
94 #else
95 
96     typedef signed   long  S32;
97     typedef unsigned long  U32;
98 
99 #endif
100 #endif
101 
102 
103 typedef struct _S64
104 {
105     U32          Low;
106     S32          High;
107 } S64;
108 
109 typedef struct _U64
110 {
111     U32          Low;
112     U32          High;
113 } U64;
114 
115 
116 /****************************************************************************/
117 /*  Pointers                                                                */
118 /****************************************************************************/
119 
120 typedef S8      *PS8;
121 typedef U8      *PU8;
122 typedef S16     *PS16;
123 typedef U16     *PU16;
124 typedef S32     *PS32;
125 typedef U32     *PU32;
126 typedef S64     *PS64;
127 typedef U64     *PU64;
128 
129 
130 #endif
131 
132