Mercurial > ecos
comparison packages/kernel/current/tests/clock1.cxx @ 2:443894e2e912 ecos-v1_2_1-release
Block commit of eCos version 1.2.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 12:24:34 +0000 |
| parents | 3111d98ba7b3 |
| children | c38311975d4f |
comparison
equal
deleted
inserted
replaced
| 1:72f549f0d891 | 2:443894e2e912 |
|---|---|
| 20 // | 20 // |
| 21 // The Original Code is eCos - Embedded Cygnus Operating System, released | 21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
| 22 // September 30, 1998. | 22 // September 30, 1998. |
| 23 // | 23 // |
| 24 // The Initial Developer of the Original Code is Cygnus. Portions created | 24 // The Initial Developer of the Original Code is Cygnus. Portions created |
| 25 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | 25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 26 // ------------------------------------------- | 26 // ------------------------------------------- |
| 27 // | 27 // |
| 28 //####COPYRIGHTEND#### | 28 //####COPYRIGHTEND#### |
| 29 //========================================================================== | 29 //========================================================================== |
| 30 //#####DESCRIPTIONBEGIN#### | 30 //#####DESCRIPTIONBEGIN#### |
| 59 #include <cyg/kernel/clock.inl> | 59 #include <cyg/kernel/clock.inl> |
| 60 #include <cyg/kernel/thread.inl> | 60 #include <cyg/kernel/thread.inl> |
| 61 | 61 |
| 62 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK | 62 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK |
| 63 | 63 |
| 64 #if defined(CYG_HAL_MIPS_SIM) | |
| 65 // Reduce time in simulated TX39 so that | |
| 66 // it runs within the timeout. | |
| 67 #define TEST_DELAY 1000000000ll | |
| 68 #else | |
| 69 | |
| 70 #define TEST_DELAY 5000000000ll | |
| 71 | |
| 72 #endif | |
| 73 | 64 |
| 74 #define NTHREADS 1 | 65 #define NTHREADS 1 |
| 75 #include "testaux.hxx" | 66 #include "testaux.hxx" |
| 76 | 67 |
| 77 static cyg_uint32 ticks; // Number of ticks thread[0] will delay for | 68 static cyg_uint32 ticks; // Number of ticks thread[0] will delay for |
| 69 | |
| 70 static cyg_uint64 TEST_DELAY; | |
| 78 | 71 |
| 79 static void entry0( CYG_ADDRWORD data ) | 72 static void entry0( CYG_ADDRWORD data ) |
| 80 { | 73 { |
| 81 ((Cyg_Thread *)data)->delay(ticks); | 74 ((Cyg_Thread *)data)->delay(ticks); |
| 82 | 75 |
| 84 } | 77 } |
| 85 | 78 |
| 86 void clock1_main( void ) | 79 void clock1_main( void ) |
| 87 { | 80 { |
| 88 CYG_TEST_INIT(); | 81 CYG_TEST_INIT(); |
| 82 | |
| 83 if (cyg_test_is_simulator) { | |
| 84 TEST_DELAY = 100000000ll; | |
| 85 } else { | |
| 86 TEST_DELAY = 3000000000ll; | |
| 87 } | |
| 89 | 88 |
| 90 new_thread(entry0, (CYG_ADDRWORD)&thread_obj[0]); | 89 new_thread(entry0, (CYG_ADDRWORD)&thread_obj[0]); |
| 91 | 90 |
| 92 Cyg_Clock::cyg_resolution res; | 91 Cyg_Clock::cyg_resolution res; |
| 93 | 92 |
| 109 | 108 |
| 110 externC void | 109 externC void |
| 111 cyg_start( void ) | 110 cyg_start( void ) |
| 112 { | 111 { |
| 113 CYG_TEST_INIT(); | 112 CYG_TEST_INIT(); |
| 114 CYG_TEST_PASS_FINISH( "N/A: Kernel real-time clock disabled"); | 113 CYG_TEST_NA( "Kernel real-time clock disabled"); |
| 115 } | 114 } |
| 116 | 115 |
| 117 #endif // def CYGVAR_KERNEL_COUNTERS_CLOCK | 116 #endif // def CYGVAR_KERNEL_COUNTERS_CLOCK |
| 118 | 117 |
| 119 // EOF clock1.cxx | 118 // EOF clock1.cxx |
