From 55aa133d9e2f9d81e408e3d01cb32b87cdac984a Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 16 Sep 2021 15:21:14 -0700 Subject: [PATCH] shims: adjust the SLPI enumeration for Windows 11 It seems that `RelationProcessorModule` is entirely undocumented but listed as an enumerated value in the `LOGICAL_PROCESSOR_RELATIONSHIP` enumeration. Update for the 10.0.22000.0 SDK (Windows 11). --- CMakeLists.txt | 14 ++++++++++++++ src/shims/hw_config.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7f771c29..2bef26395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,20 @@ int main(int argc, char *argv[]) { if(DISPATCH_HAVE_EXTENDED_SLPI_20348) add_compile_definitions(DISPATCH_HAVE_EXTENDED_SLPI_20348) endif() + + check_c_source_compiles([=[ +#include +int main(int argc, char *argv[]) { + switch ((LOGICAL_PROCESSOR_RELATIONSHIP)0) { + case RelationProcessorModule: + return 0; + } + return 0; +} +]=] DISPATCH_HAVE_EXTENDED_SLPI_22000) + if(DISPATCH_HAVE_EXTENDED_SLPI_22000) + add_compile_definitions(DISPATCH_HAVE_EXTENDED_SLPI_22000) + endif() endif() set(CMAKE_C_STANDARD 11) diff --git a/src/shims/hw_config.h b/src/shims/hw_config.h index 185cbdf14..06b8921d9 100644 --- a/src/shims/hw_config.h +++ b/src/shims/hw_config.h @@ -166,6 +166,9 @@ _dispatch_hw_get_config(_dispatch_hw_config_t c) #endif case RelationCache: case RelationGroup: +#if defined(DISPATCH_HAVE_EXTENDED_SLPI_22000) + case RelationProcessorModule: +#endif case RelationAll: break; }