aboutsummaryrefslogtreecommitdiff
path: root/kernel/timer.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-02-11 17:13:26 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-02-11 17:13:26 -0500
commite3305e8f7c119c83fd04f1995e07ff71a1110887 (patch)
treef95921215c215a60d80b1be068b2cccd72459ee2 /kernel/timer.c
parent90fda5287e3dae56508a4b31e1bc4e29cd83e377 (diff)
downloadkappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.zip
kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.gz
kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.bz2
kappa-e3305e8f7c119c83fd04f1995e07ff71a1110887.tar.xz
optimize interrupt performance
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index 7bdc1f9..bdf48eb 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1,4 +1,5 @@
#include <stdint.h>
+#include <stdio.h>
#include "io.h"
#include "isr.h"
#include "timer.h"
@@ -7,7 +8,7 @@ volatile uint64_t current_tick_data = 0;
volatile const uint64_t *current_tick = &current_tick_data;
-static void timer_callback(struct regs_t regs)
+static void timer_callback(struct regs_t *regs)
{
(void) regs;
++current_tick_data;
@@ -15,6 +16,7 @@ static void timer_callback(struct regs_t regs)
void timer_init(uint32_t freq)
{
+ printf("Timer init");
set_interrupt_handler(IRQ(0), timer_callback);
current_tick_data = 0;