Page MenuHomeFreeBSD

D48580.id149669.diff
No OneTemporary

D48580.id149669.diff

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

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)

Event Timeline