Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148440569
D48580.id149669.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
D48580.id149669.diff
View Options
diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c
--- a/sys/arm/arm/generic_timer.c
+++ b/sys/arm/arm/generic_timer.c
@@ -60,6 +60,7 @@
#if defined(__aarch64__)
#include <machine/undefined.h>
+#include <machine/cpufunc.h>
#endif
#ifdef FDT
@@ -839,23 +840,30 @@
void
DELAY(int usec)
{
+ uint64_t isar2;
int32_t counts;
TSENTER();
- /*
- * Check the timers are setup, if not just
- * use a for loop for the meantime
- */
- if (arm_tmr_sc == NULL) {
- for (; usec > 0; usec--)
- for (counts = 200; counts > 0; counts--)
- /*
- * Prevent the compiler from optimizing
- * out the loop
- */
- cpufunc_nullop();
- } else
- arm_tmr_do_delay(usec, arm_tmr_sc);
+ /* Check if feat_wfxt is available */
+ isar2 = READ_SPECIALREG(id_aa64isar2_el1);
+ if (ID_AA64ISAR2_WFxT_VAL(isar2) >> ID_AA64ISAR2_WFxT_SHIFT) {
+ wfet(usec);
+ } else {
+ /*
+ * Check the timers are setup, if not just
+ * use a for loop for the meantime
+ */
+ if (arm_tmr_sc == NULL) {
+ for (; usec > 0; usec--)
+ for (counts = 200; counts > 0; counts--)
+ /*
+ * Prevent the compiler from optimizing
+ * out the loop
+ */
+ cpufunc_nullop();
+ } else
+ arm_tmr_do_delay(usec, arm_tmr_sc);
+ }
TSEXIT();
}
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 9:52 PM (1 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29928303
Default Alt Text
D48580.id149669.diff (1 KB)
Attached To
Mode
D48580: arm64: use FEAT_WFxT for DELAY() when available
Attached
Detach File
Event Timeline
Log In to Comment