1285809Sscottl/*******************************************************************************
2285809Sscottl*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3285809Sscottl*
4285809Sscottl*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5285809Sscottl*that the following conditions are met:
6285809Sscottl*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7285809Sscottl*following disclaimer.
8285809Sscottl*2. Redistributions in binary form must reproduce the above copyright notice,
9285809Sscottl*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10285809Sscottl*with the distribution.
11285809Sscottl*
12285809Sscottl*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13285809Sscottl*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14285809Sscottl*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15285809Sscottl*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16285809Sscottl*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17285809Sscottl*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18285809Sscottl*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19285809Sscottl*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20285809Sscottl*
21285809Sscottl* $FreeBSD$
22285809Sscottl*
23285809Sscottl*******************************************************************************/
24285809Sscottl/***************************************************************************
25285809Sscottl
26285809SscottlVersion Control Information:
27285809Sscottl
28285809Sscottl$RCSfile: osenv.h,v $
29285809Sscottl$Revision: 114125 $
30285809Sscottl
31285809SscottlNote:  This file defines the working enviornment of the system.  All
32285809Sscottl       defines listed in this file could also be compiler flags.
33285809Sscottl       I am listing all the defines (even if used as a compiler flag)
34285809Sscottl       so that they can be seen and documented.
35285809Sscottl***************************************************************************/
36285809Sscottl
37285809Sscottl#ifndef __OSENV_H__
38285809Sscottl#define __OSENV_H__
39285809Sscottl#include <dev/pms/freebsd/driver/common/osstring.h>
40285809Sscottl
41285809Sscottl/*
42285809Sscottl** Define the protocols to compile with.  Currently, these defines are
43285809Sscottl** only for this header file and are used further down to define the protocol
44285809Sscottl** specific enviornment:
45285809Sscottl**
46285809Sscottl**      #define AG_PROTOCOL_ISCSI
47285809Sscottl**      #define AG_PROTOCOL_FC
48285809Sscottl*/
49285809Sscottl
50285809Sscottl/*
51285809Sscottl** Define the application types:
52285809Sscottl**
53285809Sscottl**      #define INITIATOR_DRIVER
54285809Sscottl**      #define TARGET_DRIVER
55285809Sscottl*/
56285809Sscottl
57285809Sscottl/*
58285809Sscottl** Define the endian-ness of the host CPU using one of the following:
59285809Sscottl**
60285809Sscottl**      #define AG_CPU_LITTLE_ENDIAN
61285809Sscottl**      #define AG_CPU_BIG_ENDIAN
62285809Sscottl*/
63285809Sscottl
64285809Sscottl/*
65285809Sscottl** Define the host CPU word size
66285809Sscottl**
67285809Sscottl**      #define AG_CPU_32_BIT
68285809Sscottl**      #define AG_CPU_64_BIT
69285809Sscottl**
70285809Sscottl*/
71285809Sscottl#ifdef CONFIG_IA64
72285809Sscottl#define AG_CPU_64_BIT
73285809Sscottl#else
74285809Sscottl#define AG_CPU_32_BIT
75285809Sscottl#endif
76285809Sscottl
77285809Sscottl/*
78285809Sscottl** The following allow the code to use defines for word alignment and adding
79285809Sscottl** to allow for 32bit and 64bit system differences.
80285809Sscottl*/
81285809Sscottl#ifdef AG_CPU_32_BIT
82285809Sscottl#define AG_WORD_ALIGN_ADD      3
83285809Sscottl#define AG_WORD_ALIGN_MASK     0xfffffffc
84285809Sscottl#else
85285809Sscottl#define AG_WORD_ALIGN_ADD      7
86285809Sscottl#define AG_WORD_ALIGN_MASK     0xfffffff8
87285809Sscottl#endif
88285809Sscottl
89285809Sscottl/***************************************************************************
90285809SscottliSCSI enviornment - The following is used for compiling the iSCSI
91285809Sscottl                     protocol.
92285809Sscottl**************************************************************************/
93285809Sscottl
94285809Sscottl/*
95285809Sscottl** Define the existance of an external bus swapper using on of the
96285809Sscottl** following:
97285809Sscottl**
98285809Sscottl**      #define AG_SWAPPING_BUS
99285809Sscottl**      #define AG_NON_SWAPPING_BUS
100285809Sscottl**
101285809Sscottl*/
102285809Sscottl
103285809Sscottl/*
104285809Sscottl** Define the use of cache memory for message system:
105285809Sscottl**
106285809Sscottl**      #define AG_CACHED_MSG_SYSTEM
107285809Sscottl**
108285809Sscottl*/
109285809Sscottl/* #define AG_CACHED_MSG_SYSTEM */
110285809Sscottl
111285809Sscottl/***************************************************************************
112285809SscottlFC enviornment - The following is used for compiling the FC protocol.
113285809Sscottl**************************************************************************/
114285809Sscottl
115285809Sscottl/*
116285809Sscottl** Define if an PMC-Sierra card is being used:
117285809Sscottl**
118285809Sscottl**      #define CCFLAGS_PMC_SIERRA_BOARD
119285809Sscottl**
120285809Sscottl*/
121285809Sscottl
122285809Sscottl/*
123285809Sscottl** Define if the TSDK is being used:
124285809Sscottl**
125285809Sscottl**      #define FCLayer_Tsdk
126285809Sscottl**
127285809Sscottl*/
128285809Sscottl
129285809Sscottl/*
130285809Sscottl** The following defines are not changed directly, but use either previous
131285809Sscottl** defines, or compiler directives.
132285809Sscottl**
133285809Sscottl*/
134285809Sscottl#ifdef AG_CPU_LITTLE_ENDIAN
135285809Sscottl#define FC_DMA_LITTLE_ENDIAN
136285809Sscottl#define FC_CPU_LITTLE_ENDIAN
137285809Sscottl#define SA_DMA_LITTLE_ENDIAN
138285809Sscottl#define SA_CPU_LITTLE_ENDIAN
139285809Sscottl#endif
140285809Sscottl
141285809Sscottl#ifdef AG_CPU_BIG_ENDIAN
142285809Sscottl#define FC_DMA_BIG_ENDIAN
143285809Sscottl#define FC_CPU_BIG_ENDIAN
144285809Sscottl#define SA_DMA_BIG_ENDIAN
145285809Sscottl#define SA_CPU_BIG_ENDIAN
146285809Sscottl#endif
147285809Sscottl
148285809Sscottl/* warning: leave this next line as-is.  it is used for FC-Layer testing      */
149285809Sscottl#undef   FC_CHECKMACRO
150285809Sscottl
151285809Sscottl#endif /* __OSENV_H__ */
152