+ uint32_t hi, lo;
+ __asm volatile ("rdtsc" : "=a"(lo), "=d"(hi));
+ return ( (uint64_t)lo)|( ((uint64_t)hi)<<32 );
+}
+
+unsigned long get_ticks_diff(unsigned long curr_tick, unsigned long last_tick)
+{
+ if (curr_tick >= last_tick)
+ return (unsigned long)(curr_tick - last_tick);
+ else
+ return (unsigned long)(0xFFFFFFFFFFFFFFFF - last_tick + curr_tick);
+}
+extern uint16_t xran_getSfnSecStart(void);
+
+long poll_next_tick(long interval_ns, unsigned long *used_tick)
+{
+ struct xran_ethdi_ctx *p_eth = xran_ethdi_get_ctx();
+ struct xran_io_cfg *p_io_cfg = &(p_eth->io_cfg);
+ struct xran_device_ctx * p_xran_dev_ctx = xran_dev_get_ctx();
+ struct xran_common_counters* pCnt = &p_xran_dev_ctx->fh_counters;
+