From 98793badc1c1d3e4bfd735fdecd3d2d731701ab3 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Tue, 1 Feb 2022 19:39:36 -0700 Subject: Syscall to get timer value --- src/cpu/irq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/cpu') diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 24a809c..612b6d8 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -11,6 +11,7 @@ #include #include +void utime(void); void testfxn(void); void handle_data(unsigned char); @@ -109,6 +110,8 @@ void handle_data(unsigned char data) add_thread(uart_scheduler, 0, 2); } else if (data == 0x63) { add_thread(heap_info, 0, 2); + } else if (data == 0x64) { + add_thread(utime, 0, 2); } else { } g_Drawer.x = 0; @@ -120,6 +123,16 @@ void handle_data(unsigned char data) write_string(&g_Drawer, "> "); } +void utime(void) +{ + unsigned long thi, tlo; + unsigned long long t = get_sys_time(); + thi = t >> 32; + tlo = t; + uart_hex(thi); + uart_hexn(tlo); +} + void testfxn2(void) { uart_string("Ran testfxn2\n"); -- cgit v1.2.1