- kprintf("BeRTOS is up & running: %c\r",
- spinner[i % countof(spinner)]);
- timer_delay(100);
+ sig_wait(SIG_USER0);
+ end = get_hp_ticks();
+ kprintf("%c context switch in %lu clock cycles (~%lu us) \r",
+ spinner[i % countof(spinner)],
+ end - start,
+ ((end - start) * 1000000 / CPU_FREQ));
+ led_off();
+ timer_delay(50);
+ sig_send(lp_proc, SIG_USER0);
+ }
+}
+
+static void NORETURN lp_process(void)
+{
+ while (1)
+ {
+ led_on();
+ timer_delay(50);
+ start = get_hp_ticks();
+ sig_send(hp_proc, SIG_USER0);
+ sig_wait(SIG_USER0);