Skip to content

Commit

Permalink
chore: update patch
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Sep 26, 2024
1 parent 8d7953e commit fe08798
Showing 1 changed file with 54 additions and 54 deletions.
108 changes: 54 additions & 54 deletions scripts/cpuinfo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,60 @@ index 6ce6efe..d3c2279 100644
--- a/src/arm/windows/init-by-logical-sys-info.c
+++ b/src/arm/windows/init-by-logical-sys-info.c
@@ -644,6 +644,22 @@ static bool parse_relation_cache_info(
struct cpuinfo_cache* l2_base = l1d_base + numbers_of_caches[cpuinfo_cache_level_1d];
struct cpuinfo_cache* l3_base = l2_base + numbers_of_caches[cpuinfo_cache_level_2];

+#ifdef __MINGW32__
+ cpuinfo_log_debug(
+ "info->Cache.GroupMask:%" PRIu32
+ ","
+ "info->Cache.Level:%" PRIu32 ", info->Cache.Associativity:%" PRIu32
+ ","
+ "info->Cache.LineSize:%" PRIu32
+ ","
+ "info->Cache.CacheSize:%" PRIu32 ", info->Cache.Type:%" PRIu32 "",
+ (unsigned int)info->Cache.GroupMask.Mask,
+ info->Cache.Level,
+ info->Cache.Associativity,
+ info->Cache.LineSize,
+ info->Cache.CacheSize,
+ info->Cache.Type);
+#else
cpuinfo_log_debug(
"info->Cache.GroupCount:%" PRIu32 ", info->Cache.GroupMask:%" PRIu32
","
struct cpuinfo_cache* l2_base = l1d_base + numbers_of_caches[cpuinfo_cache_level_1d];
struct cpuinfo_cache* l3_base = l2_base + numbers_of_caches[cpuinfo_cache_level_2];

+#ifdef __MINGW32__
+ cpuinfo_log_debug(
+ "info->Cache.GroupMask:%" PRIu32
+ ","
+ "info->Cache.Level:%" PRIu32 ", info->Cache.Associativity:%" PRIu32
+ ","
+ "info->Cache.LineSize:%" PRIu32
+ ","
+ "info->Cache.CacheSize:%" PRIu32 ", info->Cache.Type:%" PRIu32 "",
+ (unsigned int)info->Cache.GroupMask.Mask,
+ info->Cache.Level,
+ info->Cache.Associativity,
+ info->Cache.LineSize,
+ info->Cache.CacheSize,
+ info->Cache.Type);
+#else
cpuinfo_log_debug(
"info->Cache.GroupCount:%" PRIu32 ", info->Cache.GroupMask:%" PRIu32
","
@@ -659,6 +675,7 @@ static bool parse_relation_cache_info(
info->Cache.LineSize,
info->Cache.CacheSize,
info->Cache.Type);
+#endif

struct cpuinfo_cache* current_cache = NULL;
switch (info->Cache.Level) {
info->Cache.LineSize,
info->Cache.CacheSize,
info->Cache.Type);
+#endif

struct cpuinfo_cache* current_cache = NULL;
switch (info->Cache.Level) {
@@ -701,6 +718,18 @@ static bool parse_relation_cache_info(
current_cache->flags = CPUINFO_CACHE_UNIFIED;
}

+#ifdef __MINGW32__
+ const uint32_t group_id = info->Cache.GroupMask.Group;
+ KAFFINITY group_processors_mask = info->Cache.GroupMask.Mask;
+ while (group_processors_mask != 0) {
+ const uint32_t processor_id_in_group = low_index_from_kaffinity(group_processors_mask);
+ const uint32_t processor_global_index = global_proc_index_per_group[group_id] + processor_id_in_group;
+
+ store_cache_info_per_processor(processors, processor_global_index, info, current_cache);
+
+ group_processors_mask &= ~(1 << processor_id_in_group);
+ }
+#else
for (uint32_t i = 0; i < info->Cache.GroupCount; i++) {
/* Zero GroupCount is valid, GroupMask still can store bits set.
*/
current_cache->flags = CPUINFO_CACHE_UNIFIED;
}

+#ifdef __MINGW32__
+ const uint32_t group_id = info->Cache.GroupMask.Group;
+ KAFFINITY group_processors_mask = info->Cache.GroupMask.Mask;
+ while (group_processors_mask != 0) {
+ const uint32_t processor_id_in_group = low_index_from_kaffinity(group_processors_mask);
+ const uint32_t processor_global_index = global_proc_index_per_group[group_id] + processor_id_in_group;
+
+ store_cache_info_per_processor(processors, processor_global_index, info, current_cache);
+
+ group_processors_mask &= ~(1 << processor_id_in_group);
+ }
+#else
for (uint32_t i = 0; i < info->Cache.GroupCount; i++) {
/* Zero GroupCount is valid, GroupMask still can store bits set.
*/
@@ -721,6 +750,7 @@ static bool parse_relation_cache_info(
group_processors_mask &= (group_processors_mask - 1);
}
}
+#endif
return true;
}

group_processors_mask &= (group_processors_mask - 1);
}
}
+#endif
return true;
}

0 comments on commit fe08798

Please sign in to comment.