kevent: initialize kevents during boot

This commit is contained in:
anna 2021-08-04 03:31:21 +02:00
parent b053cc3279
commit 30404f60d4
Signed by: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -4,6 +4,7 @@
#include <ardix/io.h> #include <ardix/io.h>
#include <ardix/kent.h> #include <ardix/kent.h>
#include <ardix/kevent.h>
#include <ardix/sched.h> #include <ardix/sched.h>
#include <stdbool.h> #include <stdbool.h>
@ -27,17 +28,15 @@
*/ */
int main(void) int main(void)
{ {
uint32_t count = 0; volatile uint32_t count = 0;
unsigned int print_count = 0; volatile unsigned int print_count = 0;
REG_PIOB_OER = 1 << 27;
REG_PIOB_PER = 1 << 27;
REG_PIOB_CODR = 1 << 27;
int err = kent_root_init(); int err = kent_root_init();
if (err != 0) if (err != 0)
return err; return err;
kevents_init();
err = sched_init(); err = sched_init();
if (err != 0) if (err != 0)
return err; return err;
@ -50,11 +49,17 @@ int main(void)
if (err != 0) if (err != 0)
return err; return err;
/* we should have a serial console now */
REG_PIOB_OER = 1 << 27;
REG_PIOB_PER = 1 << 27;
REG_PIOB_CODR = 1 << 27;
while (true) { while (true) {
if (count++ != 1000000) if (count++ != 1000000)
continue; continue;
printf("hello, world (%u)!\n", print_count); printf("hello, world (%u)\n", print_count);
print_count++; print_count++;
if (print_count % 2) if (print_count % 2)