Changeset cb01e1e in mainline for kernel/test/fpu/sse1.c


Ignore:
Timestamp:
2009-04-04T00:26:27Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a85aebd
Parents:
171f9a1
Message:

use global variable and a macro for silencing tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/fpu/sse1.c

    r171f9a1 rcb01e1e  
    4444static atomic_t threads_fault;
    4545static waitq_t can_start;
    46 static bool sh_quiet;
    47 
    4846
    4947static void testit1(void *data)
     
    5250        int arg __attribute__((aligned(16))) = (int) ((unative_t) data);
    5351        int after_arg __attribute__((aligned(16)));
    54 
     52       
    5553        thread_detach(THREAD);
    5654       
    5755        waitq_sleep(&can_start);
    58 
     56       
    5957        for (i = 0; i < ATTEMPTS; i++) {
    6058                asm volatile (
     
    6260                        : [arg] "=m" (arg)
    6361                );
    64 
     62               
    6563                delay(DELAY);
    6664                asm volatile (
     
    7068               
    7169                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);
    7471                        atomic_inc(&threads_fault);
    7572                        break;
     
    8885       
    8986        waitq_sleep(&can_start);
    90 
     87       
    9188        for (i = 0; i < ATTEMPTS; i++) {
    9289                asm volatile (
     
    9491                        : [arg] "=m" (arg)
    9592                );
    96 
     93               
    9794                scheduler();
    9895                asm volatile (
     
    10299               
    103100                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);
    106102                        atomic_inc(&threads_fault);
    107103                        break;
     
    111107}
    112108
    113 
    114 char * test_sse1(bool quiet)
     109char *test_sse1(void)
    115110{
    116111        unsigned int i, total = 0;
    117         sh_quiet = quiet;
    118112       
    119113        waitq_initialize(&can_start);
     
    121115        atomic_set(&threads_fault, 0);
    122116       
    123         if (!quiet)
    124                 printf("Creating %u threads... ", 2 * THREADS);
    125 
     117        TPRINTF("Creating %u threads... ", 2 * THREADS);
     118       
    126119        for (i = 0; i < THREADS; i++) {
    127120                thread_t *t;
    128121               
    129122                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);
    132124                        break;
    133125                }
     
    136128               
    137129                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);
    140131                        break;
    141132                }
     
    144135        }
    145136       
    146         if (!quiet)
    147                 printf("ok\n");
    148                
     137        TPRINTF("ok\n");
     138       
    149139        thread_sleep(1);
    150140        waitq_wakeup(&can_start, WAKEUP_ALL);
    151141       
    152142        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));
    155144                thread_sleep(1);
    156145        }
Note: See TracChangeset for help on using the changeset viewer.