From c9ea9bda1dfaa54842bbdeb38145f41275376d95 Mon Sep 17 00:00:00 2001 From: sigsegv7 Date: Wed, 20 Sep 2023 03:02:39 -0400 Subject: kernel: init_main: Dump timer registry Signed-off-by: sigsegv7 --- sys/kern/init_main.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'sys') diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index f874ca8..f96128c 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -31,13 +31,44 @@ #include #include #include +#include #include #include #include +__MODULE_NAME("init_main"); __KERNEL_META("$Vega$: init_main.c, Ian Marco Moffett, " "Where the Vega kernel first starts up"); +static inline void +log_timer(const char *purpose, tmrr_status_t s, const struct timer *tmr) +{ + if (s == TMRR_EMPTY_ENTRY) { + KINFO("%s not yet registered\n", purpose); + } else if (tmr->name == NULL) { + KINFO("Nameless %s registered; unknown\n", purpose); + } else { + KINFO("%s registered: %s\n", purpose, tmr->name); + } +} + +/* + * Logs what timers are registered + * on the system. + */ +static void +list_timers(void) +{ + struct timer timer_tmp; + tmrr_status_t status; + + status = req_timer(TIMER_SCHED, &timer_tmp); + log_timer("SCHED_TMR", status, &timer_tmp); + + status = req_timer(TIMER_GP, &timer_tmp); + log_timer("GENERAL_PURPOSE_TMR", status, &timer_tmp); +} + void main(void) { @@ -53,6 +84,8 @@ main(void) processor_init(); vm_physseg_init(); + list_timers(); + /* We're done here, halt the processor */ __ASMV("cli; hlt"); } -- cgit v1.2.3