aboutsummaryrefslogtreecommitdiff
path: root/kernel/drivers/keyboard.c
diff options
context:
space:
mode:
authorMarvin Borner2021-04-02 23:26:28 +0200
committerMarvin Borner2021-04-02 23:26:28 +0200
commitce98400f8a9ebd4e62e76b9e292b7598d0d66cc0 (patch)
tree823f06c2c325ead611863eeb3ac974c1ae562878 /kernel/drivers/keyboard.c
parentfe468b476d567b6aa0695a030c408ccf46278c7d (diff)
Added kernel section clear/protect after init
This is a huge security improvement as it prevents potential exploits of using or modifying internal kernel functions or data.
Diffstat (limited to 'kernel/drivers/keyboard.c')
-rw-r--r--kernel/drivers/keyboard.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/drivers/keyboard.c b/kernel/drivers/keyboard.c
index 63005b9..b917e4e 100644
--- a/kernel/drivers/keyboard.c
+++ b/kernel/drivers/keyboard.c
@@ -13,10 +13,10 @@
#include <str.h>
#include <sys.h>
-static struct event_keyboard *event = NULL;
-static struct stack *queue = NULL;
-static u32 dev_id = 0;
+PROTECTED static struct stack *queue = NULL;
+PROTECTED static u32 dev_id = 0;
+static struct event_keyboard *event = NULL;
static int state = 0;
static int merged = 0;
static void keyboard_handler(struct regs *r)
@@ -78,12 +78,12 @@ static res keyboard_ready(void)
return !stack_empty(queue);
}
-void keyboard_reset(void)
+CLEAR void keyboard_reset(void)
{
stack_clear(queue);
}
-void keyboard_install(void)
+CLEAR void keyboard_install(void)
{
//keyboard_rate(); TODO: Fix keyboard rate?
irq_install_handler(1, keyboard_handler);