summaryrefslogtreecommitdiff
path: root/src/kernel/arch/i386
diff options
context:
space:
mode:
authordzwdz2021-09-21 18:37:01 +0200
committerdzwdz2021-09-21 18:37:01 +0200
commitd9ec06192725bb6bf023120e99cbe8da33756628 (patch)
tree847ff37279af11932891e70f7f14f9071182940f /src/kernel/arch/i386
parentdc7a432b877222253fe02a332fba69d077eea8fe (diff)
start using sparse's `-Wdecl`
Diffstat (limited to 'src/kernel/arch/i386')
-rw-r--r--src/kernel/arch/i386/boot.c1
-rw-r--r--src/kernel/arch/i386/boot.h4
-rw-r--r--src/kernel/arch/i386/interrupts/isr.h2
-rw-r--r--src/kernel/arch/i386/sysenter.c5
-rw-r--r--src/kernel/arch/i386/sysenter.h8
-rw-r--r--src/kernel/arch/i386/tty/serial.c4
6 files changed, 19 insertions, 5 deletions
diff --git a/src/kernel/arch/i386/boot.c b/src/kernel/arch/i386/boot.c
index 94eefd6..bd2a00b 100644
--- a/src/kernel/arch/i386/boot.c
+++ b/src/kernel/arch/i386/boot.c
@@ -1,4 +1,5 @@
#include <kernel/arch/generic.h>
+#include <kernel/arch/i386/boot.h>
#include <kernel/arch/i386/gdt.h>
#include <kernel/arch/i386/interrupts/idt.h>
#include <kernel/arch/i386/multiboot.h>
diff --git a/src/kernel/arch/i386/boot.h b/src/kernel/arch/i386/boot.h
new file mode 100644
index 0000000..544f02d
--- /dev/null
+++ b/src/kernel/arch/i386/boot.h
@@ -0,0 +1,4 @@
+#pragma once
+#include <kernel/arch/i386/multiboot.h>
+
+void kmain_early(struct multiboot_info *multiboot);
diff --git a/src/kernel/arch/i386/interrupts/isr.h b/src/kernel/arch/i386/interrupts/isr.h
index 09d4328..3189538 100644
--- a/src/kernel/arch/i386/interrupts/isr.h
+++ b/src/kernel/arch/i386/interrupts/isr.h
@@ -3,3 +3,5 @@
extern bool isr_test_interrupt_called; // used in the self-test in idt.c
extern const char _isr_stubs;
+
+void isr_stage3(int interrupt);
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c
index a0d4f73..cda4f15 100644
--- a/src/kernel/arch/i386/sysenter.c
+++ b/src/kernel/arch/i386/sysenter.c
@@ -1,10 +1,9 @@
#include <kernel/arch/generic.h>
+#include <kernel/arch/i386/sysenter.h>
#include <kernel/proc.h>
#include <shared/syscalls.h>
-struct registers _sysexit_regs; // a hack
-
-extern void _sysexit_real(void);
+struct registers _sysexit_regs;
void sysexit(struct registers regs) {
_sysexit_regs = regs;
diff --git a/src/kernel/arch/i386/sysenter.h b/src/kernel/arch/i386/sysenter.h
new file mode 100644
index 0000000..b88c186
--- /dev/null
+++ b/src/kernel/arch/i386/sysenter.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// sysenter.c
+extern struct registers _sysexit_regs;
+_Noreturn void sysenter_stage2(void);
+
+// sysenter.s
+void _sysexit_real(void);
diff --git a/src/kernel/arch/i386/tty/serial.c b/src/kernel/arch/i386/tty/serial.c
index a259750..b3f1d9d 100644
--- a/src/kernel/arch/i386/tty/serial.c
+++ b/src/kernel/arch/i386/tty/serial.c
@@ -2,7 +2,7 @@
#include <kernel/arch/i386/port_io.h>
#include <stdint.h>
-const int COM1 = 0x3f8;
+static const int COM1 = 0x3f8;
void serial_init(void) {
// see https://www.sci.muni.cz/docs/pc/serport.txt
@@ -23,7 +23,7 @@ void serial_init(void) {
* if i start using serial for input, TODO selftest */
}
-void serial_putchar(char c) {
+static void serial_putchar(char c) {
while ((port_inb(COM1 + 5) & 0x20) == 0); // wait for THRE
port_outb(COM1, c);
}