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

[Minios-devel] [UNIKRAFT/NEWLIB PATCH] Use Unikraft __getreent() when scheduling is enabled


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Fri, 22 Mar 2019 16:11:07 +0200
  • Cc: Florian.Schmidt@xxxxxxxxx
  • Delivery-date: Fri, 22 Mar 2019 14:11:19 +0000
  • Ironport-phdr: 9a23:M80B4xZfAxOYi6tSqT9jGPH/LSx+4OfEezUN459isYplN5qZr82/bnLW6fgltlLVR4KTs6sC17OO9f+5EjFfqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5uIBmsrwjdq8YajItgJ60s1hbHv3xEdvhMy2h1P1yThRH85smx/J5n7Stdvu8q+tBDX6vnYak2VKRUAzs6PW874s3rrgTDQhCU5nQASGUWkwFHDBbD4RrnQ5r+qCr6tu562CmHIc37SK0/VDq+46t3ThLjlSEKPCM7/m7KkMx9lKJVrgy8qRJxwIDaZ5qYOOZicq7HYd8XX3ZNUtpXWidcAo28dYwPD+8ZMOtGqIn9vEcOrRq4BQKxAu3v1ydIhmLr1qA9z+shFhrG3BAhH9IIqnjUqMj1NL8PUe2u0KbI1i/Pb+tL2Tjm8oTIaBchrOiKULltcsTR0VEiGx7Kg1mNs4DoPDOY2v4Tv2SF7edsT+yih3Y6pwx+vzSj3MQhh4nTio4LxF3J+z91zJs6KNGmTkNwfMSqH4FKty6AMot7WsYiQ2Z1tykk0rAGopu7fDQSyJQg2h7fd+SLc4iW7RLnU+acOSl4hHd/d7K+gxa+61SvyvbmWsmszVZFtTBJksPLtnwV1hzT7NaISudl80u81juDyhrf5+JELEwui6bXNZwszqQ+m5YLtETMBC72mEH4jK+McUUk//Cl5PjgYrX9up+cNol0hhv6MqQzgsy/HP81PRQVX2SB4eS8yabs8VfjQLVNlvE2iLXWsIjGJcQHoa60GwpV0ocl6xa+CDemy80UkmQZI1JbZh2Hi5PkO1XPIPDjEfe/mE6gkTh1yPDAJLHhBY/NLnfbmrf7Ybl981JcyBY0zd1H55xUDrYBIOjyWkDrstzUFAI3PBC0w+biCdVyy58eVHmJAqCHLKzStUWH6fk1L+aSeY9G8Ar6fv0k4f/pljo1lEEQeYGt3IALczaoE/IgJF+WMlT2hdJUOmARogs4BMj3kEDKBTVUfGqzWeQ4+ykmIIm9S5/eTMa3h+rSj2+AApRKazUeWRi3GnDyetDcVg==
  • Ironport-sdr: z5J3jGlXze2ovuP9u/fDiluKvPKP0e+QLfK0MxB4kMbt+A/hRse7kcqgnN0BUtOycFwJMn5E8n cgPxNqsvOGnw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

When scheduling is enabled, Unikraft provides the __getreent() function.

The current patch also fixes the compilation warnings that occur
because of __DYNAMIC_REENT__ redefinition when __rtems__ is defined.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk    |  7 ++++++-
 include/time.h | 17 ++++++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/Makefile.uk b/Makefile.uk
index 6a918b8..44bb13e 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -311,12 +311,17 @@ LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/posix/regfree.c
 
################################################################################
 # Newlib/libc code -- reent
 
################################################################################
+ifeq ($(CONFIG_HAVE_SCHED),y)
+# if scheduling enabled, then Unikraft provides __getreent()
+LIBNEWLIBC_CFLAGS-y += -D__DYNAMIC_REENT__
+else
+LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/getreent.c
+endif
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/closer.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/reent.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/impure.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/fcntlr.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/fstatr.c
-LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/getreent.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/gettimeofdayr.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/isattyr.c
 LIBNEWLIBC_SRCS-y += $(LIBNEWLIB_LIBC)/reent/linkr.c
diff --git a/include/time.h b/include/time.h
index b51b2dd..dd2eef2 100644
--- a/include/time.h
+++ b/include/time.h
@@ -47,7 +47,17 @@
 /* A definition only for this header */
 #define __undef_rtems__NEWLIBGLUE_TIME_H
 #define __rtems__
-#endif
+
+/*
+ * __DYNAMIC_REENT__ is defined in sys/config.h if
+ * __rtems__ is defined; we undefine it in order to
+ * avoid warnings.
+ */
+#ifdef __DYNAMIC_REENT__
+#define __define_DYNAMIC_REENT__NEWLIBGLUE_TIME_H
+#undef __DYNAMIC_REENT__
+#endif /* __DYNAMIC_REENT__ */
+#endif /* __rtems__ */
 
 #include_next <time.h>
 
@@ -57,4 +67,9 @@
 #undef __undef_rtems__NEWLIBGLUE_TIME_H
 #endif
 
+#ifdef __define_DYNAMIC_REENT__NEWLIBGLUE_TIME_H
+#define __DYNAMIC_REENT__
+#undef __define_DYNAMIC_REENT__NEWLIBGLUE_TIME_H
+#endif
+
 #endif /* NEWLIBGLUE_TIME_H */
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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