[processor-sdk/open-amp.git] / obsolete / system / zynqmp_r5 / generic / xil_standalone_lib / xenv.h
1 /******************************************************************************
2 *
3 * Copyright (C) 2002 - 2014 Xilinx, Inc. All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
30 *
31 ******************************************************************************/
32 /*****************************************************************************/
33 /**
34 *
35 * @file xenv.h
36 *
37 * Defines common services that are typically found in a host operating.
38 * environment. This include file simply includes an OS specific file based
39 * on the compile-time constant BUILD_ENV_*, where * is the name of the target
40 * environment.
41 *
42 * All services are defined as macros.
43 *
44 * <pre>
45 * MODIFICATION HISTORY:
46 *
47 * Ver Who Date Changes
48 * ----- ---- -------- -----------------------------------------------
49 * 1.00b ch 10/24/02 Added XENV_LINUX
50 * 1.00a rmm 04/17/02 First release
51 * </pre>
52 *
53 ******************************************************************************/
55 #ifndef XENV_H /* prevent circular inclusions */
56 #define XENV_H /* by using protection macros */
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
62 /*
63 * Select which target environment we are operating under
64 */
66 /* VxWorks target environment */
67 #if defined XENV_VXWORKS
68 #include "xenv_vxworks.h"
70 /* Linux target environment */
71 #elif defined XENV_LINUX
72 #include "xenv_linux.h"
74 /* Unit test environment */
75 #elif defined XENV_UNITTEST
76 #include "ut_xenv.h"
78 /* Integration test environment */
79 #elif defined XENV_INTTEST
80 #include "int_xenv.h"
82 /* Standalone environment selected */
83 #else
84 #include "xenv_standalone.h"
85 #endif
88 /*
89 * The following comments specify the types and macro wrappers that are
90 * expected to be defined by the target specific header files
91 */
93 /**************************** Type Definitions *******************************/
95 /*****************************************************************************/
96 /**
97 *
98 * XENV_TIME_STAMP
99 *
100 * A structure that contains a time stamp used by other time stamp macros
101 * defined below. This structure is processor dependent.
102 */
105 /***************** Macros (Inline Functions) Definitions *********************/
107 /*****************************************************************************/
108 /**
109 *
110 * XENV_MEM_COPY(void *DestPtr, void *SrcPtr, unsigned Bytes)
111 *
112 * Copies a non-overlapping block of memory.
113 *
114 * @param DestPtr is the destination address to copy data to.
115 * @param SrcPtr is the source address to copy data from.
116 * @param Bytes is the number of bytes to copy.
117 *
118 * @return None
119 */
121 /*****************************************************************************/
122 /**
123 *
124 * XENV_MEM_FILL(void *DestPtr, char Data, unsigned Bytes)
125 *
126 * Fills an area of memory with constant data.
127 *
128 * @param DestPtr is the destination address to set.
129 * @param Data contains the value to set.
130 * @param Bytes is the number of bytes to set.
131 *
132 * @return None
133 */
134 /*****************************************************************************/
135 /**
136 *
137 * XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
138 *
139 * Samples the processor's or external timer's time base counter.
140 *
141 * @param StampPtr is the storage for the retrieved time stamp.
142 *
143 * @return None
144 */
146 /*****************************************************************************/
147 /**
148 *
149 * XENV_TIME_STAMP_DELTA_US(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
150 *
151 * Computes the delta between the two time stamps.
152 *
153 * @param Stamp1Ptr - First sampled time stamp.
154 * @param Stamp1Ptr - Sedond sampled time stamp.
155 *
156 * @return An unsigned int value with units of microseconds.
157 */
159 /*****************************************************************************/
160 /**
161 *
162 * XENV_TIME_STAMP_DELTA_MS(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
163 *
164 * Computes the delta between the two time stamps.
165 *
166 * @param Stamp1Ptr - First sampled time stamp.
167 * @param Stamp1Ptr - Sedond sampled time stamp.
168 *
169 * @return An unsigned int value with units of milliseconds.
170 */
172 /*****************************************************************************//**
173 *
174 * XENV_USLEEP(unsigned delay)
175 *
176 * Delay the specified number of microseconds.
177 *
178 * @param delay is the number of microseconds to delay.
179 *
180 * @return None
181 */
183 #ifdef __cplusplus
184 }
185 #endif
187 #endif /* end of protection macro */