Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137364843
D52187.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52187.diff
View Options
diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h
--- a/sys/arm64/include/cpu.h
+++ b/sys/arm64/include/cpu.h
@@ -196,6 +196,31 @@
#define CPU_MATCH_RAW(mask, devid) \
(((mask) & PCPU_GET(midr)) == ((mask) & (devid)))
+#if !defined(__ASSEMBLER__)
+static inline bool
+midr_check_var_part_range(u_int midr, u_int impl, u_int part, u_int var_low,
+ u_int part_low, u_int var_high, u_int part_high)
+{
+ /* Check for the correct part */
+ if (CPU_IMPL(midr) != impl || CPU_PART(midr) != part)
+ return (false);
+
+ /* Check if the variant is between var_low and var_high inclusive */
+ if (CPU_VAR(midr) < var_low || CPU_VAR(midr) > var_high)
+ return (false);
+
+ /* If the variant is the low value, check if the part is high enough */
+ if (CPU_VAR(midr) == var_low && CPU_PART(midr) < part_low)
+ return (false);
+
+ /* If the variant is the high value, check if the part is low enough */
+ if (CPU_VAR(midr) == var_high && CPU_PART(midr) > part_high)
+ return (false);
+
+ return (true);
+}
+#endif
+
/*
* Chip-specific errata. This defines are intended to be
* booleans used within if statements. When an appropriate
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 23, 7:52 PM (11 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22141407
Default Alt Text
D52187.diff (1 KB)
Attached To
Mode
D52187: arm64: Add a function to check a range of CPU revs
Attached
Detach File
Event Timeline
Log In to Comment