Files
NativeAdreno/NativeAdrenoKernelTime.cpp
bluseliu50 61eb7d3f5b Import NativeAdreno
Co-authored-by: rpone <rponeawa@qq.com>
2026-10-20 18:21:28 +08:00

19 lines
503 B
C++

/* SPDX-License-Identifier: MIT */
#include "NativeAdrenoKernelTime.h"
#include <IOKit/IOLib.h>
#include <kern/clock.h>
int NativeAdrenoKernelTime::now_us(void *cookie,uint64_t *value)
{
if(cookie || !value)return 1;
uint64_t nanoseconds=0;
absolutetime_to_nanoseconds(mach_absolute_time(),&nanoseconds);
*value=nanoseconds/1000;
return 0;
}
int NativeAdrenoKernelTime::wait_us(void *cookie,unsigned microseconds)
{
if(cookie)return 1;
IODelay(microseconds);
return 0;
}