parlib: Fix u32/u64 issue with pvcalarm
[akaros.git] / tests / lock_test.c
index a92dab0..6072153 100644 (file)
@@ -27,6 +27,7 @@
 #ifdef __ros__
 
 #include <parlib/parlib.h>
+#include <parlib/stdio.h>
 #include <parlib/vcore.h>
 #include <parlib/timing.h>
 #include <parlib/spinlock.h>
 
 #else
 
-#include "../user/parlib/include/tsc-compat.h"
+#include "../user/parlib/include/parlib/tsc-compat.h"
 #include "misc-compat.h"
 #include "linux-lock-hacks.h" /* TODO: have a build system and lib / C file */
 
-#include "../user/benchutil/include/measure.h"
+#include "../user/benchutil/include/benchutil/measure.h"
 #include "../user/benchutil/measure.c"
 
 static void os_prep_work(pthread_t *worker_threads, int nr_threads)
@@ -732,7 +733,7 @@ static void os_prep_work(pthread_t *worker_threads, int nr_threads)
        atomic_init(&indir_idx, 0);
        atomic_init(&preempt_cnt, 0);
        atomic_init(&indir_cnt, 0);
-       pthread_can_vcore_request(FALSE);       /* 2LS won't manage vcores */
+       parlib_never_yield = TRUE;
        pthread_need_tls(FALSE);
        pthread_mcp_init();                                     /* gives us one vcore */
        register_ev_handler(EV_VCORE_PREEMPT, trace_preempt, 0);
@@ -743,11 +744,8 @@ static void os_prep_work(pthread_t *worker_threads, int nr_threads)
                clear_kevent_q(EV_VCORE_PREEMPT);
                clear_kevent_q(EV_CHECK_MSGS);
        }
-       if (vcore_request(nr_threads - 1)) {
-               printf("Failed to request %d more vcores, currently have %d\n",
-                      nr_threads - 1, num_vcores());
-               exit(-1);
-       }
+       vcore_request_total(nr_threads);
+       parlib_never_vc_request = TRUE;
        for (int i = 0; i < nr_threads; i++) {
                printd("Vcore %d mapped to pcore %d\n", i,
                       __procinfo.vcoremap[i].pcoreid);