Blame arch/nt32/src/crt_tls.c

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