]> xenbits.xensource.com Git - unikraft/libs/lwip.git/commitdiff
Adopt to new Unikraft libraries: libukmpi and libuklock
authorSharan Santhanam <sharan.santhanam@neclab.eu>
Fri, 8 Jun 2018 13:01:11 +0000 (15:01 +0200)
committerSimon Kuenzer <simon.kuenzer@neclab.eu>
Fri, 15 Jun 2018 01:21:07 +0000 (03:21 +0200)
Add dependency to libukmpi and libuklock libraries that were
recently introduced with Unikraft.

Signed-off-by: Sharan Santhanam <sharan.santhanam@neclab.eu>
Config.uk
include/arch/sys_arch.h
mailbox.c
mutex.c
semaphore.c

index 4becc66e13e4481f5c32703b3146cf15feff3052..fed9f2f9cf6943348270b825685f89735fea8137 100644 (file)
--- a/Config.uk
+++ b/Config.uk
@@ -3,7 +3,8 @@ menuconfig LIBLWIP
        default n
        select LIBNOLIBC if !HAVE_LIBC
        select LIBUKDEBUG
-       select LIBUKMTPRIM
+       select LIBUKMPI
+       select LIBUKLOCK
        select LIBUKSWRAND
        select LIBUKSCHED
        select HAVE_NW_STACK
index 93dfc957c080be7bd8f27f5204e86da12377572c..ce1d47b87054d1d0d56ceef737d1766de5be2b40 100644 (file)
 #define SYS_MBOX_NULL  NULL
 
 typedef struct {
-       struct uk_mutex_mt mtx;
+       struct uk_mutex mtx;
        int valid;
 } sys_mutex_t;
 
 typedef struct {
-       struct uk_semaphore_mt sem;
+       struct uk_semaphore sem;
        int valid;
 } sys_sem_t;
 
 typedef struct {
        struct uk_alloc *a;
-       struct uk_mbox_mt *mbox;
+       struct uk_mbox *mbox;
        int valid;
 } sys_mbox_t;
 
index 9d0546d2c1523b3b8b1720d5660b9440ff3698cb..8a6cb13f854bb757526a97d272ec7f5b0b6b7a61 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -13,7 +13,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size)
     UK_ASSERT(mbox);
     mbox->a = uk_alloc_get_default();
     UK_ASSERT(mbox->a);
-    mbox->mbox = uk_mbox_mt_create(mbox->a, size);
+    mbox->mbox = uk_mbox_create(mbox->a, size);
     if (!mbox->mbox)
         return ERR_MEM;
     mbox->valid = 1;
@@ -40,7 +40,7 @@ void sys_mbox_free(sys_mbox_t *mbox)
 {
     UK_ASSERT(sys_mbox_valid(mbox));
 
-    uk_mbox_mt_free(mbox->a, mbox->mbox);
+    uk_mbox_free(mbox->a, mbox->mbox);
     sys_mbox_set_invalid(mbox);
 }
 
@@ -54,7 +54,7 @@ void sys_mbox_post(sys_mbox_t *mbox, void *msg)
        return;
     }
 
-    uk_mbox_mt_post(mbox->mbox, msg);
+    uk_mbox_post(mbox->mbox, msg);
 }
 
 /* Try to post the "msg" to the mailbox. */
@@ -62,7 +62,7 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
 {
     UK_ASSERT(sys_mbox_valid(mbox));
 
-    if (uk_mbox_mt_post_try(mbox->mbox, msg) < 0)
+    if (uk_mbox_post_try(mbox->mbox, msg) < 0)
         return ERR_MEM;
     return ERR_OK;
 }
@@ -83,7 +83,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
 
     UK_ASSERT(sys_mbox_valid(mbox));
 
-    nsret = uk_mbox_mt_recv_to(mbox->mbox, msg,
+    nsret = uk_mbox_recv_to(mbox->mbox, msg,
                                ukarch_time_msec_to_nsec((__nsec) timeout));
     if (unlikely(nsret == __NSEC_MAX))
         return SYS_ARCH_TIMEOUT;
@@ -106,7 +106,7 @@ u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) {
 
     UK_ASSERT(sys_mbox_valid(mbox));
 
-    if (uk_mbox_mt_recv_try(mbox->mbox, &rmsg) < 0)
+    if (uk_mbox_recv_try(mbox->mbox, &rmsg) < 0)
        return SYS_MBOX_EMPTY;
 
     if (msg)
diff --git a/mutex.c b/mutex.c
index ecd20eceb6f1028197b225e71fa2330be73e37ca..aaa1085c708fe334dd2aa656c83d1301bb60e069 100644 (file)
--- a/mutex.c
+++ b/mutex.c
@@ -8,7 +8,7 @@
  * the initial state of the semaphore. */
 err_t sys_mutex_new(sys_mutex_t *mtx)
 {
-       uk_mutex_mt_init(&mtx->mtx);
+       uk_mutex_init(&mtx->mtx);
        mtx->valid = 1;
        return ERR_OK;
 }
@@ -31,10 +31,10 @@ void sys_mutex_free(sys_mutex_t *mtx)
 /* Signals a mtxaphore. */
 void sys_mutex_lock(sys_mutex_t *mtx)
 {
-       uk_mutex_mt_hold(&mtx->mtx);
+       uk_mutex_hold(&mtx->mtx);
 }
 
 void sys_mutex_unlock(sys_mutex_t *mtx)
 {
-       uk_mutex_mt_release(&mtx->mtx);
+       uk_mutex_release(&mtx->mtx);
 }
index 2f728d79238fd03dc5209ae1d123888629dbf5ad..8b1b15faec994a8ed42de98ffe1c778d0acdd76b 100644 (file)
@@ -8,7 +8,7 @@
  * the initial state of the semaphore. */
 err_t sys_sem_new(sys_sem_t *sem, u8_t count)
 {
-       uk_semaphore_mt_init(&sem->sem, (long) count);
+       uk_semaphore_init(&sem->sem, (long) count);
        sem->valid = 1;
        return ERR_OK;
 }
@@ -31,7 +31,7 @@ void sys_sem_free(sys_sem_t *sem)
 /* Signals a semaphore. */
 void sys_sem_signal(sys_sem_t *sem)
 {
-       uk_semaphore_mt_up(&sem->sem);
+       uk_semaphore_up(&sem->sem);
 }
 
 /* Blocks the thread while waiting for the semaphore to be
@@ -48,7 +48,7 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout)
 {
     __nsec nsret;
 
-    nsret = uk_semaphore_mt_down_to(&sem->sem,
+    nsret = uk_semaphore_down_to(&sem->sem,
                                     ukarch_time_msec_to_nsec((__nsec) timeout));
     if (unlikely(nsret == __NSEC_MAX))
         return SYS_ARCH_TIMEOUT;