diff options
author | Marvin Borner | 2021-04-27 23:01:51 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-27 23:01:51 +0200 |
commit | 51a80930a9bc25fae0728994cab1e0df3b63ef48 (patch) | |
tree | e08c4f8fdc3a73cca3a291ab901c2bcf6dac453e /libs/libc | |
parent | 977e62973abda3dd9fe5cb3462fc87d273ba63e3 (diff) |
Huge compositor, timer and yielding improvements
Diffstat (limited to 'libs/libc')
-rw-r--r-- | libs/libc/crt/crt0.c | 6 | ||||
-rw-r--r-- | libs/libc/inc/sys.h | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libs/libc/crt/crt0.c b/libs/libc/crt/crt0.c index 3ab7ed4..9e41ae2 100644 --- a/libs/libc/crt/crt0.c +++ b/libs/libc/crt/crt0.c @@ -15,9 +15,9 @@ int main(int, char **); int _start(int argc, char **argv); int _start(int argc, char **argv) { - u32 stamp = 0; - assert(io_read(IO_TIMER, &stamp, 0, sizeof(stamp)) == sizeof(stamp) && stamp); - srand(stamp); + struct timer timer = { 0 }; + assert(io_read(IO_TIMER, &timer, 0, sizeof(timer)) == sizeof(timer)); + srand(timer.rtc + timer.time); __stack_chk_guard = rand(); exit(main(argc, argv)); diff --git a/libs/libc/inc/sys.h b/libs/libc/inc/sys.h index f65e020..7d81f33 100644 --- a/libs/libc/inc/sys.h +++ b/libs/libc/inc/sys.h @@ -75,6 +75,15 @@ struct event_mouse { } but; }; +struct timer { + u32 rtc; + struct { + u32 user; + u32 kernel; + } ticks; + u32 time; +}; + struct stat { u32 dev_id; u32 mode; |