1 |
5 |
quickwayne |
/******************************************************************************
|
2 |
|
|
*
|
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.
|
16 |
|
|
*
|
17 |
|
|
* (c) Copyright 2002 Xilinx Inc.
|
18 |
|
|
* All rights reserved.
|
19 |
|
|
*
|
20 |
|
|
******************************************************************************/
|
21 |
|
|
/*****************************************************************************/
|
22 |
|
|
/**
|
23 |
|
|
*
|
24 |
|
|
* @file xenv.h
|
25 |
|
|
*
|
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
|
29 |
|
|
* environment.
|
30 |
|
|
*
|
31 |
|
|
* All services are defined as macros.
|
32 |
|
|
*
|
33 |
|
|
* <pre>
|
34 |
|
|
* MODIFICATION HISTORY:
|
35 |
|
|
*
|
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
|
40 |
|
|
* </pre>
|
41 |
|
|
*
|
42 |
|
|
******************************************************************************/
|
43 |
|
|
|
44 |
|
|
#ifndef XENV_H /* prevent circular inclusions */
|
45 |
|
|
#define XENV_H /* by using protection macros */
|
46 |
|
|
|
47 |
|
|
/*
|
48 |
|
|
* Select which target environment we are operating under
|
49 |
|
|
*/
|
50 |
|
|
|
51 |
|
|
/* VxWorks target environment */
|
52 |
|
|
#if defined XENV_VXWORKS
|
53 |
|
|
#include "xenv_vxworks.h"
|
54 |
|
|
|
55 |
|
|
/* Linux target environment */
|
56 |
|
|
#elif defined XENV_LINUX
|
57 |
|
|
#include "xenv_linux.h"
|
58 |
|
|
|
59 |
|
|
/* Unit test environment */
|
60 |
|
|
#elif defined XENV_UNITTEST
|
61 |
|
|
#include "ut_xenv.h"
|
62 |
|
|
|
63 |
|
|
/* Integration test environment */
|
64 |
|
|
#elif defined XENV_INTTEST
|
65 |
|
|
#include "int_xenv.h"
|
66 |
|
|
|
67 |
|
|
/* No environment selected */
|
68 |
|
|
#else
|
69 |
|
|
#include "xenv_none.h"
|
70 |
|
|
#endif
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
/*
|
74 |
|
|
* The following comments specify the types and macro wrappers that are
|
75 |
|
|
* expected to be defined by the target specific header files
|
76 |
|
|
*/
|
77 |
|
|
|
78 |
|
|
/**************************** Type Definitions *******************************/
|
79 |
|
|
|
80 |
|
|
/*****************************************************************************/
|
81 |
|
|
/**
|
82 |
|
|
*
|
83 |
|
|
* XENV_TIME_STAMP
|
84 |
|
|
*
|
85 |
|
|
* A structure that contains a time stamp used by other time stamp macros
|
86 |
|
|
* defined below. This structure is processor dependent.
|
87 |
|
|
*/
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
/***************** Macros (Inline Functions) Definitions *********************/
|
91 |
|
|
|
92 |
|
|
/*****************************************************************************/
|
93 |
|
|
/**
|
94 |
|
|
*
|
95 |
|
|
* XENV_MEM_COPY(void *DestPtr, void *SrcPtr, unsigned Bytes)
|
96 |
|
|
*
|
97 |
|
|
* Copies a non-overlapping block of memory.
|
98 |
|
|
*
|
99 |
|
|
* @param DestPtr is the destination address to copy data to.
|
100 |
|
|
* @param SrcPtr is the source address to copy data from.
|
101 |
|
|
* @param Bytes is the number of bytes to copy.
|
102 |
|
|
*
|
103 |
|
|
* @return None
|
104 |
|
|
*/
|
105 |
|
|
|
106 |
|
|
/*****************************************************************************/
|
107 |
|
|
/**
|
108 |
|
|
*
|
109 |
|
|
* XENV_MEM_FILL(void *DestPtr, char Data, unsigned Bytes)
|
110 |
|
|
*
|
111 |
|
|
* Fills an area of memory with constant data.
|
112 |
|
|
*
|
113 |
|
|
* @param DestPtr is the destination address to set.
|
114 |
|
|
* @param Data contains the value to set.
|
115 |
|
|
* @param Bytes is the number of bytes to set.
|
116 |
|
|
*
|
117 |
|
|
* @return None
|
118 |
|
|
*/
|
119 |
|
|
/*****************************************************************************/
|
120 |
|
|
/**
|
121 |
|
|
*
|
122 |
|
|
* XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
|
123 |
|
|
*
|
124 |
|
|
* Samples the processor's or external timer's time base counter.
|
125 |
|
|
*
|
126 |
|
|
* @param StampPtr is the storage for the retrieved time stamp.
|
127 |
|
|
*
|
128 |
|
|
* @return None
|
129 |
|
|
*/
|
130 |
|
|
|
131 |
|
|
/*****************************************************************************/
|
132 |
|
|
/**
|
133 |
|
|
*
|
134 |
|
|
* XENV_TIME_STAMP_DELTA_US(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
|
135 |
|
|
*
|
136 |
|
|
* Computes the delta between the two time stamps.
|
137 |
|
|
*
|
138 |
|
|
* @param Stamp1Ptr - First sampled time stamp.
|
139 |
|
|
* @param Stamp1Ptr - Sedond sampled time stamp.
|
140 |
|
|
*
|
141 |
|
|
* @return An unsigned int value with units of microseconds.
|
142 |
|
|
*/
|
143 |
|
|
|
144 |
|
|
/*****************************************************************************/
|
145 |
|
|
/**
|
146 |
|
|
*
|
147 |
|
|
* XENV_TIME_STAMP_DELTA_MS(XTIME_STAMP *Stamp1Ptr, XTIME_STAMP* Stamp2Ptr)
|
148 |
|
|
*
|
149 |
|
|
* Computes the delta between the two time stamps.
|
150 |
|
|
*
|
151 |
|
|
* @param Stamp1Ptr - First sampled time stamp.
|
152 |
|
|
* @param Stamp1Ptr - Sedond sampled time stamp.
|
153 |
|
|
*
|
154 |
|
|
* @return An unsigned int value with units of milliseconds.
|
155 |
|
|
*/
|
156 |
|
|
|
157 |
|
|
/*****************************************************************************//**
|
158 |
|
|
*
|
159 |
|
|
* XENV_USLEEP(unsigned delay)
|
160 |
|
|
*
|
161 |
|
|
* Delay the specified number of microseconds.
|
162 |
|
|
*
|
163 |
|
|
* @param delay is the number of microseconds to delay.
|
164 |
|
|
*
|
165 |
|
|
* @return None
|
166 |
|
|
*/
|
167 |
|
|
|
168 |
|
|
#endif /* end of protection macro */
|
169 |
|
|
|