From 180dfed61505cfe944755f7078d7b29063ea7734 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 24 Mar 2022 18:59:26 -0700 Subject: Allow access to CNTPCT from user mode --- usr/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'usr/main.c') diff --git a/usr/main.c b/usr/main.c index 56ddbcb..6eecc7c 100644 --- a/usr/main.c +++ b/usr/main.c @@ -41,4 +41,8 @@ void main(void) subscribe_irq(SYS_TIMER_2_IRQ, loopt, &stime_2); subscribe_irq(SYS_TIMER_3_IRQ, loopt, &stime_3); add_thread(loop, 0, 0); + unsigned long long counter; + asm volatile ("mrrc p15, 0, %0, c14" : "=r"(counter)); + draw_hex32(0, 20, counter>>32); + draw_hex32(9, 20, counter); } -- cgit v1.2.1