comparison packages/kernel/current/tests/dhrystone.c @ 18:7253dcc42a09 ecos-sw-1999-06-25

Merge from eCos master repository on 1999-06-25-15:31:50-BST
author jlarmour
date Fri, 25 Jun 1999 08:28:05 +0000
parents 4f2df4ab82c8
children 5f5102441818
comparison
equal deleted inserted replaced
17:a658ec000d9f 18:7253dcc42a09
16 // 16 //
17 // All inquiries about this file, or the functionality provided by it, 17 // All inquiries about this file, or the functionality provided by it,
18 // should be directed to the 'ecos-discuss' mailing list (see 18 // should be directed to the 'ecos-discuss' mailing list (see
19 // http://sourceware.cygnus.com/ecos/intouch.html for details). 19 // http://sourceware.cygnus.com/ecos/intouch.html for details).
20 // 20 //
21 // Contributed by: Kevin Hester <khester@opticworks.com>
22 // Maintained by: <Unmaintained>
23 // See also:
24 // Motorola's "Example Software Initializing the SMC as a UART" package
25 // (smc2.zip) at:
26 // http://www.mot.com/SPS/RISC/netcomm/tools/index.html#MPC860_table
27 // ------------------------------------------- 21 // -------------------------------------------
28 // 22 //
29 //####UNSUPPORTEDEND#### 23 //####UNSUPPORTEDEND####
30 //============================================================================= 24 //=============================================================================
31 // Originally three different files, dhry.h, dhry21a.c and dhry21b.c 25 // Originally three different files, dhry.h, dhry21a.c and dhry21b.c
44 #include <pkgconf/libc.h> 38 #include <pkgconf/libc.h>
45 39
46 #if defined(CYGFUN_KERNEL_API_C) \ 40 #if defined(CYGFUN_KERNEL_API_C) \
47 && defined(CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT) 41 && defined(CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT)
48 42
43 #ifdef __OPTIMIZE__
44
49 #include <cyg/hal/hal_cache.h> 45 #include <cyg/hal/hal_cache.h>
50 #include <cyg/kernel/kapi.h> 46 #include <cyg/kernel/kapi.h>
51 #include <stdlib.h> 47 #include <stdlib.h>
52 48
53 // Time in seconds. 49 // Time in seconds.
56 { 52 {
57 return (double) cyg_current_time() / 100; 53 return (double) cyg_current_time() / 100;
58 } 54 }
59 55
60 // Number of loops to run. 56 // Number of loops to run.
61 #define PASSES 500000 57 #if defined(CYGPKG_HAL_ARM_AEB) || defined(CYGPKG_HAL_ARM_PID)
58 #define PASSES 100000
59 #else
60 #define PASSES 400000
61 #endif
62 62
63 // Used in the code below to mark changes to the code. 63 // Used in the code below to mark changes to the code.
64 #define __ECOS__ 64 #define __ECOS__
65 65
66 #undef true 66 #undef true
582 Str_30 Str_1_Loc; 582 Str_30 Str_1_Loc;
583 Str_30 Str_2_Loc; 583 Str_30 Str_2_Loc;
584 REG int Run_Index; 584 REG int Run_Index;
585 REG int Number_Of_Runs; 585 REG int Number_Of_Runs;
586 586
587 #ifndef __ECOS__ 587
588 #ifdef __ECOS__
589
590 CYG_TEST_INIT();
591
592 #ifdef CYG_HAL_I386_LINUX
593 CYG_TEST_NA("Only runs on hardware...");
594 #else
595 if (cyg_test_is_simulator)
596 CYG_TEST_NA("Only runs on hardware...");
597 #endif
598
599 #else // __ECOS__
588 FILE *Ap; 600 FILE *Ap;
589 601
590 /* Initializations */ 602 /* Initializations */
591 603
592 if ((Ap = fopen("dhry.res","a+")) == NULL) 604 if ((Ap = fopen("dhry.res","a+")) == NULL)
1136 else /* not executed */ 1148 else /* not executed */
1137 return (false); 1149 return (false);
1138 } /* Func_3 */ 1150 } /* Func_3 */
1139 1151
1140 #else 1152 #else
1141 #define NA_MSG "CYGFUN_KERNEL_API_C && CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT" 1153 #define NA_MSG "Only makes sense to run with optimized code"
1154 #endif // __OPTIMIZE__
1155
1156 #else
1157 #define NA_MSG "Requires CYGFUN_KERNEL_API_C && CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT"
1142 #endif // CYGFUN_KERNEL_API_C && CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT 1158 #endif // CYGFUN_KERNEL_API_C && CYGSEM_LIBC_STDIO_PRINTF_FLOATING_POINT
1143 1159
1144 #else 1160 #else
1145 #define NA_MSG "CYGPKG_KERNEL && CYGPKG_LIBC" 1161 #define NA_MSG "Requires CYGPKG_KERNEL && CYGPKG_LIBC"
1146 #endif // CYGPKG_KERNEL && CYGPKG_LIBC 1162 #endif // CYGPKG_KERNEL && CYGPKG_LIBC
1147 1163
1148 #ifdef NA_MSG 1164 #ifdef NA_MSG
1149 externC void 1165 externC void
1150 cyg_start( void ) 1166 cyg_start( void )
1151 { 1167 {
1152 CYG_TEST_INIT(); 1168 CYG_TEST_INIT();
1153 CYG_TEST_NA("Requires " NA_MSG); 1169 CYG_TEST_NA(NA_MSG);
1154 } 1170 }
1155 #endif 1171 #endif