Costin Lupu [Sun, 13 Oct 2019 13:16:55 +0000 (16:16 +0300)]
pthread.h: Convert pthread_t to unsigned long
The POSIX standard outlines that pthread_t is an opaque data type and no
assumption should be made about it. However, we observed that libraries and
applications assume frequently that pthread_t is a pointer or other numerical
data type and use it to identify the corresponding threads.
pthread-embedded makes the strange decision to define pthread_t as
structure, a decision that, although compliant with POSIX standards,
makes the porting process a bit challenging. Therefore we introduce a
conversion function which simply returns the first encapsulated
unsigned long value in the structure which actually points to the
underlying thread object.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Mon, 3 Jun 2019 15:16:39 +0000 (18:16 +0300)]
Add missing pthread functions
This patch adds some missing functions for updating threads attributes,
such as the thread name or the stack address and size. Currently we
support only the fixed stack size of 64KB.
These new functions are used by the Ruby interpreter.
Costin Lupu [Mon, 3 Jun 2019 15:16:36 +0000 (18:16 +0300)]
Initial port of pthread-embedded to Unikraft
This is our initial port of pthread-embedded to Unikraft as external
library. For now you need newlib to make it work. When adding the
library in the dependency list, pthread-embedded should stay before
newlib (e.g. ...:$(UK_LIBS)/pthread-embedded:$(UK_LIBS)/newlib.git:...).