1 /******************************************************************************
3 * XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
4 * AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND
5 * SOLUTIONS FOR XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE,
6 * OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE,
7 * APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION
8 * THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
9 * AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
10 * FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY
11 * WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
12 * IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
13 * REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
14 * INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 * FOR A PARTICULAR PURPOSE.
17 * (c) Copyright 2002 Xilinx Inc.
18 * All rights reserved.
20 ******************************************************************************/
21 /*****************************************************************************/
26 * Defines common services that are typically found in a host operating.
27 * environment. This include file simply includes an OS specific file based
28 * on the compile-time constant BUILD_ENV_*, where * is the name of the target
31 * All services are defined as macros.
34 * MODIFICATION HISTORY:
36 * Ver Who Date Changes
37 * ----- ---- -------- -----------------------------------------------
38 * 1.00b ch 10/24/02 Added XENV_LINUX
39 * 1.00a rmm 04/17/02 First release
42 ******************************************************************************/
44 #ifndef XENV_H /* prevent circular inclusions */
45 #define XENV_H /* by using protection macros */
52 * Select which target environment we are operating under
55 /* VxWorks target environment */
56 #if defined XENV_VXWORKS
57 #include "xenv_vxworks.h"
59 /* Linux target environment */
60 #elif defined XENV_LINUX
61 #include "xenv_linux.h"
63 /* Unit test environment */
64 #elif defined XENV_UNITTEST
67 /* Integration test environment */
68 #elif defined XENV_INTTEST
71 /* Standalone environment selected */
73 #include "xenv_standalone.h"
78 * The following comments specify the types and macro wrappers that are
79 * expected to be defined by the target specific header files
82 /**************************** Type Definitions *******************************/
84 /*****************************************************************************/
89 * A structure that contains a time stamp used by other time stamp macros
90 * defined below. This structure is processor dependent.
94 /***************** Macros (Inline Functions) Definitions *********************/
96 /*****************************************************************************/
99 * XENV_MEM_COPY(void *DestPtr, void *SrcPtr, unsigned Bytes)
101 * Copies a non-overlapping block of memory.
103 * @param DestPtr is the destination address to copy data to.
104 * @param SrcPtr is the source address to copy data from.
105 * @param Bytes is the number of bytes to copy.
110 /*****************************************************************************/
113 * XENV_MEM_FILL(void *DestPtr, char Data, unsigned Bytes)
115 * Fills an area of memory with constant data.
117 * @param DestPtr is the destination address to set.
118 * @param Data contains the value to set.
119 * @param Bytes is the number of bytes to set.
123 /*****************************************************************************/
126 * XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
128 * Samples the processor's or external timer's time base counter.
130 * @param StampPtr is the storage for the retrieved time stamp.
135 /*****************************************************************************/
138 * XENV_TIME_STAMP_DELTA_US(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
140 * Computes the delta between the two time stamps.
142 * @param Stamp1Ptr - First sampled time stamp.
143 * @param Stamp1Ptr - Sedond sampled time stamp.
145 * @return An unsigned int value with units of microseconds.
148 /*****************************************************************************/
151 * XENV_TIME_STAMP_DELTA_MS(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
153 * Computes the delta between the two time stamps.
155 * @param Stamp1Ptr - First sampled time stamp.
156 * @param Stamp1Ptr - Sedond sampled time stamp.
158 * @return An unsigned int value with units of milliseconds.
161 /*****************************************************************************//**
163 * XENV_USLEEP(unsigned delay)
165 * Delay the specified number of microseconds.
167 * @param delay is the number of microseconds to delay.
176 #endif /* end of protection macro */