Changeset 0104056 in rtems
- Timestamp:
- 12/03/14 10:14:42 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 8905201
- Parents:
- f54e503
- git-author:
- Sebastian Huber <sebastian.huber@…> (12/03/14 10:14:42)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (12/03/14 10:19:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/sptests/spintrcritical_support/intrcritical.c
rf54e503 r0104056 68 68 } 69 69 70 static rtems_interval get_one_tick_busy_value( void ) 71 { 72 rtems_interval last; 73 rtems_interval now; 74 rtems_interval a; 75 rtems_interval b; 76 rtems_interval m; 77 78 /* Choose a lower bound */ 79 a = 1; 80 81 /* Estimate an upper bound */ 82 83 wait_for_tick_change(); 84 b = 2 * estimate_busy_loop_maximum(); 85 86 while ( true ) { 87 last = wait_for_tick_change(); 88 busy( b ); 89 now = rtems_clock_get_ticks_since_boot(); 90 91 if ( now != last ) { 92 break; 93 } 94 95 b *= 2; 96 last = now; 97 } 98 99 /* Find a good value */ 100 do { 101 m = ( a + b ) / 2; 102 103 last = wait_for_tick_change(); 104 busy( m ); 105 now = rtems_clock_get_ticks_since_boot(); 106 107 if ( now != last ) { 108 b = m; 109 } else { 110 a = m; 111 } 112 } while ( b - a > 1 ); 113 114 return m; 115 } 116 70 117 static bool interrupt_critical_busy_wait( void ) 71 118 { … … 88 135 ) 89 136 { 90 rtems_interval last;91 rtems_interval now;92 rtems_interval a;93 rtems_interval b;94 137 rtems_interval m; 95 138 … … 104 147 } 105 148 106 /* Choose a lower bound */ 107 a = 1; 108 109 /* Estimate an upper bound */ 110 111 wait_for_tick_change(); 112 b = 2 * estimate_busy_loop_maximum(); 113 114 while ( true ) { 115 last = wait_for_tick_change(); 116 busy( b ); 117 now = rtems_clock_get_ticks_since_boot(); 118 119 if ( now != last ) { 120 break; 121 } 122 123 b *= 2; 124 last = now; 125 } 126 127 /* Find a good value */ 128 do { 129 m = ( a + b ) / 2; 130 131 last = wait_for_tick_change(); 132 busy( m ); 133 now = rtems_clock_get_ticks_since_boot(); 134 135 if ( now != last ) { 136 b = m; 137 } else { 138 a = m; 139 } 140 } while ( b - a > 1 ); 149 m = get_one_tick_busy_value(); 141 150 142 151 interrupt_critical.minimum = 0;
Note: See TracChangeset
for help on using the changeset viewer.