version 0.0.1
This commit is contained in:
14
test/libdpdk_dummy/include/rte_cycles.h
Normal file
14
test/libdpdk_dummy/include/rte_cycles.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint64_t rte_get_tsc_cycles() {
|
||||
unsigned int lo, hi;
|
||||
__asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
|
||||
return ((uint64_t)hi << 32) | lo;
|
||||
}
|
||||
|
||||
uint64_t rte_get_tsc_hz() {
|
||||
// 1.8 GHz
|
||||
return 1800000000;
|
||||
}
|
||||
Reference in New Issue
Block a user