26,8 → 26,6 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
|
#ifdef mips32 |
|
#include <print.h> |
#include <debug.h> |
|
38,9 → 36,9 |
|
#include <arch.h> |
|
#define THREADS 50 |
#define DELAY 10000L |
#define ATTEMPTS 5 |
#define THREADS 50 |
#define DELAY 10000L |
#define ATTEMPTS 5 |
|
static atomic_t threads_ok; |
static atomic_t threads_fault; |
56,7 → 54,7 |
thread_detach(THREAD); |
|
waitq_sleep(&can_start); |
|
|
for (i = 0; i < ATTEMPTS; i++) { |
asm volatile ( |
"mtc1 %0,$1" |
72,7 → 70,7 |
|
if (arg != after_arg) { |
if (!sh_quiet) |
printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg); |
printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); |
atomic_inc(&threads_fault); |
break; |
} |
89,13 → 87,13 |
thread_detach(THREAD); |
|
waitq_sleep(&can_start); |
|
|
for (i = 0; i < ATTEMPTS; i++) { |
asm volatile ( |
"mtc1 %0,$1" |
: "=r" (arg) |
); |
|
|
scheduler(); |
asm volatile ( |
"mfc1 %0,$1" |
104,7 → 102,7 |
|
if (arg != after_arg) { |
if (!sh_quiet) |
printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg); |
printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); |
atomic_inc(&threads_fault); |
break; |
} |
123,14 → 121,14 |
atomic_set(&threads_fault, 0); |
|
if (!quiet) |
printf("Creating %d threads... ", 2 * THREADS); |
|
printf("Creating %u threads... ", 2 * THREADS); |
|
for (i = 0; i < THREADS; i++) { |
thread_t *t; |
|
if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { |
if (!quiet) |
printf("could not create thread %d\n", 2 * i); |
printf("could not create thread %u\n", 2 * i); |
break; |
} |
thread_ready(t); |
138,7 → 136,7 |
|
if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { |
if (!quiet) |
printf("could not create thread %d\n", 2 * i + 1); |
printf("could not create thread %u\n", 2 * i + 1); |
break; |
} |
thread_ready(t); |
162,5 → 160,3 |
|
return "Test failed"; |
} |
|
#endif |