aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/status.c9
-rw-r--r--src/util/time.c14
2 files changed, 23 insertions, 0 deletions
diff --git a/src/util/status.c b/src/util/status.c
index dd2b899..7abf931 100644
--- a/src/util/status.c
+++ b/src/util/status.c
@@ -162,6 +162,15 @@ void status(void)
"and %0, %0, #3" : "=r"(coren) :: "cc");
write_string(&g_Drawer, "Status Updated by Core #");
write_10(&g_Drawer, coren);
+ write_string(&g_Drawer, "\nSys Timer Status: ");
+ coren = *(unsigned long*)SYS_TIMER_CS;
+ write_10(&g_Drawer, coren);
+ write_string(&g_Drawer, " : ");
+ unsigned long long tval = get_time();
+ write_hex32(&g_Drawer, (tval >> 32));
+ write_hex32(&g_Drawer, tval);
+ write_char(&g_Drawer, '\n');
+ write_10(&g_Drawer, ((unsigned long)tval)/1000000);
g_Drawer.x = x;
g_Drawer.y = y;
diff --git a/src/util/time.c b/src/util/time.c
index a0c539b..e9e5716 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -51,3 +51,17 @@ unsigned long read_cntfrq(void)
asm volatile ("mrc p15, 0, %0, c14, c0, 0" : "=r"(val) );
return val;
}
+
+unsigned long long get_time(void)
+{
+ union {
+ unsigned long long tval;
+ struct {
+ unsigned long high;
+ unsigned long low;
+ } tvalb;
+ } t;
+ t.tvalb.low = *(unsigned long*)SYS_TIMER_CLO;
+ t.tvalb.high = *(unsigned long*)SYS_TIMER_CHI;
+ return t.tval;
+}