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

Re: [Minios-devel] [UNIKRAFT/MUSL PATCH 03/19] Add patch to avoid conflicts in threads definitions



Hi Gaulthier,

Why don't you use musl's pthreads?

Before porting pthread-embedded we had a look on musl's implementation.
But because of the time constraints we decided to port pthread-embedded
instead, it took less time. But AFAIR musl's pthreads implementation is
better than pthread-embedded, so why not picking that one?

Costin

On 10/15/19 6:23 PM, Gaulthier Gain wrote:
> wip: This patch fixes all declarations related to pthread in
> alltypes.h.in files. The goal is to consider libpthread-embedded to
> manage threads instead of musl internal pthread structures. In
> addition, it updates mode_t declaration in order to avoid compilation
> errors. As this patch is in the early work, musl does NOT compile.
> 
> Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
> ---
>  ...update-alltypes_in_h-for-pthread-embedded.patch | 62 
> ++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
>  create mode 100644 
> patches/0004-update-alltypes_in_h-for-pthread-embedded.patch
> 
> diff --git a/patches/0004-update-alltypes_in_h-for-pthread-embedded.patch 
> b/patches/0004-update-alltypes_in_h-for-pthread-embedded.patch
> new file mode 100644
> index 0000000..576c6d9
> --- /dev/null
> +++ b/patches/0004-update-alltypes_in_h-for-pthread-embedded.patch
> @@ -0,0 +1,62 @@
> +From b836150bc811245c43255389a12e511960d6b384 Mon Sep 17 00:00:00 2001
> +From: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
> +Date: Fri, 11 Oct 2019 11:46:39 +0200
> +Subject: [MUSL] [PATCH] Update alltypes.h.in to avoid conflicts with PTE
> +
> +Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
> +---
> + arch/x86_64/bits/alltypes.h.in |  5 -----
> + include/alltypes.h.in          | 15 +--------------
> + 2 files changed, 1 insertion(+), 19 deletions(-)
> +
> +diff --git a/arch/x86_64/bits/alltypes.h.in b/arch/x86_64/bits/alltypes.h.in
> +index dc551d4..e57e3f2 100644
> +--- a/arch/x86_64/bits/alltypes.h.in
> ++++ b/arch/x86_64/bits/alltypes.h.in
> +@@ -22,10 +22,5 @@ TYPEDEF struct { long long __ll; long double __ld; } 
> max_align_t;
> + TYPEDEF long time_t;
> + TYPEDEF long suseconds_t;
> + 
> +-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; unsigned long 
> __s[7]; } __u; } pthread_attr_t;
> +-TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void 
> *volatile __p[5]; } __u; } pthread_mutex_t;
> + TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; volatile void 
> *volatile __p[5]; } __u; } mtx_t;
> +-TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; 
> } __u; } pthread_cond_t;
> + TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[6]; 
> } __u; } cnd_t;
> +-TYPEDEF struct { union { int __i[14]; volatile int __vi[14]; void *__p[7]; 
> } __u; } pthread_rwlock_t;
> +-TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[4]; } 
> __u; } pthread_barrier_t;
> +diff --git a/include/alltypes.h.in b/include/alltypes.h.in
> +index 6a9c105..b778c63 100644
> +--- a/include/alltypes.h.in
> ++++ b/include/alltypes.h.in
> +@@ -18,7 +18,7 @@ TYPEDEF unsigned _Int64 uint64_t;
> + TYPEDEF unsigned _Int64 u_int64_t;
> + TYPEDEF unsigned _Int64 uintmax_t;
> + 
> +-TYPEDEF unsigned mode_t;
> ++typedef unsigned mode_t;
> + TYPEDEF unsigned _Reg nlink_t;
> + TYPEDEF _Int64 off_t;
> + TYPEDEF unsigned _Int64 ino_t;
> +@@ -44,19 +44,6 @@ TYPEDEF unsigned gid_t;
> + TYPEDEF int key_t;
> + TYPEDEF unsigned useconds_t;
> + 
> +-#ifdef __cplusplus
> +-TYPEDEF unsigned long pthread_t;
> +-#else
> +-TYPEDEF struct __pthread * pthread_t;
> +-#endif
> +-TYPEDEF int pthread_once_t;
> +-TYPEDEF unsigned pthread_key_t;
> +-TYPEDEF int pthread_spinlock_t;
> +-TYPEDEF struct { unsigned __attr; } pthread_mutexattr_t;
> +-TYPEDEF struct { unsigned __attr; } pthread_condattr_t;
> +-TYPEDEF struct { unsigned __attr; } pthread_barrierattr_t;
> +-TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
> +-
> + TYPEDEF struct _IO_FILE FILE;
> + 
> + TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
> +-- 
> +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®.