Added payload for figuring out sleep function

This commit is contained in:
2020-01-11 17:14:10 -05:00
parent ad9ce8f850
commit 477d7079c8
7 changed files with 37 additions and 22 deletions

View File

@@ -0,0 +1,20 @@
#include "util.h"
#include "brfunc_common.h"
PAYLOAD_SECTION
void task_sleep(unsigned int usec)
{
((BOOTROM_FUNC) ADDR_TASK_SLEEP)(usec);
}
TEXT_SECTION
unsigned long long _start(unsigned int usec)
{
unsigned long long start, end;
__asm__ volatile ("mrs %0, cntpct_el0" : "=r" (start));
task_sleep(usec);
__asm__ volatile ("mrs %0, cntpct_el0" : "=r" (end));
return end - start;
}