Module: wine Branch: master Commit: 0051e102cccee6fd461474324e32da947a9fb963 URL: https://gitlab.winehq.org/wine/wine/-/commit/0051e102cccee6fd461474324e32da9...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Jun 21 11:16:57 2024 +0200
ntdll: Move RtlIsProcessorFeaturePresent implementation to the CPU backends.
---
dlls/ntdll/rtl.c | 35 ----------------------------------- dlls/ntdll/signal_arm.c | 9 +++++++++ dlls/ntdll/signal_arm64.c | 30 ++++++++++++++++++++++++++++++ dlls/ntdll/signal_arm64ec.c | 10 ++++++++++ dlls/ntdll/signal_i386.c | 9 +++++++++ dlls/ntdll/signal_x86_64.c | 10 ++++++++++ 6 files changed, 68 insertions(+), 35 deletions(-)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 1288b57f11c..3dff04e52c9 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -34,7 +34,6 @@ #include "wine/exception.h" #include "ntdll_misc.h" #include "in6addr.h" -#include "ddk/ntddk.h" #include "ddk/ntifs.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -1421,40 +1420,6 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor) processor->Reserved = 0; }
-/*********************************************************************** - * RtlIsProcessorFeaturePresent [NTDLL.@] - */ -BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) -{ -#ifdef __aarch64__ - static const ULONGLONG arm64_features = - (1ull << PF_COMPARE_EXCHANGE_DOUBLE) | - (1ull << PF_NX_ENABLED) | - (1ull << PF_ARM_VFP_32_REGISTERS_AVAILABLE) | - (1ull << PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_SECOND_LEVEL_ADDRESS_TRANSLATION) | - (1ull << PF_FASTFAIL_AVAILABLE) | - (1ull << PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE) | - (1ull << PF_ARM_64BIT_LOADSTORE_ATOMIC) | - (1ull << PF_ARM_EXTERNAL_CACHE_AVAILABLE) | - (1ull << PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V8_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) | - (1ull << PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE); - - return (feature < PROCESSOR_FEATURE_MAX && (arm64_features & (1ull << feature)) && - user_shared_data->ProcessorFeatures[feature]); -#elif defined _WIN64 - return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; -#else - return NtWow64IsProcessorFeaturePresent( feature ); -#endif -} - /*********************************************************************** * RtlInitializeGenericTableAvl (NTDLL.@) */ diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index aeed022d78f..595eb71a81e 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -566,6 +566,15 @@ NTSTATUS WINAPI RtlGetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, }
+/*********************************************************************** + * RtlIsProcessorFeaturePresent [NTDLL.@] + */ +BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +{ + return NtWow64IsProcessorFeaturePresent( feature ); +} + + /************************************************************************* * RtlWalkFrameChain (NTDLL.@) */ diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 8b4fea80bb6..0531083ba4e 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -31,6 +31,7 @@ #define WIN32_NO_STATUS #include "windef.h" #include "winternl.h" +#include "ddk/wdm.h" #include "wine/exception.h" #include "ntdll_misc.h" #include "wine/debug.h" @@ -600,6 +601,35 @@ NTSTATUS WINAPI RtlGetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, }
+/*********************************************************************** + * RtlIsProcessorFeaturePresent [NTDLL.@] + */ +BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +{ + static const ULONGLONG arm64_features = + (1ull << PF_COMPARE_EXCHANGE_DOUBLE) | + (1ull << PF_NX_ENABLED) | + (1ull << PF_ARM_VFP_32_REGISTERS_AVAILABLE) | + (1ull << PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_SECOND_LEVEL_ADDRESS_TRANSLATION) | + (1ull << PF_FASTFAIL_AVAILABLE) | + (1ull << PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE) | + (1ull << PF_ARM_64BIT_LOADSTORE_ATOMIC) | + (1ull << PF_ARM_EXTERNAL_CACHE_AVAILABLE) | + (1ull << PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V8_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) | + (1ull << PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE); + + return (feature < PROCESSOR_FEATURE_MAX && (arm64_features & (1ull << feature)) && + user_shared_data->ProcessorFeatures[feature]); +} + + /************************************************************************* * RtlWalkFrameChain (NTDLL.@) */ diff --git a/dlls/ntdll/signal_arm64ec.c b/dlls/ntdll/signal_arm64ec.c index 9fde2a4a715..44b026fc044 100644 --- a/dlls/ntdll/signal_arm64ec.c +++ b/dlls/ntdll/signal_arm64ec.c @@ -28,6 +28,7 @@ #define WIN32_NO_STATUS #include "windef.h" #include "winternl.h" +#include "ddk/wdm.h" #include "wine/exception.h" #include "wine/list.h" #include "ntdll_misc.h" @@ -1204,6 +1205,15 @@ NTSTATUS WINAPI RtlGetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, }
+/*********************************************************************** + * RtlIsProcessorFeaturePresent [NTDLL.@] + */ +BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +{ + return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; +} + + /************************************************************************* * RtlWalkFrameChain (NTDLL.@) */ diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index a6c47f1226b..8f11d19024b 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -461,6 +461,15 @@ NTSTATUS WINAPI RtlGetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, }
+/*********************************************************************** + * RtlIsProcessorFeaturePresent [NTDLL.@] + */ +BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +{ + return NtWow64IsProcessorFeaturePresent( feature ); +} + + /************************************************************************* * RtlWalkFrameChain (NTDLL.@) */ diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index f491f07282e..0daf27f6850 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -32,6 +32,7 @@ #define WIN32_NO_STATUS #include "windef.h" #include "winternl.h" +#include "ddk/wdm.h" #include "wine/exception.h" #include "wine/list.h" #include "ntdll_misc.h" @@ -802,6 +803,15 @@ NTSTATUS WINAPI RtlGetNativeSystemInformation( SYSTEM_INFORMATION_CLASS class, }
+/*********************************************************************** + * RtlIsProcessorFeaturePresent [NTDLL.@] + */ +BOOLEAN WINAPI RtlIsProcessorFeaturePresent( UINT feature ) +{ + return feature < PROCESSOR_FEATURE_MAX && user_shared_data->ProcessorFeatures[feature]; +} + + /************************************************************************* * RtlWalkFrameChain (NTDLL.@) */