From 2c590068544d8c2e02a27a8c5a81c12c0dab0dff Mon Sep 17 00:00:00 2001 From: ice-bit Date: Mon, 6 Jul 2020 12:34:55 +0200 Subject: [PATCH] Fixed linkage bug With the new version of GCC(10.1.0) there was a problem about a variable definition. --- kernel/drivers/timer.c | 3 +-- kernel/drivers/timer.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/drivers/timer.c b/kernel/drivers/timer.c index f6756e3..553e45b 100644 --- a/kernel/drivers/timer.c +++ b/kernel/drivers/timer.c @@ -6,7 +6,6 @@ // Start tick at zero uint32_t tick = 0; - static void timer_callback(registers_t regs) { tick++; /* uint8_t buf[8]; @@ -37,4 +36,4 @@ void init_timer(uint32_t frequency) { // Send the frequency divisor outb(0x40, low); outb(0x40, high); -} \ No newline at end of file +} diff --git a/kernel/drivers/timer.h b/kernel/drivers/timer.h index 9c1c056..79c9c57 100644 --- a/kernel/drivers/timer.h +++ b/kernel/drivers/timer.h @@ -31,11 +31,11 @@ */ void init_timer(uint32_t frequency); -uint32_t tick; +extern uint32_t tick; /* Since regs parameter(from timer_callback) will be unused * GCC(with -Werror flag) will throw an error, so we can avoid this * using the following macro */ #define UNUSED_PAR(x) (void)(x) -#endif \ No newline at end of file +#endif