summaryrefslogtreecommitdiff
path: root/src/kernel/arch
diff options
context:
space:
mode:
authordzwdz2021-08-24 17:12:57 +0200
committerdzwdz2021-08-24 17:12:57 +0200
commit3b8b07ee2eb21e043a56cdc548e2be34857adb00 (patch)
tree0871986db06db00352ceccd80680ba37e4ef56e0 /src/kernel/arch
parent31c1536e68399a199a09fa55571fa5bdd92cbef7 (diff)
replace () with (void) in function definitions
`()` means that any amt of arguments will be accepted, which isn't what i want
Diffstat (limited to 'src/kernel/arch')
-rw-r--r--src/kernel/arch/generic.h4
-rw-r--r--src/kernel/arch/i386/gdt.h2
-rw-r--r--src/kernel/arch/i386/gdt/gdt.c10
-rw-r--r--src/kernel/arch/i386/interrupts/idt.c14
-rw-r--r--src/kernel/arch/i386/interrupts/idt.h2
-rw-r--r--src/kernel/arch/i386/pagedir.c2
-rw-r--r--src/kernel/arch/i386/sysenter.c4
-rw-r--r--src/kernel/arch/i386/sysenter.h2
-rw-r--r--src/kernel/arch/i386/tty/serial.c2
-rw-r--r--src/kernel/arch/i386/tty/serial.h2
-rw-r--r--src/kernel/arch/i386/tty/tty.c2
-rw-r--r--src/kernel/arch/i386/tty/vga.c4
-rw-r--r--src/kernel/arch/i386/tty/vga.h2
-rw-r--r--src/kernel/arch/log.h2
14 files changed, 27 insertions, 27 deletions
diff --git a/src/kernel/arch/generic.h b/src/kernel/arch/generic.h
index 1427658..1fa716b 100644
--- a/src/kernel/arch/generic.h
+++ b/src/kernel/arch/generic.h
@@ -13,14 +13,14 @@
extern char _bss_end;
__attribute__((noreturn))
-void halt_cpu();
+void halt_cpu(void);
// src/arch/i386/sysenter.s
_Noreturn void sysexit(struct registers);
int syscall_handler(int, int, int, int);
// all of those can allocate memory
-struct pagedir *pagedir_new();
+struct pagedir *pagedir_new(void);
struct pagedir *pagedir_copy(const struct pagedir *orig);
void pagedir_map(struct pagedir *dir, void *virt, void *phys,
bool user, bool writeable);
diff --git a/src/kernel/arch/i386/gdt.h b/src/kernel/arch/i386/gdt.h
index bcb9870..5e40cd7 100644
--- a/src/kernel/arch/i386/gdt.h
+++ b/src/kernel/arch/i386/gdt.h
@@ -12,5 +12,5 @@ enum {
SEG_end
};
-void gdt_init();
+void gdt_init(void);
void gdt_farjump(int segment);
diff --git a/src/kernel/arch/i386/gdt/gdt.c b/src/kernel/arch/i386/gdt/gdt.c
index e4cd3ef..6958bb5 100644
--- a/src/kernel/arch/i386/gdt/gdt.c
+++ b/src/kernel/arch/i386/gdt/gdt.c
@@ -42,8 +42,8 @@ static struct tss_entry TSS;
static struct lgdt_arg lgdt_arg; // probably doesn't need to be global
static void gdt_fillout(struct gdt_entry* entry, uint8_t ring, bool code);
-static void gdt_prepare();
-static void gdt_load();
+static void gdt_prepare(void);
+static void gdt_load(void);
static void gdt_fillout(struct gdt_entry* entry, uint8_t ring, bool code) {
@@ -69,7 +69,7 @@ static void gdt_fillout(struct gdt_entry* entry, uint8_t ring, bool code) {
};
}
-static void gdt_prepare() {
+static void gdt_prepare(void) {
GDT[SEG_null].present = 0;
gdt_fillout(&GDT[SEG_r0code], 0, true);
@@ -102,7 +102,7 @@ static void gdt_prepare() {
};
}
-static void gdt_load() {
+static void gdt_load(void) {
lgdt_arg.limit = sizeof(GDT) - 1;
lgdt_arg.base = (uintptr_t) &GDT;
asm("lgdt (%0)"
@@ -121,7 +121,7 @@ static void gdt_load() {
: : "r" (SEG_r0data << 3) : "memory");
}
-void gdt_init() {
+void gdt_init(void) {
gdt_prepare();
gdt_load();
}
diff --git a/src/kernel/arch/i386/interrupts/idt.c b/src/kernel/arch/i386/interrupts/idt.c
index 75c221f..d27bc61 100644
--- a/src/kernel/arch/i386/interrupts/idt.c
+++ b/src/kernel/arch/i386/interrupts/idt.c
@@ -27,12 +27,12 @@ struct lidt_arg {
static struct idt_entry IDT[256];
static struct lidt_arg lidt_arg;
-static void idt_prepare();
-static void idt_load();
-static void idt_test();
+static void idt_prepare(void);
+static void idt_load(void);
+static void idt_test(void);
-static void idt_prepare() {
+static void idt_prepare(void) {
uintptr_t offset;
for (int i = 0; i < 256; i++) {
offset = (uintptr_t) &_isr_stubs + i * 8;
@@ -50,18 +50,18 @@ static void idt_prepare() {
}
}
-static void idt_load() {
+static void idt_load(void) {
lidt_arg.limit = sizeof(IDT) - 1;
lidt_arg.base = (uintptr_t) &IDT;
asm("lidt (%0)" : : "r" (&lidt_arg) : "memory");
}
-static void idt_test() {
+static void idt_test(void) {
asm("int $0x34" : : : "memory");
assert(isr_test_interrupt_called);
}
-void idt_init() {
+void idt_init(void) {
idt_prepare();
idt_load();
idt_test();
diff --git a/src/kernel/arch/i386/interrupts/idt.h b/src/kernel/arch/i386/interrupts/idt.h
index 5627657..6576cf9 100644
--- a/src/kernel/arch/i386/interrupts/idt.h
+++ b/src/kernel/arch/i386/interrupts/idt.h
@@ -1,3 +1,3 @@
#pragma once
-void idt_init();
+void idt_init(void);
diff --git a/src/kernel/arch/i386/pagedir.c b/src/kernel/arch/i386/pagedir.c
index 61ad170..486d2a2 100644
--- a/src/kernel/arch/i386/pagedir.c
+++ b/src/kernel/arch/i386/pagedir.c
@@ -39,7 +39,7 @@ struct pagedir {
} __attribute__((packed));
-struct pagedir *pagedir_new() {
+struct pagedir *pagedir_new(void) {
struct pagedir *dir = page_alloc(1);
for (int i = 0; i < 1024; i++)
dir->e[i].present = 0;
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c
index b24c857..2470979 100644
--- a/src/kernel/arch/i386/sysenter.c
+++ b/src/kernel/arch/i386/sysenter.c
@@ -3,7 +3,7 @@
struct registers _sysexit_regs; // a hack
-extern void _sysexit_real();
+extern void _sysexit_real(void);
void sysexit(struct registers regs) {
_sysexit_regs = regs;
@@ -13,7 +13,7 @@ void sysexit(struct registers regs) {
__builtin_unreachable();
}
-_Noreturn void sysenter_stage2() {
+_Noreturn void sysenter_stage2(void) {
uint64_t val;
struct registers *regs = &process_current->regs;
diff --git a/src/kernel/arch/i386/sysenter.h b/src/kernel/arch/i386/sysenter.h
index b531fe8..b731c67 100644
--- a/src/kernel/arch/i386/sysenter.h
+++ b/src/kernel/arch/i386/sysenter.h
@@ -1,2 +1,2 @@
#pragma once
-void sysenter_setup();
+void sysenter_setup(void);
diff --git a/src/kernel/arch/i386/tty/serial.c b/src/kernel/arch/i386/tty/serial.c
index 6bfe212..a259750 100644
--- a/src/kernel/arch/i386/tty/serial.c
+++ b/src/kernel/arch/i386/tty/serial.c
@@ -4,7 +4,7 @@
const int COM1 = 0x3f8;
-void serial_init() {
+void serial_init(void) {
// see https://www.sci.muni.cz/docs/pc/serport.txt
port_outb(COM1 + 1, 0x00); // disable interrupts, we won't be using them
diff --git a/src/kernel/arch/i386/tty/serial.h b/src/kernel/arch/i386/tty/serial.h
index ac7131b..2332113 100644
--- a/src/kernel/arch/i386/tty/serial.h
+++ b/src/kernel/arch/i386/tty/serial.h
@@ -2,4 +2,4 @@
#include <stddef.h>
void serial_write(const char *buf, size_t len);
-void serial_init();
+void serial_init(void);
diff --git a/src/kernel/arch/i386/tty/tty.c b/src/kernel/arch/i386/tty/tty.c
index 89a8602..b469285 100644
--- a/src/kernel/arch/i386/tty/tty.c
+++ b/src/kernel/arch/i386/tty/tty.c
@@ -2,7 +2,7 @@
#include <kernel/arch/i386/tty/vga.h>
#include <kernel/arch/log.h>
-void tty_init() {
+void tty_init(void) {
vga_clear();
serial_init();
diff --git a/src/kernel/arch/i386/tty/vga.c b/src/kernel/arch/i386/tty/vga.c
index 3cd1034..24bbf98 100644
--- a/src/kernel/arch/i386/tty/vga.c
+++ b/src/kernel/arch/i386/tty/vga.c
@@ -9,7 +9,7 @@ static const size_t vga_len = 80 * 25;
static struct vga_cell *vga = (void*) 0xB8000;
static size_t vga_pos = 0;
-static void vga_scroll() {
+static void vga_scroll(void) {
for (size_t i = 0; i < vga_len - 80; i++)
vga[i] = vga[i + 80];
vga_pos -= 80;
@@ -26,7 +26,7 @@ void vga_write(const char *buf, size_t len) {
vga_putchar(buf[i]);
}
-void vga_clear() {
+void vga_clear(void) {
for (size_t i = 0; i < vga_len; i++)
vga[i].c = ' ';
vga_pos = 0;
diff --git a/src/kernel/arch/i386/tty/vga.h b/src/kernel/arch/i386/tty/vga.h
index c8747c7..69b1ab7 100644
--- a/src/kernel/arch/i386/tty/vga.h
+++ b/src/kernel/arch/i386/tty/vga.h
@@ -2,4 +2,4 @@
#include <stddef.h>
void vga_write(const char *buf, size_t len);
-void vga_clear();
+void vga_clear(void);
diff --git a/src/kernel/arch/log.h b/src/kernel/arch/log.h
index ea76292..ef8cb17 100644
--- a/src/kernel/arch/log.h
+++ b/src/kernel/arch/log.h
@@ -1,7 +1,7 @@
#pragma once
#include <stddef.h>
-void tty_init();
+void tty_init(void);
void tty_write(const char *buf, size_t len);
static inline void _tty_hex(const char *buf, size_t len) {