xref: /freebsd/sys/dev/mpi3mr/mpi/mpi30_type.h (revision 92f340d137ba5d6db7610ba1dae35842e2c9c8ea)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2016-2025, Broadcom Inc. All rights reserved.
5  * Support: <fbsd-storage-driver.pdl@broadcom.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation and/or other
15  *    materials provided with the distribution.
16  * 3. Neither the name of the Broadcom Inc. nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software without
18  *    specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing
34  * official policies,either expressed or implied, of the FreeBSD Project.
35  *
36  * Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131
37  *
38  * Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD
39  *
40  */
41 
42 #ifndef MPI30_TYPE_H
43 #define MPI30_TYPE_H     1
44 
45 /*****************************************************************************
46  * Define MPI3_POINTER if it has not already been defined. By default        *
47  * MPI3_POINTER is defined to be a near pointer. MPI3_POINTER can be defined *
48  * as a far pointer by defining MPI3_POINTER as "far *" before this header   *
49  * file is included.                                                         *
50  ****************************************************************************/
51 #ifndef MPI3_POINTER
52 #define MPI3_POINTER    *
53 #endif  /* MPI3_POINTER */
54 
55 /* The basic types may have already been included by mpi_type.h or mpi2_type.h */
56 #if !defined(MPI_TYPE_H) && !defined(MPI2_TYPE_H)
57 /*****************************************************************************
58  *              Basic Types                                                  *
59  ****************************************************************************/
60 typedef int8_t      S8;
61 typedef uint8_t     U8;
62 typedef int16_t     S16;
63 typedef uint16_t    U16;
64 typedef int32_t     S32;
65 typedef uint32_t    U32;
66 typedef int64_t     S64;
67 typedef uint64_t    U64;
68 
69 /*****************************************************************************
70  *              Structure Types                                              *
71  ****************************************************************************/
72 typedef struct _S64struct
73 {
74     U32         Low;
75     S32         High;
76 } S64struct;
77 
78 typedef struct _U64struct
79 {
80     U32         Low;
81     U32         High;
82 } U64struct;
83 
84 /*****************************************************************************
85  *              Pointer Types                                                *
86  ****************************************************************************/
87 typedef S8          *PS8;
88 typedef U8          *PU8;
89 typedef S16         *PS16;
90 typedef U16         *PU16;
91 typedef S32         *PS32;
92 typedef U32         *PU32;
93 typedef S64         *PS64;
94 typedef U64         *PU64;
95 typedef S64struct   *PS64struct;
96 typedef U64struct   *PU64struct;
97 #endif  /* MPI_TYPE_H && MPI2_TYPE_H */
98 
99 #endif  /* MPI30_TYPE_H */
100