#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
//#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "drv_init.h"
#include "arm_csu.h"
#include "ucp_printf.h"

int32_t g_drv_mem_fd0 = -1;

uint64_t get_arm_cycle()
{
    uint64_t cycle;

    asm volatile("mrs %0, pmccntr_el0" : "=r" (cycle));

    return cycle;
}

int32_t drv_init(void)
{
    if(0 != arm_csu_init())
    {
        UCP_PRINT_ERROR("Init arm csu error!!");
        return -1;
    }

    return 0;
}

