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

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


  • To: Florian Schmidt <florian.schmidt@xxxxxxxxx>, minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 3 Apr 2019 19:25:45 +0300
  • Cc: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
  • Delivery-date: Wed, 03 Apr 2019 16:25:56 +0000
  • Ironport-phdr: 9a23:yNWt3RZgkuh9AKEI773MD0L/LSx+4OfEezUN459isYplN5qZpsy6bR7h7PlgxGXEQZ/co6odzbaP6ua4AidfuN7B6ClELMUUEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUoHdgN6q2O+s5pbdfxtHhCanYbN1MR66sRjdutMZjId/N6o90AfFr3VHd+lU2G9jOFafkwrh6suq85Nv7jhct+g9+8JcVKnxYrg1Q6FfADk6KW4++dfltQPETQuB53scVnsZnx9VCAXb7x/0Q4n8vDLiuuVyxCeVM8v2TaspWTu59KdkVAXoiCYcODEn9mzcl9F9g7haoBKloBx/3pLUbYSIP/dwYq/RYdUXTndaU81PSyJOHJ+zb4oXD+oAI+lYqZX9p0ATphe6HAWgGf/jxiNNinLwwKY00fkuERve0QI9AdwOvnTaotb7OqgcXu+6zrXHwzrYYvNK2zrw8pTEfgwvrPyOW797bMrfyVMoFwPAllidt4vlPyiJ1uQMtWiQ8uxuVf+3i246tgp8pSSgxsA3ionVh4IVzErI9SFkwIYtON21U1J0YcW+HJtIqiGVLJF6QtklQ2xxvisx174IuYajcSQXx5kr2gTTZv+HfoSS/B7vSuScLS12iX59Zb6yiAu+/VKjx+D8TMW4zlhHoyRfntXRuX0ByRre4dWdRPRn5EeuwzOP2hjW6uFDPE87i7LWK4Ukwr4sjpoTtlnDHjPulEX2kqCWckIk9/C26+TieLrmp5ucO5VohQHlKKgugtG/Dv8iPggUWGiX4eW81Lv98k3lWLhGk/I7nrTDvJ3ZJckXvLC1DxFX34o55RuzFzKm384ZnXkDIlJFYhWHj43xNl7SJ/D4Fuu/g1WqkDtxw/DGI6XhAojWI3ffi7ftZ65961NHxwYp19Bf4IpYCqsdL/LrRk/xqNvYAwc8Mwy1xebnCdJ91pgHVW2SHKCZLr3dsVuT6+IrIumMf5MVuC3nJ/kq+fHui2U1mVgHfammxZEXcmy3Hux6I0WFZnrhmtkBEWMNvgokTezlkluCXSRIZ3muX6I84zA7B5+6DYrYQICinqCO3COhEZJNfGxJFE2MG2/yd4qYQ/cMdD6SIsh5nzwfVLihTogh1Re0uA/51rpoMOzU+ywGupL5z9V14fPcmg029TNuFMuRyX+CT3wn1l8PEhEy27p+qEo18VyD1Kl0n7QMG9hU/fJAVEEhPp7ZzuBmI9b/UQbIdJGEVQDiCtCnBzA2VZc9zsEDZ255Gs6+lVbT0izsBKUaxJKRA5lh2aXHw3n3b+Jg02uOgKImlEUnRI1LKHW7rqVksRDODcjTlBPKxO6Raa0A0XuVpy+4xm2UsRQdCVYoXA==
  • Ironport-sdr: vqf+UQET+/FXwxKkv0ysPGCvfXs7ivSkX2FHMblJLd/ze4x2T3rt0NWLjHDPG2+8oBy3fhUmfj z842cguE3SsQ==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Hi Florian,

Thanks for the patch!

Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx>

On 4/3/19 3:11 PM, Florian Schmidt wrote:
> 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);
>  
> 

_______________________________________________
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®.