mirror of
https://github.com/kamb205/KB-RPCS3.git
synced 2026-10-17 20:00:49 +02:00
31 lines
906 B
C
31 lines
906 B
C
/*
|
|
* The emulated-TLS control block, matching compiler-rt's libc/emutls.c.
|
|
* gcc_word is mode(word): 64-bit on x86-64, so {size, align, object.index/address, value}.
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
#pragma once
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct __emutls_control {
|
|
uintptr_t size; /* size of the object in bytes */
|
|
uintptr_t align; /* alignment of the object in bytes */
|
|
union {
|
|
uintptr_t index; /* 1-based; data[index-1] is the object address */
|
|
void* address; /* the object address, single-threaded */
|
|
} object;
|
|
const void* value; /* NULL, or the initial value */
|
|
} __emutls_control;
|
|
|
|
/* E: the stock compiler-rt entry point (libc.a) */
|
|
void* __emutls_get_address(__emutls_control* control);
|
|
/* F: the probe's lock-free-cache entry point */
|
|
void* ps5_fast_emutls_get_address(__emutls_control* control);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|