1 /******************************************************************************
3 * Copyright (C) 2002 - 2015 Xilinx, Inc. All rights reserved.
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:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
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.
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
22 * XILINX 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
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.
31 ******************************************************************************/
32 /*****************************************************************************/
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
42 * All services are defined as macros.
45 * MODIFICATION HISTORY:
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
53 ******************************************************************************/
55 #ifndef XENV_H /* prevent circular inclusions */
56 #define XENV_H /* by using protection macros */
63 * Select which target environment we are operating under
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
78 /* Integration test environment */
79 #elif defined XENV_INTTEST
82 /* Standalone environment selected */
84 #include "xenv_standalone.h"
89 * The following comments specify the types and macro wrappers that are
90 * expected to be defined by the target specific header files
93 /**************************** Type Definitions *******************************/
95 /*****************************************************************************/
100 * A structure that contains a time stamp used by other time stamp macros
101 * defined below. This structure is processor dependent.
105 /***************** Macros (Inline Functions) Definitions *********************/
107 /*****************************************************************************/
110 * XENV_MEM_COPY(void *DestPtr, void *SrcPtr, unsigned Bytes)
112 * Copies a non-overlapping block of memory.
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.
121 /*****************************************************************************/
124 * XENV_MEM_FILL(void *DestPtr, char Data, unsigned Bytes)
126 * Fills an area of memory with constant data.
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.
134 /*****************************************************************************/
137 * XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
139 * Samples the processor's or external timer's time base counter.
141 * @param StampPtr is the storage for the retrieved time stamp.
146 /*****************************************************************************/
149 * XENV_TIME_STAMP_DELTA_US(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
151 * Computes the delta between the two time stamps.
153 * @param Stamp1Ptr - First sampled time stamp.
154 * @param Stamp1Ptr - Sedond sampled time stamp.
156 * @return An unsigned int value with units of microseconds.
159 /*****************************************************************************/
162 * XENV_TIME_STAMP_DELTA_MS(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
164 * Computes the delta between the two time stamps.
166 * @param Stamp1Ptr - First sampled time stamp.
167 * @param Stamp1Ptr - Sedond sampled time stamp.
169 * @return An unsigned int value with units of milliseconds.
172 /*****************************************************************************//**
174 * XENV_USLEEP(unsigned delay)
176 * Delay the specified number of microseconds.
178 * @param delay is the number of microseconds to delay.
187 #endif /* end of protection macro */