Blame arch/nt64/src/crt_tls.c

860627
#include <stdint.h>
860627
#include <stddef.h>
860627
#include "psxglue.h"
860627
#include "pthread_arch.h"
860627
860627
typedef unsigned int __tls_word	__attribute__((mode(word)));
860627
typedef unsigned int __tls_ptr	__attribute__((mode(pointer)));
860627
860627
struct __emutls_object
860627
{
860627
	__tls_word	size;
860627
	__tls_word	align;
860627
	ptrdiff_t	offset;
860627
	void *		defval;
860627
};
860627
860627
void * __emutls_get_address (struct __emutls_object * obj)
860627
{
860627
	int dsoidx = obj->align & 0xFFFF0000;
bd9527
	struct __tlca_abi * tlca = (struct __tlca_abi *)__psx_tlca();
b511db
	return tlca->pthread_dtls[dsoidx >> 16] + obj->offset;
860627
}
860627