diff options
author | Marvin Borner | 2020-04-26 23:23:42 +0200 |
---|---|---|
committer | Marvin Borner | 2020-04-26 23:23:42 +0200 |
commit | f30c9803f05e90087e367953aa142275f8688f61 (patch) | |
tree | bea9166fad90c42ad4551094a5e6eec9098a7f19 /src/kernel/timer | |
parent | 31f671f2137bc09e62de09142bea232c1975c76b (diff) |
Awesome new multitasking system and scheduler
Diffstat (limited to 'src/kernel/timer')
-rw-r--r-- | src/kernel/timer/timer.c | 6 | ||||
-rw-r--r-- | src/kernel/timer/timer.h | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/kernel/timer/timer.c b/src/kernel/timer/timer.c index f1a296a..29017a5 100644 --- a/src/kernel/timer/timer.c +++ b/src/kernel/timer/timer.c @@ -1,3 +1,4 @@ +#include <stdint.h> #include <kernel/interrupts/interrupts.h> #include <kernel/io/io.h> #include <kernel/system.h> @@ -16,13 +17,12 @@ void timer_phase(int hz) void timer_handler(struct regs *r) { timer_ticks++; - // switch_task(); } // "Delay" function with CPU sleep void timer_wait(int ticks) { - unsigned int eticks; + uint32_t eticks; eticks = timer_ticks + ticks; while (timer_ticks < eticks) { @@ -30,7 +30,7 @@ void timer_wait(int ticks) } } -unsigned int get_time() +uint32_t get_time() { return timer_ticks; } diff --git a/src/kernel/timer/timer.h b/src/kernel/timer/timer.h index 389da6b..2315b62 100644 --- a/src/kernel/timer/timer.h +++ b/src/kernel/timer/timer.h @@ -1,6 +1,11 @@ #ifndef MELVIX_TIMER_H #define MELVIX_TIMER_H +#include <stdint.h> +#include <kernel/interrupts/interrupts.h> + +void timer_handler(struct regs *r); + /** * Install the timer and set the timer phase to 100 */ @@ -16,6 +21,6 @@ void timer_wait(int ticks); * Get the current timer ticks * @return The current timer ticks (1000 ticks = 1 second) */ -unsigned int get_time(); +uint32_t get_time(); #endif
\ No newline at end of file |