aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/timer
diff options
context:
space:
mode:
authorMarvin Borner2020-05-06 19:04:05 +0200
committerMarvin Borner2020-05-06 19:04:05 +0200
commitd94ffac4a584dc7a4f6f2ec567b8caab05ce9253 (patch)
tree559cd596a0a407d4b40c1d12d3c6a0686494da16 /src/kernel/timer
parent1a8563a05608b5b5e27eada44cf4790926001c68 (diff)
New build parameters and shared includes
This changes many files but I've just applied some replace commands.. So - nothing special!
Diffstat (limited to 'src/kernel/timer')
-rw-r--r--src/kernel/timer/timer.c14
-rw-r--r--src/kernel/timer/timer.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/kernel/timer/timer.c b/src/kernel/timer/timer.c
index 29017a5..dac1371 100644
--- a/src/kernel/timer/timer.c
+++ b/src/kernel/timer/timer.c
@@ -1,7 +1,7 @@
#include <stdint.h>
-#include <kernel/interrupts/interrupts.h>
-#include <kernel/io/io.h>
-#include <kernel/system.h>
+#include <interrupts/interrupts.h>
+#include <io/io.h>
+#include <system.h>
unsigned long timer_ticks = 0;
@@ -9,8 +9,8 @@ void timer_phase(int hz)
{
int divisor = (int)(3579545.0 / 3.0 / (double)hz);
outb(0x43, 0x36); // 01 10 11 0b // CTR, RW, MODE, BCD
- outb(0x40, (uint8_t)(divisor & 0xFF));
- outb(0x40, (uint8_t)(divisor >> 8));
+ outb(0x40, (u8)(divisor & 0xFF));
+ outb(0x40, (u8)(divisor >> 8));
}
// Executed 1000 times per second
@@ -22,7 +22,7 @@ void timer_handler(struct regs *r)
// "Delay" function with CPU sleep
void timer_wait(int ticks)
{
- uint32_t eticks;
+ u32 eticks;
eticks = timer_ticks + ticks;
while (timer_ticks < eticks) {
@@ -30,7 +30,7 @@ void timer_wait(int ticks)
}
}
-uint32_t get_time()
+u32 get_time()
{
return timer_ticks;
}
diff --git a/src/kernel/timer/timer.h b/src/kernel/timer/timer.h
index 2315b62..7b80b75 100644
--- a/src/kernel/timer/timer.h
+++ b/src/kernel/timer/timer.h
@@ -2,7 +2,7 @@
#define MELVIX_TIMER_H
#include <stdint.h>
-#include <kernel/interrupts/interrupts.h>
+#include <interrupts/interrupts.h>
void timer_handler(struct regs *r);
@@ -21,6 +21,6 @@ void timer_wait(int ticks);
* Get the current timer ticks
* @return The current timer ticks (1000 ticks = 1 second)
*/
-uint32_t get_time();
+u32 get_time();
#endif \ No newline at end of file