Changeset 201abde in mainline for kernel/test


Ignore:
Timestamp:
2007-04-07T20:06:52Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e58979
Parents:
6adbe3c2
Message:

make thread ID 64 bit (task ID is 64 bit already)
cleanup thread syscalls

Location:
kernel/test
Files:
10 edited

Legend:

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

    r6adbe3c2 r201abde  
    127127                if ((int) (100000000 * e) != E_10e8) {
    128128                        if (!sh_quiet)
    129                                 printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
     129                                printf("tid%llu: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
    130130                        atomic_inc(&threads_fault);
    131131                        break;
     
    162162                if ((int) (1000000 * pi) != PI_10e8) {
    163163                        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));
     164                                printf("tid%llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
    165165                        atomic_inc(&threads_fault);
    166166                        break;
     
    169169                if ((int) (100000000 * pi) != PI_10e8) {
    170170                        if (!sh_quiet)
    171                                 printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
     171                                printf("tid%llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
    172172                        atomic_inc(&threads_fault);
    173173                        break;
  • kernel/test/fpu/mips2.c

    r6adbe3c2 r201abde  
    7373                if (arg != after_arg) {
    7474                        if (!sh_quiet)
    75                                 printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     75                                printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    7676                        atomic_inc(&threads_fault);
    7777                        break;
     
    105105                if (arg != after_arg) {
    106106                        if (!sh_quiet)
    107                                 printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     107                                printf("General reg tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    108108                        atomic_inc(&threads_fault);
    109109                        break;
  • kernel/test/fpu/sse1.c

    r6adbe3c2 r201abde  
    7373                if (arg != after_arg) {
    7474                        if (!sh_quiet)
    75                                 printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     75                                printf("tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    7676                        atomic_inc(&threads_fault);
    7777                        break;
     
    105105                if (arg != after_arg) {
    106106                        if (!sh_quiet)
    107                                 printf("tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     107                                printf("tid%llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    108108                        atomic_inc(&threads_fault);
    109109                        break;
  • kernel/test/mm/falloc2.c

    r6adbe3c2 r201abde  
    5959        if (frames == NULL) {
    6060                if (!sh_quiet)
    61                         printf("Thread #%d (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
     61                        printf("Thread #%llu (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);
    6262                atomic_inc(&thread_fail);
    6363                atomic_dec(&thread_count);
     
    7070                for (order = 0; order <= MAX_ORDER; order++) {
    7171                        if (!sh_quiet)
    72                                 printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
     72                                printf("Thread #%llu (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
    7373                       
    7474                        allocated = 0;
     
    8383                       
    8484                        if (!sh_quiet)
    85                                 printf("Thread #%d (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
     85                                printf("Thread #%llu (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
    8686                       
    8787                        if (!sh_quiet)
    88                                 printf("Thread #%d (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
     88                                printf("Thread #%llu (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
    8989                       
    9090                        for (i = 0; i < allocated; i++) {
     
    9292                                        if (((uint8_t *) frames[i])[k] != val) {
    9393                                                if (!sh_quiet)
    94                                                         printf("Thread #%d (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
     94                                                        printf("Thread #%llu (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
    9595                                                atomic_inc(&thread_fail);
    9696                                                goto cleanup;
     
    101101                       
    102102                        if (!sh_quiet)
    103                                 printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
     103                                printf("Thread #%llu (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
    104104                }
    105105        }
     
    109109       
    110110        if (!sh_quiet)
    111                 printf("Thread #%d (cpu%d): Exiting\n", THREAD->tid, CPU->id);
     111                printf("Thread #%llu (cpu%d): Exiting\n", THREAD->tid, CPU->id);
    112112        atomic_dec(&thread_count);
    113113}
  • kernel/test/mm/slab1.c

    r6adbe3c2 r201abde  
    138138       
    139139        if (!sh_quiet)
    140                 printf("Starting thread #%d...\n", THREAD->tid);
     140                printf("Starting thread #%llu...\n", THREAD->tid);
    141141       
    142142        for (j = 0; j < 10; j++) {
     
    152152       
    153153        if (!sh_quiet)
    154                 printf("Thread #%d finished\n", THREAD->tid);
     154                printf("Thread #%llu finished\n", THREAD->tid);
    155155       
    156156        semaphore_up(&thr_sem);
  • kernel/test/mm/slab2.c

    r6adbe3c2 r201abde  
    151151       
    152152        if (!sh_quiet)
    153                 printf("Starting thread #%d...\n",THREAD->tid);
     153                printf("Starting thread #%llu...\n",THREAD->tid);
    154154
    155155        /* Alloc all */
    156156        if (!sh_quiet)
    157                 printf("Thread #%d allocating...\n", THREAD->tid);
     157                printf("Thread #%llu allocating...\n", THREAD->tid);
    158158       
    159159        while (1) {
     
    167167       
    168168        if (!sh_quiet)
    169                 printf("Thread #%d releasing...\n", THREAD->tid);
     169                printf("Thread #%llu releasing...\n", THREAD->tid);
    170170       
    171171        while (data) {
     
    177177       
    178178        if (!sh_quiet)
    179                 printf("Thread #%d allocating...\n", THREAD->tid);
     179                printf("Thread #%llu allocating...\n", THREAD->tid);
    180180       
    181181        while (1) {
     
    189189       
    190190        if (!sh_quiet)
    191                 printf("Thread #%d releasing...\n", THREAD->tid);
     191                printf("Thread #%llu releasing...\n", THREAD->tid);
    192192       
    193193        while (data) {
     
    199199       
    200200        if (!sh_quiet)
    201                 printf("Thread #%d finished\n", THREAD->tid);
     201                printf("Thread #%llu finished\n", THREAD->tid);
    202202       
    203203        slab_print_list();
  • kernel/test/synch/rwlock3.c

    r6adbe3c2 r201abde  
    4646       
    4747        if (!sh_quiet)
    48                 printf("cpu%d, tid %d: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
     48                printf("cpu%d, tid %llu: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);
    4949       
    5050        rwlock_read_lock(&rwlock);
     
    5252       
    5353        if (!sh_quiet) {
    54                 printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);               
    55                 printf("cpu%d, tid %d: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);         
     54                printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);             
     55                printf("cpu%d, tid %llu: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);       
    5656        }
    5757
     
    6060       
    6161        if (!sh_quiet)
    62                 printf("cpu%d, tid %d: success\n", CPU->id, THREAD->tid);
     62                printf("cpu%d, tid %llu: success\n", CPU->id, THREAD->tid);
    6363       
    6464        atomic_dec(&thread_count);
  • kernel/test/synch/rwlock4.c

    r6adbe3c2 r201abde  
    7575       
    7676        if (!sh_quiet)
    77                 printf("cpu%d, tid %d w+ (%d)\n", CPU->id, THREAD->tid, to);
     77                printf("cpu%d, tid %llu w+ (%d)\n", CPU->id, THREAD->tid, to);
    7878       
    7979        rc = rwlock_write_lock_timeout(&rwlock, to);
    8080        if (SYNCH_FAILED(rc)) {
    8181                if (!sh_quiet)
    82                         printf("cpu%d, tid %d w!\n", CPU->id, THREAD->tid);
     82                        printf("cpu%d, tid %llu w!\n", CPU->id, THREAD->tid);
    8383                atomic_dec(&thread_count);
    8484                return;
     
    8686       
    8787        if (!sh_quiet)
    88                 printf("cpu%d, tid %d w=\n", CPU->id, THREAD->tid);
     88                printf("cpu%d, tid %llu w=\n", CPU->id, THREAD->tid);
    8989
    9090        if (rwlock.readers_in) {
     
    107107       
    108108        if (!sh_quiet)
    109                 printf("cpu%d, tid %d w-\n", CPU->id, THREAD->tid);
     109                printf("cpu%d, tid %llu w-\n", CPU->id, THREAD->tid);
    110110        atomic_dec(&thread_count);
    111111}
     
    120120       
    121121        if (!sh_quiet)
    122                 printf("cpu%d, tid %d r+ (%d)\n", CPU->id, THREAD->tid, to);
     122                printf("cpu%d, tid %llu r+ (%d)\n", CPU->id, THREAD->tid, to);
    123123       
    124124        rc = rwlock_read_lock_timeout(&rwlock, to);
    125125        if (SYNCH_FAILED(rc)) {
    126126                if (!sh_quiet)
    127                         printf("cpu%d, tid %d r!\n", CPU->id, THREAD->tid);
     127                        printf("cpu%d, tid %llu r!\n", CPU->id, THREAD->tid);
    128128                atomic_dec(&thread_count);
    129129                return;
     
    131131       
    132132        if (!sh_quiet)
    133                 printf("cpu%d, tid %d r=\n", CPU->id, THREAD->tid);
     133                printf("cpu%d, tid %llu r=\n", CPU->id, THREAD->tid);
    134134       
    135135        thread_usleep(30000);
     
    137137       
    138138        if (!sh_quiet)
    139                 printf("cpu%d, tid %d r-\n", CPU->id, THREAD->tid);
     139                printf("cpu%d, tid %llu r-\n", CPU->id, THREAD->tid);
    140140        atomic_dec(&thread_count);
    141141}
  • kernel/test/synch/semaphore2.c

    r6adbe3c2 r201abde  
    6868       
    6969        to = random(20000);
    70         printf("cpu%d, tid %d down+ (%d)\n", CPU->id, THREAD->tid, to);
     70        printf("cpu%d, tid %llu down+ (%d)\n", CPU->id, THREAD->tid, to);
    7171        rc = semaphore_down_timeout(&sem, to);
    7272        if (SYNCH_FAILED(rc)) {
    73                 printf("cpu%d, tid %d down!\n", CPU->id, THREAD->tid);
     73                printf("cpu%d, tid %llu down!\n", CPU->id, THREAD->tid);
    7474                return;
    7575        }
    7676       
    77         printf("cpu%d, tid %d down=\n", CPU->id, THREAD->tid); 
     77        printf("cpu%d, tid %llu down=\n", CPU->id, THREAD->tid);       
    7878        thread_usleep(random(30000));
    7979       
    8080        semaphore_up(&sem);
    81         printf("cpu%d, tid %d up\n", CPU->id, THREAD->tid);
     81        printf("cpu%d, tid %llu up\n", CPU->id, THREAD->tid);
    8282}
    8383
  • kernel/test/thread/thread1.c

    r6adbe3c2 r201abde  
    4949        while (atomic_get(&finish)) {
    5050                if (!sh_quiet)
    51                         printf("%d ", (int) (THREAD->tid));
     51                        printf("%llu ", THREAD->tid);
    5252                thread_usleep(100000);
    5353        }
Note: See TracChangeset for help on using the changeset viewer.