core: Rewrite thread local storage implementation (#118)

This commit is contained in:
TheTurtle 2024-05-01 13:38:41 +03:00 committed by GitHub
parent b94efcba5a
commit 1b9bf924ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 176 additions and 189 deletions

View file

@ -5,12 +5,16 @@
#include "common/types.h"
namespace Xbyak {
class CodeGenerator;
}
namespace Core {
/// Installs a host exception handler to handle guest TLS access.
void InstallTlsHandler();
/// Sets the data pointer that contains the TLS image.
void SetTLSStorage(u64 image_address);
/// Patches any instructions that access TLS to trigger the exception handler.
void PatchTLS(u64 segment_addr, u64 segment_size);
/// Patches any instructions that access guest TLS to use provided storage.
void PatchTLS(u64 segment_addr, u64 segment_size, Xbyak::CodeGenerator& c);
} // namespace Core