Changeset c8410ec9 in mainline for kernel/test/fpu/fpu1.c
- Timestamp:
- 2006-12-19T11:04:39Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6536a4a9
- Parents:
- 95155b0c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/fpu/fpu1.c
r95155b0c rc8410ec9 104 104 static atomic_t threads_fault; 105 105 static waitq_t can_start; 106 static bool sh_quiet; 106 107 107 108 static void e(void *data) 108 109 { 109 110 int i; 110 double e, d,le,f;111 double e, d, le, f; 111 112 112 113 thread_detach(THREAD); … … 125 126 126 127 if ((int) (100000000 * e) != E_10e8) { 127 printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 128 if (!sh_quiet) 129 printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 128 130 atomic_inc(&threads_fault); 129 131 break; … … 159 161 #ifdef KERN_ia64_ARCH_H_ 160 162 if ((int) (1000000 * pi) != PI_10e8) { 161 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100)); 163 if (!sh_quiet) 164 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100)); 162 165 atomic_inc(&threads_fault); 163 166 break; … … 165 168 #else 166 169 if ((int) (100000000 * pi) != PI_10e8) { 167 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8); 170 if (!sh_quiet) 171 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8); 168 172 atomic_inc(&threads_fault); 169 173 break; … … 177 181 { 178 182 unsigned int i, total = 0; 183 sh_quiet = quiet; 179 184 180 185 waitq_initialize(&can_start); 181 186 atomic_set(&threads_ok, 0); 182 187 atomic_set(&threads_fault, 0); 183 printf("Creating %d threads... ", 2 * THREADS); 188 189 if (!quiet) 190 printf("Creating %d threads... ", 2 * THREADS); 184 191 185 192 for (i = 0; i < THREADS; i++) { … … 187 194 188 195 if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) { 189 printf("could not create thread %d\n", 2 * i); 196 if (!quiet) 197 printf("could not create thread %d\n", 2 * i); 190 198 break; 191 199 } … … 194 202 195 203 if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) { 196 printf("could not create thread %d\n", 2 * i + 1); 204 if (!quiet) 205 printf("could not create thread %d\n", 2 * i + 1); 197 206 break; 198 207 } … … 200 209 total++; 201 210 } 202 printf("ok\n"); 211 212 if (!quiet) 213 printf("ok\n"); 203 214 204 215 thread_sleep(1); … … 206 217 207 218 while (atomic_get(&threads_ok) != total) { 208 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 219 if (!quiet) 220 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 209 221 thread_sleep(1); 210 222 }
Note:
See TracChangeset
for help on using the changeset viewer.