1 /****************************************************************************
3 (c) SYSTEC electronic GmbH, D-07973 Greiz, August-Bebel-Str. 29
4 www.systec-electronic.com
8 Description: header file for benchmarking
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
19 2. Redistributions in binary form must reproduce the above copyright
20 notice, this list of conditions and the following disclaimer in the
21 documentation and/or other materials provided with the distribution.
23 3. Neither the name of SYSTEC electronic GmbH nor the names of its
24 contributors may be used to endorse or promote products derived
25 from this software without prior written permission. For written
26 permission, please contact info@systec-electronic.com.
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 POSSIBILITY OF SUCH DAMAGE.
43 If a provision of this License is or becomes illegal, invalid or
44 unenforceable in any jurisdiction, that shall not affect:
45 1. the validity or enforceability in that jurisdiction of any other
46 provision of this License; or
47 2. the validity or enforceability in other jurisdictions of that or
48 any other provision of this License.
50 -------------------------------------------------------------------------
52 $RCSfile: Benchmark.h,v $
56 $Revision: 1.5 $ $Date: 2008/04/17 21:36:32 $
63 -------------------------------------------------------------------------
67 2006/08/16 d.k.: start of implementation
69 ****************************************************************************/
76 #include <linux/kernel.h>
78 #ifdef CONFIG_COLDFIRE
79 #include <asm/coldfire.h>
80 #include <asm/m5485gpio.h>
82 #define BENCHMARK_SET(x) MCF_GPIO_PODR_PCIBG |= (1 << (x)) // (x+1)
83 #define BENCHMARK_RESET(x) MCF_GPIO_PODR_PCIBG &= ~(1 << (x)) // (x+1)
84 #define BENCHMARK_TOGGLE(x) MCF_GPIO_PODR_PCIBR ^= (1 << (x - 5))
86 #undef BENCHMARK_MODULES
87 #define BENCHMARK_MODULES 0x00000000
90 /***************************************************************************/
93 /* G L O B A L D E F I N I T I O N S */
96 /***************************************************************************/
98 //---------------------------------------------------------------------------
100 //---------------------------------------------------------------------------
102 #ifndef BENCHMARK_MODULES
103 #define BENCHMARK_MODULES 0x00000000
106 #define BENCHMARK_MOD_01 0x00000001
107 #define BENCHMARK_MOD_02 0x00000002
108 #define BENCHMARK_MOD_03 0x00000004
109 #define BENCHMARK_MOD_04 0x00000008
110 #define BENCHMARK_MOD_05 0x00000010
111 #define BENCHMARK_MOD_06 0x00000020
112 #define BENCHMARK_MOD_07 0x00000040
113 #define BENCHMARK_MOD_08 0x00000080
114 #define BENCHMARK_MOD_09 0x00000100
115 #define BENCHMARK_MOD_10 0x00000200
116 #define BENCHMARK_MOD_11 0x00000400
117 #define BENCHMARK_MOD_12 0x00000800
118 #define BENCHMARK_MOD_13 0x00001000
119 #define BENCHMARK_MOD_14 0x00002000
120 #define BENCHMARK_MOD_15 0x00004000
121 #define BENCHMARK_MOD_16 0x00008000
122 #define BENCHMARK_MOD_17 0x00010000
123 #define BENCHMARK_MOD_18 0x00020000
124 #define BENCHMARK_MOD_19 0x00040000
125 #define BENCHMARK_MOD_20 0x00080000
126 #define BENCHMARK_MOD_21 0x00100000
127 #define BENCHMARK_MOD_22 0x00200000
128 #define BENCHMARK_MOD_23 0x00400000
129 #define BENCHMARK_MOD_24 0x00800000
130 #define BENCHMARK_MOD_25 0x01000000
131 #define BENCHMARK_MOD_26 0x02000000
132 #define BENCHMARK_MOD_27 0x04000000
133 #define BENCHMARK_MOD_28 0x08000000
134 #define BENCHMARK_MOD_29 0x10000000
135 #define BENCHMARK_MOD_30 0x20000000
136 #define BENCHMARK_MOD_31 0x40000000
137 #define BENCHMARK_MOD_32 0x80000000
139 #if (BENCHMARK_MODULES & BENCHMARK_MOD_01)
140 #define BENCHMARK_MOD_01_SET(x) BENCHMARK_SET(x)
141 #define BENCHMARK_MOD_01_RESET(x) BENCHMARK_RESET(x)
142 #define BENCHMARK_MOD_01_TOGGLE(x) BENCHMARK_TOGGLE(x)
144 #define BENCHMARK_MOD_01_SET(x)
145 #define BENCHMARK_MOD_01_RESET(x)
146 #define BENCHMARK_MOD_01_TOGGLE(x)
149 #if (BENCHMARK_MODULES & BENCHMARK_MOD_02)
150 #define BENCHMARK_MOD_02_SET(x) BENCHMARK_SET(x)
151 #define BENCHMARK_MOD_02_RESET(x) BENCHMARK_RESET(x)
152 #define BENCHMARK_MOD_02_TOGGLE(x) BENCHMARK_TOGGLE(x)
154 #define BENCHMARK_MOD_02_SET(x)
155 #define BENCHMARK_MOD_02_RESET(x)
156 #define BENCHMARK_MOD_02_TOGGLE(x)
159 #if (BENCHMARK_MODULES & BENCHMARK_MOD_03)
160 #define BENCHMARK_MOD_03_SET(x) BENCHMARK_SET(x)
161 #define BENCHMARK_MOD_03_RESET(x) BENCHMARK_RESET(x)
162 #define BENCHMARK_MOD_03_TOGGLE(x) BENCHMARK_TOGGLE(x)
164 #define BENCHMARK_MOD_03_SET(x)
165 #define BENCHMARK_MOD_03_RESET(x)
166 #define BENCHMARK_MOD_03_TOGGLE(x)
169 #if (BENCHMARK_MODULES & BENCHMARK_MOD_04)
170 #define BENCHMARK_MOD_04_SET(x) BENCHMARK_SET(x)
171 #define BENCHMARK_MOD_04_RESET(x) BENCHMARK_RESET(x)
172 #define BENCHMARK_MOD_04_TOGGLE(x) BENCHMARK_TOGGLE(x)
174 #define BENCHMARK_MOD_04_SET(x)
175 #define BENCHMARK_MOD_04_RESET(x)
176 #define BENCHMARK_MOD_04_TOGGLE(x)
179 #if (BENCHMARK_MODULES & BENCHMARK_MOD_05)
180 #define BENCHMARK_MOD_05_SET(x) BENCHMARK_SET(x)
181 #define BENCHMARK_MOD_05_RESET(x) BENCHMARK_RESET(x)
182 #define BENCHMARK_MOD_05_TOGGLE(x) BENCHMARK_TOGGLE(x)
184 #define BENCHMARK_MOD_05_SET(x)
185 #define BENCHMARK_MOD_05_RESET(x)
186 #define BENCHMARK_MOD_05_TOGGLE(x)
189 #if (BENCHMARK_MODULES & BENCHMARK_MOD_06)
190 #define BENCHMARK_MOD_06_SET(x) BENCHMARK_SET(x)
191 #define BENCHMARK_MOD_06_RESET(x) BENCHMARK_RESET(x)
192 #define BENCHMARK_MOD_06_TOGGLE(x) BENCHMARK_TOGGLE(x)
194 #define BENCHMARK_MOD_06_SET(x)
195 #define BENCHMARK_MOD_06_RESET(x)
196 #define BENCHMARK_MOD_06_TOGGLE(x)
199 #if (BENCHMARK_MODULES & BENCHMARK_MOD_07)
200 #define BENCHMARK_MOD_07_SET(x) BENCHMARK_SET(x)
201 #define BENCHMARK_MOD_07_RESET(x) BENCHMARK_RESET(x)
202 #define BENCHMARK_MOD_07_TOGGLE(x) BENCHMARK_TOGGLE(x)
204 #define BENCHMARK_MOD_07_SET(x)
205 #define BENCHMARK_MOD_07_RESET(x)
206 #define BENCHMARK_MOD_07_TOGGLE(x)
209 #if (BENCHMARK_MODULES & BENCHMARK_MOD_08)
210 #define BENCHMARK_MOD_08_SET(x) BENCHMARK_SET(x)
211 #define BENCHMARK_MOD_08_RESET(x) BENCHMARK_RESET(x)
212 #define BENCHMARK_MOD_08_TOGGLE(x) BENCHMARK_TOGGLE(x)
214 #define BENCHMARK_MOD_08_SET(x)
215 #define BENCHMARK_MOD_08_RESET(x)
216 #define BENCHMARK_MOD_08_TOGGLE(x)
219 #if (BENCHMARK_MODULES & BENCHMARK_MOD_09)
220 #define BENCHMARK_MOD_09_SET(x) BENCHMARK_SET(x)
221 #define BENCHMARK_MOD_09_RESET(x) BENCHMARK_RESET(x)
222 #define BENCHMARK_MOD_09_TOGGLE(x) BENCHMARK_TOGGLE(x)
224 #define BENCHMARK_MOD_09_SET(x)
225 #define BENCHMARK_MOD_09_RESET(x)
226 #define BENCHMARK_MOD_09_TOGGLE(x)
229 #if (BENCHMARK_MODULES & BENCHMARK_MOD_10)
230 #define BENCHMARK_MOD_10_SET(x) BENCHMARK_SET(x)
231 #define BENCHMARK_MOD_10_RESET(x) BENCHMARK_RESET(x)
233 #define BENCHMARK_MOD_10_SET(x)
234 #define BENCHMARK_MOD_10_RESET(x)
237 #if (BENCHMARK_MODULES & BENCHMARK_MOD_11)
238 #define BENCHMARK_MOD_11_SET(x) BENCHMARK_SET(x)
239 #define BENCHMARK_MOD_11_RESET(x) BENCHMARK_RESET(x)
241 #define BENCHMARK_MOD_11_SET(x)
242 #define BENCHMARK_MOD_11_RESET(x)
245 #if (BENCHMARK_MODULES & BENCHMARK_MOD_12)
246 #define BENCHMARK_MOD_12_SET(x) BENCHMARK_SET(x)
247 #define BENCHMARK_MOD_12_RESET(x) BENCHMARK_RESET(x)
249 #define BENCHMARK_MOD_12_SET(x)
250 #define BENCHMARK_MOD_12_RESET(x)
253 #if (BENCHMARK_MODULES & BENCHMARK_MOD_13)
254 #define BENCHMARK_MOD_13_SET(x) BENCHMARK_SET(x)
255 #define BENCHMARK_MOD_13_RESET(x) BENCHMARK_RESET(x)
257 #define BENCHMARK_MOD_13_SET(x)
258 #define BENCHMARK_MOD_13_RESET(x)
261 #if (BENCHMARK_MODULES & BENCHMARK_MOD_14)
262 #define BENCHMARK_MOD_14_SET(x) BENCHMARK_SET(x)
263 #define BENCHMARK_MOD_14_RESET(x) BENCHMARK_RESET(x)
265 #define BENCHMARK_MOD_14_SET(x)
266 #define BENCHMARK_MOD_14_RESET(x)
269 #if (BENCHMARK_MODULES & BENCHMARK_MOD_15)
270 #define BENCHMARK_MOD_15_SET(x) BENCHMARK_SET(x)
271 #define BENCHMARK_MOD_15_RESET(x) BENCHMARK_RESET(x)
273 #define BENCHMARK_MOD_15_SET(x)
274 #define BENCHMARK_MOD_15_RESET(x)
277 #if (BENCHMARK_MODULES & BENCHMARK_MOD_16)
278 #define BENCHMARK_MOD_16_SET(x) BENCHMARK_SET(x)
279 #define BENCHMARK_MOD_16_RESET(x) BENCHMARK_RESET(x)
281 #define BENCHMARK_MOD_16_SET(x)
282 #define BENCHMARK_MOD_16_RESET(x)
285 #if (BENCHMARK_MODULES & BENCHMARK_MOD_17)
286 #define BENCHMARK_MOD_17_SET(x) BENCHMARK_SET(x)
287 #define BENCHMARK_MOD_17_RESET(x) BENCHMARK_RESET(x)
289 #define BENCHMARK_MOD_17_SET(x)
290 #define BENCHMARK_MOD_17_RESET(x)
293 #if (BENCHMARK_MODULES & BENCHMARK_MOD_18)
294 #define BENCHMARK_MOD_18_SET(x) BENCHMARK_SET(x)
295 #define BENCHMARK_MOD_18_RESET(x) BENCHMARK_RESET(x)
297 #define BENCHMARK_MOD_18_SET(x)
298 #define BENCHMARK_MOD_18_RESET(x)
301 #if (BENCHMARK_MODULES & BENCHMARK_MOD_19)
302 #define BENCHMARK_MOD_19_SET(x) BENCHMARK_SET(x)
303 #define BENCHMARK_MOD_19_RESET(x) BENCHMARK_RESET(x)
305 #define BENCHMARK_MOD_19_SET(x)
306 #define BENCHMARK_MOD_19_RESET(x)
309 #if (BENCHMARK_MODULES & BENCHMARK_MOD_20)
310 #define BENCHMARK_MOD_20_SET(x) BENCHMARK_SET(x)
311 #define BENCHMARK_MOD_20_RESET(x) BENCHMARK_RESET(x)
313 #define BENCHMARK_MOD_20_SET(x)
314 #define BENCHMARK_MOD_20_RESET(x)
317 #if (BENCHMARK_MODULES & BENCHMARK_MOD_21)
318 #define BENCHMARK_MOD_21_SET(x) BENCHMARK_SET(x)
319 #define BENCHMARK_MOD_21_RESET(x) BENCHMARK_RESET(x)
321 #define BENCHMARK_MOD_21_SET(x)
322 #define BENCHMARK_MOD_21_RESET(x)
325 #if (BENCHMARK_MODULES & BENCHMARK_MOD_22)
326 #define BENCHMARK_MOD_22_SET(x) BENCHMARK_SET(x)
327 #define BENCHMARK_MOD_22_RESET(x) BENCHMARK_RESET(x)
329 #define BENCHMARK_MOD_22_SET(x)
330 #define BENCHMARK_MOD_22_RESET(x)
333 #if (BENCHMARK_MODULES & BENCHMARK_MOD_23)
334 #define BENCHMARK_MOD_23_SET(x) BENCHMARK_SET(x)
335 #define BENCHMARK_MOD_23_RESET(x) BENCHMARK_RESET(x)
337 #define BENCHMARK_MOD_23_SET(x)
338 #define BENCHMARK_MOD_23_RESET(x)
341 #if (BENCHMARK_MODULES & BENCHMARK_MOD_24)
342 #define BENCHMARK_MOD_24_SET(x) BENCHMARK_SET(x)
343 #define BENCHMARK_MOD_24_RESET(x) BENCHMARK_RESET(x)
345 #define BENCHMARK_MOD_24_SET(x)
346 #define BENCHMARK_MOD_24_RESET(x)
349 #if (BENCHMARK_MODULES & BENCHMARK_MOD_25)
350 #define BENCHMARK_MOD_25_SET(x) BENCHMARK_SET(x)
351 #define BENCHMARK_MOD_25_RESET(x) BENCHMARK_RESET(x)
353 #define BENCHMARK_MOD_25_SET(x)
354 #define BENCHMARK_MOD_25_RESET(x)
357 #if (BENCHMARK_MODULES & BENCHMARK_MOD_26)
358 #define BENCHMARK_MOD_26_SET(x) BENCHMARK_SET(x)
359 #define BENCHMARK_MOD_26_RESET(x) BENCHMARK_RESET(x)
361 #define BENCHMARK_MOD_26_SET(x)
362 #define BENCHMARK_MOD_26_RESET(x)
365 #if (BENCHMARK_MODULES & BENCHMARK_MOD_27)
366 #define BENCHMARK_MOD_27_SET(x) BENCHMARK_SET(x)
367 #define BENCHMARK_MOD_27_RESET(x) BENCHMARK_RESET(x)
369 #define BENCHMARK_MOD_27_SET(x)
370 #define BENCHMARK_MOD_27_RESET(x)
373 #if (BENCHMARK_MODULES & BENCHMARK_MOD_28)
374 #define BENCHMARK_MOD_28_SET(x) BENCHMARK_SET(x)
375 #define BENCHMARK_MOD_28_RESET(x) BENCHMARK_RESET(x)
377 #define BENCHMARK_MOD_28_SET(x)
378 #define BENCHMARK_MOD_28_RESET(x)
381 #if (BENCHMARK_MODULES & BENCHMARK_MOD_29)
382 #define BENCHMARK_MOD_29_SET(x) BENCHMARK_SET(x)
383 #define BENCHMARK_MOD_29_RESET(x) BENCHMARK_RESET(x)
385 #define BENCHMARK_MOD_29_SET(x)
386 #define BENCHMARK_MOD_29_RESET(x)
389 #if (BENCHMARK_MODULES & BENCHMARK_MOD_30)
390 #define BENCHMARK_MOD_30_SET(x) BENCHMARK_SET(x)
391 #define BENCHMARK_MOD_30_RESET(x) BENCHMARK_RESET(x)
393 #define BENCHMARK_MOD_30_SET(x)
394 #define BENCHMARK_MOD_30_RESET(x)
397 #if (BENCHMARK_MODULES & BENCHMARK_MOD_31)
398 #define BENCHMARK_MOD_31_SET(x) BENCHMARK_SET(x)
399 #define BENCHMARK_MOD_31_RESET(x) BENCHMARK_RESET(x)
401 #define BENCHMARK_MOD_31_SET(x)
402 #define BENCHMARK_MOD_31_RESET(x)
405 #if (BENCHMARK_MODULES & BENCHMARK_MOD_32)
406 #define BENCHMARK_MOD_32_SET(x) BENCHMARK_SET(x)
407 #define BENCHMARK_MOD_32_RESET(x) BENCHMARK_RESET(x)
409 #define BENCHMARK_MOD_32_SET(x)
410 #define BENCHMARK_MOD_32_RESET(x)
413 //---------------------------------------------------------------------------
414 // modul global types
415 //---------------------------------------------------------------------------
417 //---------------------------------------------------------------------------
419 //---------------------------------------------------------------------------
421 //---------------------------------------------------------------------------
422 // local function prototypes
423 //---------------------------------------------------------------------------
425 #endif // _BENCHMARK_H_