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

[Minios-devel] [UNIKRAFT PATCH] plat/linuxu: add prefixes to prevent name clashes



The sa_* names as well as the CLOCK_* defines clash with newlib. To
prevent that, prefix them with k_/K_ as other names used in linuxu that
are only used for interaction with the Linux kernel.

Signed-off-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>
---
 plat/linuxu/include/linuxu/signal.h | 8 ++++----
 plat/linuxu/include/linuxu/time.h   | 4 ++--
 plat/linuxu/irq.c                   | 6 +++---
 plat/linuxu/time.c                  | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/plat/linuxu/include/linuxu/signal.h 
b/plat/linuxu/include/linuxu/signal.h
index 84234f6b..62395df3 100644
--- a/plat/linuxu/include/linuxu/signal.h
+++ b/plat/linuxu/include/linuxu/signal.h
@@ -56,10 +56,10 @@ typedef void (*uk_sighandler_t)(int);
 typedef void (*uk_sigrestore_t)(void);
 
 struct uk_sigaction {
-       uk_sighandler_t sa_handler;
-       int sa_flags;
-       uk_sigrestore_t sa_restorer;
-       k_sigset_t sa_mask;
+       uk_sighandler_t k_sa_handler;
+       int k_sa_flags;
+       uk_sigrestore_t k_sa_restorer;
+       k_sigset_t k_sa_mask;
 };
 
 /* sigaction flags */
diff --git a/plat/linuxu/include/linuxu/time.h 
b/plat/linuxu/include/linuxu/time.h
index c1a875af..648ad0bb 100644
--- a/plat/linuxu/include/linuxu/time.h
+++ b/plat/linuxu/include/linuxu/time.h
@@ -44,8 +44,8 @@
 
 /* POSIX definitions */
 
-#define CLOCK_REALTIME       0
-#define CLOCK_MONOTONIC      1
+#define K_CLOCK_REALTIME       0
+#define K_CLOCK_MONOTONIC      1
 
 typedef int k_clockid_t;
 
diff --git a/plat/linuxu/irq.c b/plat/linuxu/irq.c
index f2b18a85..961dcf9b 100644
--- a/plat/linuxu/irq.c
+++ b/plat/linuxu/irq.c
@@ -159,9 +159,9 @@ int ukplat_irq_register(unsigned long irq, 
irq_handler_func_t func, void *arg)
 
        /* Register signal action */
        memset(&action, 0, sizeof(action));
-       action.sa_handler = _irq_handle;
-       action.sa_flags = SA_RESTORER;
-       action.sa_restorer = __restorer;
+       action.k_sa_handler = _irq_handle;
+       action.k_sa_flags = SA_RESTORER;
+       action.k_sa_restorer = __restorer;
 
        rc = sys_sigaction((int) irq, &action, &h->oldaction);
        if (rc != 0)
diff --git a/plat/linuxu/time.c b/plat/linuxu/time.c
index 7b88ed4b..c6a5b349 100644
--- a/plat/linuxu/time.c
+++ b/plat/linuxu/time.c
@@ -49,7 +49,7 @@ __nsec ukplat_monotonic_clock(void)
        __nsec ret;
        int rc;
 
-       rc = sys_clock_gettime(CLOCK_MONOTONIC, &tp);
+       rc = sys_clock_gettime(K_CLOCK_MONOTONIC, &tp);
        if (unlikely(rc != 0))
                return 0;
 
@@ -65,7 +65,7 @@ __nsec ukplat_wall_clock(void)
        __nsec ret;
        int rc;
 
-       rc = sys_clock_gettime(CLOCK_REALTIME, &tp);
+       rc = sys_clock_gettime(K_CLOCK_REALTIME, &tp);
        if (unlikely(rc != 0))
                return 0;
 
@@ -97,7 +97,7 @@ void ukplat_time_init(void)
        sigev.sigev_signo = TIMER_SIGNUM;
        sigev.sigev_value.sival_ptr = &timerid;
 
-       rc = sys_timer_create(CLOCK_REALTIME, &sigev, &timerid);
+       rc = sys_timer_create(K_CLOCK_REALTIME, &sigev, &timerid);
        if (unlikely(rc != 0))
                UK_CRASH("Failed to create timer: %d\n", rc);
 
-- 
2.21.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®.