+void timing_adjust_gps_second(struct timespec* p_time)
+{
+ struct xran_device_ctx * p_xran_dev_ctx = xran_dev_get_ctx();
+
+ if (p_time->tv_nsec >= p_xran_dev_ctx->offset_nsec)
+ {
+ p_time->tv_nsec -= p_xran_dev_ctx->offset_nsec;
+ p_time->tv_sec -= p_xran_dev_ctx->offset_sec;
+ }
+ else
+ {
+ p_time->tv_nsec += 1e9 - p_xran_dev_ctx->offset_nsec;
+ p_time->tv_sec -= p_xran_dev_ctx->offset_sec + 1;
+ }
+
+ return;
+}
+uint64_t xran_tick(void)
+{
+ 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)