2013-12-15 09:09:20 +01:00
|
|
|
/* default reentrant pointer when multithread enabled */
|
|
|
|
|
|
|
|
#include <_ansi.h>
|
|
|
|
#include <string.h>
|
2016-09-27 22:37:49 +02:00
|
|
|
#include <sys/reent.h>
|
2013-12-15 09:09:20 +01:00
|
|
|
#include <kos32sys.h>
|
|
|
|
|
2016-09-27 22:37:49 +02:00
|
|
|
extern _VOID _EXFUN(__sinit,(struct _reent *));
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
void init_reent()
|
|
|
|
{
|
|
|
|
struct _reent *ent;
|
|
|
|
|
|
|
|
ent = user_alloc(sizeof(struct _reent));
|
|
|
|
|
2016-11-03 20:02:07 +01:00
|
|
|
_REENT_INIT_PTR_ZEROED(ent);
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"movl %0, %%fs:16"
|
|
|
|
::"r"(ent));
|
|
|
|
__sinit(ent);
|
|
|
|
}
|