Windows: Support enabling hardware TSO on Asahi

Relies on a wine-side patch to expose the prctl to the PE-side
This commit is contained in:
Billy Laws committed 2025-07-15 17:45:21 +01:00
1 parent 5b0e703811
commit 0361274366
3 files changed
+20

No files matched your search

+9
View File
@@ -653,6 +653,15 @@ NTSTATUS ProcessInit() {
const uintptr_t KiUserExceptionDispatcherFFS = reinterpret_cast<uintptr_t>(GetProcAddress(NtDll, "KiUserExceptionDispatcher"));
Exception::KiUserExceptionDispatcher = NtDllRedirectionLUT[KiUserExceptionDispatcherFFS - NtDllBase] + NtDllBase;
FEX_CONFIG_OPT(TSOEnabled, TSOENABLED);
if (TSOEnabled()) {
BOOL Enable = TRUE;
NTSTATUS Status = NtSetInformationProcess(NtCurrentProcess(), ProcessFexHardwareTso, &Enable, sizeof(Enable));
if (Status == STATUS_SUCCESS) {
CTX->SetHardwareTSOSupport(true);
}
}
FEX_CONFIG_OPT(ProfileStats, PROFILESTATS);
FEX_CONFIG_OPT(StartupSleep, STARTUPSLEEP);
FEX_CONFIG_OPT(StartupSleepProcName, STARTUPSLEEPPROCNAME);
+9
View File
@@ -520,6 +520,15 @@ void BTCpuProcessInit() {
// wow64.dll will only initialise the cross-process queue if this is set
GetTLS().Wow64Info().CpuFlags = WOW64_CPUFLAGS_SOFTWARE;
FEX_CONFIG_OPT(TSOEnabled, TSOENABLED);
if (TSOEnabled()) {
BOOL Enable = TRUE;
NTSTATUS Status = NtSetInformationProcess(NtCurrentProcess(), ProcessFexHardwareTso, &Enable, sizeof(Enable));
if (Status == STATUS_SUCCESS) {
CTX->SetHardwareTSOSupport(true);
}
}
FEX_CONFIG_OPT(ProfileStats, PROFILESTATS);
FEX_CONFIG_OPT(StartupSleep, STARTUPSLEEP);
FEX_CONFIG_OPT(StartupSleepProcName, STARTUPSLEEPPROCNAME);
+2
View File
@@ -452,6 +452,8 @@ typedef enum _MEMORY_INFORMATION_CLASS {
MemoryFexStatsShm = 2000,
} MEMORY_INFORMATION_CLASS;
#define ProcessFexHardwareTso (PROCESSINFOCLASS)2000
typedef enum _KEY_VALUE_INFORMATION_CLASS {
KeyValueBasicInformation,
KeyValueFullInformation,