Changeset cb01e1e in mainline for kernel/test/fpu/sse1.c
- Timestamp:
- 2009-04-04T00:26:27Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a85aebd
- Parents:
- 171f9a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/fpu/sse1.c
r171f9a1 rcb01e1e 44 44 static atomic_t threads_fault; 45 45 static waitq_t can_start; 46 static bool sh_quiet;47 48 46 49 47 static void testit1(void *data) … … 52 50 int arg __attribute__((aligned(16))) = (int) ((unative_t) data); 53 51 int after_arg __attribute__((aligned(16))); 54 52 55 53 thread_detach(THREAD); 56 54 57 55 waitq_sleep(&can_start); 58 56 59 57 for (i = 0; i < ATTEMPTS; i++) { 60 58 asm volatile ( … … 62 60 : [arg] "=m" (arg) 63 61 ); 64 62 65 63 delay(DELAY); 66 64 asm volatile ( … … 70 68 71 69 if (arg != after_arg) { 72 if (!sh_quiet) 73 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 70 TPRINTF("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 74 71 atomic_inc(&threads_fault); 75 72 break; … … 88 85 89 86 waitq_sleep(&can_start); 90 87 91 88 for (i = 0; i < ATTEMPTS; i++) { 92 89 asm volatile ( … … 94 91 : [arg] "=m" (arg) 95 92 ); 96 93 97 94 scheduler(); 98 95 asm volatile ( … … 102 99 103 100 if (arg != after_arg) { 104 if (!sh_quiet) 105 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 101 TPRINTF("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 106 102 atomic_inc(&threads_fault); 107 103 break; … … 111 107 } 112 108 113 114 char * test_sse1(bool quiet) 109 char *test_sse1(void) 115 110 { 116 111 unsigned int i, total = 0; 117 sh_quiet = quiet;118 112 119 113 waitq_initialize(&can_start); … … 121 115 atomic_set(&threads_fault, 0); 122 116 123 if (!quiet) 124 printf("Creating %u threads... ", 2 * THREADS); 125 117 TPRINTF("Creating %u threads... ", 2 * THREADS); 118 126 119 for (i = 0; i < THREADS; i++) { 127 120 thread_t *t; 128 121 129 122 if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { 130 if (!quiet) 131 printf("could not create thread %u\n", 2 * i); 123 TPRINTF("could not create thread %u\n", 2 * i); 132 124 break; 133 125 } … … 136 128 137 129 if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { 138 if (!quiet) 139 printf("could not create thread %u\n", 2 * i + 1); 130 TPRINTF("could not create thread %u\n", 2 * i + 1); 140 131 break; 141 132 } … … 144 135 } 145 136 146 if (!quiet) 147 printf("ok\n"); 148 137 TPRINTF("ok\n"); 138 149 139 thread_sleep(1); 150 140 waitq_wakeup(&can_start, WAKEUP_ALL); 151 141 152 142 while (atomic_get(&threads_ok) != (long) total) { 153 if (!quiet) 154 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 143 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 155 144 thread_sleep(1); 156 145 }
Note:
See TracChangeset
for help on using the changeset viewer.