64-bit compatibility fixes in userland/tests
authorAndrew Waterman <waterman@s144.Millennium.Berkeley.EDU>
Wed, 2 Nov 2011 09:32:32 +0000 (02:32 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 01:28:06 +0000 (18:28 -0700)
tests/block_test.c
tests/pthread_barrier_test.c
user/pthread/pthread.c

index 3ed6315..81cb934 100644 (file)
@@ -25,7 +25,7 @@ void *block_thread(void* arg)
                printf_safe("[A] pthread %d on vcore %d\n", pthread_self()->id, vcore_id());
                sys_block(5000 + pthread_self()->id);
        }
-       return (void*)(pthread_self()->id);
+       return (void*)(long)pthread_self()->id;
 }
 
 int main(int argc, char** argv) 
index 5e143c0..7802c9b 100644 (file)
@@ -22,7 +22,7 @@ void *thread(void* arg)
                //printf_safe("[A] pthread %d on vcore %d\n", pthread_self()->id, vcore_id());
                pthread_barrier_wait(&barrier);
        }
-       return (void*)(pthread_self()->id);
+       return (void*)(long)pthread_self()->id;
 }
 
 int main(int argc, char** argv) 
index 8b62cb1..491dae5 100644 (file)
@@ -407,8 +407,8 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
        /* Set the u_tf to start up in __pthread_run, which will call the real
         * start_routine and pass it the arg.  Note those aren't set until later in
         * pthread_create(). */
-       init_user_tf(&pthread->uthread.utf, (uint32_t)__pthread_run, 
-                    (uint32_t)(pthread->stacktop));
+       init_user_tf(&pthread->uthread.utf, (long)&__pthread_run,
+                    (long)(pthread->stacktop));
        pthread->start_routine = start_routine;
        pthread->arg = arg;
        /* Initialize the uthread */