Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2050 → Rev 2051

/trunk/kernel/test/debug/mips1.c
40,7 → 40,8
 
char * test_mips1(bool quiet)
{
printf("You should enter kconsole debug mode now.\n");
if (!quiet)
printf("You should enter kconsole debug mode now.\n");
asm volatile (
"break\n"
/trunk/kernel/test/fpu/fpu1.c
103,11 → 103,12
static atomic_t threads_ok;
static atomic_t threads_fault;
static waitq_t can_start;
static bool sh_quiet;
 
static void e(void *data)
{
int i;
double e,d,le,f;
double e, d, le, f;
 
thread_detach(THREAD);
 
124,7 → 125,8
}
 
if ((int) (100000000 * e) != E_10e8) {
printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
if (!sh_quiet)
printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
atomic_inc(&threads_fault);
break;
}
158,13 → 160,15
 
#ifdef KERN_ia64_ARCH_H_
if ((int) (1000000 * pi) != PI_10e8) {
printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
if (!sh_quiet)
printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
atomic_inc(&threads_fault);
break;
}
#else
if ((int) (100000000 * pi) != PI_10e8) {
printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
if (!sh_quiet)
printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
atomic_inc(&threads_fault);
break;
}
176,17 → 180,21
char * test_fpu1(bool quiet)
{
unsigned int i, total = 0;
sh_quiet = quiet;
 
waitq_initialize(&can_start);
atomic_set(&threads_ok, 0);
atomic_set(&threads_fault, 0);
printf("Creating %d threads... ", 2 * THREADS);
if (!quiet)
printf("Creating %d threads... ", 2 * THREADS);
 
for (i = 0; i < THREADS; i++) {
thread_t *t;
if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) {
printf("could not create thread %d\n", 2 * i);
if (!quiet)
printf("could not create thread %d\n", 2 * i);
break;
}
thread_ready(t);
193,19 → 201,23
total++;
if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) {
printf("could not create thread %d\n", 2 * i + 1);
if (!quiet)
printf("could not create thread %d\n", 2 * i + 1);
break;
}
thread_ready(t);
total++;
}
printf("ok\n");
if (!quiet)
printf("ok\n");
thread_sleep(1);
waitq_wakeup(&can_start, WAKEUP_ALL);
while (atomic_get(&threads_ok) != total) {
printf("Threads left: %d\n", total - atomic_get(&threads_ok));
if (!quiet)
printf("Threads left: %d\n", total - atomic_get(&threads_ok));
thread_sleep(1);
}
/trunk/kernel/test/fpu/sse1.c
45,7 → 45,9
static atomic_t threads_ok;
static atomic_t threads_fault;
static waitq_t can_start;
static bool sh_quiet;
 
 
static void testit1(void *data)
{
int i;
69,7 → 71,8
);
if (arg != after_arg) {
printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
if (!sh_quiet)
printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
atomic_inc(&threads_fault);
break;
}
100,7 → 103,8
);
if (arg != after_arg) {
printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
if (!sh_quiet)
printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
atomic_inc(&threads_fault);
break;
}
112,17 → 116,21
char * test_sse1(bool quiet)
{
unsigned int i, total = 0;
 
sh_quiet = quiet;
waitq_initialize(&can_start);
atomic_set(&threads_ok, 0);
atomic_set(&threads_fault, 0);
printf("Creating %d threads... ", 2 * THREADS);
if (!quiet)
printf("Creating %d 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))) {
printf("could not create thread %d\n", 2 * i);
if (!quiet)
printf("could not create thread %d\n", 2 * i);
break;
}
thread_ready(t);
129,19 → 137,23
total++;
if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
printf("could not create thread %d\n", 2 * i + 1);
if (!quiet)
printf("could not create thread %d\n", 2 * i + 1);
break;
}
thread_ready(t);
total++;
}
printf("ok\n");
if (!quiet)
printf("ok\n");
thread_sleep(1);
waitq_wakeup(&can_start, WAKEUP_ALL);
while (atomic_get(&threads_ok) != total) {
printf("Threads left: %d\n", total - atomic_get(&threads_ok));
if (!quiet)
printf("Threads left: %d\n", total - atomic_get(&threads_ok));
thread_sleep(1);
}