[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[UNIKRAFT PATCH 1/4] include/: Remove libc dependency in `<uk/plat/thread.h>`



Removes the dependency to a libc with the platform header
`<uk/plat/thread.h>`. This is done in order to avoid unexpected
import orders and conflicts caused by generic Unikraft headers.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 include/uk/plat/thread.h           | 16 ++++++++--------
 lib/9pfs/9pfs_vfsops.c             |  1 +
 lib/9pfs/9pfs_vnops.c              |  1 +
 lib/uknetdev/netdev.c              |  1 +
 lib/vfscore/file.c                 |  1 +
 lib/vfscore/pipe.c                 |  1 +
 plat/xen/drivers/9p/9pfront.c      |  1 +
 plat/xen/drivers/blk/blkfront_xs.c |  1 +
 plat/xen/xenbus/xs_comms.c         |  1 +
 9 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/include/uk/plat/thread.h b/include/uk/plat/thread.h
index 4b349ea7..8f3b0cea 100644
--- a/include/uk/plat/thread.h
+++ b/include/uk/plat/thread.h
@@ -38,7 +38,7 @@
 #ifndef __UKPLAT_THREAD_H__
 #define __UKPLAT_THREAD_H__
 
-#include <stdlib.h>
+#include <uk/arch/types.h>
 #include <uk/essentials.h>
 #include <uk/assert.h>
 
@@ -76,8 +76,8 @@ void *ukplat_thread_ctx_create(struct ukplat_ctx_callbacks 
*cbs,
                struct uk_alloc *allocator, unsigned long sp,
                unsigned long tlsp)
 {
-       UK_ASSERT(cbs != NULL);
-       UK_ASSERT(allocator != NULL);
+       UK_ASSERT(cbs != __NULL);
+       UK_ASSERT(allocator != __NULL);
 
        return cbs->create_cb(allocator, sp, tlsp);
 }
@@ -92,8 +92,8 @@ static inline
 void ukplat_thread_ctx_start(struct ukplat_ctx_callbacks *cbs,
                void *ctx)
 {
-       UK_ASSERT(cbs != NULL);
-       UK_ASSERT(ctx != NULL);
+       UK_ASSERT(cbs != __NULL);
+       UK_ASSERT(ctx != __NULL);
 
        cbs->start_cb(ctx);
 }
@@ -102,9 +102,9 @@ static inline
 void ukplat_thread_ctx_switch(struct ukplat_ctx_callbacks *cbs,
                void *prevctx, void *nextctx)
 {
-       UK_ASSERT(cbs != NULL);
-       UK_ASSERT(prevctx != NULL);
-       UK_ASSERT(nextctx != NULL);
+       UK_ASSERT(cbs != __NULL);
+       UK_ASSERT(prevctx != __NULL);
+       UK_ASSERT(nextctx != __NULL);
 
        cbs->switch_cb(prevctx, nextctx);
 }
diff --git a/lib/9pfs/9pfs_vfsops.c b/lib/9pfs/9pfs_vfsops.c
index 5293b221..0059e06a 100644
--- a/lib/9pfs/9pfs_vfsops.c
+++ b/lib/9pfs/9pfs_vfsops.c
@@ -38,6 +38,7 @@
 #include <uk/9pdev_trans.h>
 #include <vfscore/mount.h>
 #include <vfscore/dentry.h>
+#include <stdlib.h>
 
 #include "9pfs.h"
 
diff --git a/lib/9pfs/9pfs_vnops.c b/lib/9pfs/9pfs_vnops.c
index 5a0700c6..1da64e96 100644
--- a/lib/9pfs/9pfs_vnops.c
+++ b/lib/9pfs/9pfs_vnops.c
@@ -36,6 +36,7 @@
 
 #include <fcntl.h>
 #include <dirent.h>
+#include <stdlib.h>
 #include <uk/config.h>
 #include <uk/9p.h>
 #include <uk/errptr.h>
diff --git a/lib/uknetdev/netdev.c b/lib/uknetdev/netdev.c
index 87322c7f..6a55a25f 100644
--- a/lib/uknetdev/netdev.c
+++ b/lib/uknetdev/netdev.c
@@ -35,6 +35,7 @@
  */
 #define _GNU_SOURCE /* for asprintf() */
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <uk/netdev.h>
 #include <uk/print.h>
diff --git a/lib/vfscore/file.c b/lib/vfscore/file.c
index bc8b0dc8..fe9458ae 100644
--- a/lib/vfscore/file.c
+++ b/lib/vfscore/file.c
@@ -34,6 +34,7 @@
  */
 
 #include <unistd.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <uk/print.h>
 #include <vfscore/file.h>
diff --git a/lib/vfscore/pipe.c b/lib/vfscore/pipe.c
index 8d382965..7d435174 100644
--- a/lib/vfscore/pipe.c
+++ b/lib/vfscore/pipe.c
@@ -34,6 +34,7 @@
  */
 
 #include <uk/config.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <vfscore/file.h>
diff --git a/plat/xen/drivers/9p/9pfront.c b/plat/xen/drivers/9p/9pfront.c
index 429c7b97..0b4c5fdd 100644
--- a/plat/xen/drivers/9p/9pfront.c
+++ b/plat/xen/drivers/9p/9pfront.c
@@ -32,6 +32,7 @@
  * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
  */
 
+#include <stdlib.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <uk/config.h>
diff --git a/plat/xen/drivers/blk/blkfront_xs.c 
b/plat/xen/drivers/blk/blkfront_xs.c
index f10ca66a..d311e33e 100644
--- a/plat/xen/drivers/blk/blkfront_xs.c
+++ b/plat/xen/drivers/blk/blkfront_xs.c
@@ -33,6 +33,7 @@
  * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
  */
 #define _GNU_SOURCE /* for asprintf() */
+#include <stdlib.h>
 #include <inttypes.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/plat/xen/xenbus/xs_comms.c b/plat/xen/xenbus/xs_comms.c
index 5c393c1e..953a4eba 100644
--- a/plat/xen/xenbus/xs_comms.c
+++ b/plat/xen/xenbus/xs_comms.c
@@ -40,6 +40,7 @@
  * Ported from Mini-OS xenbus.c
  */
 
+#include <stdlib.h>
 #include <string.h>
 #include <uk/errptr.h>
 #include <uk/bitmap.h>
-- 
2.20.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.