* then the HPET functions are unavailable and should not be called.
*
* @param make_default
- * If set, the hpet timer becomes the default timer whose values are
- * returned by the rte_get_timer_hz/cycles API calls
+ * If set, the hpet timer becomes the default timer whose values are
+ * returned by the rte_get_timer_hz/cycles API calls
*
* @return
- * 0 on success,
- * -1 on error, and the make_default parameter is ignored.
+ * 0 on success,
+ * -1 on error, and the make_default parameter is ignored.
*/
int rte_eal_hpet_init(int make_default);
default: rte_panic("Invalid timer source specified\n");
}
}
-
/**
* Wait at least us microseconds.
+ * This function can be replaced with user-defined function.
+ * @see rte_delay_us_callback_register
*
* @param us
* The number of microseconds to wait.
*/
-void
-rte_delay_us(unsigned us);
+extern void
+(*rte_delay_us)(unsigned int us);
/**
* Wait at least ms milliseconds.
rte_delay_us(ms * 1000);
}
-#ifdef __cplusplus
-}
-#endif
+/**
+ * Blocking delay function.
+ *
+ * @param us
+ * Number of microseconds to wait.
+ */
+void rte_delay_us_block(unsigned int us);
+
+/**
+ * Replace rte_delay_us with user defined function.
+ *
+ * @param userfunc
+ * User function which replaces rte_delay_us. rte_delay_us_block restores
+ * buildin block delay function.
+ */
+void rte_delay_us_callback_register(void(*userfunc)(unsigned int));
#endif /* _RTE_CYCLES_H_ */